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