// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x34(%rbp)
testl %eax, %eax
je 0x5558
jmp 0x551a
movl -0x34(%rbp), %eax
decl %eax
subl $0x3, %eax
jb 0x554f
jmp 0x5526
movl -0x34(%rbp), %eax
subl $0x4, %eax
je 0x5558
jmp 0x5530
movl -0x34(%rbp), %eax
subl $0x5, %eax
je 0x5547
jmp 0x553a
movl -0x34(%rbp), %eax
addl $-0x6, %eax
subl $0x2, %eax
jb 0x554f
jmp 0x555f
movl -0x1c(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x555f
movl $0x1, -0x28(%rbp)
jmp 0x555f
movl $0x2, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x38(%rbp)
subl $0x1, %eax
je 0x5580
jmp 0x556c
movl -0x38(%rbp), %eax
subl $0x2, %eax
je 0x558c
jmp 0x5576
movl -0x38(%rbp), %eax
subl $0x4, %eax
je 0x5598
jmp 0x55a1
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x24(%rbp)
jmp 0x55a1
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
movl %eax, -0x24(%rbp)
jmp 0x55a1
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
cmpl $0x5, -0x14(%rbp)
jne 0x55d9
movq -0x10(%rbp), %rdi
movslq -0x1c(%rbp), %rcx
leaq 0x5ec1a(%rip), %rax     # 0x641d0
movq (%rax,%rcx,8), %rsi
movl -0x24(%rbp), %edx
movb $0x0, %al
callq 0x41b0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x56bf
cmpl $0x2, -0x14(%rbp)
jne 0x564f
movl -0x24(%rbp), %esi
movl $0x4, %edi
callq 0x4b6b0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x564f
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x471f2(%rip), %rsi     # 0x4c7f7
movb $0x0, %al
callq 0x41b0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x18(%rbp), %rcx
leaq 0x5ebd5(%rip), %rax     # 0x64200
movq (%rax,%rcx,8), %rdx
leaq 0x46db7(%rip), %rsi     # 0x4c3ed
movb $0x0, %al
callq 0x41b0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x56bd
movq -0x10(%rbp), %rdi
movslq -0x14(%rbp), %rcx
leaq 0x5eb12(%rip), %rax     # 0x64170
movq (%rax,%rcx,8), %rsi
movl -0x24(%rbp), %edx
movslq -0x14(%rbp), %rcx
leaq 0x5fa80(%rip), %rax     # 0x650f0
movl (%rax,%rcx,4), %ecx
shll %cl, %edx
movb $0x0, %al
callq 0x41b0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x18(%rbp), %rcx
leaq 0x5eb65(%rip), %rax     # 0x64200
movq (%rax,%rcx,8), %rdx
leaq 0x46d47(%rip), %rsi     # 0x4c3ed
movb $0x0, %al
callq 0x41b0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x56bf
cmpl $0x0, -0x14(%rbp)
jne 0x5709
movl 0x5fa79(%rip), %edi     # 0x65144
movl -0x24(%rbp), %esi
addl 0x5fa74(%rip), %esi     # 0x65148
callq 0x4b6b0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x5709
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x46ef7(%rip), %rsi     # 0x4c5e9
movb $0x0, %al
callq 0x41b0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movl -0x20(%rbp), %edi
movl -0x24(%rbp), %esi
callq 0x4b6b0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x5744
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x46ebc(%rip), %rsi     # 0x4c5e9
movb $0x0, %al
callq 0x41b0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movl -0x28(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)