// File: /workspace/github_c_makefile_star2_O2/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 0x4fa9
movl $0xce, %eax
btl %r13d, %eax
jae 0x4e48
movzbl (%rdi), %r14d
pushq $0x1
jmp 0x4e5b
pushq $0x11
popq %rax
btl %r13d, %eax
jae 0x4fa9
movzwl (%rdi), %r14d
pushq $0x2
popq %rbp
cmpl $0x2, %r13d
je 0x4e8e
cmpl $0x5, %r13d
jne 0x4edc
movslq %r8d, %rax
leaq 0x3836e(%rip), %rcx     # 0x3d1e0
movq (%rcx,%rax,8), %rsi
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x41d0
movslq %eax, %r12
addq %r15, %r12
jmp 0x4f75
pushq $0x4
popq %rdi
movl %r14d, %esi
callq 0x20888
testq %rax, %rax
je 0x4edc
movq %r15, %rdi
movq %rax, %rsi
callq 0x4080
subl %r15d, %eax
movslq %eax, %r13
addq %r15, %r13
movslq %r12d, %rax
leaq 0x38354(%rip), %rcx     # 0x3d210
movq (%rcx,%rax,8), %rdx
leaq 0x1c443(%rip), %rsi     # 0x2130a
movq %r13, %rdi
xorl %eax, %eax
callq 0x41d0
movslq %eax, %r12
addq %r13, %r12
jmp 0x4f75
movl %ebp, 0x4(%rsp)
movl %ebx, %ebp
movslq %r13d, %rax
leaq 0x38294(%rip), %rcx     # 0x3d180
movq (%rcx,%rax,8), %rsi
leaq 0x39209(%rip), %rcx     # 0x3e100
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 0x382f7(%rip), %rcx     # 0x3d210
movq (%rcx,%rax,8), %rdx
leaq 0x1c3e6(%rip), %rsi     # 0x2130a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41d0
movslq %eax, %r12
addq %rbx, %r12
testl %r13d, %r13d
je 0x4f3d
movl %ebp, %ebx
jmp 0x4f71
movl 0x39211(%rip), %edi     # 0x3e154
movl 0x3920f(%rip), %esi     # 0x3e158
addl %r14d, %esi
callq 0x20888
testq %rax, %rax
movl %ebp, %ebx
je 0x4f71
leaq 0x1c5a7(%rip), %rsi     # 0x21506
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 0x20888
testq %rax, %rax
je 0x4f98
leaq 0x1c57b(%rip), %rsi     # 0x21506
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 0x4fcb
cmpl $0x2, %r8d
je 0x4e55
movl %r8d, %ebp
cmpl $0x1, %r8d
je 0x4e40
jmp 0x4e5c
pushq $0x4
popq %rbp
movl (%rdi), %r14d
jmp 0x4e5c