// File: /workspace/github_cpp_makefile_star2_O3/derekzwy[P]an-optimal-tcam-encoding-algorithm-for-packet-classification/rulesutils.cc
// Function: extend_prefix(unsigned int, unsigned int)
struct prefix *extend_prefix(unsigned ai, unsigned aj)
{
  struct prefix *pf = new prefix();
  int i = 0;  

  if(ai == aj) {
    pf->value[i] = ai;
    pf->length[i] = 16;
    pf->fullpf = ai;
    pf->fpf_len = 16;
    pf->nvalid = 1;

    pf->cmplvalue[i] = ai;
    pf->cmpllength[i] = 16;
    pf->ninvalid = 1; 
    return pf;
  } 
 
  int k;
  bool flag = false;
  pf->ninvalid = 0;         
  while(1) {
    for(k = 0; (ai & (int)pow(2,k)) == 0 && k <= 15 ; k ++);
    if(ai + pow(2,k) - 1 == aj) {       
      pf->value[i] = ai>>k<<k;
      pf->length[i] = 16 - k;
      pf->nvalid = i + 1;

      if( i  == 0) {
        pf->fullpf = ai>>k<<k;
        pf->fpf_len = 16 - k;

        pf->cmplvalue[i] = ai>>k<<k;
        pf->cmpllength[i] = 16 - k;
        pf->ninvalid = 1;
      }
      else {
        pf->fullpf = ai>>(k + 1)<<(k + 1);
        pf->fpf_len = 16 - k - 1;
        
        int numcmpl = pf->length[i - 1] - pf->length[i] - 1;
        while(numcmpl > 0) {
            pf->cmplvalue[pf->ninvalid] = (ai - (int)pow(2,k))>>(k - numcmpl)<<(k - numcmpl);
            pf->cmpllength[pf->ninvalid] = 16 - k + numcmpl;
            numcmpl --;
            pf->ninvalid ++;
        }
      }
      return pf;
    }
    else if (ai + pow(2,k) - 1 < aj) {
      pf->value[i] = ai>>k<<k;
      pf->length[i] = 16 - k;
      if(i == 0) {
        pf->cmplvalue[pf->ninvalid] = (ai - (int)pow(2,k))>>k<<k;
        pf->cmpllength[pf->ninvalid] = 16 - k;
        pf->ninvalid ++;
      }
      else {
        int numcmpl = pf->length[i - 1] - pf->length[i] - 1;
        while(numcmpl > 0) {
            pf->cmplvalue[pf->ninvalid] = (ai - (int)pow(2,k))>>(k - numcmpl)<<(k - numcmpl);
            pf->cmpllength[pf->ninvalid] = 16 - k + numcmpl;
            numcmpl --;
            pf->ninvalid ++;
        }
      }
      ai = ai + (int)pow(2, k);
    }
    else{
        if(i != 0) {
            flag = true;
            pf->fullpf = ai>>(k + 1)<<(k + 1);
            pf->fpf_len = 16 - k - 1; 

            int numcmpl = pf->length[i - 1] - pf->fpf_len - 2;
            while(numcmpl > 0) {
                pf->cmplvalue[pf->ninvalid] = (ai - (int)pow(2,k))>>(k - numcmpl)<<(k - numcmpl);
                pf->cmpllength[pf->ninvalid] = 16 - k + numcmpl;
                numcmpl --;
                pf->ninvalid ++;
            }
        }
      break;
    }        
    i++;
  } 

  if(ai == aj){
    pf->value[i] = ai;
    pf->length[i] = 16;
    pf->nvalid = i + 1;

    pf->cmplvalue[pf->ninvalid] = ai + 1;
    pf->cmpllength[pf->ninvalid] = 16;
    pf->ninvalid ++; 
    return pf;
  } 

  while(ai < aj) {
    for(k = 15; ((ai ^ aj) & (int)pow(2,k)) == 0 ; k --);
    if(ai + pow(2,k + 1) - 1 == aj) {
      pf->value[i] = ai>>(k+1)<<(k+1);
      pf->length[i] = 15 - k;
      pf->nvalid = i + 1;

      if(!flag) {
        if(i == 0){
            pf->fullpf = ai>>(k+1)<<(k+1);
            pf->fpf_len = 15 - k;
        }
        else {
            pf->fullpf = pf->value[0]>>(15 - pf->length[0])<<(15 - pf->length[0]);
            pf->fpf_len = pf->length[0] - 1;
        }
      }

      pf->cmplvalue[pf->ninvalid] = (ai + (int)pow(2, k + 1))>>(k + 1)<<(k + 1);
      pf->cmpllength[pf->ninvalid] = 15 - k;
      pf->ninvalid ++;
      i--;
      while((pf->value[i] >> (16 - pf->length[i])) % 2 == 0 && i > 0) {
        int numcmpl = pf->length[i + 1] - pf->length[i] - 1;
        while(numcmpl > 0) {
            int move = 16 - pf->length[i] - numcmpl;
            pf->cmplvalue[pf->ninvalid] = (ai + (int)pow(2, move))>>move<<move;
            pf->cmpllength[pf->ninvalid] = pf->length[i] + numcmpl;
            numcmpl--;
            pf->ninvalid ++;
        }
        i--;
      }
      int numcmpl = pf->length[i + 1] - pf->fpf_len - 2;
      int tmp = 1;
      while(numcmpl >= tmp ) {
        int move = 16 - pf->length[i + 1] + tmp; 
        pf->cmplvalue[pf->ninvalid] = (ai + (int)pow(2, move))>>move<<move;
        pf->cmpllength[pf->ninvalid] = pf->length[i + 1] - tmp;
        tmp ++;
        pf->ninvalid ++;
      }
      return pf;
    } 
    else {
      pf->value[i]=ai>>k<<k;
      pf->length[i]=16 - k;
      ai = ai + (int)pow(2,k);
    }
    i++;        
  } 

  pf->value[i] = ai;
  pf->length[i] = 16;
  pf->nvalid = i + 1;
  
  if(!flag) {
    pf->fullpf = pf->value[0]>>(15 - pf->length[0])<<(15 - pf->length[0]);
    pf->fpf_len = pf->length[0] - 1;
  }

  pf->cmplvalue[pf->ninvalid] = ai + (int)pow(2, 0);
  pf->cmpllength[pf->ninvalid] = 16;
  pf->ninvalid ++;
  i--;
  while((pf->value[i] >> (16 - pf->length[i])) % 2 == 0 && i > 0) {
    int numcmpl = pf->length[i + 1] - pf->length[i] - 1;
    while(numcmpl > 0) {
        int move = 16 - pf->length[i] - numcmpl;
        pf->cmplvalue[pf->ninvalid] = (ai + (int)pow(2, move))>>move<<move;
        pf->cmpllength[pf->ninvalid] = pf->length[i] + numcmpl;
        numcmpl--;
        pf->ninvalid ++;
    }
    i--;
  }
  int numcmpl = pf->length[i + 1] - pf->fpf_len - 2;
  int tmp = 1;
  while(numcmpl >= tmp ) {
    int move = 16 - pf->length[i + 1] + tmp; 
    pf->cmplvalue[pf->ninvalid] = (ai + (int)pow(2, move))>>move<<move;
    pf->cmpllength[pf->ninvalid] = pf->length[i + 1] - tmp;
    tmp ++;
    pf->ninvalid ++;
  }

