// File: /workspace/github_c_makefile_star2_O0/mikebdp2[P]AtomDis/main.c
// Function: sub_dest
int sub_dest (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_REG:
	val  = *((uint16_t *) d);
	r    = 2;
	break;
    case D_ID:  case D_IM:
	out += sprintf (out, "<internal - illegal addrtype %s>", addrnames [type]);
	val  = 0;
	r    = 0;
	break;
    default:
	val = *d;
	r   = 1;
    }
    if (type == D_WS && (ind = get_index (INDEX_WORK_REG, val)) )
	out += sprintf (out, "%s", ind);
    else if (r)
	out += sprintf (out, addrtypes [type], val << addrtypes_shift[type]);
    switch (size) {
    case 1:
	out += sprintf (out, " [%s]", align_byte[align]);
	break;
    case 2:
	out += sprintf (out, " [%s]", align_word[align]);
	break;
    case 4:
	out += sprintf (out, " [%s]", align_long[align]);
	break;
    }
    if (type == D_REG && (ind = get_index (last_reg_index, val+last_reg_offset)) )
	out += sprintf (out, "  (%s)", ind);
    if (r && (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 0x52a7
jmp 0x529a
movl -0x34(%rbp), %eax
addl $-0x4, %eax
subl $0x2, %eax
jb 0x52ba
jmp 0x52fb
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
movl %eax, -0x24(%rbp)
movl $0x2, -0x28(%rbp)
jmp 0x530c
movq -0x10(%rbp), %rdi
movslq -0x14(%rbp), %rcx
leaq 0x5ee47(%rip), %rax     # 0x64110
movq (%rax,%rcx,8), %rdx
leaq 0x470f8(%rip), %rsi     # 0x4c3cc
movb $0x0, %al
callq 0x41b0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
jmp 0x530c
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x24(%rbp)
movl $0x1, -0x28(%rbp)
cmpl $0x2, -0x14(%rbp)
jne 0x5351
movl -0x24(%rbp), %esi
movl $0x4, %edi
callq 0x4b6b0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x5351
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x474bf(%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)
jmp 0x5396
cmpl $0x0, -0x28(%rbp)
je 0x5394
movq -0x10(%rbp), %rdi
movslq -0x14(%rbp), %rcx
leaq 0x5ee0a(%rip), %rax     # 0x64170
movq (%rax,%rcx,8), %rsi
movl -0x24(%rbp), %edx
movslq -0x14(%rbp), %rcx
leaq 0x5fd78(%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)
jmp 0x5396
movl -0x1c(%rbp), %eax
movl %eax, -0x38(%rbp)
subl $0x1, %eax
je 0x53ba
jmp 0x53a3
movl -0x38(%rbp), %eax
subl $0x2, %eax
je 0x53ed
jmp 0x53ad
movl -0x38(%rbp), %eax
subl $0x4, %eax
je 0x5420
jmp 0x5451
movq -0x10(%rbp), %rdi
movslq -0x18(%rbp), %rcx
leaq 0x5ee77(%rip), %rax     # 0x64240
movq (%rax,%rcx,8), %rdx
leaq 0x47019(%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 0x5451
movq -0x10(%rbp), %rdi
movslq -0x18(%rbp), %rcx
leaq 0x5ee64(%rip), %rax     # 0x64260
movq (%rax,%rcx,8), %rdx
leaq 0x46fe6(%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 0x5451
movq -0x10(%rbp), %rdi
movslq -0x18(%rbp), %rcx
leaq 0x5ee51(%rip), %rax     # 0x64280
movq (%rax,%rcx,8), %rdx
leaq 0x46fb3(%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)
cmpl $0x0, -0x14(%rbp)
jne 0x549b
movl 0x5fce7(%rip), %edi     # 0x65144
movl -0x24(%rbp), %esi
addl 0x5fce2(%rip), %esi     # 0x65148
callq 0x4b6b0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x549b
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x47165(%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)
cmpl $0x0, -0x28(%rbp)
je 0x54dc
movl -0x20(%rbp), %edi
movl -0x24(%rbp), %esi
callq 0x4b6b0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x54dc
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x47124(%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
nopw %cs:(%rax,%rax)