// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: loadBAMfields
void loadBAMfields(char** block, int32_t* refID, int32_t* pos,
    uint8_t* mapq, uint16_t* n_cigar_op, uint16_t* flag,
    int32_t* l_seq, int32_t* next_refID, int32_t* next_pos,
    int32_t* tlen, char** read_name, uint32_t** cigar,
    uint8_t** seq, char** qual, char** extra) {
  *refID = loadInt32(block);
  *pos = loadInt32(block);
  uint32_t bin_mq_nl = loadInt32(block);
  int8_t l_read_name = bin_mq_nl & 0xFF;
  *mapq = (bin_mq_nl >> 8) & 0xFF;
  uint32_t flag_nc = loadInt32(block);
  *n_cigar_op = flag_nc & 0xFFFF;
  *flag = (flag_nc >> 16) & 0xFFFF;
  *l_seq = loadInt32(block);
  *next_refID = loadInt32(block);
  *next_pos = loadInt32(block);
  *tlen = loadInt32(block);
  *read_name = *block;
  (*block) += l_read_name;
  *cigar = (uint32_t*) *block;
  (*block) += *n_cigar_op * sizeof(uint32_t);
  *seq = (uint8_t*) *block;
  (*block) += (*l_seq + 1)/2 * sizeof(uint8_t);
  *qual = *block;
  (*block) += *l_seq;
  *extra = *block;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rax
movq 0x58(%rsp), %r12
movq 0x50(%rsp), %r13
movq 0x48(%rsp), %rbp
movq 0x40(%rsp), %r10
movq (%rdi), %r11
incq %r11
movq 0x38(%rsp), %r14
xorl %ecx, %ecx
xorl %ebx, %ebx
movzbl -0x1(%r11), %r15d
shll %cl, %r15d
orl %r15d, %ebx
movq %r11, (%rdi)
incq %r11
addl $0x8, %ecx
cmpl $0x20, %ecx
jne 0xda68
movl %ebx, (%rsi)
xorl %ecx, %ecx
xorl %esi, %esi
movzbl -0x1(%r11), %ebx
shll %cl, %ebx
orl %ebx, %esi
movq %r11, (%rdi)
incq %r11
addl $0x8, %ecx
cmpl $0x20, %ecx
jne 0xda87
movl %esi, (%rdx)
xorl %ecx, %ecx
xorl %edx, %edx
movzbl -0x1(%r11), %esi
shll %cl, %esi
orl %esi, %edx
movq %r11, (%rdi)
addl $0x8, %ecx
incq %r11
cmpl $0x20, %ecx
jne 0xdaa4
movb %dh, (%rax)
movq (%rdi), %rax
xorl %ecx, %ecx
xorl %esi, %esi
movzbl (%rax), %r11d
shll %cl, %r11d
orl %r11d, %esi
incq %rax
movq %rax, (%rdi)
addl $0x8, %ecx
cmpl $0x20, %ecx
jne 0xdac4
movw %si, (%r8)
shrl $0x10, %esi
movw %si, (%r9)
xorl %ecx, %ecx
xorl %esi, %esi
movzbl (%rax), %r9d
shll %cl, %r9d
orl %r9d, %esi
incq %rax
movq %rax, (%rdi)
addl $0x8, %ecx
cmpl $0x20, %ecx
jne 0xdaeb
movl %esi, (%r14)
xorl %ecx, %ecx
xorl %esi, %esi
movzbl (%rax), %r9d
shll %cl, %r9d
orl %r9d, %esi
incq %rax
movq %rax, (%rdi)
addl $0x8, %ecx
cmpl $0x20, %ecx
jne 0xdb0a
movl %esi, (%r10)
xorl %ecx, %ecx
xorl %esi, %esi
movzbl (%rax), %r9d
shll %cl, %r9d
orl %r9d, %esi
incq %rax
movq %rax, (%rdi)
addl $0x8, %ecx
cmpl $0x20, %ecx
jne 0xdb29
movl %esi, (%rbp)
xorl %ecx, %ecx
xorl %esi, %esi
movzbl (%rax), %r9d
shll %cl, %r9d
orl %r9d, %esi
incq %rax
movq %rax, (%rdi)
addl $0x8, %ecx
cmpl $0x20, %ecx
jne 0xdb48
movl %esi, (%r13)
movq %rax, (%r12)
movsbq %dl, %rax
addq (%rdi), %rax
movq %rax, (%rdi)
movq 0x60(%rsp), %rcx
movq %rax, (%rcx)
movzwl (%r8), %eax
shll $0x2, %eax
addq (%rdi), %rax
movq %rax, (%rdi)
movq 0x68(%rsp), %rcx
movq %rax, (%rcx)
movslq (%r14), %rax
leal 0x1(%rax), %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
incl %ecx
sarl %ecx
movslq %ecx, %rcx
addq (%rdi), %rcx
movq %rcx, (%rdi)
movq 0x70(%rsp), %rdx
movq %rcx, (%rdx)
addq (%rdi), %rax
movq %rax, (%rdi)
movq 0x78(%rsp), %rcx
movq %rax, (%rcx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq