// File: /workspace/github_c_makefile_star2_O3/blasphemy[P]mmc-utils/lsmmc.c
// Function: print_sd_cid
void print_sd_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;
	char oid[3];
	char pnm[6];
	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, "8u16a40a4u4u32u4r8u4u7u1r",
		&mid, &oid[0], &pnm[0], &prv_major, &prv_minor, &psn,
		&mdt_year, &mdt_month, &crc);

	oid[2] = '\0';
	pnm[5] = '\0';

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

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

		printf("\tOID: %s\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%02x%01x %d %s\n", mdt_year, mdt_month,
		       2000 + mdt_year, months[mdt_month]);
		printf("\tCRC: 0x%02x\n", crc);
	} else {
		if (config->sd_ids[mid])
			printf("manufacturer: '%s' '%s'\n",
			       config->sd_ids[mid], oid);
		else
			printf("manufacturer: 'Unlisted' '%s'\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", 2000 + mdt_year,
		       months[mdt_month]);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rax
movq %rdi, %rbx
subq $0x8, %rsp
leaq 0x24(%rsp), %r10
leaq 0x1c(%rsp), %r11
leaq 0x18(%rsp), %r12
leaq 0x20(%rsp), %r13
leaq 0x9222(%rip), %rsi      # 0x11f4a
xorl %ebp, %ebp
leaq 0x14(%rsp), %rdx
leaq 0x9(%rsp), %r14
leaq 0x2a(%rsp), %r15
leaq 0x10(%rsp), %r9
movq %rax, %rdi
movq %r14, %rcx
movq %r15, %r8
movl $0x0, %eax
pushq %r10
pushq %r11
pushq %r12
pushq %r13
leaq 0x2c(%rsp), %r10
pushq %r10
callq 0x8b0c
addq $0x30, %rsp
movb %bpl, 0x2(%r14)
movb %bpl, 0x5(%r15)
cmpb $0x1, 0x10(%rbx)
jne 0x8dc2
leaq 0x91eb(%rip), %rsi      # 0x11f64
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0xc(%rsp), %edx
leaq 0x91e8(%rip), %rsi      # 0x11f78
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movq 0x28(%rbx), %rax
movl 0xc(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
testq %rdx, %rdx
je 0x8df4
leaq 0x671c(%rip), %rsi      # 0xf4d0
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
jmp 0x8e07
movq 0x28(%rbx), %rax
movl 0xc(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
testq %rdx, %rdx
je 0x8eca
leaq 0x9217(%rip), %rsi      # 0x11ff5
leaq 0x1(%rsp), %rcx
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
jmp 0x8ee2
leaq 0x918c(%rip), %rsi      # 0x11f87
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
leaq 0x9184(%rip), %rsi      # 0x11f92
leaq 0x1(%rsp), %rdx
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
leaq 0x9176(%rip), %rsi      # 0x11f9c
leaq 0x22(%rsp), %rdx
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %ecx
leaq 0x9160(%rip), %rsi      # 0x11fa6
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %ecx
leaq 0x9157(%rip), %rsi      # 0x11fb8
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x18(%rsp), %edx
leaq 0x9149(%rip), %rsi      # 0x11fc1
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x10(%rsp), %edx
movl 0x14(%rsp), %ecx
leal 0x7d0(%rdx), %r8d
leaq 0xdce6(%rip), %rax      # 0x16b80
movq (%rax,%rcx,8), %r9
leaq 0x912a(%rip), %rsi      # 0x11fcf
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x1c(%rsp), %edx
leaq 0x912b(%rip), %rsi      # 0x11fe7
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
jmp 0x8f45
leaq 0x913d(%rip), %rsi      # 0x1200e
leaq 0x1(%rsp), %rdx
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x8(%rsp), %ecx
movl 0x4(%rsp), %r8d
leaq 0x913b(%rip), %rsi      # 0x1202d
leaq 0x22(%rsp), %rdx
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x18(%rsp), %edx
leaq 0x9134(%rip), %rsi      # 0x12042
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl $0x7d0, %edx            # imm = 0x7D0
addl 0x10(%rsp), %edx
movl 0x14(%rsp), %eax
leaq 0xdc52(%rip), %rcx      # 0x16b80
movq (%rcx,%rax,8), %rcx
leaq 0x9119(%rip), %rsi      # 0x12052
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq