// File: /workspace/github_c_makefile_star2_O0/jsh58[P]Genrich/Genrich.c
// Function: jenkins_hash_aln
uint32_t jenkins_hash_aln(Chrom* chrom, Chrom* chrom1,
    uint32_t pos, uint32_t pos1, bool strand, bool strand1,
    int alignType, uint32_t hashSize) {
  uint32_t hash = 0;
  unsigned char* p;

  // hash Chrom*
  int end = (alignType == DISCORD ? 2 : 1);
  for (int j = 0; j < end; j++) {
    p = (unsigned char*) (j ? chrom1 : chrom);
    for (int i = 0; i < sizeof(Chrom*); i++) {
      hash += p[i];
      hash += hash << 10;
      hash ^= hash >> 6;
    }
  }

  // hash pos
  end = (alignType == SINGLE ? 1 : 2);
  for (int j = 0; j < end; j++) {
    p = (unsigned char*) (j ? &pos1 : &pos);
    for (int i = 0; i < sizeof(uint32_t); i++) {
      hash += p[i];
      hash += hash << 10;
      hash ^= hash >> 6;
    }
  }

  // hash strand
  end = alignType;  // convenient!
  for (int j = 0; j < end; j++) {
    p = (unsigned char*) (j ? &strand1 : &strand);
    for (int i = 0; i < sizeof(bool); i++) {
      hash += p[i];
      hash += hash << 10;
      hash ^= hash >> 6;
    }
  }

  hash += hash << 3;
  hash ^= hash >> 11;
  hash += hash << 15;
  return hash % hashSize;
}

// Assembly:
movl %r8d, -0x5c(%rsp)
movl %ecx, %eax
movl -0x5c(%rsp), %ecx
movl %eax, -0x58(%rsp)
movl %edx, %eax
movl -0x58(%rsp), %edx
movl %eax, -0x54(%rsp)
movq %rsi, %rax
movl -0x54(%rsp), %esi
movq %rax, -0x50(%rsp)
movq %rdi, %r8
movq -0x50(%rsp), %rdi
movb %r9b, %al
movl 0x10(%rsp), %r9d
movl 0x8(%rsp), %r9d
movq %r8, -0x8(%rsp)
movq %rdi, -0x10(%rsp)
movl %esi, -0x14(%rsp)
movl %edx, -0x18(%rsp)
andb $0x1, %cl
movb %cl, -0x19(%rsp)
andb $0x1, %al
movb %al, -0x1a(%rsp)
movl $0x0, -0x20(%rsp)
movl 0x8(%rsp), %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x2, %edx
cmovel %ecx, %eax
movl %eax, -0x2c(%rsp)
movl $0x0, -0x30(%rsp)
movl -0x30(%rsp), %eax
cmpl -0x2c(%rsp), %eax
jge 0xf56c
cmpl $0x0, -0x30(%rsp)
je 0xf4f2
movq -0x10(%rsp), %rax
movq %rax, -0x68(%rsp)
jmp 0xf4fc
movq -0x8(%rsp), %rax
movq %rax, -0x68(%rsp)
movq -0x68(%rsp), %rax
movq %rax, -0x28(%rsp)
movl $0x0, -0x34(%rsp)
movslq -0x34(%rsp), %rax
cmpq $0x8, %rax
jae 0xf55a
movq -0x28(%rsp), %rax
movslq -0x34(%rsp), %rcx
movzbl (%rax,%rcx), %eax
addl -0x20(%rsp), %eax
movl %eax, -0x20(%rsp)
movl -0x20(%rsp), %eax
shll $0xa, %eax
addl -0x20(%rsp), %eax
movl %eax, -0x20(%rsp)
movl -0x20(%rsp), %eax
shrl $0x6, %eax
xorl -0x20(%rsp), %eax
movl %eax, -0x20(%rsp)
movl -0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rsp)
jmp 0xf50e
jmp 0xf55c
movl -0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rsp)
jmp 0xf4d1
movl 0x8(%rsp), %edx
movl $0x2, %eax
movl $0x1, %ecx
cmpl $0x1, %edx
cmovel %ecx, %eax
movl %eax, -0x2c(%rsp)
movl $0x0, -0x38(%rsp)
movl -0x38(%rsp), %eax
cmpl -0x2c(%rsp), %eax
jge 0xf629
cmpl $0x0, -0x38(%rsp)
je 0xf5ad
leaq -0x18(%rsp), %rax
movq %rax, -0x70(%rsp)
jmp 0xf5b9
leaq -0x14(%rsp), %rax
movq %rax, -0x70(%rsp)
jmp 0xf5b9
movq -0x70(%rsp), %rax
movq %rax, -0x28(%rsp)
movl $0x0, -0x3c(%rsp)
movslq -0x3c(%rsp), %rax
cmpq $0x4, %rax
jae 0xf617
movq -0x28(%rsp), %rax
movslq -0x3c(%rsp), %rcx
movzbl (%rax,%rcx), %eax
addl -0x20(%rsp), %eax
movl %eax, -0x20(%rsp)
movl -0x20(%rsp), %eax
shll $0xa, %eax
addl -0x20(%rsp), %eax
movl %eax, -0x20(%rsp)
movl -0x20(%rsp), %eax
shrl $0x6, %eax
xorl -0x20(%rsp), %eax
movl %eax, -0x20(%rsp)
movl -0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rsp)
jmp 0xf5cb
jmp 0xf619
movl -0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rsp)
jmp 0xf58c
movl 0x8(%rsp), %eax
movl %eax, -0x2c(%rsp)
movl $0x0, -0x40(%rsp)
movl -0x40(%rsp), %eax
cmpl -0x2c(%rsp), %eax
jge 0xf6d6
cmpl $0x0, -0x40(%rsp)
je 0xf65a
leaq -0x1a(%rsp), %rax
movq %rax, -0x78(%rsp)
jmp 0xf666
leaq -0x19(%rsp), %rax
movq %rax, -0x78(%rsp)
jmp 0xf666
movq -0x78(%rsp), %rax
movq %rax, -0x28(%rsp)
movl $0x0, -0x44(%rsp)
movslq -0x44(%rsp), %rax
cmpq $0x1, %rax
jae 0xf6c4
movq -0x28(%rsp), %rax
movslq -0x44(%rsp), %rcx
movzbl (%rax,%rcx), %eax
addl -0x20(%rsp), %eax
movl %eax, -0x20(%rsp)
movl -0x20(%rsp), %eax
shll $0xa, %eax
addl -0x20(%rsp), %eax
movl %eax, -0x20(%rsp)
movl -0x20(%rsp), %eax
shrl $0x6, %eax
xorl -0x20(%rsp), %eax
movl %eax, -0x20(%rsp)
movl -0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rsp)
jmp 0xf678
jmp 0xf6c6
movl -0x40(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rsp)
jmp 0xf639
movl -0x20(%rsp), %eax
shll $0x3, %eax
addl -0x20(%rsp), %eax
movl %eax, -0x20(%rsp)
movl -0x20(%rsp), %eax
shrl $0xb, %eax
xorl -0x20(%rsp), %eax
movl %eax, -0x20(%rsp)
movl -0x20(%rsp), %eax
shll $0xf, %eax
addl -0x20(%rsp), %eax
movl %eax, -0x20(%rsp)
movl -0x20(%rsp), %eax
xorl %edx, %edx
divl 0x10(%rsp)
movl %edx, %eax
retq