// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x2c(%rsp), %r10
leaq 0x1c(%rsp), %r11
leaq 0x18(%rsp), %r15
leaq 0xc(%rsp), %r12
leaq 0x10(%rsp), %r13
leaq 0x20(%rsp), %rbp
leaq 0x90df(%rip), %rsi      # 0x1206c
leaq 0x14(%rsp), %rdx
leaq 0x28(%rsp), %rcx
leaq 0x24(%rsp), %r8
leaq 0x31(%rsp), %r14
movq %rax, %rdi
movq %r14, %r9
movl $0x0, %eax
pushq %r10
pushq %r11
pushq %r15
pushq %r12
pushq %r13
pushq %rbp
callq 0x8b0c
addq $0x30, %rsp
movb $0x0, 0x6(%r14)
cmpb $0x1, 0x10(%rbx)
jne 0x901b
leaq 0x90b5(%rip), %rsi      # 0x12087
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x14(%rsp), %edx
leaq 0x8f8f(%rip), %rsi      # 0x11f78
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movq 0x20(%rbx), %rax
movl 0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
testq %rdx, %rdx
je 0x904c
leaq 0x64c3(%rip), %rsi      # 0xf4d0
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
jmp 0x905f
movq 0x20(%rbx), %rax
movl 0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
movl 0x24(%rsp), %ecx
testq %rdx, %rdx
je 0x915c
leaq 0x90b4(%rip), %rsi      # 0x120ef
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
jmp 0x9171
leaq 0x8f34(%rip), %rsi      # 0x11f87
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x28(%rsp), %edx
leaq 0x9032(%rip), %rsi      # 0x1209c
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x28(%rsp), %eax
cmpq $0x3, %rax
ja 0x909a
leaq 0x89b9(%rip), %rcx      # 0x11a40
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x24(%rsp), %edx
leaq 0x9024(%rip), %rsi      # 0x120c9
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
leaq 0x8ee4(%rip), %rsi      # 0x11f9c
leaq 0x31(%rsp), %rdx
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
leaq 0x8ece(%rip), %rsi      # 0x11fa6
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
leaq 0x8ec5(%rip), %rsi      # 0x11fb8
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x20(%rsp), %edx
leaq 0x8eb7(%rip), %rsi      # 0x11fc1
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x1c(%rsp), %edx
movl 0x18(%rsp), %ecx
leal 0x7cd(%rcx), %r8d
leaq 0xda54(%rip), %rax      # 0x16b80
movq (%rax,%rdx,8), %r9
leaq 0x8fa0(%rip), %rsi      # 0x120d7
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x2c(%rsp), %edx
leaq 0x8e99(%rip), %rsi      # 0x11fe7
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
jmp 0x91d4
leaq 0x8fa5(%rip), %rsi      # 0x12108
movl $0x1, %edi
movl %ecx, %edx
xorl %eax, %eax
callq 0x31c0
movl 0x10(%rsp), %ecx
movl 0xc(%rsp), %r8d
leaq 0x8eac(%rip), %rsi      # 0x1202d
leaq 0x31(%rsp), %rdx
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x20(%rsp), %edx
leaq 0x8ea5(%rip), %rsi      # 0x12042
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl $0x7cd, %edx            # imm = 0x7CD
addl 0x18(%rsp), %edx
movl 0x1c(%rsp), %eax
leaq 0xd9c3(%rip), %rcx      # 0x16b80
movq (%rcx,%rax,8), %rcx
leaq 0x8e8a(%rip), %rsi      # 0x12052
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq