// File: /workspace/github_c_makefile_star2_O1/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 0xcef2(%rip), %rax      # 0x1d118
movq (%rax), %rax
movslq 0x18(%rax), %rcx
leaq (%rcx,%rcx,2), %rdx
leaq 0xcb28(%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 0x10381
movl %r9d, %r15d
movl %r8d, %r12d
leaq 0x411f(%rip), %rcx      # 0x14388
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0xf442
movslq %eax, %rbx
jmp 0x10338
callq 0xf442
movslq %eax, %rbx
callq 0xf442
shll $0x8, %eax
movl %ebp, 0x4(%rsp)
movslq %eax, %rbp
addq %rbx, %rbp
callq 0xf442
shll $0x10, %eax
movl %r13d, 0x8(%rsp)
movl %r12d, %r13d
movq %r15, %r12
movslq %eax, %r15
callq 0xf442
shll $0x18, %eax
movslq %eax, %rbx
addq %r15, %rbx
movq %r12, %r15
movl %r13d, %r12d
movl 0x8(%rsp), %r13d
jmp 0x10331
callq 0xf442
movslq %eax, %rbx
callq 0xf442
shll $0x8, %eax
movq %r15, 0x8(%rsp)
movslq %eax, %r15
addq %rbx, %r15
callq 0xf442
shll $0x10, %eax
movl %ebp, 0x4(%rsp)
movslq %eax, %rbp
callq 0xf442
shll $0x18, %eax
movslq %eax, %rbx
addq %rbp, %rbx
movl 0x4(%rsp), %ebp
addq %r15, %rbx
movq 0x8(%rsp), %r15
callq 0xf442
callq 0xf442
jmp 0x10338
callq 0xf442
movl %ebp, 0x4(%rsp)
movslq %eax, %rbp
callq 0xf442
shll $0x8, %eax
movslq %eax, %rbx
addq %rbp, %rbx
movl 0x4(%rsp), %ebp
movl 0x58(%rsp), %eax
leaq 0xcdd5(%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 0xfe9c
addq $0x20, %rsp
callq 0xcbd0
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x9400
nop