// File: /workspace/github_cpp_makefile_star2_O1/rfotino[P]consolite-compiler/src/syntax.cpp
// Function: FunctionToken::output(Parser*)
void FunctionToken::output(Parser *parser) {
  // Check if this is a builtin function, in which case we should
  // do nothing.
  if (isBuiltin(_name)) {
    return;
  }
  // Create an end label for the function, so if we return we can jump
  // to it without having to unwind the stack each time.
  std::string endLabel = parser->getUnusedLabel(_name + "_end");
  // Create a label for the function so that we can CALL it.
  parser->writeln(_name + ":");
  // Assign registers or stack positions to parameters. Parameters can
  // be stored in registers "A" through "D", and if there are more than
  // 4 parameters they will be stored on the stack before the return
  // address. The return address is stored at FP, so the first
  // overflow parameter will be stored at -2, the next at -4, etc.
  std::string reg = "A";
  int offset = -ADDRESS_SIZE;
  int numOverflowParams = 0;
  for (auto param : _parameters) {
    if (reg[0] <= 'D') {
      param->setReg(reg);
      reg[0]++;
    } else {
      param->setOffset(offset);
      offset -= DATA_SIZE;
      numOverflowParams++;
    }
  }
  // Assign registers or stack positions to local variables. Local
  // variables can be stored in registers "E" through "K", and if there
  // are more local variables than can fit in registers we store them
  // as frame pointer offsets. The offset starts at 0 and increases from
  // there.
  reg = "E";
  offset = 0;
  int extraParamOffset = 0;
  for (auto local : _localVars) {
    if (reg[0] <= 'K' && local->canBeReg()) {
      local->setReg(reg);
      // This is a callee-saved register, push it onto the stack and
      // make a note that we need to pop it later.
      parser->writeInst("PUSH " + reg);
      _savedRegisters.push(reg);
      extraParamOffset -= DATA_SIZE;
      // Increment the register
      reg[0]++;
    } else {
      local->setOffset(offset);
      offset += DATA_SIZE;
    }
    // If this is an array, reserve space for the array's data.
    if (local->type().isArray()) {
      // The data offset is at the current stack offset + DATA_SIZE.
      // We must add DATA_SIZE because the stack pointer points at an
      // address that's in use, and we want the next unused address.
      local->setDataOffset(offset + DATA_SIZE);
      offset += local->type().arraySize() * DATA_SIZE;
    }
  }
  // Save the previous value of the frame pointer.
  parser->writeInst("PUSH FP");
  _savedRegisters.push("FP");
  extraParamOffset -= DATA_SIZE;
  // Set the frame pointer to the stack's current location.
  parser->writeInst("MOV FP SP");
  // Store parameters on the stack if they are currently stored in
  // registers but are flagged as needing their own address. Also fix
  // offset for parameters on the stack based on the number of saved
  // registers.
  for (auto param : _parameters) {
    if (param->isReg() && !param->canBeReg()) {
      parser->writeInst("PUSH " + param->getReg());
      param->setOffset(offset);
      offset += DATA_SIZE;
    } else if (!param->isReg()) {
      param->setOffset(param->getOffset() + extraParamOffset);
    }
  }
  // Reserve space for the local variable storage on the stack.
  if (0 < offset) {
    parser->writeInst("MOVI L " + toHexStr(offset));
    parser->writeInst("ADD SP L");
  }

  // Outputs initial values of local variables.
  for (auto local : _localVars) {
    local->output(parser);
  }

  // Assign assembly-level labels to all label declarations.
  for (auto label : _labels) {
    std::string asmLabel = parser->getUnusedLabel(_name + "_" + label->name());
    label->setAsmLabel(asmLabel);
  }

  // Output assembly code for the rest of the statement types.
  for (auto statement : _statements) {
    statement->output(parser, shared_from_this(), endLabel);
  }

  // Unwind the stack, popping the saved registers, then return.
  // We have a label here so that when we have return statements
  // they can jump here without having to unwind the stack in
  // multiple places.
  parser->writeln(endLabel + ":");
  parser->writeInst("MOV SP FP");
  while (!_savedRegisters.empty()) {
    parser->writeInst("POP " + _savedRegisters.top());
    _savedRegisters.pop();
  }
  // If there are overflow parameters, pop them off the stack in
  // addition to jumping to the return address.
  if (0 < numOverflowParams) {
    parser->writeInst("RET " + toHexStr(numOverflowParams * DATA_SIZE, 2));
  } else {
    parser->writeInst("RET");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rsi, 0x40(%rsp)
movq %rdi, %r12
addq $0x58, %rdi
callq 0x3403f
testb %al, %al
jne 0x1c159
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x58(%r12), %rsi
movq 0x60(%r12), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xc014
leaq 0x1bb97(%rip), %rsi     # 0x36edb
movq %rbx, %rdi
callq 0x7560
leaq 0x108(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq 0x40(%rsp), %rsi
callq 0xa992
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x1b37a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
movq 0x58(%r12), %rsi
movq 0x60(%r12), %rdx
addq %rsi, %rdx
callq 0xc014
leaq 0x1d25d(%rip), %rsi     # 0x385f8
leaq 0x8(%rsp), %rdi
callq 0x7560
leaq 0x8(%rsp), %rsi
movq 0x40(%rsp), %rdi
callq 0xb2c4
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x1b3cb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0xf0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1b47d(%rip), %rsi     # 0x3685b
leaq 0x1b477(%rip), %rdx     # 0x3685c
leaq 0xe0(%rsp), %rdi
callq 0xc0a4
movq 0x78(%r12), %r15
movq %r12, 0x78(%rsp)
movq 0x80(%r12), %r12
cmpq %r12, %r15
je 0x1b494
movl $0x0, 0x8c(%rsp)
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
leaq 0xe0(%rsp), %rbx
movq 0x2cb6c(%rip), %r13     # 0x47f98
movq (%r15), %rdi
movq 0x8(%r15), %r14
testq %r14, %r14
je 0x1b44a
cmpb $0x0, (%r13)
je 0x1b445
incl 0x8(%r14)
jmp 0x1b44a
lock
incl 0x8(%r14)
movq 0xe0(%rsp), %rax
cmpb $0x44, (%rax)
jg 0x1b46f
addq $0x10, %rdi
movq %rbx, %rsi
callq 0x71a0
movq 0xe0(%rsp), %rax
incb (%rax)
jmp 0x1b47c
movl %ebp, 0x30(%rdi)
addl $-0x2, %ebp
incl 0x8c(%rsp)
testq %r14, %r14
je 0x1b489
movq %r14, %rdi
callq 0x81ea
addq $0x10, %r15
cmpq %r12, %r15
jne 0x1b42c
jmp 0x1b49f
movl $0x0, 0x8c(%rsp)
leaq 0xe0(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x1b3ad(%rip), %rcx     # 0x3685f
xorl %ebx, %ebx
movl $0x1, %r8d
xorl %esi, %esi
callq 0x7450
movq 0x78(%rsp), %r15
movq 0x90(%r15), %r13
movq 0x98(%r15), %rax
movq %rax, 0xd8(%rsp)
cmpq %rax, %r13
je 0x1b714
leaq 0xf0(%r15), %rax
movq %rax, 0x100(%rsp)
leaq 0x28(%rsp), %r14
movq $0x0, 0x68(%rsp)
leaq 0xe0(%rsp), %rbx
movl $0x0, 0x74(%rsp)
movq (%r13), %r12
movq 0x8(%r13), %r15
testq %r15, %r15
je 0x1b536
movq 0x2ca72(%rip), %rax     # 0x47f98
cmpb $0x0, (%rax)
je 0x1b531
incl 0x8(%r15)
jmp 0x1b536
lock
incl 0x8(%r15)
movq 0xe0(%rsp), %rax
cmpb $0x4b, (%rax)
jg 0x1b5bc
cmpb $0x1, 0x90(%r12)
jne 0x1b5bc
leaq 0x10(%r12), %rdi
movq %rbx, %rsi
callq 0x71a0
leaq 0x8(%rsp), %rbp
movq %rbp, %rdi
leaq 0x1abe5(%rip), %rsi     # 0x3614f
movq %rbx, %rdx
callq 0xb963
movq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0xadb2
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1b59b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x100(%rsp), %rdi
movq %rbx, %rsi
callq 0x309f4
addl $-0x2, 0x74(%rsp)
movq 0xe0(%rsp), %rax
incb (%rax)
jmp 0x1b5ce
movq 0x68(%rsp), %rax
movl %eax, 0x30(%r12)
addl $0x2, %eax
movq %rax, 0x68(%rsp)
leaq 0x2b77b(%rip), %rax     # 0x46d50
movq %rax, 0x8(%rsp)
movl 0x40(%r12), %eax
movl %eax, 0x10(%rsp)
leaq 0x2b736(%rip), %rbp     # 0x46d20
movq %rbp, 0x8(%rsp)
movq %r14, 0x18(%rsp)
movq 0x48(%r12), %rsi
movq 0x50(%r12), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rdi
callq 0xc014
movq %r14, %rax
movl 0x68(%r12), %r14d
movl %r14d, 0x38(%rsp)
movq %rbp, 0x8(%rsp)
movq 0x18(%rsp), %rdi
cmpq %rax, %rdi
je 0x1b634
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x72c0
testb $0x1, %r14b
je 0x1b6df
movq %r15, 0x80(%rsp)
movq 0x68(%rsp), %rax
movq %rax, %r15
addl $0x2, %eax
movw %ax, 0xb0(%r12)
leaq 0x2b6ef(%rip), %rax     # 0x46d50
movq %rax, 0x8(%rsp)
movl 0x40(%r12), %eax
movl %eax, 0x10(%rsp)
leaq 0x2b6aa(%rip), %r14     # 0x46d20
movq %r14, 0x8(%rsp)
leaq 0x28(%rsp), %rbp
movq %rbp, 0x18(%rsp)
movq 0x48(%r12), %rsi
movq 0x50(%r12), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rdi
callq 0xc014
movl 0x68(%r12), %eax
movl %eax, 0x38(%rsp)
movzwl 0x3a(%rsp), %r12d
movq %r14, 0x8(%rsp)
movq 0x18(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1b6c7
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x72c0
leal (%r15,%r12,2), %r15d
movq %r15, 0x68(%rsp)
leaq 0x28(%rsp), %r14
movq 0x80(%rsp), %r15
jmp 0x1b6e4
leaq 0x28(%rsp), %r14
testq %r15, %r15
je 0x1b6f1
movq %r15, %rdi
callq 0x81ea
addq $0x10, %r13
cmpq 0xd8(%rsp), %r13
jne 0x1b512
addl $-0x2, 0x74(%rsp)
movq 0x78(%rsp), %r15
movq 0x68(%rsp), %rbx
jmp 0x1b71c
movl $0xfffffffe, 0x74(%rsp) # imm = 0xFFFFFFFE
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %r14
movq %r14, (%rdi)
leaq 0x1b652(%rip), %rsi     # 0x36d82
leaq 0x1b652(%rip), %rdx     # 0x36d89
callq 0xc0a4
leaq 0x8(%rsp), %rsi
movq 0x40(%rsp), %rdi
callq 0xadb2
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x1b762
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x1b616(%rip), %rsi     # 0x36d87
leaq 0x1b611(%rip), %rdx     # 0x36d89
callq 0xc0a4
leaq 0xf0(%r15), %r12
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x300a0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x1b7a8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x1b5d3(%rip), %rsi     # 0x36d8a
leaq 0x1b5d5(%rip), %rdx     # 0x36d93
callq 0xc0a4
leaq 0x8(%rsp), %rsi
movq 0x40(%rsp), %rdi
callq 0xadb2
movq %r12, 0xd8(%rsp)
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x1b7f1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x78(%r15), %r13
movq 0x80(%r15), %rbp
cmpq %rbp, %r13
je 0x1b94b
leaq 0x48(%rsp), %r14
movq (%r13), %r12
movq 0x8(%r13), %r15
testq %r15, %r15
je 0x1b82e
movq 0x2c77a(%rip), %rax     # 0x47f98
cmpb $0x0, (%rax)
je 0x1b829
incl 0x8(%r15)
jmp 0x1b82e
lock
incl 0x8(%r15)
movq 0x18(%r12), %rax
testq %rax, %rax
je 0x1b84c
cmpb $0x0, 0x90(%r12)
je 0x1b85a
testq %rax, %rax
jne 0x1b92c
movl 0x74(%rsp), %eax
addl %eax, 0x30(%r12)
jmp 0x1b92c
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x10(%r12), %rsi
movq 0x18(%r12), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0xc014
movl $0x5, %r8d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x1a8c2(%rip), %rcx     # 0x3614f
callq 0x7320
leaq 0x18(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1b8ba
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x1b8c0
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xadb2
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1b903
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x1b91f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x72c0
movl %ebx, 0x30(%r12)
addl $0x2, %ebx
leaq 0x48(%rsp), %r14
testq %r15, %r15
je 0x1b93e
movq %r15, %rdi
callq 0x81ea
leaq 0x48(%rsp), %r14
addq $0x10, %r13
cmpq %rbp, %r13
jne 0x1b80a
testl %ebx, %ebx
movq 0x78(%rsp), %r14
jle 0x1ba4c
movzwl %bx, %esi
leaq 0x48(%rsp), %rdi
movl $0x4, %edx
callq 0x33cd0
leaq 0x1aeaa(%rip), %rcx     # 0x3681b
leaq 0x48(%rsp), %rdi
movl $0x7, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x7320
leaq 0x18(%rsp), %rbx
movq %rbx, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1b9ad
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x1b9b3
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x40(%rsp), %rdi
callq 0xadb2
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1b9f0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1ba0b
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x8(%rsp), %rdi
movq %rbx, (%rdi)
leaq 0x1b37a(%rip), %rsi     # 0x36d94
leaq 0x1b37b(%rip), %rdx     # 0x36d9c
callq 0xc0a4
leaq 0x8(%rsp), %rsi
movq 0x40(%rsp), %rdi
callq 0xadb2
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1ba4c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x90(%r14), %r13
movq 0x98(%r14), %rbp
cmpq %rbp, %r13
je 0x1bb9f
leaq 0x1b665(%rip), %r12     # 0x370cf
leaq 0x90(%rsp), %rbx
movq (%r13), %r14
movq 0x8(%r13), %r15
testq %r15, %r15
je 0x1ba96
movq 0x2c512(%rip), %rax     # 0x47f98
cmpb $0x0, (%rax)
je 0x1ba91
incl 0x8(%r15)
jmp 0x1ba96
lock
incl 0x8(%r15)
xorps %xmm0, %xmm0
movaps %xmm0, 0xb0(%rsp)
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r12, %rdx
callq 0xc0a4
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x48(%rsp), %rdi
movq %r12, %rsi
movq %r12, %rdx
callq 0xc0a4
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
movq %r12, %rdx
callq 0xc0a4
movq (%r14), %rax
movq %r14, %rdi
movq 0x40(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
leaq 0x8(%rsp), %rcx
leaq 0x48(%rsp), %r8
movq %rbx, %r9
callq *0x8(%rax)
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x1bb3b
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x1bb57
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1bb73
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x1bb85
callq 0x81ea
testq %r15, %r15
je 0x1bb92
movq %r15, %rdi
callq 0x81ea
addq $0x10, %r13
cmpq %rbp, %r13
jne 0x1ba72
movq 0x78(%rsp), %rax
movq 0xa8(%rax), %rbp
movq 0xb0(%rax), %rax
movq %rax, 0x68(%rsp)
cmpq %rax, %rbp
je 0x1bdc5
leaq 0xa0(%rsp), %r14
leaq 0x58(%rsp), %rbx
leaq 0x90(%rsp), %r13
movq (%rbp), %r15
movq 0x8(%rbp), %r12
testq %r12, %r12
je 0x1bbfb
movq 0x2c3af(%rip), %rax     # 0x47f98
cmpb $0x0, (%rax)
je 0x1bbf5
incl 0x8(%r12)
jmp 0x1bbfb
lock
incl 0x8(%r12)
movq %r14, 0x90(%rsp)
movq 0x78(%rsp), %rax
movq 0x58(%rax), %rsi
movq 0x60(%rax), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0xc014
movq %r13, %rdi
leaq 0x1b178(%rip), %rsi     # 0x36d9d
callq 0x7560
leaq 0xc0(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x10(%r15), %rsi
movq 0x18(%r15), %rdx
addq %rsi, %rdx
leaq 0xb0(%rsp), %rdi
callq 0xc014
movq 0x90(%rsp), %rcx
movl $0xf, %esi
cmpq %r14, %rcx
je 0x1bc6c
movq 0xa0(%rsp), %rsi
movq 0x98(%rsp), %r8
movq 0xb8(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0x1bca9
movl $0xf, %esi
leaq 0xc0(%rsp), %rdi
cmpq %rdi, 0xb0(%rsp)
je 0x1bca4
movq 0xc0(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1bcbb
movq 0xb0(%rsp), %rsi
movq %r13, %rdi
callq 0x70d0
jmp 0x1bccc
leaq 0xb0(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7320
movq %rbx, 0x48(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x1bcec
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x1bcf2
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x8(%rsp), %rdi
movq 0x40(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0xa992
movq 0x48(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1bd3a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x1bd5f
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x90(%rsp), %rdi
cmpq %r14, %rdi
je 0x1bd7c
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x72c0
addq $0x30, %r15
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
callq 0x71a0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1bda9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
testq %r12, %r12
je 0x1bdb6
movq %r12, %rdi
callq 0x81ea
addq $0x10, %rbp
cmpq 0x68(%rsp), %rbp
jne 0x1bbd5
movq 0x78(%rsp), %rax
movq 0xd8(%rax), %rbx
movq 0xe0(%rax), %rbp
cmpq %rbp, %rbx
je 0x1beed
movq 0x78(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x68(%rsp)
leaq 0x1b2d9(%rip), %r13     # 0x370cf
leaq 0x48(%rsp), %r14
movq (%rbx), %r12
movq 0x8(%rbx), %r15
testq %r15, %r15
je 0x1be1e
movq 0x2c18a(%rip), %rax     # 0x47f98
cmpb $0x0, (%rax)
je 0x1be19
incl 0x8(%r15)
jmp 0x1be1e
lock
incl 0x8(%r15)
leaq 0x90(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x3192a
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
movq %r13, %rdx
callq 0xc0a4
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movq %r13, %rdx
callq 0xc0a4
movq (%r12), %rax
movq %r12, %rdi
movq 0x40(%rsp), %rsi
leaq 0x90(%rsp), %rdx
leaq 0x108(%rsp), %rcx
leaq 0x8(%rsp), %r8
movq %r14, %r9
callq *0x8(%rax)
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x1bea5
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1bec1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x1bed3
callq 0x81ea
testq %r15, %r15
je 0x1bee0
movq %r15, %rdi
callq 0x81ea
addq $0x10, %rbx
cmpq %rbp, %rbx
jne 0x1bdfb
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %r12
movq %r12, (%rdi)
movq 0x108(%rsp), %rsi
movq 0x110(%rsp), %rdx
addq %rsi, %rdx
callq 0xc014
leaq 0x1c6df(%rip), %rsi     # 0x385f8
leaq 0x8(%rsp), %rdi
callq 0x7560
movq 0x78(%rsp), %r13
movq 0xd8(%rsp), %rbp
leaq 0x8(%rsp), %rsi
movq 0x40(%rsp), %rdi
callq 0xb2c4
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1bf56
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1ae3a(%rip), %rsi     # 0x36d9f
leaq 0x1ae3c(%rip), %rdx     # 0x36da8
callq 0xc0a4
leaq 0x8(%rsp), %rsi
movq 0x40(%rsp), %rdi
callq 0xadb2
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1bf97
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x120(%r13), %rdx
cmpq 0x100(%r13), %rdx
je 0x1c01b
movl $0x200, %r15d           # imm = 0x200
leaq 0x1a180(%rip), %rbx     # 0x36134
leaq 0x8(%rsp), %r14
cmpq 0x128(%r13), %rdx
jne 0x1bfd0
movq 0x138(%r13), %rax
movq -0x8(%rax), %rdx
addq %r15, %rdx
addq $-0x20, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb963
movq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0xadb2
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1c003
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
movq %rbp, %rdi
callq 0x30864
movq 0x120(%r13), %rdx
cmpq 0x100(%r13), %rdx
jne 0x1bfb9
movl 0x8c(%rsp), %eax
testl %eax, %eax
jle 0x1c078
addl %eax, %eax
movzwl %ax, %esi
leaq 0x48(%rsp), %rdi
movl $0x2, %edx
callq 0x33cd0
leaq 0x1ad68(%rip), %rcx     # 0x36da9
leaq 0x48(%rsp), %rdi
movl $0x4, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x7320
movq %r12, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1c0b3
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x1c0bb
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1ad27(%rip), %rsi     # 0x36dae
leaq 0x1ad23(%rip), %rdx     # 0x36db1
callq 0xc0a4
leaq 0x8(%rsp), %rsi
movq 0x40(%rsp), %rdi
callq 0xadb2
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1c113
movq 0x18(%rsp), %rsi
jmp 0x1c10b
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x40(%rsp), %rdi
callq 0xadb2
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1c0f8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1c113
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x1c138
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1c159
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x72c0
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1c31a
jmp 0x1c312
movq %rax, %r13
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
jne 0x1c1b3
jmp 0x1c1c5
jmp 0x1c1c2
jmp 0x1c312
movq %rax, %r13
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
jne 0x1c32b
jmp 0x1c4df
jmp 0x1c312
movq %rax, %r13
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1c1c5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x1c1c5
movq %rax, %r13
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1c4df
movq 0x58(%rsp), %rsi
jmp 0x1c330
jmp 0x1c312
jmp 0x1c31a
jmp 0x1c312
jmp 0x1c31a
jmp 0x1c31a
jmp 0x1c312
jmp 0x1c20d
jmp 0x1c312
jmp 0x1c20d
jmp 0x1c312
movq %rax, %r13
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
jne 0x1c32b
jmp 0x1c4df
jmp 0x1c312
jmp 0x1c312
jmp 0x1c24c
jmp 0x1c231
movq %rax, %r13
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x1c504
movq 0x18(%rsp), %rsi
jmp 0x1c4fc
movq %rax, %r13
jmp 0x1c504
jmp 0x1c256
movq %rax, %r13
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x1c525
movq 0x18(%rsp), %rsi
jmp 0x1c51d
movq %r15, 0x80(%rsp)
movq %rax, %r13
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1c4c7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x1c4c7
jmp 0x1c4bc
jmp 0x1c33d
movq %rax, %r13
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1c2cf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x1c2cf
movq %rax, %r13
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x1c4b2
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x1c4b2
jmp 0x1c4bc
jmp 0x1c4c4
movq %rax, %r13
testq %r14, %r14
je 0x1c4df
movq %r14, %rdi
jmp 0x1c4da
movq %rax, %r13
jmp 0x1c4df
movq %rax, %r13
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1c4df
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x1c4df
movq %rax, %r13
jmp 0x1c4b2
movq %rax, %r13
jmp 0x1c38a
movq %rax, %r13
jmp 0x1c36e
movq %rax, %r13
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x1c36e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1c38a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x98(%rsp), %rdi
jmp 0x1c4a8
movq %rax, %r13
jmp 0x1c420
jmp 0x1c3a1
movq %rax, %r13
jmp 0x1c3ea
movq %rax, %r13
jmp 0x1c3c5
movq %rax, %r13
movq 0x48(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1c3c5
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x1c3ea
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x90(%rsp), %rdi
cmpq %r14, %rdi
je 0x1c420
movq 0xa0(%rsp), %rsi
jmp 0x1c418
movq %rax, %r13
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1c420
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
testq %r12, %r12
je 0x1c4df
movq %r12, %rdi
jmp 0x1c4da
movq %rax, %r13
jmp 0x1c4a0
movq %rax, %r13
jmp 0x1c484
movq %rax, %r13
jmp 0x1c468
movq %rax, %r13
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x1c468
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x1c484
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1c4a0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x1c4b2
callq 0x81ea
testq %r15, %r15
je 0x1c4df
movq %r15, %rdi
jmp 0x1c4da
movq %r15, 0x80(%rsp)
movq %rax, %r13
cmpq $0x0, 0x80(%rsp)
je 0x1c4df
movq 0x80(%rsp), %rdi
callq 0x81ea
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x1c504
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1c525
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x72c0
movq %r13, %rdi
callq 0x74f0
nop