alloc_f(int argc, char **argv)

{

	int64_t offset;

	int nb_sectors;

	char s1[64];

	int num;

	int ret;

	const char *retstr;



	offset = cvtnum(argv[1]);

	if (offset & 0x1ff) {

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

			(long long)offset);

		return 0;

	}



	if (argc == 3)

		nb_sectors = cvtnum(argv[2]);

	else

		nb_sectors = 1;



	ret = bdrv_is_allocated(bs, offset >> 9, nb_sectors, &num);



	cvtstr(offset, s1, sizeof(s1));



	retstr = ret ? "allocated" : "not allocated";

	if (nb_sectors == 1)

		printf("sector %s at offset %s\n", retstr, s1);

	else

		printf("%d/%d sectors %s at offset %s\n",

			num, nb_sectors, retstr, s1);

	return 0;

}

alloc_f(int argc, char **argv)

{

	int64_t offset;

	int nb_sectors;

	char s1[64];

	int num;

	int ret;

	const char *retstr;



	offset = cvtnum(argv[1]);

	if (offset & 0x1ff) {

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

			(long long)offset);

		return 0;

	}



	if (argc == 3)

		nb_sectors = cvtnum(argv[2]);

	else

		nb_sectors = 1;



	ret = bdrv_is_allocated(bs, offset >> 9, nb_sectors, &num);



	cvtstr(offset, s1, sizeof(s1));



	retstr = ret ? "allocated" : "not allocated";

	if (nb_sectors == 1)

		printf("sector %s at offset %s\n", retstr, s1);

	else

		printf("%d/%d sectors %s at offset %s\n",

			num, nb_sectors, retstr, s1);

	return 0;

}

FUNC_0(int VAR_0, char **VAR_1)

{

	int64_t offset;

	int VAR_2;

	char VAR_3[64];

	int VAR_4;

	int VAR_5;

	const char *VAR_6;



	offset = cvtnum(VAR_1[1]);

	if (offset & 0x1ff) {

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

			(long long)offset);

		return 0;

	}



	if (VAR_0 == 3)

		VAR_2 = cvtnum(VAR_1[2]);

	else

		VAR_2 = 1;



	VAR_5 = bdrv_is_allocated(bs, offset >> 9, VAR_2, &VAR_4);



	cvtstr(offset, VAR_3, sizeof(VAR_3));



	VAR_6 = VAR_5 ? "allocated" : "not allocated";

	if (VAR_2 == 1)

		printf("sector %s at offset %s\n", VAR_6, VAR_3);

	else

		printf("%d/%d sectors %s at offset %s\n",

			VAR_4, VAR_2, VAR_6, VAR_3);

	return 0;

}

FUNC_0(int VAR_0, char **VAR_1)
{ int64_t offset; int VAR_2; char VAR_3[64]; int VAR_4; int VAR_5; const char *VAR_6; offset = cvtnum(VAR_1[1]); if (offset & 0x1ff) { printf("offset %lld is not sector aligned\n",
(long long)offset); return 0; } if (VAR_0 == 3)
VAR_2 = cvtnum(VAR_1[2]); else
VAR_2 = 1; VAR_5 = bdrv_is_allocated(bs, offset >> 9, VAR_2, &VAR_4); cvtstr(offset, VAR_3, sizeof(VAR_3)); VAR_6 = VAR_5 ? "allocated" : "not allocated"; if (VAR_2 == 1)
printf("sector %s at offset %s\n", VAR_6, VAR_3); else
printf("%d/%d sectors %s at offset %s\n",
VAR_4, VAR_2, VAR_6, VAR_3); return 0; }