// File: /workspace/github_c_makefile_star2_O0/fukunagatsu[P]RIblast/sais.c
// Function: sais_main
static
sais_index_type
sais_main(const void *T, sais_index_type *SA,
          sais_index_type fs, sais_index_type n, sais_index_type k, int cs,
          sais_bool_type isbwt) {
  sais_index_type *C, *B, *D, *RA, *b;
  sais_index_type i, j, m, p, q, t, name, pidx = 0, newfs;
  sais_index_type c0, c1;
  unsigned int flags;

  assert((T != NULL) && (SA != NULL));
  assert((0 <= fs) && (0 < n) && (1 <= k));

  if(k <= MINBUCKETSIZE) {
    if((C = SAIS_MYMALLOC(k, sais_index_type)) == NULL) { return -2; }
    if(k <= fs) {
      B = SA + (n + fs - k);
      flags = 1;
    } else {
      if((B = SAIS_MYMALLOC(k, sais_index_type)) == NULL) { SAIS_MYFREE(C, k, sais_index_type); return -2; }
      flags = 3;
    }
  } else if(k <= fs) {
    C = SA + (n + fs - k);
    if(k <= (fs - k)) {
      B = C - k;
      flags = 0;
    } else if(k <= (MINBUCKETSIZE * 4)) {
      if((B = SAIS_MYMALLOC(k, sais_index_type)) == NULL) { return -2; }
      flags = 2;
    } else {
      B = C;
      flags = 8;
    }
  } else {
    if((C = B = SAIS_MYMALLOC(k, sais_index_type)) == NULL) { return -2; }
    flags = 4 | 8;
  }
  if((n <= SAIS_LMSSORT2_LIMIT) && (2 <= (n / k))) {
    if(flags & 1) { flags |= ((k * 2) <= (fs - k)) ? 32 : 16; }
    else if((flags == 0) && ((k * 2) <= (fs - k * 2))) { flags |= 32; }
  }

  /* stage 1: reduce the problem by at least 1/2
     sort all the LMS-substrings */
  getCounts(T, C, n, k, cs); getBuckets(C, B, k, 1); /* find ends of buckets */
  for(i = 0; i < n; ++i) { SA[i] = 0; }
  b = &t; i = n - 1; j = n; m = 0; c0 = chr(n - 1);
  do { c1 = c0; } while((0 <= --i) && ((c0 = chr(i)) >= c1));
  for(; 0 <= i;) {
    do { c1 = c0; } while((0 <= --i) && ((c0 = chr(i)) <= c1));
    if(0 <= i) {
      *b = j; b = SA + --B[c1]; j = i; ++m;
      do { c1 = c0; } while((0 <= --i) && ((c0 = chr(i)) >= c1));
    }
  }

  if(1 < m) {
    if(flags & (16 | 32)) {
      if(flags & 16) {
        if((D = SAIS_MYMALLOC(k * 2, sais_index_type)) == NULL) {
          if(flags & (1 | 4)) { SAIS_MYFREE(C, k, sais_index_type); }
          if(flags & 2) { SAIS_MYFREE(B, k, sais_index_type); }
          return -2;
        }
      } else {
        D = B - k * 2;
      }
      assert((j + 1) < n);
      ++B[chr(j + 1)];
      for(i = 0, j = 0; i < k; ++i) {
        j += C[i];
        if(B[i] != j) { assert(SA[B[i]] != 0); SA[B[i]] += n; }
        D[i] = D[i + k] = 0;
      }
      LMSsort2(T, SA, C, B, D, n, k, cs);
      name = LMSpostproc2(SA, n, m);
      if(flags & 16) { SAIS_MYFREE(D, k * 2, sais_index_type); }
    } else {
      LMSsort1(T, SA, C, B, n, k, cs);
      name = LMSpostproc1(T, SA, n, m, cs);
    }
  } else if(m == 1) {
    *b = j + 1;
    name = 1;
  } else {
    name = 0;
  }

  /* stage 2: solve the reduced problem
     recurse if names are not yet unique */
  if(name < m) {
    if(flags & 4) { SAIS_MYFREE(C, k, sais_index_type); }
    if(flags & 2) { SAIS_MYFREE(B, k, sais_index_type); }
    newfs = (n + fs) - (m * 2);
    if((flags & (1 | 4 | 8)) == 0) {
      if((k + name) <= newfs) { newfs -= k; }
      else { flags |= 8; }
    }
    assert((n >> 1) <= (newfs + m));
    RA = SA + m + newfs;
    for(i = m + (n >> 1) - 1, j = m - 1; m <= i; --i) {
      if(SA[i] != 0) {
        RA[j--] = SA[i] - 1;
      }
    }
    if(sais_main(RA, SA, newfs, m, name, sizeof(sais_index_type), 0) != 0) {
      if(flags & 1) { SAIS_MYFREE(C, k, sais_index_type); }
      return -2;
    }

    i = n - 1; j = m - 1; c0 = chr(n - 1);
    do { c1 = c0; } while((0 <= --i) && ((c0 = chr(i)) >= c1));
    for(; 0 <= i;) {
      do { c1 = c0; } while((0 <= --i) && ((c0 = chr(i)) <= c1));
      if(0 <= i) {
        RA[j--] = i + 1;
        do { c1 = c0; } while((0 <= --i) && ((c0 = chr(i)) >= c1));
      }
    }
    for(i = 0; i < m; ++i) { SA[i] = RA[SA[i]]; }
    if(flags & 4) {
      if((C = B = SAIS_MYMALLOC(k, int)) == NULL) { return -2; }
    }
    if(flags & 2) {
      if((B = SAIS_MYMALLOC(k, int)) == NULL) {
        if(flags & 1) { SAIS_MYFREE(C, k, sais_index_type); }
        return -2;
      }
    }
  }

  /* stage 3: induce the result for the original problem */
  if(flags & 8) { getCounts(T, C, n, k, cs); }
  /* put all left-most S characters into their buckets */
  if(1 < m) {
    getBuckets(C, B, k, 1); /* find ends of buckets */
    i = m - 1, j = n, p = SA[m - 1], c1 = chr(p);
    do {
      q = B[c0 = c1];
      while(q < j) { SA[--j] = 0; }
      do {
        SA[--j] = p;
        if(--i < 0) { break; }
        p = SA[i];
      } while((c1 = chr(p)) == c0);
    } while(0 <= i);
    while(0 < j) { SA[--j] = 0; }
  }
  if(isbwt == 0) { induceSA(T, SA, C, B, n, k, cs); }
  else { pidx = computeBWT(T, SA, C, B, n, k, cs); }
  if(flags & (1 | 4)) { SAIS_MYFREE(C, k, sais_index_type); }
  if(flags & 2) { SAIS_MYFREE(B, k, sais_index_type); }

  return pidx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movl $0x0, -0x70(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x34f2b
cmpq $0x0, -0x18(%rbp)
je 0x34f2b
jmp 0x34f4a
leaq 0x3e2e(%rip), %rdi      # 0x38d60
leaq 0x3e43(%rip), %rsi      # 0x38d7c
movl $0x158, %edx            # imm = 0x158
leaq 0x3e3e(%rip), %rcx      # 0x38d83
callq 0x31c0
xorl %eax, %eax
cmpl -0x1c(%rbp), %eax
jg 0x34f64
xorl %eax, %eax
cmpl -0x20(%rbp), %eax
jge 0x34f64
movl $0x1, %eax
cmpl -0x24(%rbp), %eax
jg 0x34f64
jmp 0x34f83
leaq 0x3e54(%rip), %rdi      # 0x38dbf
leaq 0x3e0a(%rip), %rsi      # 0x38d7c
movl $0x159, %edx            # imm = 0x159
leaq 0x3e05(%rip), %rcx      # 0x38d83
callq 0x31c0
cmpl $0x100, -0x24(%rbp)     # imm = 0x100
jg 0x35017
movslq -0x24(%rbp), %rdi
shlq $0x2, %rdi
callq 0x33b0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x34fb3
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x35c18
movl -0x24(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jg 0x34fdf
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
addl -0x1c(%rbp), %ecx
subl -0x24(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movl $0x1, -0x80(%rbp)
jmp 0x35012
movslq -0x24(%rbp), %rdi
shlq $0x2, %rdi
callq 0x33b0
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x3500b
movq -0x30(%rbp), %rdi
callq 0x3320
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x35c18
movl $0x3, -0x80(%rbp)
jmp 0x350e4
movl -0x24(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jg 0x350b4
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
addl -0x1c(%rbp), %ecx
subl -0x24(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl -0x24(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl -0x24(%rbp), %ecx
cmpl %ecx, %eax
jg 0x3506c
movq -0x30(%rbp), %rax
movslq -0x24(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x80(%rbp)
jmp 0x350b2
cmpl $0x400, -0x24(%rbp)     # imm = 0x400
jg 0x350a1
movslq -0x24(%rbp), %rdi
shlq $0x2, %rdi
callq 0x33b0
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x35098
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x35c18
movl $0x2, -0x80(%rbp)
jmp 0x350b0
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x8, -0x80(%rbp)
jmp 0x350b2
jmp 0x350e2
movslq -0x24(%rbp), %rdi
shlq $0x2, %rdi
callq 0x33b0
movq %rax, -0x38(%rbp)
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x350db
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x35c18
movl $0xc, -0x80(%rbp)
jmp 0x350e4
cmpl $0x3fffffff, -0x20(%rbp) # imm = 0x3FFFFFFF
jg 0x35152
movl -0x20(%rbp), %eax
cltd
idivl -0x24(%rbp)
movl %eax, %ecx
movl $0x2, %eax
cmpl %ecx, %eax
jg 0x35152
movl -0x80(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x3512c
movl -0x24(%rbp), %edx
shll %edx
movl -0x1c(%rbp), %esi
subl -0x24(%rbp), %esi
movl $0x10, %eax
movl $0x20, %ecx
cmpl %esi, %edx
cmovlel %ecx, %eax
orl -0x80(%rbp), %eax
movl %eax, -0x80(%rbp)
jmp 0x35150
cmpl $0x0, -0x80(%rbp)
jne 0x3514e
movl -0x24(%rbp), %eax
shll %eax
movl -0x1c(%rbp), %ecx
movl -0x24(%rbp), %edx
shll %edx
subl %edx, %ecx
cmpl %ecx, %eax
jg 0x3514e
movl -0x80(%rbp), %eax
orl $0x20, %eax
movl %eax, -0x80(%rbp)
jmp 0x35150
jmp 0x35152
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl -0x20(%rbp), %edx
movl -0x24(%rbp), %ecx
movl -0x28(%rbp), %r8d
callq 0x35f40
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl -0x24(%rbp), %edx
movl $0x1, %ecx
callq 0x35fe0
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x351a7
movq -0x18(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x35185
leaq -0x68(%rbp), %rax
movq %rax, -0x50(%rbp)
movl -0x20(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
movslq -0x28(%rbp), %rax
cmpq $0x4, %rax
jne 0x351e7
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x84(%rbp)
jmp 0x351fe
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x54(%rbp), %edx
addl $-0x1, %edx
movl %edx, -0x54(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl %edx, %ecx
movb %al, -0x85(%rbp)
jg 0x35268
movslq -0x28(%rbp), %rax
cmpq $0x4, %rax
jne 0x35241
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x8c(%rbp)
jmp 0x35253
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
movl %eax, -0x78(%rbp)
cmpl -0x7c(%rbp), %eax
setge %al
movb %al, -0x85(%rbp)
movb -0x85(%rbp), %al
testb $0x1, %al
jne 0x35207
jmp 0x35274
xorl %eax, %eax
cmpl -0x54(%rbp), %eax
jg 0x353a4
jmp 0x35281
movl -0x78(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x54(%rbp), %edx
addl $-0x1, %edx
movl %edx, -0x54(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl %edx, %ecx
movb %al, -0x8d(%rbp)
jg 0x352e2
movslq -0x28(%rbp), %rax
cmpq $0x4, %rax
jne 0x352bb
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x94(%rbp)
jmp 0x352cd
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x94(%rbp)
movl -0x94(%rbp), %eax
movl %eax, -0x78(%rbp)
cmpl -0x7c(%rbp), %eax
setle %al
movb %al, -0x8d(%rbp)
movb -0x8d(%rbp), %al
testb $0x1, %al
jne 0x35281
xorl %eax, %eax
cmpl -0x54(%rbp), %eax
jg 0x3539f
movl -0x58(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rdx
movslq -0x7c(%rbp), %rsi
movl (%rdx,%rsi,4), %ecx
addl $-0x1, %ecx
movl %ecx, (%rdx,%rsi,4)
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x58(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
movl -0x78(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x54(%rbp), %edx
addl $-0x1, %edx
movl %edx, -0x54(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl %edx, %ecx
movb %al, -0x95(%rbp)
jg 0x35393
movslq -0x28(%rbp), %rax
cmpq $0x4, %rax
jne 0x3536c
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x9c(%rbp)
jmp 0x3537e
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
movl %eax, -0x78(%rbp)
cmpl -0x7c(%rbp), %eax
setge %al
movb %al, -0x95(%rbp)
movb -0x95(%rbp), %al
testb $0x1, %al
jne 0x35332
jmp 0x3539f
jmp 0x35274
movl $0x1, %eax
cmpl -0x5c(%rbp), %eax
jge 0x35611
movl -0x80(%rbp), %eax
andl $0x30, %eax
cmpl $0x0, %eax
je 0x355d2
movl -0x80(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x3541d
movl -0x24(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x33b0
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x3541b
movl -0x80(%rbp), %eax
andl $0x5, %eax
cmpl $0x0, %eax
je 0x353fb
movq -0x30(%rbp), %rdi
callq 0x3320
movl -0x80(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x3540f
movq -0x38(%rbp), %rdi
callq 0x3320
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x35c18
jmp 0x35439
movq -0x38(%rbp), %rax
movl -0x24(%rbp), %ecx
shll %ecx
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl -0x58(%rbp), %eax
addl $0x1, %eax
cmpl -0x20(%rbp), %eax
jge 0x35446
jmp 0x35465
leaq 0x3993(%rip), %rdi      # 0x38de0
leaq 0x3928(%rip), %rsi      # 0x38d7c
movl $0x192, %edx            # imm = 0x192
leaq 0x3923(%rip), %rcx      # 0x38d83
callq 0x31c0
movq -0x38(%rbp), %rax
movq %rax, -0xa8(%rbp)
movslq -0x28(%rbp), %rax
cmpq $0x4, %rax
jne 0x35492
movq -0x10(%rbp), %rax
movl -0x58(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xac(%rbp)
jmp 0x354a9
movq -0x10(%rbp), %rax
movl -0x58(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0xac(%rbp)
movq -0xa8(%rbp), %rax
movl -0xac(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl $0x0, -0x54(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x3557e
movq -0x30(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl -0x58(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x38(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x58(%rbp), %eax
je 0x3554d
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movslq -0x54(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x35515
jmp 0x35534
leaq 0x38d0(%rip), %rdi      # 0x38dec
leaq 0x3859(%rip), %rsi      # 0x38d7c
movl $0x196, %edx            # imm = 0x196
leaq 0x3854(%rip), %rcx      # 0x38d83
callq 0x31c0
movl -0x20(%rbp), %edx
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movslq -0x54(%rbp), %rsi
movslq (%rcx,%rsi,4), %rcx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movq -0x40(%rbp), %rax
movl -0x54(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x40(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x354d0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
movl -0x20(%rbp), %r9d
movl -0x24(%rbp), %r10d
movl -0x28(%rbp), %eax
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x36090
movq -0x18(%rbp), %rdi
movl -0x20(%rbp), %esi
movl -0x5c(%rbp), %edx
callq 0x367c0
movl %eax, -0x6c(%rbp)
movl -0x80(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x355d0
movq -0x40(%rbp), %rdi
callq 0x3320
jmp 0x3560f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movl -0x20(%rbp), %r8d
movl -0x24(%rbp), %r9d
movl -0x28(%rbp), %eax
movl %eax, (%rsp)
callq 0x36a00
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x20(%rbp), %edx
movl -0x5c(%rbp), %ecx
movl -0x28(%rbp), %r8d
callq 0x36f70
movl %eax, -0x6c(%rbp)
jmp 0x35635
cmpl $0x1, -0x5c(%rbp)
jne 0x3562c
movl -0x58(%rbp), %ecx
addl $0x1, %ecx
movq -0x50(%rbp), %rax
movl %ecx, (%rax)
movl $0x1, -0x6c(%rbp)
jmp 0x35633
movl $0x0, -0x6c(%rbp)
jmp 0x35635
movl -0x6c(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x35a22
movl -0x80(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x35655
movq -0x30(%rbp), %rdi
callq 0x3320
movl -0x80(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x35669
movq -0x38(%rbp), %rdi
callq 0x3320
movl -0x20(%rbp), %eax
addl -0x1c(%rbp), %eax
movl -0x5c(%rbp), %ecx
shll %ecx
subl %ecx, %eax
movl %eax, -0x74(%rbp)
movl -0x80(%rbp), %eax
andl $0xd, %eax
cmpl $0x0, %eax
jne 0x356a7
movl -0x24(%rbp), %eax
addl -0x6c(%rbp), %eax
cmpl -0x74(%rbp), %eax
jg 0x3569c
movl -0x24(%rbp), %ecx
movl -0x74(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x74(%rbp)
jmp 0x356a5
movl -0x80(%rbp), %eax
orl $0x8, %eax
movl %eax, -0x80(%rbp)
jmp 0x356a7
movl -0x20(%rbp), %eax
sarl %eax
movl -0x74(%rbp), %ecx
addl -0x5c(%rbp), %ecx
cmpl %ecx, %eax
jg 0x356b8
jmp 0x356d7
leaq 0x373b(%rip), %rdi      # 0x38dfa
leaq 0x36b6(%rip), %rsi      # 0x38d7c
movl $0x1b1, %edx            # imm = 0x1B1
leaq 0x36b1(%rip), %rcx      # 0x38d83
callq 0x31c0
movq -0x18(%rbp), %rax
movslq -0x5c(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0x74(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movl -0x5c(%rbp), %eax
movl -0x20(%rbp), %ecx
sarl %ecx
addl %ecx, %eax
subl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x5c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x58(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x54(%rbp), %eax
jg 0x35754
movq -0x18(%rbp), %rax
movslq -0x54(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x35747
movq -0x18(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl (%rax,%rcx,4), %edx
subl $0x1, %edx
movq -0x48(%rbp), %rax
movl -0x58(%rbp), %ecx
movl %ecx, %esi
addl $-0x1, %esi
movl %esi, -0x58(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x35749
movl -0x54(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x3570e
movq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x74(%rbp), %edx
movl -0x5c(%rbp), %ecx
movl -0x6c(%rbp), %r8d
movl $0x4, %r9d
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x34ef0
cmpl $0x0, %eax
je 0x3579f
movl -0x80(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x35793
movq -0x30(%rbp), %rdi
callq 0x3320
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x35c18
movl -0x20(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x5c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x58(%rbp)
movslq -0x28(%rbp), %rax
cmpq $0x4, %rax
jne 0x357d3
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xb0(%rbp)
jmp 0x357ea
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0xb0(%rbp)
movl -0xb0(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x54(%rbp), %edx
addl $-0x1, %edx
movl %edx, -0x54(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl %edx, %ecx
movb %al, -0xb1(%rbp)
jg 0x35854
movslq -0x28(%rbp), %rax
cmpq $0x4, %rax
jne 0x3582d
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xb8(%rbp)
jmp 0x3583f
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0xb8(%rbp)
movl -0xb8(%rbp), %eax
movl %eax, -0x78(%rbp)
cmpl -0x7c(%rbp), %eax
setge %al
movb %al, -0xb1(%rbp)
movb -0xb1(%rbp), %al
testb $0x1, %al
jne 0x357f3
jmp 0x35860
xorl %eax, %eax
cmpl -0x54(%rbp), %eax
jg 0x35970
jmp 0x3586d
movl -0x78(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x54(%rbp), %edx
addl $-0x1, %edx
movl %edx, -0x54(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl %edx, %ecx
movb %al, -0xb9(%rbp)
jg 0x358ce
movslq -0x28(%rbp), %rax
cmpq $0x4, %rax
jne 0x358a7
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xc0(%rbp)
jmp 0x358b9
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0xc0(%rbp)
movl -0xc0(%rbp), %eax
movl %eax, -0x78(%rbp)
cmpl -0x7c(%rbp), %eax
setle %al
movb %al, -0xb9(%rbp)
movb -0xb9(%rbp), %al
testb $0x1, %al
jne 0x3586d
xorl %eax, %eax
cmpl -0x54(%rbp), %eax
jg 0x3596b
movl -0x54(%rbp), %edx
addl $0x1, %edx
movq -0x48(%rbp), %rax
movl -0x58(%rbp), %ecx
movl %ecx, %esi
addl $-0x1, %esi
movl %esi, -0x58(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x78(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x54(%rbp), %edx
addl $-0x1, %edx
movl %edx, -0x54(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl %edx, %ecx
movb %al, -0xc1(%rbp)
jg 0x3595f
movslq -0x28(%rbp), %rax
cmpq $0x4, %rax
jne 0x35938
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xc8(%rbp)
jmp 0x3594a
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0xc8(%rbp)
movl -0xc8(%rbp), %eax
movl %eax, -0x78(%rbp)
cmpl -0x7c(%rbp), %eax
setge %al
movb %al, -0xc1(%rbp)
movb -0xc1(%rbp), %al
testb $0x1, %al
jne 0x358fe
jmp 0x3596b
jmp 0x35860
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x359a8
movq -0x48(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq -0x54(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x35977
movl -0x80(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x359dc
movslq -0x24(%rbp), %rdi
shlq $0x2, %rdi
callq 0x33b0
movq %rax, -0x38(%rbp)
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x359da
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x35c18
jmp 0x359dc
movl -0x80(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x35a20
movslq -0x24(%rbp), %rdi
shlq $0x2, %rdi
callq 0x33b0
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x35a1e
movl -0x80(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x35a12
movq -0x30(%rbp), %rdi
callq 0x3320
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x35c18
jmp 0x35a20
jmp 0x35a22
movl -0x80(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x35a44
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl -0x20(%rbp), %edx
movl -0x24(%rbp), %ecx
movl -0x28(%rbp), %r8d
callq 0x35f40
movl $0x1, %eax
cmpl -0x5c(%rbp), %eax
jge 0x35b99
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl -0x24(%rbp), %edx
movl $0x1, %ecx
callq 0x35fe0
movl -0x5c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movl -0x5c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x60(%rbp)
movslq -0x28(%rbp), %rax
cmpq $0x4, %rax
jne 0x35aa6
movq -0x10(%rbp), %rax
movslq -0x60(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xcc(%rbp)
jmp 0x35ab8
movq -0x10(%rbp), %rax
movslq -0x60(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0xcc(%rbp)
movl -0xcc(%rbp), %eax
movl %eax, -0x7c(%rbp)
movq -0x38(%rbp), %rax
movl -0x7c(%rbp), %ecx
movl %ecx, -0x78(%rbp)
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x58(%rbp), %eax
jge 0x35af5
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x58(%rbp)
movslq %ecx, %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x35ad4
jmp 0x35af7
movl -0x60(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x58(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x54(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x54(%rbp)
cmpl $0x0, %eax
jge 0x35b1d
jmp 0x35b68
movq -0x18(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x60(%rbp)
movslq -0x28(%rbp), %rax
cmpq $0x4, %rax
jne 0x35b48
movq -0x10(%rbp), %rax
movslq -0x60(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xd0(%rbp)
jmp 0x35b5a
movq -0x10(%rbp), %rax
movslq -0x60(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0xd0(%rbp)
movl -0xd0(%rbp), %eax
movl %eax, -0x7c(%rbp)
cmpl -0x78(%rbp), %eax
je 0x35af7
jmp 0x35b6a
xorl %eax, %eax
cmpl -0x54(%rbp), %eax
jle 0x35ac1
jmp 0x35b77
xorl %eax, %eax
cmpl -0x58(%rbp), %eax
jge 0x35b97
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x58(%rbp)
movslq %ecx, %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x35b77
jmp 0x35b99
cmpl $0x0, 0x10(%rbp)
jne 0x35bc4
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movl -0x20(%rbp), %r8d
movl -0x24(%rbp), %r9d
movl -0x28(%rbp), %eax
movl %eax, (%rsp)
callq 0x373c0
jmp 0x35bea
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movl -0x20(%rbp), %r8d
movl -0x24(%rbp), %r9d
movl -0x28(%rbp), %eax
movl %eax, (%rsp)
callq 0x37950
movl %eax, -0x70(%rbp)
movl -0x80(%rbp), %eax
andl $0x5, %eax
cmpl $0x0, %eax
je 0x35bfe
movq -0x30(%rbp), %rdi
callq 0x3320
movl -0x80(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x35c12
movq -0x38(%rbp), %rdi
callq 0x3320
movl -0x70(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)