// File: /workspace/github_c_makefile_star2_O0/stevenmherring[P]DNS/fine-trie.c
// Function: insert
int _insert (const char *string, size_t strlen, int32_t ip4_address,
    struct trie_node *node, struct trie_node *parent, struct trie_node *left)
    {
      int rc;

      // assert that this thread has a lock on both parent or left
      // whichever is not null

      // First things first, check if we are NULL
      assert (node != NULL);


      // get a lock on node
      rc = pthread_mutex_lock(&(node->lock));
      assert(rc == 0);


      int cmp, keylen;


      assert (node->strlen < 64);
      assert (node->strlen > 0);
      assert (strlen > 0);

      // Take the minimum of the two lengths
      cmp = compare_keys (node->key, node->strlen, string, strlen, &keylen);
      if (cmp == 0) {
        // Yes, either quit, or recur on the children

        // If this key is longer than our search string, we need to insert
        // "above" this node
        if (node->strlen > keylen)
        {
          struct trie_node *new_node;

          assert(keylen == strlen);
          assert((!parent) || parent->children == node);

          new_node = new_leaf (string, strlen, ip4_address);

          rc = pthread_mutex_lock(&(new_node->lock));
          assert(rc == 0);


          node->strlen -= keylen;
          new_node->children = node;

          assert ((!parent) || (!left));

          // should already have a lock on the parent or left node
          if (parent)
          {
            parent->children = new_node;
          }
          else if (left) {
            left->next = new_node;
          }
          else if ((!parent) || (!left)) {
            root = new_node;

          }

          rc = pthread_mutex_unlock(&(new_node->lock));
          assert(rc == 0);


          rc = pthread_mutex_unlock(&(node->lock));
          assert(rc == 0);


          return 1;
        }
        else if (strlen > keylen)
        {
          if (node->children == NULL)
          {
            struct trie_node *new_node = new_leaf (string, strlen - keylen, ip4_address);

            rc = pthread_mutex_lock(&(new_node->lock));
            assert(rc == 0);

            node->children = new_node;

            rc = pthread_mutex_unlock(&(new_node->lock));
            assert(rc == 0);

            rc = pthread_mutex_unlock(&(node->lock));
            assert(rc == 0);

            return 1;
          }
          else
          {
            // Recur on children list, store "parent" (loosely defined)
            int rv = _insert(string, strlen - keylen, ip4_address, node->children, node, NULL);

            rc = pthread_mutex_unlock(&(node->lock));
            assert(rc == 0);

            return rv;
          }
        }
        else
        {
          assert (strlen == keylen);
          if (node->ip4_address == 0)
          {
            node->ip4_address = ip4_address;

            // unlock node
            rc = pthread_mutex_unlock(&(node->lock));
            assert(rc == 0);

            return 1;
          }
          else
          {
            // unlock node
            rc = pthread_mutex_unlock(&(node->lock));
            assert(rc == 0);

            return 0;
          }
        }
      } else
      {
        /* Is there any common substring? */
        int i, cmp2, keylen2, overlap = 0;
        for (i = 1; i < keylen; i++) {
          cmp2 = compare_keys (&node->key[i], node->strlen - i,
            &string[i], strlen - i, &keylen2);
            assert (keylen2 > 0);
            if (cmp2 == 0)
            {
              overlap = 1;
              break;
            }
          }

          if (overlap) {
            // Insert a common parent, recur
            struct trie_node *new_node = new_leaf (&string[i], strlen - i, 0);

            // lock new node
            rc = pthread_mutex_lock(&(new_node->lock));
            assert(rc == 0);


            int diff = node->strlen - i;
            assert ((node->strlen - diff) > 0);
            node->strlen -= diff;
            new_node->children = node;
            assert ((!parent) || (!left));

            // TODO get root lock
            if (node == root)
            {
              new_node->next = node->next;
              node->next = NULL;
              root = new_node;
            }
            else if (parent)
            {
              assert(parent->children == node);
              new_node->next = NULL;
              parent->children = new_node;
            }
            else if (left)
            {
              new_node->next = node->next;
              node->next = NULL;
              left->next = new_node;
            }
            else if ((!parent) && (!left)) {
              // TODO get root lock
              root = new_node;
            }

            rc = pthread_mutex_unlock(&(node->lock));
            assert(rc == 0);



            int rv = _insert(string, i, ip4_address, node, new_node, NULL);

            rc = pthread_mutex_unlock(&(new_node->lock));
            assert(rc == 0);


            return rv;

          }
          else if (cmp < 0)
          {
            if (node->next == NULL) {
              // Insert here
              struct trie_node *new_node = new_leaf (string, strlen, ip4_address);

              rc = pthread_mutex_lock(&(new_node->lock));
              assert(rc == 0);


              node->next = new_node;

              rc = pthread_mutex_unlock(&(new_node->lock));
              assert(rc == 0);


              // unlock node
              rc = pthread_mutex_unlock(&(node->lock));
              assert(rc == 0);

              return 1;
            }
            else
            {
              // No, recur right (the node's key is "greater" than  the search key)
              // by convention node should be locked and node->next will be locked inside the method
              int rv = _insert(string, strlen, ip4_address, node->next, NULL, node);
              rc = pthread_mutex_unlock(&(node->lock));
              assert(rc == 0);
              return rv;
            }
          }
          else
          {
            // Insert here
            struct trie_node *new_node = new_leaf (string, strlen, ip4_address);
            rc = pthread_mutex_lock(&(new_node->lock));
            assert(rc == 0);
            new_node->next = node;
            // TODO get root lock
            if (node == root)
            {
              root = new_node;
            }
            else if (parent && parent->children == node)
            {
              parent->children = new_node;
            }

            rc = pthread_mutex_unlock(&(new_node->lock));
            assert(rc == 0);

          }

          rc = pthread_mutex_unlock(&(node->lock));
          assert(rc == 0);
          return 1;
        }
      }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x1ffb
