// File: /workspace/github_c_makefile_star2_O1/richarddurbin[P]hash10x/hash10x.c
// Function: main
int main (int argc, char *argv[])
{
  --argc ; ++argv ;		/* eat program name */

  outFile = stdout ;
  
  timeUpdate (stdout) ;		/* initialise timer */

  /* command line parameters */
  params.k = 21 ;
  params.w = 31 ;
  params.r = 17 ;
  params.B = 28 ;
  params.N = 0 ;
  params.chunkSize = 100000 ;
  params.clusterThreshold = 5 ;
#ifdef OMP
  numThreads = omp_get_max_threads () ;
  omp_set_num_threads (numThreads) ;
#endif
  
  if (!argc) usage () ;

#ifdef SIZES
  printf ("sizeof ClusterBlock is %d\n", sizeof(ClusterBlock)) ;
  printf ("sizeof ClusterHash is %d\n", sizeof(ClusterHash)) ;
  exit (0) ;
#endif

  clusterBlocks = arrayCreate (1200, ClusterBlock) ;

  FILE *f ;
  char inputBuffer[1024] ;	/* use these for interactive mode */
  char *inputArgs[32] ;
  Array inputArray = arrayCreate (1024, char) ;
  
  while (argc) {
    if (**argv != '-')
      die ("option/command %s does not start with '-': run without arguments for usage", *argv) ;
    if (!isInteractive)
      { fprintf (outFile, "COMMAND %s", *argv) ;
	int i ;
	for (i = 1 ; i < argc && *argv[i] != '-' ; ++i) fprintf (outFile, " %s", argv[i]) ;
	fputc ('\n', outFile) ;
	if (outFile != stdout)
	  { printf ("COMMAND %s", *argv) ;
	    int i ;
	    for (i = 1 ; i < argc && *argv[i] != '-' ; ++i) fprintf (outFile, " %s", argv[i]) ;
	    putchar ('\n') ;
	  }
      }
#define ARGMATCH(x,n)	(!strcmp (*argv, x) && argc >= n && (argc -= n, argv += n))
    if (ARGMATCH("-k",2)) params.k = atoi(argv[-1]) ;
    else if (ARGMATCH("-w",2)) params.w = atoi(argv[-1]) ;
    else if (ARGMATCH("-r",2)) params.r = atoi(argv[-1]) ;
    else if (ARGMATCH("-B",2)) params.B = atoi(argv[-1]) ;
    else if (ARGMATCH("-N",2)) params.N = atoi(argv[-1]) ;
    else if (ARGMATCH("-c",2)) params.chunkSize = atoi(argv[-1]) ;
    else if (ARGMATCH("-t",2) || ARGMATCH ("--threads",2))
      {
#ifdef OMP
	numThreads = atoi(argv[-1]) ;
	if (numThreads > omp_get_max_threads ()) numThreads = omp_get_max_threads () ;
	omp_set_num_threads (numThreads) ;
	fprintf (outFile, "  setting number of threads to %d\n", numThreads) ;
#else
	fprintf (stderr, "  can't set thread number - not compiled with OMP\n") ;
#endif
      }
    else if (ARGMATCH("-o",2) || ARGMATCH("--output",2))
      { if (!strcmp (argv[-1], "-"))
	  outFile = stdout ;
	else if (!(outFile = fopen (argv[-1], "w")))
	  { fprintf (stderr, "can't open output file %s\n", argv[-1]) ; outFile = stdout ; }
      }
    else if (ARGMATCH("--interactive",1)) isInteractive = TRUE ;
    else if (ARGMATCH("--tables",1)) isPrintTables = !isPrintTables ;
    else if (ARGMATCH("--verbose",1)) isVerbose = !isVerbose ;
    else if (ARGMATCH("--readFQB",2))
      { if (!(f = fopen (argv[-1], "r"))) die ("failed to open fqb file %s", argv[-1]) ;
	initialise (params.k, params.w, params.r, params.B) ;
        readFQB (f, params.N, params.chunkSize) ;
	fillHashTable () ;
      }
    else if (ARGMATCH("--readHash",2))
      { if (!(f = fopen (argv[-1], "r"))) die ("failed to open hash file %s", argv[-1]) ;
	initialise (params.k, params.w, params.r, params.B) ;
	readHashFile (f) ;
	fillHashTable () ;
      }
    else if (ARGMATCH("--writeHash",2))
      { if (!(f = fopen (argv[-1], "w"))) die ("failed to open hash file %s", argv[-1]) ;
	writeHashFile (f) ;
      }
    else if (ARGMATCH("--hashDepthRange",3))
      { hashWithinRangeBuild (atoi(argv[-2]), atoi(argv[-1])) ;
	goodHashesBuild () ;
      }
    else if (ARGMATCH("--hashInfo",4))
      hashInfo (atoi(argv[-3]), atoi(argv[-2]), atoi(argv[-1])) ;
    else if (ARGMATCH("--hashExplore",2))
      exploreHash (atoi(argv[-1])) ;
    else if (ARGMATCH("--doubleShared",3))
      doubleShared (atoi(argv[-2]), atoi(argv[-1])) ;
    else if (ARGMATCH("--codeExplore",2))
      if (goodHashes)
	codeExplore (atoi(argv[-1]), params.clusterThreshold) ;
      else
	{ fprintf (outFile, "!! you must set hashDepthRange before codeExplore\n") ;
	  if (outFile != stdout) fprintf (stderr, "!! you must set hashDepthRange before codeExplore\n") ;
	}
    else if (ARGMATCH("--cribBuild",3))
      { FILE *f1, *f2 ;
	if (!(f1 = fopen (argv[-2], "r"))) die ("failed to open .fa file %s", argv[-2]) ;
	if (!(f2 = fopen (argv[-1], "r"))) die ("failed to open .fa file %s", argv[-1]) ;
	cribBuild (f1, f2) ;
      }
    else if (ARGMATCH("-ct",2) || ARGMATCH ("--clusterThreshold",2))
      params.clusterThreshold = atoi(argv[-1]) ;
    else if (ARGMATCH("--cluster",3))
      { int code, codeMin = atoi(argv[-2]), codeMax = atoi(argv[-1]) ;
	if (!codeMin) codeMin = 1 ;
	if (!codeMax) codeMax = arrayMax(clusterBlocks) ;
	if (goodHashes)
	  {
#ifdef OMP
#pragma omp parallel for
#endif
	    for (code = codeMin ; code < codeMax ; ++code)
	      { codeClusterFind (code, params.clusterThreshold) ;
		codeClusterReadMerge (code) ;
	      }
	    fprintf (outFile, "  clustered codes %d to %d\n", codeMin, codeMax) ;
	    if (outFile != stdout) printf ("  clustered codes %d to %d\n", codeMin, codeMax) ;
	  }
      else
	{ fprintf (outFile, "!! you must set hashDepthRange before cluster\n") ;
	  if (outFile != stdout) fprintf (stderr, "!! you must set hashDepthRange before cluster\n") ;
	}
      }
    else if (ARGMATCH("--clusterReport",3))
      { int code, codeMin = atoi(argv[-2]), codeMax = atoi(argv[-1]) ;
	if (!codeMax) codeMax = arrayMax(clusterBlocks) ;
	codeClusterReport (codeMin, codeMax) ;
      }
    else if (ARGMATCH("--clusterSplit",1)) clusterSplitCodes () ;
    else if (ARGMATCH("--hashStats",1)) hashDepthHist () ;
    else if (ARGMATCH("--codeStats",1)) codeSizeHist () ;
    else if (ARGMATCH("--cribSummary",1)) cribSummary () ;
    else if (ARGMATCH("--errorFix",3)) errorFix (atoi(argv[-2]), atoi(argv[-1])) ;
    else if (ARGMATCH("--shareScan",3)) shareScan (atoi(argv[-2]), atoi(argv[-1])) ;
    else if (ARGMATCH("--help",1)) usage () ;
    else if (ARGMATCH("--quit",1) || ARGMATCH("--exit",1)) break ; /* end loop */
    else
      if (isInteractive) fprintf (stderr, "  unknown option/command %s", (*argv)+2) ;
      else die ("unknown option/command %s; run without arguments for usage", *argv) ;

    printf ("  ") ; timeUpdate (stdout) ; fflush (stdout) ;
    
    if (isInteractive)		/* get an input line from stdin and convert to *argv */
      { if (argc) fprintf (stderr, "INPUT ERROR - ignoring arguments starting %s\n", *argv) ;
	char c ;
	printf ("> ") ; fflush (stdout) ;
	while ((c = getchar())) if (!isspace (c) || c == '\n') break ; /* remove leading space */
	if (c == '\n') { argc = 1 ; argv = inputArgs ; *argv = "--help" ; continue ; }
	arr(inputArray,0,char) = '-' ; arr(inputArray,1,char) = '-' ; arrayMax(inputArray) = 2 ;
	while (c != '\n' && c != EOF)
	  { for ( ; isgraph(c) ; c = getchar ())
	      array(inputArray, arrayMax(inputArray), char) = c ;
	    array(inputArray, arrayMax(inputArray), char) = 0 ; /* string terminator */
	    while (isspace (c) && c != '\n') c = getchar() ;	/* eat whitespace separator */
	  }
	if (c == EOF) break ;	       /* end of file or error - exit program */
	argv = inputArgs ; argc = 0 ; int i = 0 ;
	while (i < arrayMax(inputArray))
	  { argv[argc++] = arrp(inputArray,i,char) ;
	    while (*arrp(inputArray,i++,char)) ;
	  }
      }
  }

  fprintf (outFile, "total resources used: ") ; timeTotal (outFile) ;
  if (outFile != stdout) { printf ("total resources used: ") ; timeTotal (stdout) ; }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %r15
movl %edi, %ebx
movq 0x9c41(%rip), %rbp      # 0xefc8
movq (%rbp), %rdi
movq %rdi, 0xaffe(%rip)      # 0x10390
callq 0x96ed
movaps 0x4c92(%rip), %xmm0     # 0xa030
movups %xmm0, 0xb083(%rip)     # 0x10428
movabsq $0x186a000000000, %rax  # imm = 0x186A000000000
movq %rax, 0xb082(%rip)      # 0x10438
movl $0x5, 0xb080(%rip)      # 0x10440
decl %ebx
je 0x60bd
movl $0x4b0, %edi            # imm = 0x4B0
movl $0x20, %esi
callq 0x8c70
movq %rax, 0xafaa(%rip)      # 0x10388
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x8c70
testl %ebx, %ebx
je 0x605c
movq %rax, %r14
addq $0x8, %r15
leaq 0x532f(%rip), %r12      # 0xa732
movq (%r15), %rsi
cmpb $0x2d, (%rsi)
je 0x5419
leaq 0x5dc9(%rip), %rdi      # 0xb1db
xorl %eax, %eax
callq 0x9408
cmpb $0x0, 0xaf52(%rip)      # 0x10372
jne 0x54e3
movq 0xaf63(%rip), %rdi      # 0x10390
movq (%r15), %rdx
leaq 0x5def(%rip), %rsi      # 0xb226
xorl %eax, %eax
callq 0x1150
cmpl $0x2, %ebx
jl 0x546d
movl %ebx, %r13d
movl $0x1, %ebp
movq (%r15,%rbp,8), %rdx
cmpb $0x2d, (%rdx)
je 0x546d
movq 0xaf35(%rip), %rdi      # 0x10390
movq %r12, %rsi
xorl %eax, %eax
callq 0x1150
incq %rbp
cmpq %rbp, %r13
jne 0x544b
movq 0xaf1c(%rip), %rsi      # 0x10390
movl $0xa, %edi
callq 0x1100
movq 0xaf0b(%rip), %rax      # 0x10390
movq 0x9b3c(%rip), %rbp      # 0xefc8
cmpq (%rbp), %rax
je 0x54e3
movq (%r15), %rsi
leaq 0x5d8a(%rip), %rdi      # 0xb226
xorl %eax, %eax
callq 0x10d0
cmpl $0x2, %ebx
jl 0x54d2
movl %ebx, %r13d
movl $0x1, %ebp
movq (%r15,%rbp,8), %rdx
cmpb $0x2d, (%rdx)
je 0x54d2
movq 0xaed0(%rip), %rdi      # 0x10390
movq %r12, %rsi
xorl %eax, %eax
callq 0x1150
incq %rbp
cmpq %rbp, %r13
jne 0x54b0
movl $0xa, %edi
callq 0x1050
movq 0x9ae5(%rip), %rbp      # 0xefc8
movq (%r15), %r13
movq %r13, %rdi
leaq 0x5d41(%rip), %rsi      # 0xb231
callq 0x1130
cmpl $0x2, %ebx
jl 0x5519
testl %eax, %eax
jne 0x5519
addl $-0x2, %ebx
movq 0x8(%r15), %rdi
addq $0x10, %r15
callq 0x1210
movl %eax, 0xaf14(%rip)      # 0x10428
jmp 0x5615
movq %r13, %rdi
leaq 0x5d11(%rip), %rsi      # 0xb234
callq 0x1130
cmpl $0x2, %ebx
jl 0x554c
testl %eax, %eax
jne 0x554c
addl $-0x2, %ebx
movq 0x8(%r15), %rdi
addq $0x10, %r15
callq 0x1210
movl %eax, 0xaee5(%rip)      # 0x1042c
jmp 0x5615
movq %r13, %rdi
leaq 0x5ce1(%rip), %rsi      # 0xb237
callq 0x1130
cmpl $0x2, %ebx
jl 0x557f
testl %eax, %eax
jne 0x557f
addl $-0x2, %ebx
movq 0x8(%r15), %rdi
addq $0x10, %r15
callq 0x1210
movl %eax, 0xaeb6(%rip)      # 0x10430
jmp 0x5615
movq %r13, %rdi
leaq 0x5cb1(%rip), %rsi      # 0xb23a
callq 0x1130
cmpl $0x2, %ebx
jl 0x55af
testl %eax, %eax
jne 0x55af
addl $-0x2, %ebx
movq 0x8(%r15), %rdi
addq $0x10, %r15
callq 0x1210
movl %eax, 0xae87(%rip)      # 0x10434
jmp 0x5615
movq %r13, %rdi
leaq 0x5c84(%rip), %rsi      # 0xb23d
callq 0x1130
cmpl $0x2, %ebx
jl 0x55df
testl %eax, %eax
jne 0x55df
addl $-0x2, %ebx
movq 0x8(%r15), %rdi
addq $0x10, %r15
callq 0x1210
movl %eax, 0xae5b(%rip)      # 0x10438
jmp 0x5615
movq %r13, %rdi
leaq 0x5c57(%rip), %rsi      # 0xb240
callq 0x1130
cmpl $0x2, %ebx
jl 0x57f3
testl %eax, %eax
jne 0x57f3
addl $-0x2, %ebx
movq 0x8(%r15), %rdi
addq $0x10, %r15
callq 0x1210
movl %eax, 0xae27(%rip)      # 0x1043c
movq %r15, %r13
leaq 0x5233(%rip), %rdi      # 0xa852
xorl %eax, %eax
callq 0x10d0
movq (%rbp), %rdi
callq 0x96ed
movq (%rbp), %rdi
callq 0x11a0
cmpb $0x0, 0xad33(%rip)      # 0x10372
je 0x57d6
testl %ebx, %ebx
jne 0x57e6
leaq 0x5ed4(%rip), %rdi      # 0xb528
xorl %eax, %eax
callq 0x10d0
movq (%rbp), %rdi
callq 0x11a0
callq 0x1140
movl %eax, %r15d
testb %r15b, %r15b
je 0x5696
callq 0x1270
movl %r15d, %ecx
shll $0x18, %ecx
cmpl $0xa000000, %ecx        # imm = 0xA000000
je 0x5696
movq (%rax), %rax
movsbq %r15b, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
jne 0x5664
cmpb $0xa, %r15b
jne 0x56b2
leaq 0x5deb(%rip), %rax      # 0xb48e
movq %rax, 0x10(%rsp)
movl $0x1, %ebx
jmp 0x57b1
movq 0x8(%r14), %rax
movb $0x2d, %dl
movb %dl, (%rax)
movq 0x8(%r14), %rax
movslq 0x14(%r14), %rcx
movb %dl, (%rax,%rcx)
movl $0x2, 0x18(%r14)
cmpb $-0x1, %r15b
je 0x57ba
movzbl %r15b, %eax
cmpl $0xa, %eax
je 0x576c
callq 0x1270
movq %rax, %rbp
movq (%rax), %rax
movsbq %r15b, %rcx
cmpw $0x0, (%rax,%rcx,2)
jns 0x5717
movl 0x18(%r14), %esi
movq %r14, %rdi
callq 0x8f2b
movb %r15b, (%rax)
callq 0x1140
movl %eax, %r15d
movq (%rbp), %rax
jmp 0x56ef
movl 0x18(%r14), %esi
movq %r14, %rdi
callq 0x8f2b
movb $0x0, (%rax)
cmpb $0xa, %r15b
je 0x56cd
movq (%rbp), %rax
movsbq %r15b, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
je 0x56cd
callq 0x1140
movl %eax, %r15d
movq (%rbp), %rax
movsbq %r15b, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpb $0xa, %r15b
je 0x56cd
testw %ax, %ax
jne 0x573f
jmp 0x56cd
movl 0x18(%r14), %eax
testl %eax, %eax
jle 0x57be
movslq 0x14(%r14), %rcx
xorl %ebx, %ebx
xorl %edx, %edx
movq 0x9845(%rip), %rbp      # 0xefc8
movl %ecx, %esi
imull %edx, %esi
movslq %esi, %rsi
addq 0x8(%r14), %rsi
movq %rsi, 0x10(%rsp,%rbx,8)
movslq %edx, %rsi
imulq %rcx, %rsi
addq 0x8(%r14), %rsi
incl %edx
cmpb $0x0, (%rsi)
leaq (%rsi,%rcx), %rsi
jne 0x579f
incq %rbx
cmpl %edx, %eax
jg 0x5783
xorl %eax, %eax
leaq 0x10(%rsp), %r13
jmp 0x57ce
movb $0x1, %al
jmp 0x57c7
xorl %ebx, %ebx
leaq 0x10(%rsp), %r13
xorl %eax, %eax
movq 0x97fa(%rip), %rbp      # 0xefc8
testb %al, %al
jne 0x605c
movq %r13, %r15
testl %ebx, %ebx
jne 0x5403
jmp 0x605c
movq %r13, %rdi
callq 0x19c3
jmp 0x564d
movq %r13, %rdi
leaq 0x5a46(%rip), %rsi      # 0xb243
callq 0x1130
cmpl $0x2, %ebx
jl 0x580f
testl %eax, %eax
je 0x58e4
movq %r13, %rdi
leaq 0x5a2d(%rip), %rsi      # 0xb246
callq 0x1130
cmpl $0x2, %ebx
jl 0x582b
testl %eax, %eax
je 0x58e4
movq %r13, %rdi
leaq 0x5a4e(%rip), %rsi      # 0xb283
callq 0x1130
cmpl $0x2, %ebx
jl 0x5843
testl %eax, %eax
je 0x585b
movq %r13, %rdi
leaq 0x5a39(%rip), %rsi      # 0xb286
callq 0x1130
cmpl $0x2, %ebx
jl 0x58bb
testl %eax, %eax
jne 0x58bb
addl $-0x2, %ebx
leaq 0x10(%r15), %r13
movq 0x8(%r15), %rbp
movq %rbp, %rdi
leaq 0x5a1f(%rip), %rsi      # 0xb28f
callq 0x1130
testl %eax, %eax
je 0x58a4
movq %rbp, %rdi
leaq 0x59b2(%rip), %rsi      # 0xb235
callq 0x11e0
movq %rax, 0xab01(%rip)      # 0x10390
testq %rax, %rax
je 0x59ec
movq 0x9729(%rip), %rbp      # 0xefc8
jmp 0x5618
movq 0x971d(%rip), %rbp      # 0xefc8
movq (%rbp), %rax
movq %rax, 0xaada(%rip)      # 0x10390
jmp 0x5618
movq %r13, %rdi
leaq 0x59e7(%rip), %rsi      # 0xb2ac
callq 0x1130
testl %ebx, %ebx
jle 0x5910
testl %eax, %eax
jne 0x5910
addq $0x8, %r15
decl %ebx
movb $0x1, 0xaa93(%rip)      # 0x10372
jmp 0x5615
addl $-0x2, %ebx
addq $0x10, %r15
movq 0x96fe(%rip), %rax      # 0xeff0
movq (%rax), %rcx
movl $0x32, %esi
movl $0x1, %edx
leaq 0x594a(%rip), %rdi      # 0xb250
callq 0x1250
jmp 0x5615
movq %r13, %rdi
leaq 0x59a0(%rip), %rsi      # 0xb2ba
callq 0x1130
testl %ebx, %ebx
jle 0x5940
testl %eax, %eax
jne 0x5940
addq $0x8, %r15
decl %ebx
cmpb $0x0, 0xaa3c(%rip)      # 0x10370
sete 0xaa35(%rip)            # 0x10370
jmp 0x5615
movq %r13, %rdi
leaq 0x5979(%rip), %rsi      # 0xb2c3
callq 0x1130
testl %ebx, %ebx
jle 0x5970
testl %eax, %eax
jne 0x5970
addq $0x8, %r15
decl %ebx
cmpb $0x0, 0xaa0d(%rip)      # 0x10371
sete 0xaa06(%rip)            # 0x10371
jmp 0x5615
movq %r13, %rdi
leaq 0x5953(%rip), %rsi      # 0xb2cd
callq 0x1130
cmpl $0x2, %ebx
jl 0x59fd
testl %eax, %eax
jne 0x59fd
movq 0x8(%r15), %rdi
leaq 0x58a5(%rip), %rsi      # 0xb238
callq 0x11e0
movq %rax, %r13
testq %rax, %rax
jne 0x59b2
movq 0x8(%r15), %rsi
leaq 0x592c(%rip), %rdi      # 0xb2d7
xorl %eax, %eax
callq 0x9408
addl $-0x2, %ebx
addq $0x10, %r15
movl 0xaa69(%rip), %edi      # 0x10428
movl 0xaa67(%rip), %esi      # 0x1042c
movl 0xaa65(%rip), %edx      # 0x10430
movl 0xaa63(%rip), %ecx      # 0x10434
callq 0x5266
movl 0xaa5c(%rip), %esi      # 0x10438
movl 0xaa5a(%rip), %edx      # 0x1043c
movq %r13, %rdi
callq 0x2066
jmp 0x5a6b
addq $0x8, %r15
movq %r15, %rdi
callq 0x198e
jmp 0x5898
movq %r13, %rdi
leaq 0x58eb(%rip), %rsi      # 0xb2f2
callq 0x1130
cmpl $0x2, %ebx
jl 0x5a75
testl %eax, %eax
jne 0x5a75
movq 0x8(%r15), %rdi
leaq 0x5818(%rip), %rsi      # 0xb238
callq 0x11e0
movq %rax, %r13
testq %rax, %rax
jne 0x5a3f
movq 0x8(%r15), %rsi
leaq 0x58c5(%rip), %rdi      # 0xb2fd
xorl %eax, %eax
callq 0x9408
addl $-0x2, %ebx
addq $0x10, %r15
movl 0xa9dc(%rip), %edi      # 0x10428
movl 0xa9da(%rip), %esi      # 0x1042c
movl 0xa9d8(%rip), %edx      # 0x10430
movl 0xa9d6(%rip), %ecx      # 0x10434
callq 0x5266
movq %r13, %rdi
callq 0x25ce
callq 0x296d
jmp 0x5615
movq %r13, %rdi
leaq 0x589a(%rip), %rsi      # 0xb319
callq 0x1130
cmpl $0x2, %ebx
jl 0x5acb
testl %eax, %eax
jne 0x5acb
movq 0x8(%r15), %rdi
leaq 0x579d(%rip), %rsi      # 0xb235
callq 0x11e0
movq %rax, %r13
testq %rax, %rax
jne 0x5ab7
movq 0x8(%r15), %rsi
leaq 0x584d(%rip), %rdi      # 0xb2fd
xorl %eax, %eax
callq 0x9408
addl $-0x2, %ebx
addq $0x10, %r15
movq %r13, %rdi
callq 0x2374
jmp 0x5615
movq %r13, %rdi
leaq 0x5850(%rip), %rsi      # 0xb325
callq 0x1130
cmpl $0x3, %ebx
jl 0x5b18
testl %eax, %eax
jne 0x5b18
leaq 0x18(%r15), %r13
addl $-0x3, %ebx
movq 0x8(%r15), %rdi
callq 0x1210
movl %eax, %ebp
movq 0x10(%r15), %rdi
callq 0x1210
movl %ebp, %edi
movq 0x94c1(%rip), %rbp      # 0xefc8
movl %eax, %esi
callq 0x360e
callq 0x432b
jmp 0x5618
movq %r13, %rdi
leaq 0x5814(%rip), %rsi      # 0xb336
callq 0x1130
cmpl $0x4, %ebx
jl 0x5b71
testl %eax, %eax
jne 0x5b71
leaq 0x20(%r15), %r13
addl $-0x4, %ebx
movq 0x8(%r15), %rdi
callq 0x1210
movl %eax, 0xc(%rsp)
movq 0x10(%r15), %rdi
callq 0x1210
movl %eax, %ebp
movq 0x18(%r15), %rdi
callq 0x1210
movl 0xc(%rsp), %edi
movl %ebp, %esi
movq 0x9463(%rip), %rbp      # 0xefc8
movl %eax, %edx
callq 0x3c87
jmp 0x5618
movq %r13, %rdi
leaq 0x57c6(%rip), %rsi      # 0xb341
callq 0x1130
cmpl $0x2, %ebx
jl 0x5ba5
testl %eax, %eax
jne 0x5ba5
addl $-0x2, %ebx
movq 0x8(%r15), %rdi
addq $0x10, %r15
callq 0x1210
movl %eax, %edi
callq 0x39a7
jmp 0x5615
movq %r13, %rdi
leaq 0x57a0(%rip), %rsi      # 0xb34f
callq 0x1130
cmpl $0x3, %ebx
jl 0x5be6
testl %eax, %eax
jne 0x5be6
leaq 0x18(%r15), %r13
addl $-0x3, %ebx
movq 0x8(%r15), %rdi
callq 0x1210
movl %eax, %ebp
movq 0x10(%r15), %rdi
callq 0x1210
movl %ebp, %edi
movl %eax, %esi
callq 0x3b32
jmp 0x5898
movq %r13, %rdi
leaq 0x576e(%rip), %rsi      # 0xb35e
callq 0x1130
cmpl $0x2, %ebx
jl 0x5c2e
testl %eax, %eax
jne 0x5c2e
addl $-0x2, %ebx
leaq 0x10(%r15), %r13
cmpq $0x0, 0xa803(%rip)      # 0x10410
je 0x5cfc
movq 0x8(%r15), %rdi
callq 0x1210
movl 0xa81e(%rip), %esi      # 0x10440
movl %eax, %edi
callq 0x60c7
jmp 0x5898
movq %r13, %rdi
leaq 0x5767(%rip), %rsi      # 0xb39f
callq 0x1130
cmpl $0x3, %ebx
jl 0x5cae
testl %eax, %eax
jne 0x5cae
movq 0x8(%r15), %rdi
leaq 0x55e7(%rip), %rsi      # 0xb238
callq 0x11e0
movq %rax, %r13
testq %rax, %rax
jne 0x5c70
movq 0x8(%r15), %rsi
leaq 0x5742(%rip), %rdi      # 0xb3ab
xorl %eax, %eax
callq 0x9408
movq 0x10(%r15), %rdi
leaq 0x55bd(%rip), %rsi      # 0xb238
callq 0x11e0
movq %rax, %rbp
testq %rax, %rax
jne 0x5c9a
movq 0x10(%r15), %rsi
leaq 0x5718(%rip), %rdi      # 0xb3ab
xorl %eax, %eax
callq 0x9408
addl $-0x3, %ebx
addq $0x18, %r15
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2f6a
jmp 0x5cf4
movq %r13, %rdi
leaq 0x570e(%rip), %rsi      # 0xb3c6
callq 0x1130
cmpl $0x2, %ebx
jl 0x5cc6
testl %eax, %eax
je 0x5cde
movq %r13, %rdi
leaq 0x56fa(%rip), %rsi      # 0xb3ca
callq 0x1130
cmpl $0x2, %ebx
jl 0x5d3a
testl %eax, %eax
jne 0x5d3a
addl $-0x2, %ebx
movq 0x8(%r15), %rdi
addq $0x10, %r15
callq 0x1210
movl %eax, 0xa74c(%rip)      # 0x10440
movq %r15, %r13
jmp 0x5898
movq 0xa68d(%rip), %rcx      # 0x10390
movl $0x32, %esi
movl $0x1, %edx
leaq 0x5658(%rip), %rdi      # 0xb36c
callq 0x1250
movq 0xa670(%rip), %rax      # 0x10390
movq 0x92a1(%rip), %rcx      # 0xefc8
cmpq (%rcx), %rax
je 0x5898
callq 0x1972
jmp 0x5898
movq %r13, %rdi
leaq 0x5699(%rip), %rsi      # 0xb3dd
callq 0x1130
cmpl $0x3, %ebx
jl 0x5e12
testl %eax, %eax
jne 0x5e12
movq 0x8(%r15), %rdi
callq 0x1210
movl %eax, %ebp
movq 0x10(%r15), %rdi
callq 0x1210
movl %eax, %r13d
cmpl $0x1, %ebp
adcl $0x0, %ebp
movl %ebp, 0xc(%rsp)
testl %eax, %eax
jne 0x5d8a
movq 0xa602(%rip), %rax      # 0x10388
movl 0x18(%rax), %r13d
addl $-0x3, %ebx
addq $0x18, %r15
cmpq $0x0, 0xa677(%rip)      # 0x10410
je 0x5e88
cmpl %r13d, 0xc(%rsp)
jge 0x5dc5
movl 0xc(%rsp), %ebp
movl 0xa690(%rip), %esi      # 0x10440
movl %ebp, %edi
callq 0x44d6
movl %ebp, %edi
callq 0x4874
incl %ebp
cmpl %ebp, %r13d
jne 0x5daa
movq 0xa5c4(%rip), %rdi      # 0x10390
leaq 0x5614(%rip), %rsi      # 0xb3e7
movl 0xc(%rsp), %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x1150
movq 0xa5a8(%rip), %rax      # 0x10390
movq 0x91d9(%rip), %rcx      # 0xefc8
cmpq (%rcx), %rax
je 0x5cf4
leaq 0x55e8(%rip), %rdi      # 0xb3e7
movl 0xc(%rsp), %esi
movl %r13d, %edx
xorl %eax, %eax
callq 0x10d0
jmp 0x5cf4
movq %r13, %rdi
leaq 0x5616(%rip), %rsi      # 0xb432
callq 0x1130
cmpl $0x3, %ebx
jl 0x5e61
testl %eax, %eax
jne 0x5e61
movq 0x8(%r15), %rdi
callq 0x1210
movl %eax, %ebp
movq 0x10(%r15), %rdi
callq 0x1210
testl %eax, %eax
jne 0x5e4c
movq 0xa53f(%rip), %rax      # 0x10388
movl 0x18(%rax), %eax
addl $-0x3, %ebx
addq $0x18, %r15
movl %ebp, %edi
movl %eax, %esi
callq 0x4a44
jmp 0x5cf4
movq %r13, %rdi
leaq 0x55d7(%rip), %rsi      # 0xb442
callq 0x1130
testl %ebx, %ebx
jle 0x5ec6
testl %eax, %eax
jne 0x5ec6
addq $0x8, %r15
decl %ebx
callq 0x4eb9
jmp 0x5cf4
movq 0xa501(%rip), %rcx      # 0x10390
movl $0x2e, %esi
movl $0x1, %edx
leaq 0x5563(%rip), %rdi      # 0xb403
callq 0x1250
movq 0xa4e4(%rip), %rax      # 0x10390
movq 0x9115(%rip), %rcx      # 0xefc8
cmpq (%rcx), %rax
je 0x5cf4
callq 0x1956
jmp 0x5cf4
movq %r13, %rdi
leaq 0x5581(%rip), %rsi      # 0xb451
callq 0x1130
testl %ebx, %ebx
jle 0x5eed
testl %eax, %eax
jne 0x5eed
addq $0x8, %r15
decl %ebx
callq 0x2da1
jmp 0x5cf4
movq %r13, %rdi
leaq 0x5566(%rip), %rsi      # 0xb45d
callq 0x1130
testl %ebx, %ebx
jle 0x5f14
testl %eax, %eax
jne 0x5f14
addq $0x8, %r15
decl %ebx
callq 0x2e2b
jmp 0x5cf4
movq %r13, %rdi
leaq 0x554b(%rip), %rsi      # 0xb469
callq 0x1130
testl %ebx, %ebx
jle 0x5f3b
testl %eax, %eax
jne 0x5f3b
addq $0x8, %r15
decl %ebx
callq 0x524d
jmp 0x5cf4
movq %r13, %rdi
leaq 0x5532(%rip), %rsi      # 0xb477
callq 0x1130
cmpl $0x3, %ebx
jl 0x5f7c
testl %eax, %eax
jne 0x5f7c
leaq 0x18(%r15), %r13
addl $-0x3, %ebx
movq 0x8(%r15), %rdi
callq 0x1210
movl %eax, %ebp
movq 0x10(%r15), %rdi
callq 0x1210
movl %ebp, %edi
movl %eax, %esi
callq 0x3d88
jmp 0x5898
movq %r13, %rdi
leaq 0x54fc(%rip), %rsi      # 0xb482
callq 0x1130
cmpl $0x3, %ebx
jl 0x5fbd
testl %eax, %eax
jne 0x5fbd
leaq 0x18(%r15), %r13
addl $-0x3, %ebx
movq 0x8(%r15), %rdi
callq 0x1210
movl %eax, %ebp
movq 0x10(%r15), %rdi
callq 0x1210
movl %ebp, %edi
movl %eax, %esi
callq 0x409f
jmp 0x5898
movq %r13, %rdi
leaq 0x54c7(%rip), %rsi      # 0xb48e
callq 0x1130
testl %ebx, %ebx
jle 0x5fd4
testl %eax, %eax
je 0x6028
movq %r13, %rdi
leaq 0x54b7(%rip), %rsi      # 0xb495
callq 0x1130
testl %ebx, %ebx
movq 0x8fdc(%rip), %rbp      # 0xefc8
jle 0x5ff2
testl %eax, %eax
je 0x605c
movq %r13, %rdi
leaq 0x54a0(%rip), %rsi      # 0xb49c
callq 0x1130
testl %ebx, %ebx
jle 0x6009
testl %eax, %eax
je 0x605c
cmpb $0x0, 0xa362(%rip)      # 0x10372
jne 0x6038
leaq 0x54a6(%rip), %rdi      # 0xb4bf
movq %r13, %rsi
xorl %eax, %eax
callq 0x9408
jmp 0x5cf4
addq $0x8, %r15
decl %ebx
callq 0x1290
jmp 0x5cf4
movq 0x8fb1(%rip), %rax      # 0xeff0
movq (%rax), %rdi
addq $0x2, %r13
leaq 0x5456(%rip), %rsi      # 0xb4a3
movq %r13, %rdx
xorl %eax, %eax
callq 0x1150
jmp 0x5cf4
movq 0xa32d(%rip), %rcx      # 0x10390
leaq 0x54c1(%rip), %rdi      # 0xb52b
movl $0x16, %esi
movl $0x1, %edx
callq 0x1250
movq 0xa310(%rip), %rdi      # 0x10390
callq 0x9808
movq 0xa304(%rip), %rax      # 0x10390
cmpq (%rbp), %rax
je 0x60a9
leaq 0x5492(%rip), %rdi      # 0xb52b
xorl %eax, %eax
callq 0x10d0
movq (%rbp), %rdi
callq 0x9808
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1290
jmp 0x53c8