// File: /workspace/github_c_makefile_star2_O3/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 0x81b9(%rip), %rsi      # 0x131c9
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 0x8b0c
addq $0x20, %rsp
cmpb $0x1, 0x10(%rbx)
jne 0xb1c0
leaq 0x8194(%rip), %rsi      # 0x131df
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x14(%rsp), %edx
leaq 0x8191(%rip), %rsi      # 0x131f3
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
cmpl $0x0, 0x14(%rsp)
leaq 0x8192(%rip), %rsi      # 0x1320c
leaq 0x703d(%rip), %rbx      # 0x120be
cmovneq %rbx, %rsi
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x4(%rsp), %edx
leaq 0x817b(%rip), %rsi      # 0x13217
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x4(%rsp), %eax
movq %rbx, %rsi
cmpq $0x3, %rax
ja 0xb0c3
leaq 0x6a7c(%rip), %rcx      # 0x11b38
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x1c(%rsp), %edx
leaq 0x8186(%rip), %rsi      # 0x13260
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x10(%rsp), %edx
leaq 0x818f(%rip), %rsi      # 0x13280
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x10(%rsp), %eax
cmpq $0x4, %rax
ja 0xb115
leaq 0x6a3a(%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 0x81d3(%rip), %rsi      # 0x13301
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl (%rsp), %eax
testb $0x4, %al
je 0xb157
leaq 0x81d2(%rip), %rsi      # 0x1331a
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl (%rsp), %eax
testb $0x1, %al
je 0xb16e
leaq 0x81bf(%rip), %rsi      # 0x13321
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
leaq 0x81b3(%rip), %rsi      # 0x13328
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0xc(%rsp), %edx
leaq 0x81a3(%rip), %rsi      # 0x1332f
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
cmpl $0x2, 0x4(%rsp)
jb 0xb1f6
movl 0xc(%rsp), %eax
testl %eax, %eax
je 0xb297
cmpl $0x1, %eax
jne 0xb2aa
leaq 0x8193(%rip), %rsi      # 0x1334e
jmp 0xb29e
leaq 0x7de1(%rip), %rsi      # 0x12fa8
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x4(%rsp), %eax
cmpq $0x3, %rax
ja 0xb23c
leaq 0x67fc(%rip), %rcx      # 0x119e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x81aa(%rip), %rsi      # 0x1339e
jmp 0xb243
leaq 0x815c(%rip), %rsi      # 0x13359
jmp 0xb29e
movl 0xc(%rsp), %eax
cmpl $0x1, %eax
leaq 0x81ad(%rip), %rcx      # 0x133bd
leaq 0x81af(%rip), %rdx      # 0x133c6
cmoveq %rcx, %rdx
testl %eax, %eax
leaq 0x8190(%rip), %rsi      # 0x133b4
cmovneq %rdx, %rsi
jmp 0xb243
leaq 0x819e(%rip), %rsi      # 0x133cf
jmp 0xb243
leaq 0x8171(%rip), %rsi      # 0x133ab
jmp 0xb243
leaq 0x8183(%rip), %rsi      # 0x133c6
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
leaq 0x8182(%rip), %rsi      # 0x133d8
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl (%rsp), %eax
testb $0x4, %al
je 0xb27f
leaq 0x80aa(%rip), %rsi      # 0x1331a
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl (%rsp), %eax
leaq 0x7852(%rip), %rbx      # 0x12ad8
testb $0x1, %al
je 0xb315
leaq 0x808c(%rip), %rsi      # 0x13321
jmp 0xb309
leaq 0x80a5(%rip), %rsi      # 0x13343
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x18(%rsp), %edx
leaq 0x80ae(%rip), %rsi      # 0x13363
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x8(%rsp), %edx
leaq 0x80ad(%rip), %rsi      # 0x13379
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x8(%rsp), %eax
testb $0x2, %al
je 0xb2f7
leaq 0x80a9(%rip), %rsi      # 0x13390
movl $0x1, %edi
xorl %eax, %eax
callq 0x31c0
movl 0x8(%rsp), %eax
leaq 0x7075(%rip), %rbx      # 0x12373
testb $0x1, %al
je 0xb315
leaq 0x808e(%rip), %rsi      # 0x13397
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