// File: /workspace/github_c_makefile_star2_O3/mikebdp2[P]AtomDis/main.c
// Function: sub_src
int sub_src (uint8_t *d, char *out, int type, int align, int size, int index) {
    uint32_t    val;
    int         r;
    const char *ind;
    switch (type) {
    case D_IM:
	r = size;
	break;
    case D_PS:  case D_WS:  case D_FB:  case D_PLL:  case D_MC:
	r = 1;
	break;
    case D_REG:  case D_ID:
	r = 2;
    }
    switch (r) {
    case 1:
	val = *d;
	break;
    case 2:
	val = *(uint16_t *)d;
	break;
    case 4:
	val = *(uint32_t *)d;
	break;
    }
    if (type == D_IM) {
	out += sprintf (out, addrtypes_im [size], val);
    } else if (type == D_WS && (ind = get_index (INDEX_WORK_REG, val)) ) {
	out += sprintf (out, "%s", ind);
	out += sprintf (out, " [%s]", align_source[align]);
    } else {
	out += sprintf (out, addrtypes [type], val << addrtypes_shift [type]);
	out += sprintf (out, " [%s]", align_source[align]);
    }
    if (type == D_REG && (ind = get_index (last_reg_index, val+last_reg_offset)) )
	out += sprintf (out, "  (%s)", ind);
    if ( (ind = get_index (index, val)) )
	out += sprintf (out, "  (%s)", ind);
    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movl %ecx, %r12d
movl %edx, %r13d
movq %rsi, %r15
cmpl $0x7, %edx
ja 0x5140
movl $0xce, %eax
btl %r13d, %eax
jae 0x4fd9
movzbl (%rdi), %r14d
movl $0x1, %ebp
jmp 0x4ff1
movl $0x11, %eax
btl %r13d, %eax
jae 0x5140
movzwl (%rdi), %r14d
movl $0x2, %ebp
cmpl $0x2, %r13d
je 0x5023
cmpl $0x5, %r13d
jne 0x5073
movslq %r8d, %rax
leaq 0x371d9(%rip), %rcx     # 0x3c1e0
movq (%rcx,%rax,8), %rsi
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x41d0
movslq %eax, %r12
addq %r15, %r12
jmp 0x510c
movl $0x4, %edi
movl %r14d, %esi
callq 0x216c4
testq %rax, %rax
je 0x5073
movq %r15, %rdi
movq %rax, %rsi
callq 0x4080
subl %r15d, %eax
movslq %eax, %r13
addq %r15, %r13
movslq %r12d, %rax
leaq 0x371bd(%rip), %rcx     # 0x3c210
movq (%rcx,%rax,8), %rdx
leaq 0x1d2ac(%rip), %rsi     # 0x2230a
movq %r13, %rdi
xorl %eax, %eax
callq 0x41d0
movslq %eax, %r12
addq %r13, %r12
jmp 0x510c
movl %ebp, 0x4(%rsp)
movl %ebx, %ebp
movslq %r13d, %rax
leaq 0x370fd(%rip), %rcx     # 0x3c180
movq (%rcx,%rax,8), %rsi
leaq 0x38072(%rip), %rcx     # 0x3d100
movb (%rcx,%rax,4), %cl
movl %r14d, %edx
shll %cl, %edx
movq %r15, %rdi
xorl %eax, %eax
callq 0x41d0
movslq %eax, %rbx
addq %r15, %rbx
movslq %r12d, %rax
leaq 0x37160(%rip), %rcx     # 0x3c210
movq (%rcx,%rax,8), %rdx
leaq 0x1d24f(%rip), %rsi     # 0x2230a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41d0
movslq %eax, %r12
addq %rbx, %r12
testl %r13d, %r13d
je 0x50d4
movl %ebp, %ebx
jmp 0x5108
movl 0x3807a(%rip), %edi     # 0x3d154
movl 0x38078(%rip), %esi     # 0x3d158
addl %r14d, %esi
callq 0x216c4
testq %rax, %rax
movl %ebp, %ebx
je 0x5108
leaq 0x1d410(%rip), %rsi     # 0x22506
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x41d0
cltq
addq %rax, %r12
movl 0x4(%rsp), %ebp
movl %ebx, %edi
movl %r14d, %esi
callq 0x216c4
testq %rax, %rax
je 0x512f
leaq 0x1d3e4(%rip), %rsi     # 0x22506
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x41d0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x4, %r8d
je 0x5162
cmpl $0x2, %r8d
je 0x4fe8
movl %r8d, %ebp
cmpl $0x1, %r8d
je 0x4fce
jmp 0x4ff1
movl (%rdi), %r14d
movl $0x4, %ebp
jmp 0x4ff1