// File: /workspace/github_c_makefile_star2_O1/blasphemy[P]mmc-utils/lsmmc.c
// Function: print_sd_scr
void print_sd_scr(struct config *config, char *scr)
{
	unsigned int scr_structure;
	unsigned int sd_spec;
	unsigned int data_stat_after_erase;
	unsigned int sd_security;
	unsigned int sd_bus_widths;
	unsigned int sd_spec3;
	unsigned int ex_security;
	unsigned int cmd_support;

	parse_bin(scr, "4u4u1u3u4u1u4u9r2u32r",
		&scr_structure, &sd_spec, &data_stat_after_erase,
		&sd_security, &sd_bus_widths, &sd_spec3,
		&ex_security, &cmd_support);

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

		printf("\tSCR_STRUCTURE: 0x%01x (", scr_structure);
		switch (scr_structure) {
		case 0:
			printf("SCR v1.0)\n");
			break;
		default:
			printf("reserved)\n");
			break;
		}

		printf("\tSD_SPEC: 0x%01x (", sd_spec);
		switch (sd_spec) {
		case 0:
			printf("SD v1.0/1.01)\n");
			break;
		case 1:
			printf("SD v1.10)\n");
			break;
		case 2:
			printf("SD v2.00/v3.0x)\n");
			break;
		case 3:
			printf("SD v4.00)\n");
			break;
		default:
			printf("reserved)\n");
			break;
		}

		printf("\tDATA_STAT_AFTER_ERASE: 0x%01x\n",
		       data_stat_after_erase);

		printf("\tSD_SECURITY: 0x%01x (", sd_security);
		switch (sd_security) {
		case 0:
			printf("no security)\n");
			break;
		case 1:
			printf("not used)\n");
			break;
		case 2:
			printf("SDSC card/security v1.01)\n");
			break;
		case 3:
			printf("SDHC card/security v2.00)\n");
			break;
		case 4:
			printf("SDXC card/security v3.xx)\n");
			break;
		default:
			printf("reserved)\n");
			break;
		}

		printf("\tSD_BUS_WIDTHS: 0x%01x (", sd_bus_widths);
		if (BITS(sd_bus_widths, 2, 2))
			printf("4bit, ");
		if (BITS(sd_bus_widths, 0, 0))
			printf("1bit, ");
		printf(" bus)\n");

		printf("\tSD_SPEC3: 0x%01x (", sd_spec3);
		if (sd_spec >= 2) {
			switch (sd_spec3) {
			case 0:
				printf("SD v2.00)\n");
				break;
			case 1:
				printf("SD v3.0x)\n");
				break;
			}
		} else {
			printf("SD 1.xx)\n");
		}

		printf("\tEX_SECURITY: 0x%01x\n", ex_security);

		printf("\tCMD_SUPPORT: 0x%01x (", cmd_support);
		if (BITS(cmd_support, 1, 1))
			printf("CMD23 ");
		if (BITS(cmd_support, 0, 0))
			printf("CMD20 ");
		printf(" )\n");
	} else {
		printf("version: ");
		switch (sd_spec) {
		case 0:
			printf("SD 1.0/1.01\n");
			break;
		case 1:
			printf("SD 1.10\n");
			break;
		case 2:
			switch (sd_spec3) {
			case 0:
				printf("SD 2.00\n");
				break;
			case 1:
				printf("SD 3.0x\n");
				break;
			default:
				printf("unknown\n");
				break;
			}
			break;
		case 3:
			printf("SD 4.00\n");
			break;
		default:
			printf("unknown\n");
			break;
		}

		printf("bus widths: ");
		if (BITS(sd_bus_widths, 2, 2))
			printf("4bit, ");
		if (BITS(sd_bus_widths, 0, 0))
			printf("1bit, ");
		printf("\b\b\n");
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x8(%rsp), %r10
leaq 0x18(%rsp), %r11
leaq 0xc(%rsp), %r14
movq %rsp, %r15
leaq 0x8113(%rip), %rsi      # 0x131d9
leaq 0x14(%rsp), %rdx
leaq 0x4(%rsp), %rcx
leaq 0x1c(%rsp), %r8
leaq 0x10(%rsp), %r9
movq %rax, %rdi
xorl %eax, %eax
pushq %r10
pushq %r11
pushq %r14
pushq %r15
callq 0x8c10
addq $0x20, %rsp
cmpb $0x1, 0x10(%rbx)
jne 0xb274
leaq 0x80ee(%rip), %rsi      # 0x131ef
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x14(%rsp), %edx
leaq 0x80eb(%rip), %rsi      # 0x13203
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
cmpl $0x0, 0x14(%rsp)
leaq 0x80ec(%rip), %rsi      # 0x1321c
leaq 0x6f97(%rip), %rbx      # 0x120ce
cmovneq %rbx, %rsi
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x4(%rsp), %edx
leaq 0x80d5(%rip), %rsi      # 0x13227
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x4(%rsp), %eax
movq %rbx, %rsi
cmpq $0x3, %rax
ja 0xb179
leaq 0x69ea(%rip), %rcx      # 0x11b5c
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x1c(%rsp), %edx
leaq 0x80e0(%rip), %rsi      # 0x13270
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x10(%rsp), %edx
leaq 0x80e9(%rip), %rsi      # 0x13290
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x10(%rsp), %eax
cmpq $0x4, %rax
ja 0xb1cb
leaq 0x6984(%rip), %rcx      # 0x11b48
movslq (%rcx,%rax,4), %rbx
addq %rcx, %rbx
movl $0x1, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x31c0
movl (%rsp), %edx
leaq 0x812d(%rip), %rsi      # 0x13311
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
testb $0x4, (%rsp)
je 0xb209
leaq 0x812d(%rip), %rsi      # 0x1332a
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
testb $0x1, (%rsp)
je 0xb222
leaq 0x811b(%rip), %rsi      # 0x13331
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
leaq 0x810f(%rip), %rsi      # 0x13338
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0xc(%rsp), %edx
leaq 0x80ff(%rip), %rsi      # 0x1333f
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
cmpl $0x2, 0x4(%rsp)
jb 0xb2aa
movl 0xc(%rsp), %eax
testl %eax, %eax
je 0xb349
cmpl $0x1, %eax
jne 0xb35c
leaq 0x80ef(%rip), %rsi      # 0x1335e
jmp 0xb350
leaq 0x7d3d(%rip), %rsi      # 0x12fb8
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x4(%rsp), %eax
cmpq $0x3, %rax
ja 0xb2f0
leaq 0x6758(%rip), %rcx      # 0x119f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x8106(%rip), %rsi      # 0x133ae
jmp 0xb2f7
leaq 0x80b8(%rip), %rsi      # 0x13369
jmp 0xb350
movl 0xc(%rsp), %eax
cmpl $0x1, %eax
leaq 0x8109(%rip), %rcx      # 0x133cd
leaq 0x810b(%rip), %rdx      # 0x133d6
cmoveq %rcx, %rdx
testl %eax, %eax
leaq 0x80ec(%rip), %rsi      # 0x133c4
cmovneq %rdx, %rsi
jmp 0xb2f7
leaq 0x80fa(%rip), %rsi      # 0x133df
jmp 0xb2f7
leaq 0x80cd(%rip), %rsi      # 0x133bb
jmp 0xb2f7
leaq 0x80df(%rip), %rsi      # 0x133d6
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
leaq 0x80de(%rip), %rsi      # 0x133e8
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
testb $0x4, (%rsp)
je 0xb32f
leaq 0x8007(%rip), %rsi      # 0x1332a
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
leaq 0x77b2(%rip), %rbx      # 0x12ae8
testb $0x1, (%rsp)
je 0xb3c5
leaq 0x7fea(%rip), %rsi      # 0x13331
jmp 0xb3b9
leaq 0x8003(%rip), %rsi      # 0x13353
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x18(%rsp), %edx
leaq 0x800c(%rip), %rsi      # 0x13373
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x8(%rsp), %edx
leaq 0x800b(%rip), %rsi      # 0x13389
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
testb $0x2, 0x8(%rsp)
je 0xb3a4
leaq 0x8008(%rip), %rsi      # 0x133a0
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
leaq 0x6fd8(%rip), %rbx      # 0x12383
testb $0x1, 0x8(%rsp)
je 0xb3c5
leaq 0x7fee(%rip), %rsi      # 0x133a7
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl $0x1, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x31c0
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq