// File: /workspace/github_c_makefile_star2_O0/blasphemy[P]mmc-utils/lsmmc.c
// Function: print_mmc_cid
void print_mmc_cid(struct config *config, char *cid)
{
	static const char *months[] = {
		"jan", "feb", "mar", "apr", "may", "jun",
		"jul", "aug", "sep", "oct", "nov", "dec",
		"invalid0", "invalid1", "invalid2", "invalid3",
	};
	unsigned int mid;
	unsigned int cbx;
	unsigned int oid;
	char pnm[7];
	unsigned int prv_major;
	unsigned int prv_minor;
	unsigned int psn;
	unsigned int mdt_month;
	unsigned int mdt_year;
	unsigned int crc;

	parse_bin(cid, "8u6r2u8u48a4u4u32u4u4u7u1r",
		&mid, &cbx, &oid, &pnm[0], &psn, &prv_major, &prv_minor,
		&mdt_year, &mdt_month, &crc);

	pnm[6] = '\0';

	if (config->verbose) {
		printf("======MMC/CID======\n");

		printf("\tMID: 0x%02x (", mid);
		if (config->mmc_ids[mid])
			printf("%s)\n", config->mmc_ids[mid]);
		else
			printf("Unlisted)\n");

		printf("\tCBX: 0x%01x (", cbx);
		switch (cbx) {
		case 0:
			printf("card)\n");
			break;
		case 1:
			printf("BGA)\n");
			break;
		case 2:
			printf("PoP)\n");
			break;
		case 3:
			printf("reserved)\n");
			break;
		}

		printf("\tOID: 0x%01x\n", oid);
		printf("\tPNM: %s\n", pnm);
		printf("\tPRV: 0x%01x%01x ", prv_major, prv_minor);
		printf("(%d.%d)\n", prv_major, prv_minor);
		printf("\tPSN: 0x%08x\n", psn);
		printf("\tMDT: 0x%01x%01x %d %s\n", mdt_month, mdt_year,
		       1997 + mdt_year, months[mdt_month]);
		printf("\tCRC: 0x%02x\n", crc);
	} else {
		if (config->mmc_ids[mid])
			printf("manufacturer: '%s' '%c'\n",
			       config->mmc_ids[mid], oid);
		else
			printf("manufacturer: 'Unlisted' '%c'\n", oid);

		printf("product: '%s' %d.%d\n", pnm, prv_major, prv_minor);
		printf("serial: 0x%08x\n", psn);
		printf("manfacturing date: %d %s\n", 1997 + mdt_year,
		       months[mdt_month]);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rdi, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movq -0x28(%rbp), %rdi
leaq -0x3b(%rbp), %r9
leaq 0xc248(%rip), %rsi      # 0x1732c
leaq -0x2c(%rbp), %rdx
leaq -0x30(%rbp), %rcx
leaq -0x34(%rbp), %r8
leaq -0x48(%rbp), %r15
leaq -0x40(%rbp), %r14
leaq -0x44(%rbp), %rbx
leaq -0x50(%rbp), %r11
leaq -0x4c(%rbp), %r10
leaq -0x54(%rbp), %rax
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %r11, 0x18(%rsp)
movq %r10, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movb $0x0, %al
callq 0xab80
movb $0x0, -0x35(%rbp)
movq -0x20(%rbp), %rax
testb $0x1, 0x10(%rax)
je 0xb2ab
leaq 0xc202(%rip), %rdi      # 0x17347
movb $0x0, %al
callq 0x30c0
movl -0x2c(%rbp), %esi
leaq 0xc0e2(%rip), %rdi      # 0x17238
movb $0x0, %al
callq 0x30c0
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x2c(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0xb18e
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x2c(%rbp), %ecx
movq (%rax,%rcx,8), %rsi
leaq 0x934a(%rip), %rdi      # 0x144cf
movb $0x0, %al
callq 0x30c0
jmp 0xb19c
leaq 0xc0b2(%rip), %rdi      # 0x17247
movb $0x0, %al
callq 0x30c0
movl -0x30(%rbp), %esi
leaq 0xc1b6(%rip), %rdi      # 0x1735c
xorl %eax, %eax
callq 0x30c0
movl -0x30(%rbp), %eax
movq %rax, -0x60(%rbp)
subq $0x3, %rax
ja 0xb20c
movq -0x60(%rbp), %rax
leaq 0xb7b3(%rip), %rcx      # 0x16978
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xc196(%rip), %rdi      # 0x1736b
movb $0x0, %al
callq 0x30c0
jmp 0xb20c
leaq 0xc18d(%rip), %rdi      # 0x17372
movb $0x0, %al
callq 0x30c0
jmp 0xb20c
leaq 0xc183(%rip), %rdi      # 0x17378
movb $0x0, %al
callq 0x30c0
jmp 0xb20c
leaq 0xc179(%rip), %rdi      # 0x1737e
movb $0x0, %al
callq 0x30c0
movl -0x34(%rbp), %esi
leaq 0xc173(%rip), %rdi      # 0x17389
movb $0x0, %al
callq 0x30c0
leaq -0x3b(%rbp), %rsi
leaq 0xc034(%rip), %rdi      # 0x1725c
movb $0x0, %al
callq 0x30c0
movl -0x40(%rbp), %esi
movl -0x44(%rbp), %edx
leaq 0xc02a(%rip), %rdi      # 0x17266
movb $0x0, %al
callq 0x30c0
movl -0x40(%rbp), %esi
movl -0x44(%rbp), %edx
leaq 0xc028(%rip), %rdi      # 0x17278
movb $0x0, %al
callq 0x30c0
movl -0x48(%rbp), %esi
leaq 0xc020(%rip), %rdi      # 0x17281
movb $0x0, %al
callq 0x30c0
movl -0x4c(%rbp), %esi
movl -0x50(%rbp), %edx
movl -0x50(%rbp), %ecx
addl $0x7cd, %ecx            # imm = 0x7CD
movl -0x4c(%rbp), %eax
movl %eax, %edi
leaq 0x1082d(%rip), %rax     # 0x1bab0
movq (%rax,%rdi,8), %r8
leaq 0xc109(%rip), %rdi      # 0x17397
movb $0x0, %al
callq 0x30c0
movl -0x54(%rbp), %esi
leaq 0xc008(%rip), %rdi      # 0x172a7
movb $0x0, %al
callq 0x30c0
jmp 0xb340
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x2c(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0xb2df
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x2c(%rbp), %ecx
movq (%rax,%rcx,8), %rsi
movl -0x34(%rbp), %edx
leaq 0xc0d9(%rip), %rdi      # 0x173af
movb $0x0, %al
callq 0x30c0
jmp 0xb2f0
movl -0x34(%rbp), %esi
leaq 0xc0df(%rip), %rdi      # 0x173c8
movb $0x0, %al
callq 0x30c0
leaq -0x3b(%rbp), %rsi
movl -0x40(%rbp), %edx
movl -0x44(%rbp), %ecx
leaq 0xbfec(%rip), %rdi      # 0x172ed
movb $0x0, %al
callq 0x30c0
movl -0x48(%rbp), %esi
leaq 0xbff0(%rip), %rdi      # 0x17302
movb $0x0, %al
callq 0x30c0
movl -0x50(%rbp), %esi
addl $0x7cd, %esi            # imm = 0x7CD
movl -0x4c(%rbp), %eax
movl %eax, %ecx
leaq 0x10782(%rip), %rax     # 0x1bab0
movq (%rax,%rcx,8), %rdx
leaq 0xbfd9(%rip), %rdi      # 0x17312
movb $0x0, %al
callq 0x30c0
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax,%rax)