// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x27(%rbp), %rcx
leaq -0x2d(%rbp), %r8
leaq 0xc344(%rip), %rsi      # 0x1720a
leaq -0x24(%rbp), %rdx
leaq -0x34(%rbp), %r9
leaq -0x38(%rbp), %r14
leaq -0x3c(%rbp), %rbx
leaq -0x44(%rbp), %r11
leaq -0x40(%rbp), %r10
leaq -0x48(%rbp), %rax
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movb $0x0, %al
callq 0xab80
movb $0x0, -0x25(%rbp)
movb $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rax
testb $0x1, 0x10(%rax)
je 0xb015
leaq 0xc306(%rip), %rdi      # 0x17224
movb $0x0, %al
callq 0x30c0
movl -0x24(%rbp), %esi
leaq 0xc309(%rip), %rdi      # 0x17238
movb $0x0, %al
callq 0x30c0
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x24(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0xaf67
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x24(%rbp), %ecx
movq (%rax,%rcx,8), %rsi
leaq 0x9571(%rip), %rdi      # 0x144cf
movb $0x0, %al
callq 0x30c0
jmp 0xaf75
leaq 0xc2d9(%rip), %rdi      # 0x17247
movb $0x0, %al
callq 0x30c0
leaq -0x27(%rbp), %rsi
leaq 0xc2d2(%rip), %rdi      # 0x17252
movb $0x0, %al
callq 0x30c0
leaq -0x2d(%rbp), %rsi
leaq 0xc2ca(%rip), %rdi      # 0x1725c
movb $0x0, %al
callq 0x30c0
movl -0x34(%rbp), %esi
movl -0x38(%rbp), %edx
leaq 0xc2c0(%rip), %rdi      # 0x17266
movb $0x0, %al
callq 0x30c0
movl -0x34(%rbp), %esi
movl -0x38(%rbp), %edx
leaq 0xc2be(%rip), %rdi      # 0x17278
movb $0x0, %al
callq 0x30c0
movl -0x3c(%rbp), %esi
leaq 0xc2b6(%rip), %rdi      # 0x17281
movb $0x0, %al
callq 0x30c0
movl -0x44(%rbp), %esi
movl -0x40(%rbp), %edx
movl -0x44(%rbp), %ecx
addl $0x7d0, %ecx            # imm = 0x7D0
movl -0x40(%rbp), %eax
movl %eax, %edi
leaq 0x10a43(%rip), %rax     # 0x1ba30
movq (%rax,%rdi,8), %r8
leaq 0xc297(%rip), %rdi      # 0x1728f
movb $0x0, %al
callq 0x30c0
movl -0x48(%rbp), %esi
leaq 0xc29e(%rip), %rdi      # 0x172a7
movb $0x0, %al
callq 0x30c0
jmp 0xb0ac
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x24(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0xb04a
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x24(%rbp), %ecx
movq (%rax,%rcx,8), %rsi
leaq -0x27(%rbp), %rdx
leaq 0xc274(%rip), %rdi      # 0x172b5
movb $0x0, %al
callq 0x30c0
jmp 0xb05c
leaq -0x27(%rbp), %rsi
leaq 0xc279(%rip), %rdi      # 0x172ce
movb $0x0, %al
callq 0x30c0
leaq -0x2d(%rbp), %rsi
movl -0x34(%rbp), %edx
movl -0x38(%rbp), %ecx
leaq 0xc280(%rip), %rdi      # 0x172ed
movb $0x0, %al
callq 0x30c0
movl -0x3c(%rbp), %esi
leaq 0xc284(%rip), %rdi      # 0x17302
movb $0x0, %al
callq 0x30c0
movl -0x44(%rbp), %esi
addl $0x7d0, %esi            # imm = 0x7D0
movl -0x40(%rbp), %eax
movl %eax, %ecx
leaq 0x10996(%rip), %rax     # 0x1ba30
movq (%rax,%rcx,8), %rdx
leaq 0xc26d(%rip), %rdi      # 0x17312
movb $0x0, %al
callq 0x30c0
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopw %cs:(%rax,%rax)