// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x10(%rsp), %r10
leaq 0x20(%rsp), %r11
leaq 0x14(%rsp), %r14
leaq 0x8(%rsp), %r15
leaq 0x899e(%rip), %rsi      # 0x13209
leaq 0x1c(%rsp), %rdx
leaq 0xc(%rsp), %rcx
leaq 0x24(%rsp), %r8
leaq 0x18(%rsp), %r9
movq %rax, %rdi
xorl %eax, %eax
pushq %r10
pushq %r11
pushq %r14
pushq %r15
callq 0x8524
addq $0x20, %rsp
cmpb $0x1, 0x10(%rbx)
jne 0xaa05
leaq 0x8979(%rip), %rsi      # 0x1321f
pushq $0x1
popq %rbp
movl %ebp, %edi
xorl %eax, %eax
callq 0x31d0
movl 0x1c(%rsp), %edx
leaq 0x8976(%rip), %rsi      # 0x13233
movl %ebp, %edi
xorl %eax, %eax
callq 0x31d0
cmpl $0x0, 0x1c(%rsp)
leaq 0x897a(%rip), %rsi      # 0x1324c
leaq 0x7825(%rip), %rbx      # 0x120fe
cmovneq %rbx, %rsi
movl %ebp, %edi
xorl %eax, %eax
callq 0x31d0
movl 0xc(%rsp), %edx
leaq 0x8966(%rip), %rsi      # 0x13257
movl %ebp, %edi
xorl %eax, %eax
callq 0x31d0
movl 0xc(%rsp), %eax
movq %rbx, %rsi
cmpq $0x3, %rax
ja 0xa915
leaq 0x726a(%rip), %rcx      # 0x11b78
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
pushq $0x1
popq %rbp
movl %ebp, %edi
xorl %eax, %eax
callq 0x31d0
movl 0x24(%rsp), %edx
leaq 0x8974(%rip), %rsi      # 0x132a0
movl %ebp, %edi
xorl %eax, %eax
callq 0x31d0
movl 0x18(%rsp), %edx
leaq 0x8980(%rip), %rsi      # 0x132c0
movl %ebp, %edi
xorl %eax, %eax
callq 0x31d0
movl 0x18(%rsp), %eax
cmpq $0x4, %rax
ja 0xa961
leaq 0x722e(%rip), %rcx      # 0x11b88
movslq (%rcx,%rax,4), %rbx
addq %rcx, %rbx
pushq $0x1
popq %rbp
movl %ebp, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x31d0
movl 0x8(%rsp), %edx
leaq 0x89c6(%rip), %rsi      # 0x13341
movl %ebp, %edi
xorl %eax, %eax
callq 0x31d0
movl 0x8(%rsp), %eax
testb $0x4, %al
je 0xa9a1
leaq 0x89c7(%rip), %rsi      # 0x1335a
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x31d0
movl 0x8(%rsp), %eax
testb $0x1, %al
je 0xa9b6
leaq 0x89b5(%rip), %rsi      # 0x13361
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x31d0
leaq 0x89ab(%rip), %rsi      # 0x13368
pushq $0x1
popq %rbx
movl %ebx, %edi
xorl %eax, %eax
callq 0x31d0
movl 0x14(%rsp), %edx
leaq 0x899b(%rip), %rsi      # 0x1336f
movl %ebx, %edi
xorl %eax, %eax
callq 0x31d0
cmpl $0x2, 0xc(%rsp)
jb 0xaa39
movl 0x14(%rsp), %eax
testl %eax, %eax
je 0xaad3
cmpl $0x1, %eax
jne 0xaae4
leaq 0x898e(%rip), %rsi      # 0x1338e
jmp 0xaada
leaq 0x85dc(%rip), %rsi      # 0x12fe8
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x31d0
movl 0xc(%rsp), %eax
cmpq $0x3, %rax
ja 0xaa7f
leaq 0x6ff9(%rip), %rcx      # 0x11a20
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x89a7(%rip), %rsi      # 0x133de
jmp 0xaa86
leaq 0x8959(%rip), %rsi      # 0x13399
jmp 0xaada
movl 0x14(%rsp), %eax
cmpl $0x1, %eax
leaq 0x89aa(%rip), %rcx      # 0x133fd
leaq 0x89ac(%rip), %rdx      # 0x13406
cmoveq %rcx, %rdx
testl %eax, %eax
leaq 0x898d(%rip), %rsi      # 0x133f4
cmovneq %rdx, %rsi
jmp 0xaa86
leaq 0x899b(%rip), %rsi      # 0x1340f
jmp 0xaa86
leaq 0x896e(%rip), %rsi      # 0x133eb
jmp 0xaa86
leaq 0x8980(%rip), %rsi      # 0x13406
pushq $0x1
popq %rbx
movl %ebx, %edi
xorl %eax, %eax
callq 0x31d0
leaq 0x897f(%rip), %rsi      # 0x13418
movl %ebx, %edi
xorl %eax, %eax
callq 0x31d0
movl 0x8(%rsp), %eax
testb $0x4, %al
je 0xaabf
leaq 0x88a9(%rip), %rsi      # 0x1335a
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x31d0
movl 0x8(%rsp), %eax
leaq 0x8052(%rip), %rbx      # 0x12b18
testb $0x1, %al
je 0xab48
leaq 0x8890(%rip), %rsi      # 0x13361
jmp 0xab3e
leaq 0x88a9(%rip), %rsi      # 0x13383
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x31d0
movl 0x20(%rsp), %edx
leaq 0x88b4(%rip), %rsi      # 0x133a3
pushq $0x1
popq %rbx
movl %ebx, %edi
xorl %eax, %eax
callq 0x31d0
movl 0x10(%rsp), %edx
leaq 0x88b3(%rip), %rsi      # 0x133b9
movl %ebx, %edi
xorl %eax, %eax
callq 0x31d0
movl 0x10(%rsp), %eax
testb $0x2, %al
je 0xab2c
leaq 0x88b2(%rip), %rsi      # 0x133d0
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x31d0
movl 0x10(%rsp), %eax
leaq 0x7880(%rip), %rbx      # 0x123b3
testb $0x1, %al
je 0xab48
leaq 0x8899(%rip), %rsi      # 0x133d7
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x31d0
pushq $0x1
popq %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x31d0
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq