// File: /workspace/github_c_makefile_star2_O0/negge[P]xlink/src/xlink.c
// Function: xlink_file_load_omf_record
static void xlink_file_load_omf_record(xlink_file *file,
 xlink_omf_record *rec) {
  unsigned char checksum;
  XLINK_ERROR(file->size < 3,
   ("Need 3 bytes for a record but only have %i", file->size));
  rec->buf = &file->buf[file->pos];
  rec->idx = 0;
  rec->type = xlink_omf_record_read_byte(rec);
  rec->size = xlink_omf_record_read_word(rec);
  XLINK_ERROR(file->size - 3 < rec->size,
   ("Record extends %i bytes past the end of file %s",
   rec->size - file->size + 3, file->name));
  file->pos += 3 + rec->size;
  file->size -= 3 + rec->size;
  checksum = rec->buf[3 + rec->size - 1];
  if (checksum != 0) {
    int i;
    for (i = 0; i < 3 + rec->size - 1; i++) {
      checksum += rec->buf[i];
    }
  }
  XLINK_ERROR(checksum != 0, ("Invalid checksum, expected 0 got %i", checksum));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x3, 0x8(%rax)
jae 0x7649
movq -0x8(%rbp), %rax
movl 0x8(%rax), %esi
leaq 0x8541(%rip), %rdi      # 0xfb79
movb $0x0, %al
callq 0xad90
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21c0
jmp 0x764b
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movl 0xc(%rax), %eax
addq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x10(%rbp), %rdi
callq 0x4cf0
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0xc(%rax)
movq -0x10(%rbp), %rdi
callq 0x4bf0
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0xe(%rax)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
subl $0x3, %eax
movq -0x10(%rbp), %rcx
movzwl 0xe(%rcx), %ecx
cmpl %ecx, %eax
jae 0x76dc
movq -0x10(%rbp), %rax
movzwl 0xe(%rax), %esi
movq -0x8(%rbp), %rax
subl 0x8(%rax), %esi
addl $0x3, %esi
movq -0x8(%rbp), %rax
movq (%rax), %rdx
leaq 0x84d9(%rip), %rdi      # 0xfba4
movb $0x0, %al
callq 0xad90
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21c0
jmp 0x76de
movq -0x10(%rbp), %rax
movzwl 0xe(%rax), %ecx
addl $0x3, %ecx
movq -0x8(%rbp), %rax
addl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
movzwl 0xe(%rax), %edx
addl $0x3, %edx
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movzwl 0xe(%rcx), %ecx
addl $0x3, %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
je 0x7772
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
movzwl 0xe(%rcx), %ecx
addl $0x3, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x7770
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x18(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
movzbl -0x11(%rbp), %eax
addl %ecx, %eax
movb %al, -0x11(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x7738
jmp 0x7772
jmp 0x7774
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
je 0x7799
movzbl -0x11(%rbp), %esi
leaq 0x844c(%rip), %rdi      # 0xfbd4
movb $0x0, %al
callq 0xad90
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21c0
jmp 0x779b
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)