aio_read_f(int argc, char **argv)

{

	int nr_iov, c;

	struct aio_ctx *ctx = calloc(1, sizeof(struct aio_ctx));

	BlockDriverAIOCB *acb;



	while ((c = getopt(argc, argv, "CP:qv")) != EOF) {

		switch (c) {

		case 'C':

			ctx->Cflag = 1;

			break;

		case 'P':

			ctx->Pflag = 1;

			ctx->pattern = parse_pattern(optarg);

			if (ctx->pattern < 0)

				return 0;

			break;

		case 'q':

			ctx->qflag = 1;

			break;

		case 'v':

			ctx->vflag = 1;

			break;

		default:

			free(ctx);

			return command_usage(&aio_read_cmd);

		}

	}



	if (optind > argc - 2) {

		free(ctx);

		return command_usage(&aio_read_cmd);

	}



	ctx->offset = cvtnum(argv[optind]);

	if (ctx->offset < 0) {

		printf("non-numeric length argument -- %s\n", argv[optind]);

		free(ctx);

		return 0;

	}

	optind++;



	if (ctx->offset & 0x1ff) {

		printf("offset %" PRId64 " is not sector aligned\n",

                       ctx->offset);

		free(ctx);

		return 0;

	}



	nr_iov = argc - optind;

	ctx->buf = create_iovec(&ctx->qiov, &argv[optind], nr_iov, 0xab);



	gettimeofday(&ctx->t1, NULL);

	acb = bdrv_aio_readv(bs, ctx->offset >> 9, &ctx->qiov,

			      ctx->qiov.size >> 9, aio_read_done, ctx);

	if (!acb) {

		free(ctx->buf);

		free(ctx);

		return -EIO;

	}



	return 0;

}

aio_read_f(int argc, char **argv)

{

	int nr_iov, c;

	struct aio_ctx *ctx = calloc(1, sizeof(struct aio_ctx));

	BlockDriverAIOCB *acb;



	while ((c = getopt(argc, argv, "CP:qv")) != EOF) {

		switch (c) {

		case 'C':

			ctx->Cflag = 1;

			break;

		case 'P':

			ctx->Pflag = 1;

			ctx->pattern = parse_pattern(optarg);

			if (ctx->pattern < 0)

				return 0;

			break;

		case 'q':

			ctx->qflag = 1;

			break;

		case 'v':

			ctx->vflag = 1;

			break;

		default:

			free(ctx);

			return command_usage(&aio_read_cmd);

		}

	}



	if (optind > argc - 2) {

		free(ctx);

		return command_usage(&aio_read_cmd);

	}



	ctx->offset = cvtnum(argv[optind]);

	if (ctx->offset < 0) {

		printf("non-numeric length argument -- %s\n", argv[optind]);

		free(ctx);

		return 0;

	}

	optind++;



	if (ctx->offset & 0x1ff) {

		printf("offset %" PRId64 " is not sector aligned\n",

                       ctx->offset);

		free(ctx);

		return 0;

	}



	nr_iov = argc - optind;

	ctx->buf = create_iovec(&ctx->qiov, &argv[optind], nr_iov, 0xab);



	gettimeofday(&ctx->t1, NULL);

	acb = bdrv_aio_readv(bs, ctx->offset >> 9, &ctx->qiov,

			      ctx->qiov.size >> 9, aio_read_done, ctx);

	if (!acb) {

		free(ctx->buf);

		free(ctx);

		return -EIO;

	}



	return 0;

}

			if (ctx->pattern < 0)
FUNC_0(int VAR_0, char **VAR_1)

{

	int VAR_2, VAR_3;

	struct aio_ctx *VAR_4 = calloc(1, sizeof(struct aio_ctx));

	BlockDriverAIOCB *acb;



	while ((VAR_3 = getopt(VAR_0, VAR_1, "CP:qv")) != EOF) {

		switch (VAR_3) {

		case 'C':

			VAR_4->Cflag = 1;

			break;

		case 'P':

			VAR_4->Pflag = 1;

			VAR_4->pattern = parse_pattern(optarg);

			if (VAR_4->pattern < 0)

				return 0;

			break;

		case 'q':

			VAR_4->qflag = 1;

			break;

		case 'v':

			VAR_4->vflag = 1;

			break;

		default:

			free(VAR_4);

			return command_usage(&aio_read_cmd);

		}

	}



	if (optind > VAR_0 - 2) {

		free(VAR_4);

		return command_usage(&aio_read_cmd);

	}



	VAR_4->offset = cvtnum(VAR_1[optind]);

	if (VAR_4->offset < 0) {

		printf("non-numeric length argument -- %s\n", VAR_1[optind]);

		free(VAR_4);

		return 0;

	}

	optind++;



	if (VAR_4->offset & 0x1ff) {

		printf("offset %" PRId64 " is not sector aligned\n",

                       VAR_4->offset);

		free(VAR_4);

		return 0;

	}



	VAR_2 = VAR_0 - optind;

	VAR_4->buf = create_iovec(&VAR_4->qiov, &VAR_1[optind], VAR_2, 0xab);



	gettimeofday(&VAR_4->t1, NULL);

	acb = bdrv_aio_readv(bs, VAR_4->offset >> 9, &VAR_4->qiov,

			      VAR_4->qiov.size >> 9, aio_read_done, VAR_4);

	if (!acb) {

		free(VAR_4->buf);

		free(VAR_4);

		return -EIO;

	}



	return 0;

}

FUNC_0(int VAR_0, char **VAR_1)
{ int VAR_2, VAR_3; struct aio_ctx *VAR_4 = calloc(1, sizeof(struct aio_ctx)); BlockDriverAIOCB *acb; while ((VAR_3 = getopt(VAR_0, VAR_1, "CP:qv")) != EOF) { switch (VAR_3) { case 'C':
VAR_4->Cflag = 1; break; case 'P':
VAR_4->Pflag = 1; VAR_4->pattern = parse_pattern(optarg); if (VAR_4->pattern < 0)
return 0; break; case 'q':
VAR_4->qflag = 1; break; case 'v':
VAR_4->vflag = 1; break; default:
free(VAR_4); return command_usage(&aio_read_cmd); } } if (optind > VAR_0 - 2) { free(VAR_4); return command_usage(&aio_read_cmd); } VAR_4->offset = cvtnum(VAR_1[optind]); if (VAR_4->offset < 0) { printf("non-numeric length argument -- %s\n", VAR_1[optind]); free(VAR_4); return 0; } optind++; if (VAR_4->offset & 0x1ff) { printf("offset %" PRId64 " is not sector aligned\n",
VAR_4->offset); free(VAR_4); return 0; } VAR_2 = VAR_0 - optind; VAR_4->buf = create_iovec(&VAR_4->qiov, &VAR_1[optind], VAR_2, 0xab); gettimeofday(&VAR_4->t1, NULL); acb = bdrv_aio_readv(bs, VAR_4->offset >> 9, &VAR_4->qiov,
VAR_4->qiov.size >> 9, aio_read_done, VAR_4); if (!acb) { free(VAR_4->buf); free(VAR_4); return -EIO; } return 0; }