// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_elf32m68k.c
// Function: m68k_reloc_vlink2elf
static uint8_t m68k_reloc_vlink2elf(struct Reloc *r)
/* Try to map vlink-internal representation to a valid ELF reloc type */
{
  if (isstdreloc(r,R_ABS,32)) return R_68K_32;
  else if (isstdreloc(r,R_ABS,16)) return R_68K_16;
  else if (isstdreloc(r,R_ABS,8)) return R_68K_8;
  else if (isstdreloc(r,R_PC,32)) return R_68K_PC32;
  else if (isstdreloc(r,R_PC,16)) return R_68K_PC16;
  else if (isstdreloc(r,R_PC,8)) return R_68K_PC8;
  else if (isstdreloc(r,R_GOT,32)) return R_68K_GOT32;
  else if (isstdreloc(r,R_GOT,16)) return R_68K_GOT16;
  else if (isstdreloc(r,R_GOT,8)) return R_68K_GOT8;
  else if (isstdreloc(r,R_GOTOFF,32)) return R_68K_GOT32O;
  else if (isstdreloc(r,R_GOTOFF,16)) return R_68K_GOT16O;
  else if (isstdreloc(r,R_GOTOFF,8)) return R_68K_GOT8O;
  else if (isstdreloc(r,R_PLT,32)) return R_68K_PLT32;
  else if (isstdreloc(r,R_PLT,16)) return R_68K_PLT16;
  else if (isstdreloc(r,R_PLT,8)) return R_68K_PLT8;
  else if (isstdreloc(r,R_PLTOFF,32)) return R_68K_PLT32O;
  else if (isstdreloc(r,R_PLTOFF,16)) return R_68K_PLT16O;
  else if (isstdreloc(r,R_PLTOFF,8)) return R_68K_PLT8O;
  else if (r->rtype == R_COPY) return R_68K_COPY;
  else if (r->rtype == R_GLOBDAT) return R_68K_GLOB_DAT;
  else if (r->rtype == R_JMPSLOT) return R_68K_JMP_SLOT;
  else if (r->rtype == R_LOADREL) return R_68K_RELATIVE;

  return R_NONE;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rsi
pushq $0x20
popq %rdx
callq 0xad23
movl %eax, %ecx
movb $0x1, %al
testl %ecx, %ecx
jne 0x18f9c
pushq $0x1
popq %rsi
pushq $0x10
popq %rdx
movq %rbx, %rdi
callq 0xad23
movl %eax, %ecx
movb $0x2, %al
testl %ecx, %ecx
jne 0x18f9c
pushq $0x1
popq %rsi
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0xad23
movl %eax, %ecx
movb $0x3, %al
testl %ecx, %ecx
jne 0x18f9c
pushq $0x2
popq %rsi
pushq $0x20
popq %rdx
movq %rbx, %rdi
callq 0xad23
movl %eax, %ecx
movb $0x4, %al
testl %ecx, %ecx
jne 0x18f9c
pushq $0x2
popq %rsi
pushq $0x10
popq %rdx
movq %rbx, %rdi
callq 0xad23
movl %eax, %ecx
movb $0x5, %al
testl %ecx, %ecx
jne 0x18f9c
pushq $0x2
popq %rsi
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0xad23
movl %eax, %ecx
movb $0x6, %al
testl %ecx, %ecx
jne 0x18f9c
pushq $0x3
popq %rsi
pushq $0x20
popq %rdx
movq %rbx, %rdi
callq 0xad23
movl %eax, %ecx
movb $0x7, %al
testl %ecx, %ecx
jne 0x18f9c
pushq $0x3
popq %rsi
pushq $0x10
popq %rdx
movq %rbx, %rdi
callq 0xad23
movl %eax, %ecx
movb $0x8, %al
testl %ecx, %ecx
jne 0x18f9c
pushq $0x3
popq %rsi
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0xad23
movl %eax, %ecx
movb $0x9, %al
testl %ecx, %ecx
jne 0x18f9c
pushq $0x5
popq %rsi
pushq $0x20
popq %rdx
movq %rbx, %rdi
callq 0xad23
movl %eax, %ecx
movb $0xa, %al
testl %ecx, %ecx
jne 0x18f9c
pushq $0x5
popq %rsi
pushq $0x10
popq %rdx
movq %rbx, %rdi
callq 0xad23
movl %eax, %ecx
movb $0xb, %al
testl %ecx, %ecx
jne 0x18f9c
pushq $0x5
popq %rsi
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0xad23
movl %eax, %ecx
movb $0xc, %al
testl %ecx, %ecx
jne 0x18f9c
pushq $0x7
popq %rsi
pushq $0x20
popq %rdx
movq %rbx, %rdi
callq 0xad23
movl %eax, %ecx
movb $0xd, %al
testl %ecx, %ecx
jne 0x18f9c
pushq $0x7
popq %rsi
pushq $0x10
popq %rdx
movq %rbx, %rdi
callq 0xad23
movl %eax, %ecx
movb $0xe, %al
testl %ecx, %ecx
jne 0x18f9c
pushq $0x7
popq %rsi
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0xad23
movl %eax, %ecx
movb $0xf, %al
testl %ecx, %ecx
jne 0x18f9c
pushq $0x9
popq %rsi
pushq $0x20
popq %rdx
movq %rbx, %rdi
callq 0xad23
movl %eax, %ecx
movb $0x10, %al
testl %ecx, %ecx
jne 0x18f9c
pushq $0x9
popq %rsi
pushq $0x10
popq %rdx
movq %rbx, %rdi
callq 0xad23
movl %eax, %ecx
movb $0x11, %al
testl %ecx, %ecx
jne 0x18f9c
pushq $0x9
popq %rsi
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0xad23
movl %eax, %ecx
movb $0x12, %al
testl %ecx, %ecx
jne 0x18f9c
movb 0x38(%rbx), %al
addb $-0x6, %al
cmpb $0x9, %al
ja 0x18f9a
movzbl %al, %eax
leaq 0x8f8b(%rip), %rcx      # 0x21f20
movb (%rax,%rcx), %al
jmp 0x18f9c
xorl %eax, %eax
popq %rbx
retq
nop