jmp 0x201a
leaq 0x30e8(%rip), %rdi      # 0x50ea
leaq 0x303b(%rip), %rsi      # 0x5044
movl $0x167, %edx            # imm = 0x167
leaq 0x320f(%rip), %rcx      # 0x5224
callq 0x10a0
movq -0x28(%rbp), %rdi
addq $0x58, %rdi
callq 0x11d0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x2032
jmp 0x2051
leaq 0x3114(%rip), %rdi      # 0x514d
leaq 0x3004(%rip), %rsi      # 0x5044
movl $0x16c, %edx            # imm = 0x16C
leaq 0x31d8(%rip), %rcx      # 0x5224
callq 0x10a0
movq -0x28(%rbp), %rax
cmpl $0x40, 0x8(%rax)
jae 0x205d
jmp 0x207c
leaq 0x30cd(%rip), %rdi      # 0x5131
leaq 0x2fd9(%rip), %rsi      # 0x5044
movl $0x172, %edx            # imm = 0x172
leaq 0x31ad(%rip), %rcx      # 0x5224
callq 0x10a0
movq -0x28(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jbe 0x2088
jmp 0x20a7
leaq 0x31fc(%rip), %rdi      # 0x528b
leaq 0x2fae(%rip), %rsi      # 0x5044
movl $0x173, %edx            # imm = 0x173
leaq 0x3182(%rip), %rcx      # 0x5224
callq 0x10a0
cmpq $0x0, -0x18(%rbp)
jbe 0x20b0
jmp 0x20cf
leaq 0x31da(%rip), %rdi      # 0x5291
leaq 0x2f86(%rip), %rsi      # 0x5044
movl $0x174, %edx            # imm = 0x174
leaq 0x315a(%rip), %rcx      # 0x5224
callq 0x10a0
movq -0x28(%rbp), %rdi
addq $0x18, %rdi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rax
movl %eax, %ecx
leaq -0x44(%rbp), %r8
callq 0x1460
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
jne 0x24f1
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
cmpl -0x44(%rbp), %eax
jbe 0x22c4
movslq -0x44(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x211a
jmp 0x2139
leaq 0x317b(%rip), %rdi      # 0x529c
leaq 0x2f1c(%rip), %rsi      # 0x5044
movl $0x181, %edx            # imm = 0x181
leaq 0x30f0(%rip), %rcx      # 0x5224
callq 0x10a0
cmpq $0x0, -0x30(%rbp)
je 0x214e
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x28(%rbp), %rax
jne 0x2150
jmp 0x216f
leaq 0x3156(%rip), %rdi      # 0x52ad
leaq 0x2ee6(%rip), %rsi      # 0x5044
movl $0x182, %edx            # imm = 0x182
leaq 0x30ba(%rip), %rcx      # 0x5224
callq 0x10a0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x12e0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
addq $0x58, %rdi
callq 0x11d0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x219b
jmp 0x21ba
leaq 0x2fab(%rip), %rdi      # 0x514d
leaq 0x2e9b(%rip), %rsi      # 0x5044
movl $0x187, %edx            # imm = 0x187
leaq 0x306f(%rip), %rcx      # 0x5224
callq 0x10a0
movl -0x44(%rbp), %edx
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x8(%rax)
movq -0x28(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x10(%rax)
cmpq $0x0, -0x30(%rbp)
je 0x21e3
cmpq $0x0, -0x38(%rbp)
jne 0x21e5
jmp 0x2204
leaq 0x30e7(%rip), %rdi      # 0x52d3
leaq 0x2e51(%rip), %rsi      # 0x5044
movl $0x18d, %edx            # imm = 0x18D
leaq 0x3025(%rip), %rcx      # 0x5224
callq 0x10a0
cmpq $0x0, -0x30(%rbp)
je 0x2219
movq -0x50(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x224a
cmpq $0x0, -0x38(%rbp)
je 0x222d
movq -0x50(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2248
cmpq $0x0, -0x30(%rbp)
je 0x223b
cmpq $0x0, -0x38(%rbp)
jne 0x2246
movq -0x50(%rbp), %rax
movq %rax, 0x4eca(%rip)      # 0x7110
jmp 0x2248
jmp 0x224a
movq -0x50(%rbp), %rdi
addq $0x58, %rdi
callq 0x1110
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x2262
jmp 0x2281
leaq 0x2ee4(%rip), %rdi      # 0x514d
leaq 0x2dd4(%rip), %rsi      # 0x5044
movl $0x19d, %edx            # imm = 0x19D
leaq 0x2fa8(%rip), %rcx      # 0x5224
callq 0x10a0
movq -0x28(%rbp), %rdi
addq $0x58, %rdi
callq 0x1110
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x2299
jmp 0x22b8
leaq 0x2ead(%rip), %rdi      # 0x514d
leaq 0x2d9d(%rip), %rsi      # 0x5044
movl $0x1a1, %edx            # imm = 0x1A1
leaq 0x2f71(%rip), %rcx      # 0x5224
callq 0x10a0
movl $0x1, -0x4(%rbp)
jmp 0x2a5e
movq -0x18(%rbp), %rax
movslq -0x44(%rbp), %rcx
cmpq %rcx, %rax
jbe 0x2429
movq -0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x23bc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movslq -0x44(%rbp), %rax
subq %rax, %rsi
movl -0x1c(%rbp), %edx
callq 0x12e0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
addq $0x58, %rdi
callq 0x11d0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x2317
jmp 0x2336
leaq 0x2e2f(%rip), %rdi      # 0x514d
leaq 0x2d1f(%rip), %rsi      # 0x5044
movl $0x1ad, %edx            # imm = 0x1AD
leaq 0x2ef3(%rip), %rcx      # 0x5224
callq 0x10a0
movq -0x58(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rdi
addq $0x58, %rdi
callq 0x1110
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x235a
jmp 0x2379
leaq 0x2dec(%rip), %rdi      # 0x514d
leaq 0x2cdc(%rip), %rsi      # 0x5044
movl $0x1b2, %edx            # imm = 0x1B2
leaq 0x2eb0(%rip), %rcx      # 0x5224
callq 0x10a0
movq -0x28(%rbp), %rdi
addq $0x58, %rdi
callq 0x1110
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x2391
jmp 0x23b0
leaq 0x2db5(%rip), %rdi      # 0x514d
leaq 0x2ca5(%rip), %rsi      # 0x5044
movl $0x1b5, %edx            # imm = 0x1B5
leaq 0x2e79(%rip), %rcx      # 0x5224
callq 0x10a0
movl $0x1, -0x4(%rbp)
jmp 0x2a5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movslq -0x44(%rbp), %rax
subq %rax, %rsi
movl -0x1c(%rbp), %edx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x28(%rbp), %r8
xorl %eax, %eax
movl %eax, %r9d
callq 0x1fd0
movl %eax, -0x5c(%rbp)
movq -0x28(%rbp), %rdi
addq $0x58, %rdi
callq 0x1110
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x23ff
jmp 0x241e
leaq 0x2d47(%rip), %rdi      # 0x514d
leaq 0x2c37(%rip), %rsi      # 0x5044
movl $0x1bf, %edx            # imm = 0x1BF
leaq 0x2e0b(%rip), %rcx      # 0x5224
callq 0x10a0
movl -0x5c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2a5e
movq -0x18(%rbp), %rax
movslq -0x44(%rbp), %rcx
cmpq %rcx, %rax
jne 0x2438
jmp 0x2457
leaq 0x2d16(%rip), %rdi      # 0x5155
leaq 0x2bfe(%rip), %rsi      # 0x5044
movl $0x1c6, %edx            # imm = 0x1C6
leaq 0x2dd2(%rip), %rcx      # 0x5224
callq 0x10a0
movq -0x28(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x24ae
movl -0x1c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x28(%rbp), %rdi
addq $0x58, %rdi
callq 0x1110
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x2483
jmp 0x24a2
leaq 0x2cc3(%rip), %rdi      # 0x514d
leaq 0x2bb3(%rip), %rsi      # 0x5044
movl $0x1cd, %edx            # imm = 0x1CD
leaq 0x2d87(%rip), %rcx      # 0x5224
callq 0x10a0
movl $0x1, -0x4(%rbp)
jmp 0x2a5e
movq -0x28(%rbp), %rdi
addq $0x58, %rdi
callq 0x1110
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x24c6
jmp 0x24e5
leaq 0x2c80(%rip), %rdi      # 0x514d
leaq 0x2b70(%rip), %rsi      # 0x5044
movl $0x1d5, %edx            # imm = 0x1D5
leaq 0x2d44(%rip), %rcx      # 0x5224
callq 0x10a0
movl $0x0, -0x4(%rbp)
jmp 0x2a5e
movl $0x0, -0x6c(%rbp)
movl $0x1, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x258e
movq -0x28(%rbp), %rdi
addq $0x18, %rdi
movslq -0x60(%rbp), %rax
addq %rax, %rdi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %esi
subl -0x60(%rbp), %esi
movq -0x10(%rbp), %rdx
movslq -0x60(%rbp), %rax
addq %rax, %rdx
movq -0x18(%rbp), %rax
movslq -0x60(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
leaq -0x68(%rbp), %r8
callq 0x1460
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x68(%rbp)
jle 0x2550
jmp 0x256f
leaq 0x2d91(%rip), %rdi      # 0x52e8
leaq 0x2ae6(%rip), %rsi      # 0x5044
movl $0x1e1, %edx            # imm = 0x1E1
leaq 0x2cba(%rip), %rcx      # 0x5224
callq 0x10a0
cmpl $0x0, -0x64(%rbp)
jne 0x257e
movl $0x1, -0x6c(%rbp)
jmp 0x258e
jmp 0x2580
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x24ff
cmpl $0x0, -0x6c(%rbp)
je 0x27e1
movq -0x10(%rbp), %rdi
movslq -0x60(%rbp), %rax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
movslq -0x60(%rbp), %rax
subq %rax, %rsi
xorl %edx, %edx
callq 0x12e0
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
addq $0x58, %rdi
callq 0x11d0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x25d1
jmp 0x25f0
leaq 0x2b75(%rip), %rdi      # 0x514d
leaq 0x2a65(%rip), %rsi      # 0x5044
movl $0x1ef, %edx            # imm = 0x1EF
leaq 0x2c39(%rip), %rcx      # 0x5224
callq 0x10a0
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
subl -0x60(%rbp), %eax
movl %eax, -0x7c(%rbp)
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
subl -0x7c(%rbp), %eax
cmpl $0x0, %eax
jbe 0x260e
jmp 0x262d
leaq 0x2cdf(%rip), %rdi      # 0x52f4
leaq 0x2a28(%rip), %rsi      # 0x5044
movl $0x1f3, %edx            # imm = 0x1F3
leaq 0x2bfc(%rip), %rcx      # 0x5224
callq 0x10a0
movl -0x7c(%rbp), %edx
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x8(%rax)
movq -0x28(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rcx, 0x10(%rax)
cmpq $0x0, -0x30(%rbp)
je 0x2656
cmpq $0x0, -0x38(%rbp)
jne 0x2658
jmp 0x2677
leaq 0x2c74(%rip), %rdi      # 0x52d3
leaq 0x29de(%rip), %rsi      # 0x5044
movl $0x1f6, %edx            # imm = 0x1F6
leaq 0x2bb2(%rip), %rcx      # 0x5224
callq 0x10a0
movq -0x28(%rbp), %rax
cmpq 0x4a8e(%rip), %rax      # 0x7110
jne 0x26ad
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq -0x78(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movq -0x78(%rbp), %rax
movq %rax, 0x4a68(%rip)      # 0x7110
jmp 0x2748
cmpq $0x0, -0x30(%rbp)
je 0x26fc
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x28(%rbp), %rax
jne 0x26c4
jmp 0x26e3
leaq 0x2bef(%rip), %rdi      # 0x52ba
leaq 0x2972(%rip), %rsi      # 0x5044
movl $0x201, %edx            # imm = 0x201
leaq 0x2b46(%rip), %rcx      # 0x5224
callq 0x10a0
movq -0x78(%rbp), %rax
movq $0x0, (%rax)
movq -0x78(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x2746
cmpq $0x0, -0x38(%rbp)
je 0x2729
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq -0x78(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movq -0x78(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2744
cmpq $0x0, -0x30(%rbp)
jne 0x2742
cmpq $0x0, -0x38(%rbp)
jne 0x2742
movq -0x78(%rbp), %rax
movq %rax, 0x49ce(%rip)      # 0x7110
jmp 0x2744
jmp 0x2746
jmp 0x2748
movq -0x28(%rbp), %rdi
addq $0x58, %rdi
callq 0x1110
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x2760
jmp 0x277f
leaq 0x29e6(%rip), %rdi      # 0x514d
leaq 0x28d6(%rip), %rsi      # 0x5044
movl $0x211, %edx            # imm = 0x211
leaq 0x2aaa(%rip), %rcx      # 0x5224
callq 0x10a0
movq -0x10(%rbp), %rdi
movslq -0x60(%rbp), %rsi
movl -0x1c(%rbp), %edx
movq -0x28(%rbp), %rcx
movq -0x78(%rbp), %r8
xorl %eax, %eax
movl %eax, %r9d
callq 0x1fd0
movl %eax, -0x80(%rbp)
movq -0x78(%rbp), %rdi
addq $0x58, %rdi
callq 0x1110
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x27b7
jmp 0x27d6
leaq 0x298f(%rip), %rdi      # 0x514d
leaq 0x287f(%rip), %rsi      # 0x5044
movl $0x218, %edx            # imm = 0x218
leaq 0x2a53(%rip), %rcx      # 0x5224
callq 0x10a0
movl -0x80(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2a5e
cmpl $0x0, -0x40(%rbp)
jge 0x2940
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x28d5
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x12e0
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rdi
addq $0x58, %rdi
callq 0x11d0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x282b
jmp 0x284a
leaq 0x291b(%rip), %rdi      # 0x514d
leaq 0x280b(%rip), %rsi      # 0x5044
movl $0x225, %edx            # imm = 0x225
leaq 0x29df(%rip), %rcx      # 0x5224
callq 0x10a0
movq -0x88(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x88(%rbp), %rdi
addq $0x58, %rdi
callq 0x1110
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x2873
jmp 0x2892
leaq 0x28d3(%rip), %rdi      # 0x514d
leaq 0x27c3(%rip), %rsi      # 0x5044
movl $0x22b, %edx            # imm = 0x22B
leaq 0x2997(%rip), %rcx      # 0x5224
callq 0x10a0
movq -0x28(%rbp), %rdi
addq $0x58, %rdi
callq 0x1110
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x28aa
jmp 0x28c9
leaq 0x289c(%rip), %rdi      # 0x514d
leaq 0x278c(%rip), %rsi      # 0x5044
movl $0x230, %edx            # imm = 0x230
leaq 0x2960(%rip), %rcx      # 0x5224
callq 0x10a0
movl $0x1, -0x4(%rbp)
jmp 0x2a5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq -0x28(%rbp), %r9
xorl %eax, %eax
movl %eax, %r8d
callq 0x1fd0
movl %eax, -0x8c(%rbp)
movq -0x28(%rbp), %rdi
addq $0x58, %rdi
callq 0x1110
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x2913
jmp 0x2932
leaq 0x2833(%rip), %rdi      # 0x514d
leaq 0x2723(%rip), %rsi      # 0x5044
movl $0x23a, %edx            # imm = 0x23A
leaq 0x28f7(%rip), %rcx      # 0x5224
callq 0x10a0
movl -0x8c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2a5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x12e0
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rdi
addq $0x58, %rdi
callq 0x11d0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x2972
jmp 0x2991
leaq 0x27d4(%rip), %rdi      # 0x514d
leaq 0x26c4(%rip), %rsi      # 0x5044
movl $0x243, %edx            # imm = 0x243
leaq 0x2898(%rip), %rcx      # 0x5224
callq 0x10a0
movq -0x28(%rbp), %rcx
movq -0x98(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
cmpq 0x4766(%rip), %rax      # 0x7110
jne 0x29bc
movq -0x98(%rbp), %rax
movq %rax, 0x4756(%rip)      # 0x7110
jmp 0x29e2
cmpq $0x0, -0x30(%rbp)
je 0x29e0
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x28(%rbp), %rax
jne 0x29e0
movq -0x98(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x29e2
movq -0x98(%rbp), %rdi
addq $0x58, %rdi
callq 0x1110
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x29fd
jmp 0x2a1c
leaq 0x2749(%rip), %rdi      # 0x514d
leaq 0x2639(%rip), %rsi      # 0x5044
movl $0x250, %edx            # imm = 0x250
leaq 0x280d(%rip), %rcx      # 0x5224
callq 0x10a0
jmp 0x2a1e
jmp 0x2a20
movq -0x28(%rbp), %rdi
addq $0x58, %rdi
callq 0x1110
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x2a38
jmp 0x2a57
leaq 0x270e(%rip), %rdi      # 0x514d
leaq 0x25fe(%rip), %rsi      # 0x5044
movl $0x255, %edx            # imm = 0x255
leaq 0x27d2(%rip), %rcx      # 0x5224
callq 0x10a0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw (%rax,%rax)