// File: /workspace/github_c_makefile_star2_O3/Nico01[P]obj2asm/outarget.c
// Function: get_fix
int get_fix( result, mode, pre_name, size_bytes, size, assign,
                                                    size_known, seg_reg )
    char            *result;        /* Resulting name will go here            */
    int             mode;           /* 0 = Data Deref, 1 = Code, 2 = Data Ref */
    int             pre_name;       /* Fixup type words needed?               */
    int             size_bytes;     /* Word size (386=4 others=2)             */
    int             size;           /* Size of expected value                 */
    int             assign;         /* TRUE to set size, FALSE to ignore      */
    int             *size_known;    /* Is "word ptr" text needed?             */
    int             seg_reg;        /* Segment register used                  */
{
    dword   data;
    dword   more;
    int             fix_count;

    size_bytes = size_bytes;
    fix_count = fix_type[fix_rec->form].num_bytes;

    /*
    ** BASE types do not get larger
    */
    if ( fix_rec->extended && fix_rec->form != BASE ) {
        fix_count += 2;
    }

    switch( fix_count ) {
        case 1: data = buff_getc();
                break;
        case 2: data = buff_getc();
                data += (buff_getc() << 8);
                break;
        case 4: data = buff_getc();
                data += (buff_getc() << 8);
                data += (buff_getc() << 16);
                data += (buff_getc() << 24);
                break;
        case 6: data = buff_getc();
                data += (buff_getc() << 8);
                data += (buff_getc() << 16);
                data += (buff_getc() << 24);
                more = buff_getc();
                more += (buff_getc() << 8);
                break;
        default:
                fmt_error( "Invalid fixup type" );
                break;
    }

    get_target( result, fix_rec, mode, data, pre_name, size, assign,
                                                        size_known, seg_reg );
    fix_advance();

    return( fix_count );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r13d
movl %esi, %ebp
movq %rdi, 0x10(%rsp)
leaq 0xce7a(%rip), %rax      # 0x1d118
movq (%rax), %rax
movslq 0x18(%rax), %rcx
leaq (%rcx,%rcx,2), %rdx
leaq 0xcab0(%rip), %rsi      # 0x1cd60
movl (%rsi,%rdx,8), %edx
cmpl $0x0, 0x38(%rax)
leal 0x2(%rdx), %r14d
cmovel %edx, %r14d
cmpq $0x2, %rcx
cmovel %edx, %r14d
leal -0x1(%r14), %eax
cmpl $0x5, %eax
ja 0x103f9
movl %r9d, %r15d
movl %r8d, %r12d
leaq 0x40a7(%rip), %rcx      # 0x14388
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0xf47e
movslq %eax, %rbx
jmp 0x103b0
callq 0xf47e
movslq %eax, %rbx
callq 0xf47e
shll $0x8, %eax
movl %ebp, 0x4(%rsp)
movslq %eax, %rbp
addq %rbx, %rbp
callq 0xf47e
shll $0x10, %eax
movl %r13d, 0x8(%rsp)
movl %r12d, %r13d
movq %r15, %r12
movslq %eax, %r15
callq 0xf47e
shll $0x18, %eax
movslq %eax, %rbx
addq %r15, %rbx
movq %r12, %r15
movl %r13d, %r12d
movl 0x8(%rsp), %r13d
jmp 0x103a9
callq 0xf47e
movslq %eax, %rbx
callq 0xf47e
shll $0x8, %eax
movq %r15, 0x8(%rsp)
movslq %eax, %r15
addq %rbx, %r15
callq 0xf47e
shll $0x10, %eax
movl %ebp, 0x4(%rsp)
movslq %eax, %rbp
callq 0xf47e
shll $0x18, %eax
movslq %eax, %rbx
addq %rbp, %rbx
movl 0x4(%rsp), %ebp
addq %r15, %rbx
movq 0x8(%rsp), %r15
callq 0xf47e
callq 0xf47e
jmp 0x103b0
callq 0xf47e
movl %ebp, 0x4(%rsp)
movslq %eax, %rbp
callq 0xf47e
shll $0x8, %eax
movslq %eax, %rbx
addq %rbp, %rbx
movl 0x4(%rsp), %ebp
movl 0x58(%rsp), %eax
leaq 0xcd5d(%rip), %rcx      # 0x1d118
movq (%rcx), %rsi
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
movl %ebp, %edx
movq %rbx, %rcx
movl %r13d, %r8d
movl %r12d, %r9d
pushq %rax
pushq 0x60(%rsp)
pushq %r15
callq 0xfec1
addq $0x20, %rsp
callq 0xcc3c
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x9400
nop