// File: /workspace/github_c_makefile_star2_O3/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
movl $0x1, %esi
movl $0x20, %edx
callq 0xb27a
movl %eax, %ecx
movb $0x1, %al
testl %ecx, %ecx
jne 0x1a5fd
movq %rbx, %rdi
movl $0x1, %esi
movl $0x10, %edx
callq 0xb27a
movl %eax, %ecx
movb $0x2, %al
testl %ecx, %ecx
jne 0x1a5fd
movq %rbx, %rdi
movl $0x1, %esi
movl $0x8, %edx
callq 0xb27a
movl %eax, %ecx
movb $0x3, %al
testl %ecx, %ecx
jne 0x1a5fd
movq %rbx, %rdi
movl $0x2, %esi
movl $0x20, %edx
callq 0xb27a
movl %eax, %ecx
movb $0x4, %al
testl %ecx, %ecx
jne 0x1a5fd
movq %rbx, %rdi
movl $0x2, %esi
movl $0x10, %edx
callq 0xb27a
movl %eax, %ecx
movb $0x5, %al
testl %ecx, %ecx
jne 0x1a5fd
movq %rbx, %rdi
movl $0x2, %esi
movl $0x8, %edx
callq 0xb27a
movl %eax, %ecx
movb $0x6, %al
testl %ecx, %ecx
jne 0x1a5fd
movq %rbx, %rdi
movl $0x3, %esi
movl $0x20, %edx
callq 0xb27a
movl %eax, %ecx
movb $0x7, %al
testl %ecx, %ecx
jne 0x1a5fd
movq %rbx, %rdi
movl $0x3, %esi
movl $0x10, %edx
callq 0xb27a
movl %eax, %ecx
movb $0x8, %al
testl %ecx, %ecx
jne 0x1a5fd
movq %rbx, %rdi
movl $0x3, %esi
movl $0x8, %edx
callq 0xb27a
movl %eax, %ecx
movb $0x9, %al
testl %ecx, %ecx
jne 0x1a5fd
movq %rbx, %rdi
movl $0x5, %esi
movl $0x20, %edx
callq 0xb27a
movl %eax, %ecx
movb $0xa, %al
testl %ecx, %ecx
jne 0x1a5fd
movq %rbx, %rdi
movl $0x5, %esi
movl $0x10, %edx
callq 0xb27a
movl %eax, %ecx
movb $0xb, %al
testl %ecx, %ecx
jne 0x1a5fd
movq %rbx, %rdi
movl $0x5, %esi
movl $0x8, %edx
callq 0xb27a
movl %eax, %ecx
movb $0xc, %al
testl %ecx, %ecx
jne 0x1a5fd
movq %rbx, %rdi
movl $0x7, %esi
movl $0x20, %edx
callq 0xb27a
movl %eax, %ecx
movb $0xd, %al
testl %ecx, %ecx
jne 0x1a5fd
movq %rbx, %rdi
movl $0x7, %esi
movl $0x10, %edx
callq 0xb27a
movl %eax, %ecx
movb $0xe, %al
testl %ecx, %ecx
jne 0x1a5fd
movq %rbx, %rdi
movl $0x7, %esi
movl $0x8, %edx
callq 0xb27a
movl %eax, %ecx
movb $0xf, %al
testl %ecx, %ecx
jne 0x1a5fd
movq %rbx, %rdi
movl $0x9, %esi
movl $0x20, %edx
callq 0xb27a
movl %eax, %ecx
movb $0x10, %al
testl %ecx, %ecx
jne 0x1a5fd
movq %rbx, %rdi
movl $0x9, %esi
movl $0x10, %edx
callq 0xb27a
movl %eax, %ecx
movb $0x11, %al
testl %ecx, %ecx
jne 0x1a5fd
movq %rbx, %rdi
movl $0x9, %esi
movl $0x8, %edx
callq 0xb27a
movl %eax, %ecx
movb $0x12, %al
testl %ecx, %ecx
jne 0x1a5fd
movb 0x38(%rbx), %al
addb $-0x6, %al
cmpb $0x9, %al
ja 0x1a5fb
movzbl %al, %eax
leaq 0x9cfa(%rip), %rcx      # 0x242f0
movb (%rax,%rcx), %al
jmp 0x1a5fd
xorl %eax, %eax
popq %rbx
retq
nop