// File: /workspace/github_c_makefile_star2_O1/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 0x3566c(%rip), %rcx     # 0x39dd0
leaq 0x2(%rdi), %rax
movq %rax, (%rsp)
movzbl 0x1(%rdi), %r13d
movq 0x8(%rbx,%rcx), %rdx
leaq 0x1dbde(%rip), %rsi     # 0x2235b
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 0x1d89e(%rip), %rax     # 0x22040
movl (%rax,%r13,4), %ebp
leaq 0x35623(%rip), %rax     # 0x39dd0
movl 0x14(%rbx,%rax), %r9d
movq %r15, %rbx
movq (%rsp), %rdi
movq %r12, %rsi
movl %r13d, %ecx
movl %ebp, %r8d
callq 0x4f97
cltq
leaq (%r15,%rax), %r14
addq $0x2, %r14
movb (%r14), %r13b
cmpb $0x5a, %r13b
je 0x48e2
movq %r12, %rdi
callq 0x4090
movq %rax, %r15
addq %r12, %r15
xorl %r12d, %r12d
cmpb $0x5a, 0x1(%r14)
je 0x48e2
cmpb $0x63, %r13b
jne 0x48c5
testb $0x7, %r12b
jne 0x4820
movabsq $0x202020202020200a, %rax # imm = 0x202020202020200A
movq %rax, (%r15)
movb $0x0, 0x8(%r15)
addq $0x8, %r15
cmpl $0x4, %ebp
je 0x4871
cmpl $0x2, %ebp
je 0x4850
cmpl $0x1, %ebp
jne 0x4891
movzbl 0x1(%r14), %edx
addq $0x2, %r14
movq %r15, %rdi
leaq 0x1db5c(%rip), %rsi     # 0x2239e
xorl %eax, %eax
callq 0x41d0
cltq
addq %rax, %r15
jmp 0x4894
movzwl 0x1(%r14), %edx
movq %r15, %rdi
leaq 0x1db47(%rip), %rsi     # 0x223a6
xorl %eax, %eax
callq 0x41d0
cltq
addq %rax, %r15
addq $0x3, %r14
jmp 0x4894
movl 0x1(%r14), %edx
movq %r15, %rdi
leaq 0x1db2f(%rip), %rsi     # 0x223ae
xorl %eax, %eax
callq 0x41d0
cltq
addq %rax, %r15
addq $0x5, %r14
jmp 0x4894
incq %r14
movzwl (%r14), %edx
movq %r15, %rdi
leaq 0x1dbc4(%rip), %rsi     # 0x22466
xorl %eax, %eax
callq 0x41d0
cltq
addq %rax, %r15
movb 0x2(%r14), %r13b
addq $0x2, %r14
incl %r12d
cmpb $0x5a, %r13b
jne 0x47ef
jmp 0x48e2
movups 0x1dab1(%rip), %xmm0    # 0x2237d
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