// File: /workspace/github_c_makefile_star2_O2/mikebdp2[P]AtomDis/main.c
// Function: op_switch
int op_switch (uint8_t *d, char *out) {
    const optab_t *op = &optable[d[0]];
    uint8_t       *t    = d+1;
    int            attr = *t++;
    int            i = 0;
    /* Multiline, because even the hexdump typically needs lots of space */
    out += sprintf (out, "\n                          %-5s  ", op->name);
    t   += sub_src (t, out, attr & 0x07, (attr & 0x38) >> 3, size_align[(attr & 0x38)>>3], op->srcindex);
    out += strlen  (out);

    while (t[0] != 0x5a && t[1] != 0x5a) { /* EndOfSwitch: 2x NOP */
	if (*t++ != 'c') {
	    out += sprintf (out, "missing CASE for switch");
	    t   -= 3;
	    break;
	}
	if (! (i++ & 7))
	    out += sprintf (out, "\n       ");
	switch (size_align[(attr & 0x38)>>3]) {
	case 1:
	    out += sprintf (out, " %02x->", *t++);
	    break;
	case 2:
	    out += sprintf (out, " %04x->", *(uint16_t *)t);
	    t   += 2;
	    break;
	case 4:
	    out += sprintf (out, " %08x->", *(uint32_t *)t);
	    t   += 4;
	    break;
	}
	out += sprintf (out, "%04x", *(uint16_t *)t);
	t   += 2;
    }
    t += 2;
    return t - d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movzbl (%rdi), %ebx
shll $0x5, %ebx
leaq 0x367f6(%rip), %rcx     # 0x3add0
leaq 0x2(%rdi), %rax
movq %rax, (%rsp)
movzbl 0x1(%rdi), %r13d
movq 0x8(%rbx,%rcx), %rdx
leaq 0x1cd68(%rip), %rsi     # 0x2135b
movq %r14, %rdi
xorl %eax, %eax
callq 0x41d0
movslq %eax, %r12
addq %r14, %r12
movl %r13d, %edx
andl $0x7, %edx
shrl $0x3, %r13d
andl $0x7, %r13d
leaq 0x1ca28(%rip), %rax     # 0x21040
movl (%rax,%r13,4), %ebp
leaq 0x367ad(%rip), %rax     # 0x3add0
movl 0x14(%rbx,%rax), %r9d
movq %r15, %rbx
movq (%rsp), %rdi
movq %r12, %rsi
movl %r13d, %ecx
movl %ebp, %r8d
callq 0x4e15
cltq
leaq (%r15,%rax), %r14
addq $0x2, %r14
movq %r12, %rdi
callq 0x4090
movq %rax, %r15
addq %r12, %r15
leaq 0x1ce0a(%rip), %r13     # 0x21466
xorl %r12d, %r12d
movb (%r14), %al
cmpb $0x5a, %al
je 0x474c
cmpb $0x5a, 0x1(%r14)
je 0x474c
cmpb $0x63, %al
jne 0x472f
testb $0x7, %r12b
jne 0x4699
movabsq $0x202020202020200a, %rax # imm = 0x202020202020200A
movq %rax, (%r15)
movb $0x0, 0x8(%r15)
addq $0x8, %r15
cmpl $0x4, %ebp
je 0x46ea
cmpl $0x2, %ebp
je 0x46c9
cmpl $0x1, %ebp
jne 0x470a
movzbl 0x1(%r14), %edx
addq $0x2, %r14
movq %r15, %rdi
leaq 0x1cce3(%rip), %rsi     # 0x2139e
xorl %eax, %eax
callq 0x41d0
cltq
addq %rax, %r15
jmp 0x470d
movzwl 0x1(%r14), %edx
movq %r15, %rdi
leaq 0x1ccce(%rip), %rsi     # 0x213a6
xorl %eax, %eax
callq 0x41d0
cltq
addq %rax, %r15
addq $0x3, %r14
jmp 0x470d
movl 0x1(%r14), %edx
movq %r15, %rdi
leaq 0x1ccb6(%rip), %rsi     # 0x213ae
xorl %eax, %eax
callq 0x41d0
cltq
addq %rax, %r15
addq $0x5, %r14
jmp 0x470d
incq %r14
movzwl (%r14), %edx
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x41d0
cltq
addq %rax, %r15
addq $0x2, %r14
incl %r12d
jmp 0x465f
movups 0x1cc47(%rip), %xmm0    # 0x2137d
movups %xmm0, (%r15)
movabsq $0x68637469777320, %rax # imm = 0x68637469777320
movq %rax, 0x10(%r15)
addq $-0x2, %r14
subl %ebx, %r14d
addl $0x2, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq