LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc.c
// Function: prepare_args
static int prepare_args(int *ac, char ***av, char *prgname, struct Command *cmd ){

	char	**ret;
	int	i;
	char	*newname;

	ret = (char **)malloc(sizeof(char*)*(*ac+1));
	newname = (char*)malloc(strlen(prgname)+strlen(cmd->verb)+2);
	if( !ret || !newname ){
		free(ret);
		free(newname);
		return -1;
	}

	ret[0] = newname;
	for(i=0; i < *ac ; i++ )
		ret[i+1] = (*av)[i];

	strcpy(newname, prgname);
	strcat(newname, " ");
	strcat(newname, cmd->verb);

	(*ac)++;
	*av = ret;

	return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x31c0
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
callq 0x30a0
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x30a0
movq -0x48(%rbp), %rdi
addq %rax, %rdi
addq $0x2, %rdi
callq 0x31c0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x3dcd
cmpq $0x0, -0x40(%rbp)
jne 0x3deb
movq -0x30(%rbp), %rdi
callq 0x3030
movq -0x40(%rbp), %rdi
callq 0x3030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3e7e
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x3e33
movq -0x18(%rbp), %rax
movq (%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x30(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x3dfd
movq -0x40(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3060
movq -0x40(%rbp), %rdi
leaq 0x12af3(%rip), %rsi     # 0x1693e
callq 0x3230
movq -0x40(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x3230
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: read_extcsd
int read_extcsd(int fd, __u8 *ext_csd)
{
	int ret = 0;
	struct mmc_ioc_cmd idata;
	memset(&idata, 0, sizeof(idata));
	memset(ext_csd, 0, sizeof(__u8) * 512);
	idata.write_flag = 0;
	idata.opcode = MMC_SEND_EXT_CSD;
	idata.arg = 0;
	idata.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC;
	idata.blksz = 512;
	idata.blocks = 1;
	mmc_ioc_cmd_set_data(idata, ext_csd);

	ret = ioctl(fd, MMC_IOC_CMD, &idata);
	if (ret)
		perror("ioctl");

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x30f0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x30f0
movl $0x0, -0x60(%rbp)
movl $0x8, -0x58(%rbp)
movl $0x0, -0x54(%rbp)
movl $0xb5, -0x40(%rbp)
movl $0x200, -0x3c(%rbp)     # imm = 0x200
movl $0x1, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x4(%rbp), %edi
movl $0xc048b300, %esi       # imm = 0xC048B300
leaq -0x60(%rbp), %rdx
movb $0x0, %al
callq 0x3100
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x3f20
leaq 0x1264c(%rip), %rdi     # 0x16567
callq 0x3200
movl -0x14(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: write_extcsd_value
int write_extcsd_value(int fd, __u8 index, __u8 value)
{
	int ret = 0;
	struct mmc_ioc_cmd idata;

	memset(&idata, 0, sizeof(idata));
	idata.write_flag = 1;
	idata.opcode = MMC_SWITCH;
	idata.arg = (MMC_SWITCH_MODE_WRITE_BYTE << 24) |
			(index << 16) |
			(value << 8) |
			EXT_CSD_CMD_SET_NORMAL;
	idata.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC;

	ret = ioctl(fd, MMC_IOC_CMD, &idata);
	if (ret)
		perror("ioctl");

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %dl, %al
movb %sil, %cl
movl %edi, -0x4(%rbp)
movb %cl, -0x5(%rbp)
movb %al, -0x6(%rbp)
movl $0x0, -0xc(%rbp)
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x30f0
movl $0x1, -0x58(%rbp)
movl $0x6, -0x50(%rbp)
movzbl -0x5(%rbp), %eax
shll $0x10, %eax
orl $0x3000000, %eax        # imm = 0x3000000
movzbl -0x6(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
orl $0x1, %eax
movl %eax, -0x4c(%rbp)
movl $0x49d, -0x38(%rbp)     # imm = 0x49D
movl -0x4(%rbp), %edi
movl $0xc048b300, %esi       # imm = 0xC048B300
leaq -0x58(%rbp), %rdx
movb $0x0, %al
callq 0x3100
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x3fb5
leaq 0x125b7(%rip), %rdi     # 0x16567
callq 0x3200
movl -0xc(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: send_status
int send_status(int fd, __u32 *response)
{
	int ret = 0;
	struct mmc_ioc_cmd idata;

	memset(&idata, 0, sizeof(idata));
	idata.opcode = MMC_SEND_STATUS;
	idata.arg = (1 << 16);
	idata.flags = MMC_RSP_R1 | MMC_CMD_AC;

	ret = ioctl(fd, MMC_IOC_CMD, &idata);
	if (ret)
	perror("ioctl");

	*response = idata.response[0];

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x30f0
movl $0xd, -0x58(%rbp)
movl $0x10000, -0x54(%rbp)   # imm = 0x10000
movl $0x15, -0x40(%rbp)
movl -0x4(%rbp), %edi
movl $0xc048b300, %esi       # imm = 0xC048B300
leaq -0x60(%rbp), %rdx
movb $0x0, %al
callq 0x3100
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x4023
leaq 0x12549(%rip), %rdi     # 0x16567
callq 0x3200
movl -0x50(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl -0x14(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: do_writeprotect_boot_get
int do_writeprotect_boot_get(int nargs, char **argv)
{
	__u8 ext_csd[512];
	int fd, ret;
	char *device;

	if (nargs != 2) {
		fprintf(stderr, "Usage: mmc writeprotect boot get </path/to/mmcblkX>\n");
		exit(1);
	}

	device = argv[1];

	fd = open(device, O_RDWR);
	if (fd < 0) {
		perror("open");
		exit(1);
	}

	ret = read_extcsd(fd, ext_csd);
	if (ret) {
		fprintf(stderr, "Could not read EXT_CSD from %s\n", device);
		exit(1);
	}

	print_writeprotect_boot_status(ext_csd);

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x4(%rbp)
je 0x407a
movq 0x16f91(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
leaq 0xf657(%rip), %rsi      # 0x136c0
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x220(%rbp)
movq -0x220(%rbp), %rdi
movl $0x2, %esi
movb $0x0, %al
callq 0x31e0
movl %eax, -0x214(%rbp)
cmpl $0x0, -0x214(%rbp)
jge 0x40c1
leaq 0x11f32(%rip), %rdi     # 0x15fe4
callq 0x3200
movl $0x1, %edi
callq 0x3240
movl -0x214(%rbp), %edi
leaq -0x210(%rbp), %rsi
callq 0x3e90
movl %eax, -0x218(%rbp)
cmpl $0x0, -0x218(%rbp)
je 0x410b
movq 0x16f07(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movq -0x220(%rbp), %rdx
leaq 0xf5fb(%rip), %rsi      # 0x136f5
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
leaq -0x210(%rbp), %rdi
callq 0x4130
movl -0x218(%rbp), %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: print_writeprotect_boot_status
static void print_writeprotect_boot_status(__u8 *ext_csd)
{
	__u8 reg;
	__u8 ext_csd_rev = ext_csd[EXT_CSD_REV];

	/* A43: reserved [174:0] */
	if (ext_csd_rev >= 5) {
		printf("Boot write protection status registers"
			" [BOOT_WP_STATUS]: 0x%02x\n", ext_csd[174]);

		reg = ext_csd[EXT_CSD_BOOT_WP];
		printf("Boot Area Write protection [BOOT_WP]: 0x%02x\n", reg);
		printf(" Power ro locking: ");
		if (reg & EXT_CSD_BOOT_WP_B_PWR_WP_DIS)
			printf("not possible\n");
		else
			printf("possible\n");

		printf(" Permanent ro locking: ");
		if (reg & EXT_CSD_BOOT_WP_B_PERM_WP_DIS)
			printf("not possible\n");
		else
			printf("possible\n");

		printf(" ro lock status: ");
		if (reg & EXT_CSD_BOOT_WP_B_PWR_WP_EN)
			printf("locked until next power on\n");
		else if (reg & EXT_CSD_BOOT_WP_B_PERM_WP_EN)
			printf("locked permanently\n");
		else
			printf("not locked\n");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movb 0xc0(%rax), %al
movb %al, -0xa(%rbp)
movzbl -0xa(%rbp), %eax
cmpl $0x5, %eax
jl 0x4256
movq -0x8(%rbp), %rax
movzbl 0xae(%rax), %esi
leaq 0x1268f(%rip), %rdi     # 0x167f7
movb $0x0, %al
callq 0x30c0
movq -0x8(%rbp), %rax
movb 0xad(%rax), %al
movb %al, -0x9(%rbp)
movzbl -0x9(%rbp), %esi
leaq 0x126b1(%rip), %rdi     # 0x16838
movb $0x0, %al
callq 0x30c0
leaq 0x126d1(%rip), %rdi     # 0x16866
movb $0x0, %al
callq 0x30c0
movzbl -0x9(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x41b8
leaq 0x126cb(%rip), %rdi     # 0x1687a
movb $0x0, %al
callq 0x30c0
jmp 0x41c6
leaq 0x126bf(%rip), %rdi     # 0x1687e
movb $0x0, %al
callq 0x30c0
leaq 0x126bb(%rip), %rdi     # 0x16888
movb $0x0, %al
callq 0x30c0
movzbl -0x9(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x41f0
leaq 0x12693(%rip), %rdi     # 0x1687a
movb $0x0, %al
callq 0x30c0
jmp 0x41fe
leaq 0x12687(%rip), %rdi     # 0x1687e
movb $0x0, %al
callq 0x30c0
leaq 0x1269b(%rip), %rdi     # 0x168a0
movb $0x0, %al
callq 0x30c0
movzbl -0x9(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4228
leaq 0x12693(%rip), %rdi     # 0x168b2
movb $0x0, %al
callq 0x30c0
jmp 0x4254
movzbl -0x9(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x4244
leaq 0x12693(%rip), %rdi     # 0x168ce
movb $0x0, %al
callq 0x30c0
jmp 0x4252
leaq 0x12697(%rip), %rdi     # 0x168e2
movb $0x0, %al
callq 0x30c0
jmp 0x4254
jmp 0x4256
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: do_writeprotect_boot_set
int do_writeprotect_boot_set(int nargs, char **argv)
{
	__u8 ext_csd[512], value;
	int fd, ret;
	char *device;

	if (nargs != 2) {
		fprintf(stderr, "Usage: mmc writeprotect boot set </path/to/mmcblkX>\n");
		exit(1);
	}

	device = argv[1];

	fd = open(device, O_RDWR);
	if (fd < 0) {
		perror("open");
		exit(1);
	}

	ret = read_extcsd(fd, ext_csd);
	if (ret) {
		fprintf(stderr, "Could not read EXT_CSD from %s\n", device);
		exit(1);
	}

	value = ext_csd[EXT_CSD_BOOT_WP] |
		EXT_CSD_BOOT_WP_B_PWR_WP_EN;
	ret = write_extcsd_value(fd, EXT_CSD_BOOT_WP, value);
	if (ret) {
		fprintf(stderr, "Could not write 0x%02x to "
			"EXT_CSD[%d] in %s\n",
			value, EXT_CSD_BOOT_WP, device);
		exit(1);
	}

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x4(%rbp)
je 0x429a
movq 0x16d71(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
leaq 0xf48c(%rip), %rsi      # 0x13715
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rdi
movl $0x2, %esi
movb $0x0, %al
callq 0x31e0
movl %eax, -0x218(%rbp)
cmpl $0x0, -0x218(%rbp)
jge 0x42e1
leaq 0x11d12(%rip), %rdi     # 0x15fe4
callq 0x3200
movl $0x1, %edi
callq 0x3240
movl -0x218(%rbp), %edi
leaq -0x210(%rbp), %rsi
callq 0x3e90
movl %eax, -0x21c(%rbp)
cmpl $0x0, -0x21c(%rbp)
je 0x432b
movq 0x16ce7(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movq -0x228(%rbp), %rdx
leaq 0xf3db(%rip), %rsi      # 0x136f5
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movzbl -0x163(%rbp), %eax
orl $0x1, %eax
movb %al, -0x211(%rbp)
movl -0x218(%rbp), %edi
movl $0xad, %esi
movzbl -0x211(%rbp), %edx
callq 0x3f30
movl %eax, -0x21c(%rbp)
cmpl $0x0, -0x21c(%rbp)
je 0x4396
movq 0x16c88(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movzbl -0x211(%rbp), %edx
movq -0x228(%rbp), %r8
leaq 0xf3ca(%rip), %rsi      # 0x1374a
movl $0xad, %ecx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movl -0x21c(%rbp), %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: get_wp_group_size_in_blks
static int get_wp_group_size_in_blks(__u8 *ext_csd, __u32 *size)
{
	__u8 ext_csd_rev = ext_csd[EXT_CSD_REV];

	if ((ext_csd_rev < 5) || (ext_csd[EXT_CSD_ERASE_GROUP_DEF] == 0))
		return 1;

	*size = ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] *
		ext_csd[EXT_CSD_HC_WP_GRP_SIZE] * 1024;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movb 0xc0(%rax), %al
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
cmpl $0x5, %eax
jl 0x46c2
movq -0x10(%rbp), %rax
movzbl 0xaf(%rax), %eax
cmpl $0x0, %eax
jne 0x46cb
movl $0x1, -0x4(%rbp)
jmp 0x46f4
movq -0x10(%rbp), %rax
movzbl 0xe0(%rax), %ecx
movq -0x10(%rbp), %rax
movzbl 0xdd(%rax), %eax
imull %eax, %ecx
shll $0xa, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: get_size_in_blks
static __u32 get_size_in_blks(int fd)
{
	int res;
	int size;

	res = ioctl(fd, BLKGETSIZE, &size);
	if (res) {
		fprintf(stderr, "Error getting device size, errno: %d\n",
			errno);
		perror("");
		return -1;
	}
	return size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %edi
movl $0x1260, %esi           # imm = 0x1260
leaq -0x10(%rbp), %rdx
movb $0x0, %al
callq 0x3100
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x4763
movq 0x168c2(%rip), %rax     # 0x1aff0
movq (%rax), %rax
movq %rax, -0x18(%rbp)
callq 0x3050
movq -0x18(%rbp), %rdi
movl (%rax), %edx
leaq 0x121a7(%rip), %rsi     # 0x168ee
movb $0x0, %al
callq 0x3180
leaq 0xeea7(%rip), %rdi      # 0x135fc
callq 0x3200
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4769
movl -0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: send_write_protect_type
static int send_write_protect_type(int fd, __u32 blk_addr, __u64 *group_bits)
{
	int ret = 0;
	struct mmc_ioc_cmd idata;
	__u8 buf[8];
	__u64 bits = 0;
	int x;

	memset(&idata, 0, sizeof(idata));
	idata.write_flag = 0;
	idata.opcode = MMC_SEND_WRITE_PROT_TYPE;
	idata.blksz      = 8,
	idata.blocks     = 1,
	idata.arg = blk_addr;
	idata.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC;
	mmc_ioc_cmd_set_data(idata, buf);

	ret = ioctl(fd, MMC_IOC_CMD, &idata);
	if (ret)
		perror("ioctl");
	for (x = 0; x < sizeof(buf); x++)
		bits |= (__u64)(buf[7 - x]) << (x * 8);
	*group_bits = bits;
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq $0x0, -0x70(%rbp)
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x30f0
movl $0x0, -0x60(%rbp)
movl $0x1f, -0x58(%rbp)
movl $0x8, -0x3c(%rbp)
movl $0x1, -0x38(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x54(%rbp)
movl $0xb5, -0x40(%rbp)
leaq -0x68(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x4(%rbp), %edi
movl $0xc048b300, %esi       # imm = 0xC048B300
leaq -0x60(%rbp), %rdx
movb $0x0, %al
callq 0x3100
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x480d
leaq 0x11d5f(%rip), %rdi     # 0x16567
callq 0x3200
movl $0x0, -0x74(%rbp)
movslq -0x74(%rbp), %rax
cmpq $0x8, %rax
jae 0x484b
movl $0x7, %eax
subl -0x74(%rbp), %eax
cltq
movzbl -0x68(%rbp,%rax), %eax
movl -0x74(%rbp), %ecx
shll $0x3, %ecx
movl %ecx, %ecx
shlq %cl, %rax
orq -0x70(%rbp), %rax
movq %rax, -0x70(%rbp)
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x4814
movq -0x70(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl -0x14(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: print_wp_status
static void print_wp_status(__u32 wp_sizeblks, __u32 start_group,
			__u32 end_group, int rptype)
{
	printf("Write Protect Groups %d-%d (Blocks %d-%d), ",
		start_group, end_group,
		start_group * wp_sizeblks, ((end_group + 1) * wp_sizeblks) - 1);
	printf("%s Write Protection\n", prot_desc[rptype]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movl -0x8(%rbp), %esi
movl -0xc(%rbp), %edx
movl -0x8(%rbp), %ecx
imull -0x4(%rbp), %ecx
movl -0xc(%rbp), %r8d
addl $0x1, %r8d
imull -0x4(%rbp), %r8d
subl $0x1, %r8d
leaq 0x1206b(%rip), %rdi     # 0x16914
movb $0x0, %al
callq 0x30c0
movslq -0x10(%rbp), %rcx
leaq 0x16eb5(%rip), %rax     # 0x1b770
movq (%rax,%rcx,8), %rsi
leaq 0x1207a(%rip), %rdi     # 0x16940
movb $0x0, %al
callq 0x30c0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: set_write_protect
static int set_write_protect(int fd, __u32 blk_addr, int on_off)
{
	int ret = 0;
	struct mmc_ioc_cmd idata;

	memset(&idata, 0, sizeof(idata));
	idata.write_flag = 1;
	if (on_off)
		idata.opcode = MMC_SET_WRITE_PROT;
	else
		idata.opcode = MMC_CLEAR_WRITE_PROT;
	idata.arg = blk_addr;
	idata.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC;

	ret = ioctl(fd, MMC_IOC_CMD, &idata);
	if (ret)
		perror("ioctl");

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x30f0
movl $0x1, -0x58(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x4d2e
movl $0x1c, -0x50(%rbp)
jmp 0x4d35
movl $0x1d, -0x50(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl $0x49d, -0x38(%rbp)     # imm = 0x49D
movl -0x4(%rbp), %edi
movl $0xc048b300, %esi       # imm = 0xC048B300
leaq -0x58(%rbp), %rdx
movb $0x0, %al
callq 0x3100
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x4d6a
leaq 0x11802(%rip), %rdi     # 0x16567
callq 0x3200
movl -0x10(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: do_hwreset
int do_hwreset(int value, int nargs, char **argv)
{
	__u8 ext_csd[512];
	int fd, ret;
	char *device;

	if (nargs != 2) {
		fprintf(stderr, "Usage: mmc hwreset enable </path/to/mmcblkX>\n");
		exit(1);
	}

	device = argv[1];

	fd = open(device, O_RDWR);
	if (fd < 0) {
		perror("open");
		exit(1);
	}

	ret = read_extcsd(fd, ext_csd);
	if (ret) {
		fprintf(stderr, "Could not read EXT_CSD from %s\n", device);
		exit(1);
	}

	if ((ext_csd[EXT_CSD_RST_N_FUNCTION] & EXT_CSD_RST_N_EN_MASK) ==
	    EXT_CSD_HW_RESET_EN) {
		fprintf(stderr,
			"H/W Reset is already permanently enabled on %s\n",
			device);
		exit(1);
	}
	if ((ext_csd[EXT_CSD_RST_N_FUNCTION] & EXT_CSD_RST_N_EN_MASK) ==
	    EXT_CSD_HW_RESET_DIS) {
		fprintf(stderr,
			"H/W Reset is already permanently disabled on %s\n",
			device);
		exit(1);
	}

	ret = write_extcsd_value(fd, EXT_CSD_RST_N_FUNCTION, value);
	if (ret) {
		fprintf(stderr,
			"Could not write 0x%02x to EXT_CSD[%d] in %s\n",
			value, EXT_CSD_RST_N_FUNCTION, device);
		exit(1);
	}

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
je 0x553d
movq 0x15ace(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
leaq 0xe699(%rip), %rsi      # 0x13bc5
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x220(%rbp)
movq -0x220(%rbp), %rdi
movl $0x2, %esi
movb $0x0, %al
callq 0x31e0
movl %eax, -0x214(%rbp)
cmpl $0x0, -0x214(%rbp)
jge 0x5584
leaq 0x10a6f(%rip), %rdi     # 0x15fe4
callq 0x3200
movl $0x1, %edi
callq 0x3240
movl -0x214(%rbp), %edi
leaq -0x210(%rbp), %rsi
callq 0x3e90
movl %eax, -0x218(%rbp)
cmpl $0x0, -0x218(%rbp)
je 0x55ce
movq 0x15a44(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movq -0x220(%rbp), %rdx
leaq 0xe138(%rip), %rsi      # 0x136f5
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movzbl -0x16e(%rbp), %eax
andl $0x3, %eax
cmpl $0x1, %eax
jne 0x5606
movq 0x15a0c(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movq -0x220(%rbp), %rdx
leaq 0xe5fe(%rip), %rsi      # 0x13bf3
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movzbl -0x16e(%rbp), %eax
andl $0x3, %eax
cmpl $0x2, %eax
jne 0x563e
movq 0x159d4(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movq -0x220(%rbp), %rdx
leaq 0xe5f6(%rip), %rsi      # 0x13c23
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movl -0x214(%rbp), %edi
movl -0x4(%rbp), %eax
movl $0xa2, %esi
movzbl %al, %edx
callq 0x3f30
movl %eax, -0x218(%rbp)
cmpl $0x0, -0x218(%rbp)
je 0x5694
movq 0x15986(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movl -0x4(%rbp), %edx
movq -0x220(%rbp), %r8
leaq 0xe0cc(%rip), %rsi      # 0x1374a
movl $0xa2, %ecx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movl -0x218(%rbp), %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: do_write_bkops_en
int do_write_bkops_en(int nargs, char **argv)
{
	__u8 ext_csd[512], value = 0;
	int fd, ret;
	char *device;

	if (nargs != 2) {
	       fprintf(stderr, "Usage: mmc bkops enable </path/to/mmcblkX>\n");
	       exit(1);
	}

	device = argv[1];

	fd = open(device, O_RDWR);
	if (fd < 0) {
		perror("open");
		exit(1);
	}

	ret = read_extcsd(fd, ext_csd);
	if (ret) {
		fprintf(stderr, "Could not read EXT_CSD from %s\n", device);
		exit(1);
	}

	if (!(ext_csd[EXT_CSD_BKOPS_SUPPORT] & 0x1)) {
		fprintf(stderr, "%s doesn't support BKOPS\n", device);
		exit(1);
	}

	ret = write_extcsd_value(fd, EXT_CSD_BKOPS_EN, BKOPS_ENABLE);
	if (ret) {
		fprintf(stderr, "Could not write 0x%02x to EXT_CSD[%d] in %s\n",
			value, EXT_CSD_BKOPS_EN, device);
		exit(1);
	}

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x211(%rbp)
cmpl $0x2, -0x4(%rbp)
je 0x5751
movq 0x158ba(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
leaq 0xe514(%rip), %rsi      # 0x13c54
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rdi
movl $0x2, %esi
movb $0x0, %al
callq 0x31e0
movl %eax, -0x218(%rbp)
cmpl $0x0, -0x218(%rbp)
jge 0x5798
leaq 0x1085b(%rip), %rdi     # 0x15fe4
callq 0x3200
movl $0x1, %edi
callq 0x3240
movl -0x218(%rbp), %edi
leaq -0x210(%rbp), %rsi
callq 0x3e90
movl %eax, -0x21c(%rbp)
cmpl $0x0, -0x21c(%rbp)
je 0x57e2
movq 0x15830(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movq -0x228(%rbp), %rdx
leaq 0xdf24(%rip), %rsi      # 0x136f5
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movzbl -0x1a(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x5817
movq 0x157fb(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movq -0x228(%rbp), %rdx
leaq 0xe47a(%rip), %rsi      # 0x13c80
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movl -0x218(%rbp), %edi
movl $0xa3, %esi
movl $0x1, %edx
callq 0x3f30
movl %eax, -0x21c(%rbp)
cmpl $0x0, -0x21c(%rbp)
je 0x5870
movq 0x157ae(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movzbl -0x211(%rbp), %edx
movq -0x228(%rbp), %r8
leaq 0xdef0(%rip), %rsi      # 0x1374a
movl $0xa3, %ecx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movl -0x21c(%rbp), %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: do_status_get
int do_status_get(int nargs, char **argv)
{
	__u32 response;
	int fd, ret;
	char *device;

	if (nargs != 2) {
		fprintf(stderr, "Usage: mmc status get </path/to/mmcblkX>\n");
		exit(1);
	}

	device = argv[1];

	fd = open(device, O_RDWR);
	if (fd < 0) {
		perror("open");
		exit(1);
	}

	ret = send_status(fd, &response);
	if (ret) {
		fprintf(stderr, "Could not read response to SEND_STATUS from %s\n", device);
		exit(1);
	}

	printf("SEND_STATUS response: 0x%08x\n", response);

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x4(%rbp)
je 0x58b7
movq 0x15754(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
leaq 0xe3f4(%rip), %rsi      # 0x13c9a
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movl $0x2, %esi
movb $0x0, %al
callq 0x31e0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x58f2
leaq 0x10701(%rip), %rdi     # 0x15fe4
callq 0x3200
movl $0x1, %edi
callq 0x3240
movl -0x18(%rbp), %edi
leaq -0x14(%rbp), %rsi
callq 0x3fc0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x592d
movq 0x156e2(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movq -0x28(%rbp), %rdx
leaq 0xe3a8(%rip), %rsi      # 0x13cc4
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movl -0x14(%rbp), %esi
leaq 0xe3bd(%rip), %rdi      # 0x13cf4
movb $0x0, %al
callq 0x30c0
movl -0x1c(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: get_sector_count
unsigned int get_sector_count(__u8 *ext_csd)
{
	return (ext_csd[EXT_CSD_SEC_COUNT_3] << 24) |
	(ext_csd[EXT_CSD_SEC_COUNT_2] << 16) |
	(ext_csd[EXT_CSD_SEC_COUNT_1] << 8)  |
	ext_csd[EXT_CSD_SEC_COUNT_0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0xd7(%rax), %eax
shll $0x18, %eax
movq -0x8(%rbp), %rcx
movzbl 0xd6(%rcx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzbl 0xd5(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzbl 0xd4(%rcx), %ecx
orl %ecx, %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: do_sanitize
int do_sanitize(int nargs, char **argv)
{
	int fd, ret;
	char *device;

	if (nargs != 2) {
		fprintf(stderr, "Usage: mmc sanitize </path/to/mmcblkX>\n");
		exit(1);
	}

	device = argv[1];

	fd = open(device, O_RDWR);
	if (fd < 0) {
		perror("open");
		exit(1);
	}

	ret = write_extcsd_value(fd, EXT_CSD_SANITIZE_START, 1);
	if (ret) {
		fprintf(stderr, "Could not write 0x%02x to EXT_CSD[%d] in %s\n",
			1, EXT_CSD_SANITIZE_START, device);
		exit(1);
	}

	return ret;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x4(%rbp)
je 0x8347
movq 0x12cc4(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
leaq 0xdc3e(%rip), %rsi      # 0x15f74
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movl $0x2, %esi
movb $0x0, %al
callq 0x31e0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0x8382
leaq 0xdc71(%rip), %rdi      # 0x15fe4
callq 0x3200
movl $0x1, %edi
callq 0x3240
movl -0x14(%rbp), %edi
movl $0xa5, %esi
movl $0x1, %edx
callq 0x3f30
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x83cd
movq 0x12c4c(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movq -0x20(%rbp), %r8
leaq 0xb398(%rip), %rsi      # 0x1374a
movl $0x1, %edx
movl $0xa5, %ecx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movl -0x18(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: rpmb_read_counter
int rpmb_read_counter(int dev_fd, unsigned int *cnt)
{
	int ret;
	struct rpmb_frame frame_in = {
		.req_resp = htobe16(MMC_RPMB_READ_CNT)
	}, frame_out;

	/* Execute RPMB op */
	ret = do_rpmb_op(dev_fd, &frame_in, &frame_out, 1);
	if (ret != 0) {
		perror("RPMB ioctl failed");
		exit(1);
	}

	/* Check RPMB response */
	if (frame_out.result != 0)
		return be16toh(frame_out.result);

	*cnt = be32toh(frame_out.write_counter);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x420, %rsp            # imm = 0x420
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x214(%rbp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x30f0
movl $0x2, %edi
callq 0x8670
movw %ax, -0x16(%rbp)
movl -0x8(%rbp), %edi
leaq -0x214(%rbp), %rsi
leaq -0x414(%rbp), %rdx
movl $0x1, %ecx
callq 0x86a0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x893d
leaq 0xd71a(%rip), %rdi      # 0x16048
callq 0x3200
movl $0x1, %edi
callq 0x3240
movzwl -0x218(%rbp), %eax
cmpl $0x0, %eax
je 0x895d
movzwl -0x218(%rbp), %edi
callq 0x8670
movzwl %ax, %eax
movl %eax, -0x4(%rbp)
jmp 0x8977
movl -0x220(%rbp), %edi
callq 0x8990
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x420, %rsp            # imm = 0x420
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: do_rpmb_read_counter
int do_rpmb_read_counter(int nargs, char **argv)
{
	int ret, dev_fd;
	unsigned int cnt;

	if (nargs != 2) {
		fprintf(stderr, "Usage: mmc rpmb read-counter </path/to/mmcblkXrpmb>\n");
		exit(1);
	}

	dev_fd = open(argv[1], O_RDWR);
	if (dev_fd < 0) {
		perror("device open");
		exit(1);
	}

	ret = rpmb_read_counter(dev_fd, &cnt);

	/* Check RPMB response */
	if (ret != 0) {
		printf("RPMB operation failed, retcode 0x%04x\n", ret);
		exit(1);
	}

	close(dev_fd);

	printf("Counter value: 0x%08x\n", cnt);

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x4(%rbp)
je 0x8a07
movq 0x12604(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
leaq 0xd68b(%rip), %rsi      # 0x16081
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x2, %esi
movb $0x0, %al
callq 0x31e0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x8a3a
leaq 0xd5b2(%rip), %rdi      # 0x15fdd
callq 0x3200
movl $0x1, %edi
callq 0x3240
movl -0x18(%rbp), %edi
leaq -0x1c(%rbp), %rsi
callq 0x88d0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x8a6a
movl -0x14(%rbp), %esi
leaq 0xd601(%rip), %rdi      # 0x1605a
movb $0x0, %al
callq 0x30c0
movl $0x1, %edi
callq 0x3240
movl -0x18(%rbp), %edi
callq 0x3110
movl -0x1c(%rbp), %esi
leaq 0xd63a(%rip), %rdi      # 0x160b6
movb $0x0, %al
callq 0x30c0
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: do_PPEU
int do_PPEU(int nargs, char **argv)
{
 int cmd56_arg = 0x110005FB;
 char data_in[SD_BLOCK_SIZE];
 int fd, ret;
 char *device;
 if (!((nargs == 2)||(nargs == 3))) {
	 printf("Usage mmc ppeu read <-d>");
	 exit(1);
 }
 device = argv[nargs-1];
 fd = open(device, O_RDWR);
 if (fd < 0) {
 perror("open");
 exit(1);
 }
 //execute CMD56 and get one 512-byte data block
 ret = CMD56_data_in(fd, cmd56_arg, data_in);
 if (ret) {
 fprintf(stderr, "CMD56 CALL FAILED, %s\n", device);
 exit(1);
 }
 if (!strcmp("-d", argv[1]))
 dump_data_block(data_in); //data block dumping
 /* write data to stdout in CSV format */
 printf("Fixed Filed Header: %02Xh %02Xh %02Xh %02Xh\n",
 data_in[0], data_in[1], data_in[2], data_in[3]);
 printf("Percentage Step Size: %d\n", data_in[7]);
 printf("TLC/QLC Percentage Utilization: %d%%\n", data_in[8]);
 printf("SLC Percentage Utilization: %d%%\n", data_in[9]);

 return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x110005fb, -0x14(%rbp) # imm = 0x110005FB
cmpl $0x2, -0x4(%rbp)
je 0x9f9d
cmpl $0x3, -0x4(%rbp)
je 0x9f9d
leaq 0xc781(%rip), %rdi      # 0x1670d
movb $0x0, %al
callq 0x30c0
movl $0x1, %edi
callq 0x3240
movq -0x10(%rbp), %rax
movl -0x4(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x230(%rbp)
movq -0x230(%rbp), %rdi
movl $0x2, %esi
movb $0x0, %al
callq 0x31e0
movl %eax, -0x224(%rbp)
cmpl $0x0, -0x224(%rbp)
jge 0x9fed
leaq 0xc006(%rip), %rdi      # 0x15fe4
callq 0x3200
movl $0x1, %edi
callq 0x3240
movl -0x224(%rbp), %edi
movl -0x14(%rbp), %esi
leaq -0x220(%rbp), %rdx
callq 0xa0e0
movl %eax, -0x228(%rbp)
cmpl $0x0, -0x228(%rbp)
je 0xa03a
movq 0x10fd8(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movq -0x230(%rbp), %rdx
leaq 0xc6fd(%rip), %rsi      # 0x16726
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x3240
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0xc6f4(%rip), %rdi      # 0x1673d
callq 0x3170
cmpl $0x0, %eax
jne 0xa05f
leaq -0x220(%rbp), %rdi
callq 0xa180
movsbl -0x220(%rbp), %esi
movsbl -0x21f(%rbp), %edx
movsbl -0x21e(%rbp), %ecx
movsbl -0x21d(%rbp), %r8d
leaq 0xc6bd(%rip), %rdi      # 0x16740
movb $0x0, %al
callq 0x30c0
movsbl -0x219(%rbp), %esi
leaq 0xc6d5(%rip), %rdi      # 0x1676d
movb $0x0, %al
callq 0x30c0
movsbl -0x218(%rbp), %esi
leaq 0xc6da(%rip), %rdi      # 0x16787
movb $0x0, %al
callq 0x30c0
movsbl -0x217(%rbp), %esi
leaq 0xc6eb(%rip), %rdi      # 0x167ad
movb $0x0, %al
callq 0x30c0
movl -0x228(%rbp), %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: CMD56_data_in
int CMD56_data_in(int fd, int cmd56_arg, char *lba_block_data)
{
 int ret = 0;
 struct mmc_ioc_cmd idata;
 memset(&idata, 0, sizeof(idata));
 memset(lba_block_data, 0, sizeof(__u8) * 512);
 idata.write_flag = 0;
 idata.opcode = SD_GEN_CMD;
 idata.arg = cmd56_arg;
 idata.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC;
 idata.blksz = SD_BLOCK_SIZE;
 idata.blocks = 1;
 mmc_ioc_cmd_set_data(idata, lba_block_data);
 ret = ioctl(fd, MMC_IOC_CMD, &idata);
 if (ret)
 perror("ioctl");
 return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x30f0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x30f0
movl $0x0, -0x60(%rbp)
movl $0x38, -0x58(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x54(%rbp)
movl $0xb5, -0x40(%rbp)
movl $0x200, -0x3c(%rbp)     # imm = 0x200
movl $0x1, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x4(%rbp), %edi
movl $0xc048b300, %esi       # imm = 0xC048B300
leaq -0x60(%rbp), %rdx
movb $0x0, %al
callq 0x3100
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0xa172
leaq 0xc3fa(%rip), %rdi      # 0x16567
callq 0x3200
movl -0x14(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: dump_data_block
void dump_data_block(char *lba_block_data)
{
 int count=0;
 printf("CMD56 data block dumping:");
 while( count < SD_BLOCK_SIZE) {
 if(count % 16 == 0)
 printf("\n%03d: ", count);
 printf("%02x ", lba_block_data[count]);
 count++;
 }
 printf("\n");

 return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
leaq 0xc635(%rip), %rdi      # 0x167cf
movb $0x0, %al
callq 0x30c0
cmpl $0x200, -0xc(%rbp)      # imm = 0x200
jge 0xa1f0
movl -0xc(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0xa1cb
movl -0xc(%rbp), %esi
leaq 0xc625(%rip), %rdi      # 0x167e9
movb $0x0, %al
callq 0x30c0
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %esi
leaq 0xc613(%rip), %rdi      # 0x167f1
movb $0x0, %al
callq 0x30c0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xa1a1
leaq 0xdba3(%rip), %rdi      # 0x17d9a
movb $0x0, %al
callq 0x30c0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/mmc_cmds.c
// Function: set_single_cmd
static inline void set_single_cmd(struct mmc_ioc_cmd *ioc, __u32 opcode,
				  int write_flag, unsigned int blocks)
{
	ioc->opcode = opcode;
	ioc->write_flag = write_flag;
	ioc->arg = 0x0;
	ioc->blksz = 512;
	ioc->blocks = blocks;
	ioc->flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x10(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x8(%rbp), %rax
movl $0x200, 0x24(%rax)      # imm = 0x200
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x8(%rbp), %rax
movl $0xb5, 0x20(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/lsmmc.c
// Function: usage
void usage(void)
{
	printf("Usage: print mmc [-h] [-v] <device path ...>\n");
	printf("\n");
	printf("Options:\n");
	printf("\t-h\tShow this help.\n");
	printf("\t-v\tEnable verbose mode.\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xcc55(%rip), %rdi      # 0x16ed0
movb $0x0, %al
callq 0x30c0
leaq 0xdb11(%rip), %rdi      # 0x17d9a
movb $0x0, %al
callq 0x30c0
leaq 0xcc67(%rip), %rdi      # 0x16efe
movb $0x0, %al
callq 0x30c0
leaq 0xcc63(%rip), %rdi      # 0x16f08
movb $0x0, %al
callq 0x30c0
leaq 0xcc6a(%rip), %rdi      # 0x16f1d
movb $0x0, %al
callq 0x30c0
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/lsmmc.c
// Function: parse_opts
int parse_opts(int argc, char **argv, struct config *config)
{
	int c;

	while ((c = getopt(argc, argv, "hv")) != -1) {
		switch (c) {
		case 'h':
			usage();
			return -1;
		case 'v':
			config->verbose = true;
			break;
		case '?':
			fprintf(stderr,
				"Unknown option '%c' encountered.\n\n", c);
			usage();
			return -1;
		case ':':
			fprintf(stderr,
				"Argument for option '%c' missing.\n\n", c);
			usage();
			return -1;
		default:
			fprintf(stderr,
				"Unimplemented option '%c' encountered.\n", c);
			break;
		}
	}

	if (optind >= argc) {
		fprintf(stderr, "Expected mmc directory arguments.\n\n");
		usage();
		return -1;
	}

	config->dir = strdup(argv[optind]);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0xcc56(%rip), %rdx      # 0x16f37
callq 0x3210
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
je 0xa3ad
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
subl $0x3a, %eax
je 0xa364
jmp 0xa2ff
movl -0x20(%rbp), %eax
subl $0x3f, %eax
je 0xa338
jmp 0xa309
movl -0x20(%rbp), %eax
subl $0x68, %eax
je 0xa31d
jmp 0xa313
movl -0x20(%rbp), %eax
subl $0x76, %eax
je 0xa32e
jmp 0xa38d
callq 0xa270
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa40a
movq -0x18(%rbp), %rax
movb $0x1, 0x10(%rax)
jmp 0xa3a8
movq 0x10cb1(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movl -0x1c(%rbp), %edx
leaq 0xcbee(%rip), %rsi      # 0x16f3a
movb $0x0, %al
callq 0x3180
callq 0xa270
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa40a
movq 0x10c85(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movl -0x1c(%rbp), %edx
leaq 0xcbe5(%rip), %rsi      # 0x16f5d
movb $0x0, %al
callq 0x3180
callq 0xa270
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa40a
movq 0x10c5c(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movl -0x1c(%rbp), %edx
leaq 0xcbe0(%rip), %rsi      # 0x16f81
movb $0x0, %al
callq 0x3180
jmp 0xa2d3
movq 0x10c1c(%rip), %rax     # 0x1afd0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jl 0xa3e1
movq 0x10c2e(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
leaq 0xcbdd(%rip), %rsi      # 0x16fa9
movb $0x0, %al
callq 0x3180
callq 0xa270
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa40a
movq -0x10(%rbp), %rax
movq 0x10be4(%rip), %rcx     # 0x1afd0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x3260
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/lsmmc.c
// Function: parse_ids
int parse_ids(struct config *config)
{
	unsigned int ids_cnt = sizeof(database) / sizeof(struct ids_database);
	unsigned int value;
	char **ids;
	char *type;
	int i;

	for (i = 0; i < ids_cnt; i++) {
		type = database[i].type;

		if (!strcmp(type, "mmc")) {
			ids = config->mmc_ids;
		} else if (!strcmp(type, "sd")) {
			ids = config->sd_ids;
		} else {
			fprintf(stderr,
				"MMC/SD id parse error, unknown type: '%s'.\n",
				type);
			return -1;
		}

		value = database[i].id;

		if (value >= IDS_MAX) {
			fprintf(stderr,
				"MMC/SD id parse error, id out of range.\n");
			return -1;
		}

		if (ids[value]) {
			fprintf(stderr,
				"Duplicate entries: type='%s', id='0x%1x'.\n",
				type, value);
			return -1;
		}

		ids[value] = database[i].manufacturer;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl $0x1c, -0x14(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0xa576
movslq -0x2c(%rbp), %rcx
leaq 0x1133f(%rip), %rax     # 0x1b790
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
leaq 0xca27(%rip), %rsi      # 0x16e91
callq 0x3170
cmpl $0x0, %eax
jne 0xa482
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0xa4cf
movq -0x28(%rbp), %rdi
leaq 0xe34f(%rip), %rsi      # 0x187dc
callq 0x3170
cmpl $0x0, %eax
jne 0xa4a5
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0xa4cd
movq 0x10b44(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movq -0x28(%rbp), %rdx
leaq 0xcb13(%rip), %rsi      # 0x16fcd
movb $0x0, %al
callq 0x3180
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa57d
jmp 0xa4cf
movslq -0x2c(%rbp), %rcx
leaq 0x112b6(%rip), %rax     # 0x1b790
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x18(%rbp)
cmpl $0x100, -0x18(%rbp)     # imm = 0x100
jb 0xa511
movq 0x10af9(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
leaq 0xcaf8(%rip), %rsi      # 0x16ff9
movb $0x0, %al
callq 0x3180
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa57d
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0xa547
movq 0x10aca(%rip), %rax     # 0x1aff0
movq (%rax), %rdi
movq -0x28(%rbp), %rdx
movl -0x18(%rbp), %ecx
leaq 0xcaeb(%rip), %rsi      # 0x17022
movb $0x0, %al
callq 0x3180
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa57d
movslq -0x2c(%rbp), %rcx
leaq 0x1123e(%rip), %rax     # 0x1b790
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdx
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xa43a
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/lsmmc.c
// Function: to_binstr
char *to_binstr(char *hexstr)
{
	char *bindigits[] = {
		"0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111",
		"1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111",
	};
	char *binstr, *tail;

	binstr = calloc(strlen(hexstr) * 4 + 1, sizeof(char));
	if (!binstr)
		return NULL;

	tail = binstr;

	while (hexstr && *hexstr != '\0') {
		if (!isxdigit(*hexstr)) {
			free(binstr);
			return NULL;
		}

		if (isdigit(*hexstr))
			strcat(tail, bindigits[*hexstr - '0']);
		else if (islower(*hexstr))
			strcat(tail, bindigits[*hexstr - 'a' + 10]);
		else
			strcat(tail, bindigits[*hexstr - 'A' + 10]);

		hexstr++;
		tail += 4;
	}

	return binstr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
leaq -0x90(%rbp), %rdi
leaq 0x10533(%rip), %rsi     # 0x1ad60
movl $0x80, %edx
callq 0x31b0
movq -0x10(%rbp), %rdi
callq 0x30a0
movq %rax, %rdi
shlq $0x2, %rdi
addq $0x1, %rdi
movl $0x1, %esi
callq 0x3160
movq %rax, -0x98(%rbp)
cmpq $0x0, -0x98(%rbp)
jne 0xa873
movq $0x0, -0x8(%rbp)
jmp 0xa9c5
movq -0x98(%rbp), %rax
movq %rax, -0xa0(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x10(%rbp)
movb %al, -0xa1(%rbp)
je 0xa8a3
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0xa1(%rbp)
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0xa8b2
jmp 0xa9ba
callq 0x3270
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
jne 0xa8eb
movq -0x98(%rbp), %rdi
callq 0x3030
movq $0x0, -0x8(%rbp)
jmp 0xa9c5
callq 0x3270
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0xa92d
movq -0xa0(%rbp), %rdi
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
cltq
movq -0x90(%rbp,%rax,8), %rsi
callq 0x3230
jmp 0xa997
callq 0x3270
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0xa972
movq -0xa0(%rbp), %rdi
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
subl $0x61, %eax
addl $0xa, %eax
cltq
movq -0x90(%rbp,%rax,8), %rsi
callq 0x3230
jmp 0xa995
movq -0xa0(%rbp), %rdi
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
subl $0x41, %eax
addl $0xa, %eax
cltq
movq -0x90(%rbp,%rax,8), %rsi
callq 0x3230
jmp 0xa997
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0xa0(%rbp), %rax
addq $0x4, %rax
movq %rax, -0xa0(%rbp)
jmp 0xa881
movq -0x98(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/lsmmc.c
// Function: bin_to_unsigned
void bin_to_unsigned(unsigned int *u, char *binstr, int width)
{
	*u = 0;
	assert(width <= 32);

	while (binstr && *binstr != '\0' && width > 0) {
		*u <<= 1;
		*u |= *binstr == '0' ? 0 : 1;

		binstr++;
		width--;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
cmpl $0x20, -0x14(%rbp)
jg 0xaa05
jmp 0xaa24
leaq 0xc724(%rip), %rdi      # 0x17130
leaq 0xc729(%rip), %rsi      # 0x1713c
movl $0x19a, %edx            # imm = 0x19A
leaq 0xc725(%rip), %rcx      # 0x17144
callq 0x30e0
jmp 0xaa26
xorl %eax, %eax
cmpq $0x0, -0x10(%rbp)
movb %al, -0x15(%rbp)
je 0xaa4d
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x15(%rbp)
je 0xaa4d
cmpl $0x0, -0x14(%rbp)
setg %al
movb %al, -0x15(%rbp)
movb -0x15(%rbp), %al
testb $0x1, %al
jne 0xaa56
jmp 0xaa93
movq -0x8(%rbp), %rax
movl (%rax), %ecx
shll %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movsbl (%rax), %edx
movl $0x1, %ecx
xorl %eax, %eax
cmpl $0x30, %edx
cmovel %eax, %ecx
movq -0x8(%rbp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xaa26
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/lsmmc.c
// Function: bin_to_ascii
void bin_to_ascii(char *a, char *binstr, int width)
{
	assert(width % 8 == 0);
	*a = '\0';

	while (binstr && *binstr != '\0' && width > 0) {
		unsigned int u;
		char c[2] = { '\0', '\0' };
		char *s = &c[0];

		bin_to_unsigned(&u, binstr, 8);
		c[0] = u;

		strcat(a, s);
		binstr += 8;
		width -= 8;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0xaac5
jmp 0xaae4
leaq 0xc6aa(%rip), %rdi      # 0x17176
leaq 0xc669(%rip), %rsi      # 0x1713c
movl $0x1a7, %edx            # imm = 0x1A7
leaq 0xc6a6(%rip), %rcx      # 0x17185
callq 0x30e0
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
xorl %eax, %eax
cmpq $0x0, -0x10(%rbp)
movb %al, -0x29(%rbp)
je 0xab12
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x29(%rbp)
je 0xab12
cmpl $0x0, -0x14(%rbp)
setg %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0xab1b
jmp 0xab72
leaq -0x1a(%rbp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x30f0
leaq -0x1a(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x18(%rbp), %rdi
movl $0x8, %edx
callq 0xa9e0
movl -0x18(%rbp), %eax
movb %al, -0x1a(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x3230
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
subl $0x8, %eax
movl %eax, -0x14(%rbp)
jmp 0xaaeb
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)