  return pf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %r14d
movl %edi, %r12d
movl $0x110, %edi            # imm = 0x110
callq 0x2160
movq %rax, %rbx
movl $0x110, %edx            # imm = 0x110
movq %rax, %rdi
xorl %esi, %esi
callq 0x20b0
cmpl %r14d, %r12d
jne 0x3bac
movl %r12d, (%rbx)
movl $0x10, %eax
movl %eax, 0x40(%rbx)
movl %r12d, 0x100(%rbx)
movabsq $0x100000010, %rcx      # imm = 0x100000010
movq %rcx, 0x104(%rbx)
movl %r12d, 0x80(%rbx)
movl %eax, 0xc0(%rbx)
movl $0x1, 0x10c(%rbx)
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r14d, -0x5c(%rbp)
movl %r14d, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x50(%rbp)
movq %rbx, -0x40(%rbp)
addq $0x40, %rbx
movq %rbx, -0x58(%rbp)
movq $-0x1, -0x68(%rbp)
xorl %eax, %eax
movq %rax, -0x38(%rbp)
movl $0xfffffff0, %eax       # imm = 0xFFFFFFF0
xorl %r13d, %r13d
movl %r13d, %r14d
movl %eax, %r15d
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x2120
leal 0x1(%r14), %r13d
cmpl $0xf, %r14d
ja 0x3c10
cvttsd2si %xmm0, %ecx
andl %r12d, %ecx
leal 0x1(%r15), %eax
testl %ecx, %ecx
je 0x3bdf
movq %r12, %rbx
movl %r12d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x2120
addsd -0x48(%rbp), %xmm0
movsd 0x34ae(%rip), %xmm1     # 0x70e8
addsd %xmm1, %xmm0
leal -0x1(%r13), %r12d
ucomisd -0x50(%rbp), %xmm0
jne 0x3c4f
jnp 0x3d8e
movsd -0x30(%rbp), %xmm0
callq 0x2120
addsd -0x48(%rbp), %xmm0
addsd 0x3482(%rip), %xmm0     # 0x70e8
movsd -0x50(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x3e7f
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r12d, %ecx
shll %cl, %r14d
movl %r14d, %eax
andl %ebx, %eax
movq -0x40(%rbp), %r12
movq -0x38(%rbp), %rcx
movl %eax, (%r12,%rcx,4)
movl $0x11, %eax
subl %r13d, %eax
movl %eax, 0x40(%r12,%rcx,4)
testq %rcx, %rcx
je 0x3d2b
movq -0x58(%rbp), %rax
movl -0x4(%rax,%rcx,4), %r14d
leal (%r14,%r13), %eax
addl $-0x12, %eax
testl %eax, %eax
movsd -0x30(%rbp), %xmm0
jle 0x3d70
movq %r12, %r13
addl %r14d, %r15d
movl $0x11, %r12d
subl %r14d, %r12d
decl %r14d
movsd -0x30(%rbp), %xmm0
callq 0x2120
cvttsd2si %xmm0, %eax
movsd -0x30(%rbp), %xmm0
movl %ebx, %edx
subl %eax, %edx
movl %r12d, %ecx
shrl %cl, %edx
shll %cl, %edx
movl 0x10c(%r13), %eax
movl %edx, 0x80(%r13,%rax,4)
movl 0x10c(%r13), %eax
movl %r14d, 0xc0(%r13,%rax,4)
incl 0x10c(%r13)
decl %r15d
decl %r14d
incl %r12d
cmpl $0x1, %r15d
ja 0x3cd7
jmp 0x3d70
movsd -0x30(%rbp), %xmm0
movl %eax, %r15d
callq 0x2120
cvttsd2si %xmm0, %eax
movsd -0x30(%rbp), %xmm0
movl %ebx, %ecx
subl %eax, %ecx
andl %r14d, %ecx
movl 0x10c(%r12), %eax
movl %ecx, 0x80(%r12,%rax,4)
movl 0x10c(%r12), %eax
movl %r15d, 0xc0(%r12,%rax,4)
incl 0x10c(%r12)
callq 0x2120
cvttsd2si %xmm0, %eax
addl %eax, %ebx
movq -0x38(%rbp), %rax
incq %rax
incq -0x68(%rbp)
movq %rbx, %r12
jmp 0x3bd3
movq %rbx, %r8
movl %r8d, %edx
movl %r12d, %ecx
shrl %cl, %edx
shll %cl, %edx
movq -0x38(%rbp), %rdi
movl %edi, %eax
movq -0x40(%rbp), %rbx
movl %edx, (%rbx,%rax,4)
movl $0x11, %ecx
subl %r13d, %ecx
movl %ecx, 0x40(%rbx,%rax,4)
leal 0x1(%rdi), %esi
movl %esi, 0x108(%rbx)
testq %rdi, %rdi
je 0x4053
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movl %r12d, %ecx
shll %cl, %edx
andl %r8d, %edx
movl %edx, 0x100(%rbx)
movl $0x10, %ecx
subl %r13d, %ecx
movl %ecx, 0x104(%rbx)
shlq $0x20, %rdi
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
addq %rdi, %rcx
sarq $0x1e, %rcx
movl 0x40(%rbx,%rcx), %ecx
movl 0x40(%rbx,%rax,4), %r15d
movl %r15d, %eax
notl %eax
addl %ecx, %eax
testl %eax, %eax
jle 0x3b9a
movl %ecx, %r14d
subl %r15d, %r14d
movl %r14d, %r12d
subl %r13d, %r12d
addl $0x10, %r12d
subl %ecx, %r15d
addl %r13d, %r15d
movsd -0x30(%rbp), %xmm0
movq %r8, %r13
callq 0x2120
movq %r13, %r8
cvttsd2si %xmm0, %eax
movl %r8d, %edx
subl %eax, %edx
movl %r15d, %ecx
shrl %cl, %edx
shll %cl, %edx
movl 0x10c(%rbx), %eax
movl %edx, 0x80(%rbx,%rax,4)
movl 0x10c(%rbx), %eax
movl %r12d, 0xc0(%rbx,%rax,4)
incl 0x10c(%rbx)
decl %r14d
decl %r12d
incl %r15d
cmpl $0x1, %r14d
ja 0x3e2a
jmp 0x3b9a
cmpq $0x0, -0x38(%rbp)
movq %rbx, %rdi
movq -0x40(%rbp), %rbx
je 0x3f3d
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
movl %r12d, %ecx
shll %cl, %eax
andl %edi, %eax
movl %eax, 0x100(%rbx)
movl $0x10, %eax
subl %r13d, %eax
movl %eax, 0x104(%rbx)
movq -0x38(%rbp), %rax
shlq $0x20, %rax
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
addq %rax, %rcx
sarq $0x1e, %rcx
movl 0x40(%rbx,%rcx), %r15d
leal (%r15,%r13), %eax
addl $-0x12, %eax
testl %eax, %eax
jle 0x3f3d
leal (%r15,%r13), %r14d
addl $-0x11, %r14d
movl $0x11, %r12d
subl %r15d, %r12d
decl %r15d
movsd -0x30(%rbp), %xmm0
movq %rdi, %r13
callq 0x2120
movq %r13, %rdi
cvttsd2si %xmm0, %eax
movl %edi, %edx
subl %eax, %edx
movl %r12d, %ecx
shrl %cl, %edx
shll %cl, %edx
movl 0x10c(%rbx), %eax
movl %edx, 0x80(%rbx,%rax,4)
movl 0x10c(%rbx), %eax
movl %r15d, 0xc0(%rbx,%rax,4)
incl 0x10c(%rbx)
decl %r14d
decl %r15d
incl %r12d
cmpl $0x1, %r14d
ja 0x3eee
movl -0x5c(%rbp), %esi
cmpl %esi, %edi
jne 0x3f8a
movq -0x38(%rbp), %rdx
movl %edx, %eax
movq -0x40(%rbp), %rbx
movl %esi, (%rbx,%rax,4)
movl $0x10, %ecx
movl %ecx, 0x40(%rbx,%rax,4)
leal 0x1(%rdx), %eax
movl %eax, 0x108(%rbx)
incl %esi
movl 0x10c(%rbx), %eax
movl %esi, 0x80(%rbx,%rax,4)
movl 0x10c(%rbx), %eax
movl %ecx, 0xc0(%rbx,%rax,4)
incl 0x10c(%rbx)
jmp 0x3b9a
movq %rdi, %r12
movq -0x40(%rbp), %rbx
movq -0x38(%rbp), %rcx
jae 0x4072
movq %rcx, %r13
movq -0x68(%rbp), %rbx
movl %r12d, %r14d
xorl %esi, %r14d
xorl %r15d, %r15d
leal 0xf(%r15), %edi
movsd 0x3139(%rip), %xmm0     # 0x70f0
callq 0x21e0
cvttsd2si %xmm0, %eax
decl %r15d
testl %eax, %r14d
je 0x3fab
movl %r12d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x30(%rbp)
leal 0x11(%r15), %r14d
movsd 0x310c(%rip), %xmm0     # 0x70f0
movl %r14d, %edi
callq 0x21e0
addsd -0x30(%rbp), %xmm0
addsd 0x30ef(%rip), %xmm0     # 0x70e8
ucomisd -0x50(%rbp), %xmm0
jne 0x4006
jnp 0x4289
leal 0x10(%r15), %ecx
movl %r12d, %eax
shrl %cl, %eax
shll %cl, %eax
movq -0x40(%rbp), %rdx
movl %eax, (%rdx,%r13,4)
negl %r15d
movl %r15d, 0x40(%rdx,%r13,4)
movsd 0x30c7(%rip), %xmm0     # 0x70f0
movl %ecx, %edi
callq 0x21e0
cvttsd2si %xmm0, %eax
addl %eax, %r12d
incq %r13
incq %rbx
movl -0x5c(%rbp), %esi
cmpl %esi, %r12d
jb 0x3fa2
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rbx
jmp 0x4075
movl %edx, 0x100(%rbx)
movl %ecx, 0x104(%rbx)
movl %edx, 0x80(%rbx,%rax,4)
movl %ecx, 0xc0(%rbx,%rax,4)
jmp 0x3b90
movl %ecx, %r13d
leal 0x1(%r13), %eax
movl %r13d, %esi
movl %r12d, (%rbx,%rsi,4)
movl $0x10, 0x40(%rbx,%rsi,4)
movl %eax, 0x108(%rbx)
testq %rcx, %rcx
jne 0x40ae
movl (%rbx), %eax
movl 0x40(%rbx), %edx
movb $0xf, %cl
subb %dl, %cl
shrl %cl, %eax
shll %cl, %eax
movl %eax, 0x100(%rbx)
decl %edx
movl %edx, 0x104(%rbx)
movq %r12, -0x48(%rbp)
leal 0x1(%r12), %eax
movl 0x10c(%rbx), %ecx
movl %eax, 0x80(%rbx,%rcx,4)
movl 0x10c(%rbx), %eax
movl $0x10, 0xc0(%rbx,%rax,4)
incl 0x10c(%rbx)
movslq %r13d, %rax
movl 0x3c(%rbx,%rax,4), %r9d
movb $0x10, %cl
subb %r9b, %cl
movl $0x1, %edx
shll %cl, %edx
cmpl $0x2, %r13d
jl 0x41f0
andl -0x4(%rbx,%rax,4), %edx
jne 0x41f0
movq %rbx, %r12
movq -0x58(%rbp), %rcx
leaq (%rcx,%rax,4), %rdi
addq $-0x4, %rdi
movq %rsi, %rax
decq %rax
movq -0x48(%rbp), %rbx
movq %rax, -0x38(%rbp)
movq %rsi, -0x50(%rbp)
movl (%rcx,%rsi,4), %eax
movl %r9d, %ecx
notl %ecx
addl %eax, %ecx
testl %ecx, %ecx
jle 0x41ae
movl %eax, %r14d
subl %r9d, %r14d
subl %eax, %r9d
addl $0x11, %r9d
movl %r9d, -0x30(%rbp)
movl -0x30(%rbp), %r15d
subl (%rdi), %r15d
movsd 0x2f9e(%rip), %xmm0     # 0x70f0
movq %rdi, %r13
movl %r15d, %edi
callq 0x21e0
movq %r13, %rdi
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %r15d, %ecx
shrl %cl, %eax
movl -0x30(%rbp), %r9d
shll %cl, %eax
movl 0x10c(%r12), %ecx
movl %eax, 0x80(%r12,%rcx,4)
movl (%r13), %eax
addl %r14d, %eax
decl %eax
movl 0x10c(%r12), %ecx
movl %eax, 0xc0(%r12,%rcx,4)
incl 0x10c(%r12)
decl %r14d
incl %r9d
cmpl $0x1, %r14d
ja 0x413f
movq -0x38(%rbp), %r13
movl 0x3c(%r12,%r13,4), %r9d
movb $0x10, %cl
subb %r9b, %cl
movl $0x1, %edx
shll %cl, %edx
cmpq $0x2, %r13
movq -0x58(%rbp), %rcx
movq -0x50(%rbp), %rsi
jl 0x41ed
leaq -0x1(%r13), %rax
leaq (%rcx,%r13,4), %rdi
addq $-0x4, %rdi
andl -0x4(%r12,%r13,4), %edx
decq %rsi
testl %edx, %edx
je 0x411c
movq %r12, %rbx
movslq %r13d, %r12
movl 0x40(%rbx,%r12,4), %edx
subl 0x104(%rbx), %edx
leal -0x2(%rdx), %eax
testl %eax, %eax
jle 0x3b9a
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl $0x11, %r14d
movq %rdx, -0x30(%rbp)
movl %r14d, %r15d
subl 0x40(%rbx,%r12,4), %r15d
movsd 0x2ec7(%rip), %xmm0     # 0x70f0
movl %r15d, %edi
callq 0x21e0
movq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rdx
cvttsd2si %xmm0, %eax
addl %edi, %eax
movl %r15d, %ecx
shrl %cl, %eax
shll %cl, %eax
movl 0x10c(%rbx), %ecx
movl %eax, 0x80(%rbx,%rcx,4)
movl 0x40(%rbx,%r12,4), %eax
addl %r13d, %eax
movl 0x10c(%rbx), %ecx
movl %eax, 0xc0(%rbx,%rcx,4)
incl 0x10c(%rbx)
leal (%rdx,%r13), %eax
decl %eax
movl %r13d, %ecx
decl %ecx
incl %r14d
movl %ecx, %r13d
cmpl $0x1, %eax
jne 0x4219
jmp 0x3b9a
movq %rbx, -0x68(%rbp)
movq %r12, %rbx
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl %r14d, %ecx
shll %cl, %r12d
movl %r12d, %eax
andl %ebx, %eax
movl %r14d, %edi
movq %r13, %r14
movl %r14d, %ecx
movq -0x40(%rbp), %rsi
movl %eax, (%rsi,%rcx,4)
notl %r15d
movl %r15d, 0x40(%rsi,%rcx,4)
leal 0x1(%r13), %ecx
movl %ecx, 0x108(%rsi)
cmpq $0x0, -0x38(%rbp)
movq %rbx, -0x48(%rbp)
jne 0x4300
testq %r14, %r14
je 0x42ea
movl (%rsi), %edx
movl 0x40(%rsi), %eax
movb $0xf, %cl
subb %al, %cl
shrl %cl, %edx
shll %cl, %edx
movl %edx, 0x100(%rsi)
decl %eax
jmp 0x42f3
movl %eax, 0x100(%rsi)
movl %r15d, %eax
movl %eax, 0x104(%rsi)
movq -0x48(%rbp), %rbx
movq %r13, %r14
movsd 0x2de8(%rip), %xmm0     # 0x70f0
movq %rsi, %r13
callq 0x21e0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
andl %r12d, %eax
movl 0x10c(%r13), %ecx
movl %eax, 0x80(%r13,%rcx,4)
movl 0x10c(%r13), %eax
movl %r15d, 0xc0(%r13,%rax,4)
incl 0x10c(%r13)
movq %r14, %rax
shlq $0x20, %rax
movabsq $-0x100000000, %r12     # imm = 0xFFFFFFFF00000000
addq %rax, %r12
sarq $0x1e, %r12
movl 0x40(%r13,%r12), %r8d
movb $0x10, %cl
subb %r8b, %cl
movl $0x1, %eax
shll %cl, %eax
cmpq $0x2, %r14
movq %r14, %rsi
jb 0x4458
andl (%r13,%r12), %eax
jne 0x4458
movq -0x58(%rbp), %rcx
addq %rcx, %r12
movq -0x68(%rbp), %r14
movq -0x48(%rbp), %r13
movq -0x40(%rbp), %rbx
movq %r14, -0x50(%rbp)
movq %rsi, -0x38(%rbp)
movl (%rcx,%rsi,4), %eax
movl %r8d, %ecx
notl %ecx
addl %eax, %ecx
testl %ecx, %ecx
jle 0x4418
movl %eax, %r14d
subl %r8d, %r14d
subl %eax, %r8d
addl $0x11, %r8d
movl %r8d, -0x30(%rbp)
movl -0x30(%rbp), %r15d
subl (%r12), %r15d
movsd 0x2d27(%rip), %xmm0     # 0x70f0
movl %r15d, %edi
callq 0x21e0
cvttsd2si %xmm0, %eax
addl %r13d, %eax
movl %r15d, %ecx
shrl %cl, %eax
movl -0x30(%rbp), %r8d
shll %cl, %eax
movl 0x10c(%rbx), %ecx
movl %eax, 0x80(%rbx,%rcx,4)
movl (%r12), %eax
addl %r14d, %eax
decl %eax
movl 0x10c(%rbx), %ecx
movl %eax, 0xc0(%rbx,%rcx,4)
incl 0x10c(%rbx)
decl %r14d
incl %r8d
cmpl $0x1, %r14d
ja 0x43b5
movq -0x50(%rbp), %rdx
movl 0x3c(%rbx,%rdx,4), %r8d
movb $0x10, %cl
subb %r8b, %cl
movl $0x1, %eax
shll %cl, %eax
cmpq $0x2, %rdx
jl 0x445b
leaq -0x1(%rdx), %r14
movq -0x58(%rbp), %rcx
leaq (%rcx,%rdx,4), %r12
addq $-0x4, %r12
andl -0x4(%rbx,%rdx,4), %eax
movq -0x38(%rbp), %rsi
decq %rsi
testl %eax, %eax
je 0x4392
jmp 0x445b
movq %rsi, %rdx
movslq %edx, %r12
movq -0x40(%rbp), %rbx
movl 0x40(%rbx,%r12,4), %edx
subl 0x104(%rbx), %edx
leal -0x2(%rdx), %eax
testl %eax, %eax
jle 0x3b9a
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl $0x11, %r14d
movq %rdx, -0x30(%rbp)
movl %r14d, %r15d
subl 0x40(%rbx,%r12,4), %r15d
movsd 0x2c58(%rip), %xmm0     # 0x70f0
movl %r15d, %edi
callq 0x21e0
movq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rdx
cvttsd2si %xmm0, %eax
addl %edi, %eax
movl %r15d, %ecx
shrl %cl, %eax
shll %cl, %eax
movl 0x10c(%rbx), %ecx
movl %eax, 0x80(%rbx,%rcx,4)
movl 0x40(%rbx,%r12,4), %eax
addl %r13d, %eax
movl 0x10c(%rbx), %ecx
movl %eax, 0xc0(%rbx,%rcx,4)
incl 0x10c(%rbx)
leal (%rdx,%r13), %eax
decl %eax
movl %r13d, %ecx
decl %ecx
incl %r14d
movl %ecx, %r13d
cmpl $0x1, %eax
jne 0x4488
jmp 0x3b9a