open_f(int argc, char **argv)

{

	int flags = 0;

	int readonly = 0;

	int growable = 0;

	int c;



	while ((c = getopt(argc, argv, "snrg")) != EOF) {

		switch (c) {

		case 's':

			flags |= BDRV_O_SNAPSHOT;

			break;

		case 'n':

			flags |= BDRV_O_NOCACHE;

			break;

		case 'r':

			readonly = 1;

			break;

		case 'g':

			growable = 1;

			break;

		default:

			return command_usage(&open_cmd);

		}

	}



	if (!readonly) {

            flags |= BDRV_O_RDWR;

        }



	if (optind != argc - 1)

		return command_usage(&open_cmd);



	return openfile(argv[optind], flags, growable);

}

open_f(int argc, char **argv)

{

	int flags = 0;

	int readonly = 0;

	int growable = 0;

	int c;



	while ((c = getopt(argc, argv, "snrg")) != EOF) {

		switch (c) {

		case 's':

			flags |= BDRV_O_SNAPSHOT;

			break;

		case 'n':

			flags |= BDRV_O_NOCACHE;

			break;

		case 'r':

			readonly = 1;

			break;

		case 'g':

			growable = 1;

			break;

		default:

			return command_usage(&open_cmd);

		}

	}



	if (!readonly) {

            flags |= BDRV_O_RDWR;

        }



	if (optind != argc - 1)

		return command_usage(&open_cmd);



	return openfile(argv[optind], flags, growable);

}

FUNC_0(int VAR_0, char **VAR_1)

{

	int VAR_2 = 0;

	int VAR_3 = 0;

	int VAR_4 = 0;

	int VAR_5;



	while ((VAR_5 = getopt(VAR_0, VAR_1, "snrg")) != EOF) {

		switch (VAR_5) {

		case 's':

			VAR_2 |= BDRV_O_SNAPSHOT;

			break;

		case 'n':

			VAR_2 |= BDRV_O_NOCACHE;

			break;

		case 'r':

			VAR_3 = 1;

			break;

		case 'g':

			VAR_4 = 1;

			break;

		default:

			return command_usage(&open_cmd);

		}

	}



	if (!VAR_3) {

            VAR_2 |= BDRV_O_RDWR;

        }



	if (optind != VAR_0 - 1)

		return command_usage(&open_cmd);



	return openfile(VAR_1[optind], VAR_2, VAR_4);

}

FUNC_0(int VAR_0, char **VAR_1)
{ int VAR_2 = 0; int VAR_3 = 0; int VAR_4 = 0; int VAR_5; while ((VAR_5 = getopt(VAR_0, VAR_1, "snrg")) != EOF) { switch (VAR_5) { case 's':
VAR_2 |= BDRV_O_SNAPSHOT; break; case 'n':
VAR_2 |= BDRV_O_NOCACHE; break; case 'r':
VAR_3 = 1; break; case 'g':
VAR_4 = 1; break; default:
return command_usage(&open_cmd); } } if (!VAR_3) { VAR_2 |= BDRV_O_RDWR; } if (optind != VAR_0 - 1)
return command_usage(&open_cmd); return openfile(VAR_1[optind], VAR_2, VAR_4); }