// File: /workspace/github_c_makefile_star2_O0/richarddurbin[P]hash10x/fq2b.c
// Function: read10xWhitelist
void read10xWhitelist (char *fileName)
{ FILE *f = fopen (fileName, "r") ;
  if (!f) die ("failed to open 10x whitelist file %s\n", fileName) ;
  char s[32] ;
  U32 u ; 
  int i,j,n = 0 ;

  if (!(table = calloc ((size_t)1<<32, 1))) die ("can't allocate barcode table") ;
  for (i = 0 ; i < 16 ; ++i)
    for (j = 0 ; j < 4 ; ++j)
      { mask[i*4 + j] = ~(3 << (2*i)) ; bits[i*4 + j] = j << (2*i) ; }
  
  while (!feof (f) && fscanf (f, "%s\n", s))
    { ++n ;
      if (strlen(s) != 16) die ("bad barcode line % in %s: %s", n, fileName, s) ;
      seqPack (s, &u, 16) ;
      for (i = 0 ; i < 16 ; ++i)
	{ U8 ui = 1 + i*4 + ((u >> (2*i)) & 0x3) ; /* code to reset i'th base to u[i] */
	  for (j = 0 ; j < 4 ; ++j) table[switchBase(u,1+i*4+j)] = ui ;
	}
    }
  fclose (f) ;
  fprintf (stderr, "read %d barcodes from file %s\n", n, fileName) ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x3a35(%rip), %rsi      # 0x506c
callq 0x1190
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x1659
movq -0x8(%rbp), %rsi
leaq 0x3a1c(%rip), %rdi      # 0x506e
movb $0x0, %al
callq 0x4700
movl $0x0, -0x40(%rbp)
movabsq $0x100000000, %rdi      # imm = 0x100000000
movl $0x1, %esi
callq 0x10f0
movq %rax, 0x730d(%rip)      # 0x8988
cmpq $0x0, %rax
jne 0x168f
leaq 0x3a0c(%rip), %rdi      # 0x5094
movb $0x0, %al
callq 0x4700
movl $0x0, -0x38(%rbp)
cmpl $0x10, -0x38(%rbp)
jge 0x1706
movl $0x0, -0x3c(%rbp)
cmpl $0x4, -0x3c(%rbp)
jge 0x16f9
movl -0x38(%rbp), %ecx
shll %ecx
movl $0x3, %edx
shll %cl, %edx
xorl $-0x1, %edx
movl -0x38(%rbp), %eax
shll $0x2, %eax
addl -0x3c(%rbp), %eax
movslq %eax, %rcx
leaq 0x72c5(%rip), %rax      # 0x8990
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %edx
movl -0x38(%rbp), %ecx
shll %ecx
shll %cl, %edx
movl -0x38(%rbp), %eax
shll $0x2, %eax
addl -0x3c(%rbp), %eax
movslq %eax, %rcx
leaq 0x73a5(%rip), %rax      # 0x8a90
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x16a3
jmp 0x16fb
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x1696
jmp 0x1708
movq -0x10(%rbp), %rdi
callq 0x1130
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x42(%rbp)
jne 0x173c
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rdx
leaq 0x39bd(%rip), %rsi      # 0x50e9
movb $0x0, %al
callq 0x1050
cmpl $0x0, %eax
setne %al
movb %al, -0x42(%rbp)
movb -0x42(%rbp), %al
testb $0x1, %al
jne 0x1748
jmp 0x1812
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x1090
cmpq $0x10, %rax
je 0x1779
movl -0x40(%rbp), %esi
movq -0x8(%rbp), %rdx
leaq -0x30(%rbp), %rcx
leaq 0x393f(%rip), %rdi      # 0x50b1
movb $0x0, %al
callq 0x4700
leaq -0x30(%rbp), %rdi
leaq -0x34(%rbp), %rsi
movl $0x10, %edx
callq 0x13a0
movl $0x0, -0x38(%rbp)
cmpl $0x10, -0x38(%rbp)
jge 0x180d
movl -0x38(%rbp), %eax
shll $0x2, %eax
addl $0x1, %eax
movl -0x34(%rbp), %edx
movl -0x38(%rbp), %ecx
shll %ecx
shrl %cl, %edx
movl %edx, %ecx
andl $0x3, %ecx
addl %ecx, %eax
movb %al, -0x41(%rbp)
movl $0x0, -0x3c(%rbp)
cmpl $0x4, -0x3c(%rbp)
jge 0x1800
movb -0x41(%rbp), %al
movb %al, -0x51(%rbp)
movq 0x71b9(%rip), %rax      # 0x8988
movq %rax, -0x50(%rbp)
movl -0x34(%rbp), %edi
movl -0x38(%rbp), %esi
shll $0x2, %esi
addl $0x1, %esi
addl -0x3c(%rbp), %esi
callq 0x1840
movb -0x51(%rbp), %dl
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x17bc
jmp 0x1802
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x1792
jmp 0x1708
movq -0x10(%rbp), %rdi
callq 0x1080
movq 0x67d6(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
movl -0x40(%rbp), %edx
movq -0x8(%rbp), %rcx
leaq 0x389b(%rip), %rsi      # 0x50ce
movb $0x0, %al
callq 0x1120
addq $0x60, %rsp
popq %rbp
retq