// File: /workspace/github_cpp_makefile_star2_O2/Cicko[P]Ram-Machine/RamMachine.cpp
// Function: RamMachine::runProgram(bool)
void RamMachine::runProgram (bool trace) {
  pc_ = 0;
  error_ = false;
  outTape_->reset ();
  memory_->reset ();
  inTape_->reset();
  bool halt = false;

  while (!halt && !error_)
  {

    bool salto = false;
    Instruction * actual = program_->getInstruction (pc_);

    if (actual->getOp () == "read") {               // READ
      int inTapeData = inTape_->read ();
      switch (actual->getType ()) {
        case INDIRECT:   // Indirect
          memory_->write (inTapeData,memory_->read (stoi (actual->getOperand ())));
          break;
        case DIRECT:   // Direct
          memory_->write (inTapeData,stoi (actual->getOperand ()));
          break;
        case IMMEDIATE:   // Immediate
          cout << "El modo inmediato no tiene sentido en la operacion READ. Saliendo al menu..." << endl;
          error_ = true;
          break;
        default:
          cout << "No se reconoce este tipo de READ. Saliendo al menu..." << endl;
          error_ = true;
      }
    }
    else if (actual->getOp () == "write") {         // WRITE
      switch (actual->getType ()) {
        case INDIRECT:
          outTape_->write (memory_->read (memory_->read (stoi (actual->getOperand ()))));
          break;
        case DIRECT:
          outTape_->write (memory_->read (stoi (actual->getOperand ())));
          break;
        case IMMEDIATE:
          outTape_->write (stoi (actual->getOperand()));
          break;
        default:
          cout << "No se reconoce este tipo de WRITE. Saliendo al menu..." << endl;
          error_ = true;
      }
    }
    else if (actual->getOp () == "load") {          // LOAD
      switch (actual->getType ()) {
        case INDIRECT:
          memory_->write (memory_->read (memory_->read (stoi (actual->getOperand ()))),ACCUM);
          break;
        case DIRECT:
          memory_->write (memory_->read (stoi (actual->getOperand ())),ACCUM);
          break;
        case IMMEDIATE:
          memory_->write (stoi (actual->getOperand ()),ACCUM);
          break;
        default:
          cout << "No se reconoce este tipo de LOAD. Saliendo al menu..." << endl;
          error_ = true;
      }
    }
    else if (actual->getOp() == "store") {
      switch (actual->getType()) {
        case INDIRECT:
          memory_->write (memory_->read (ACCUM), memory_->read (stoi (actual->getOperand())));
          break;
        case DIRECT:
          memory_->write (memory_->read (ACCUM),stoi (actual->getOperand()));
          break;
        case IMMEDIATE:
          cout << "No esta permitido el modo inmediato en la operacion STORE. Saliendo al menu.." << endl;
          error_ = true;
          break;
        default:
          cout << "No se reconoce este tipo de STORE. Saliendo al menu..." << endl;
          error_ = true;
      }
    }
    else if (actual->getOp() == "add") {
      switch (actual->getType()) {
        case INDIRECT:
          memory_->write(memory_->read (ACCUM) + memory_->read (memory_->read (stoi (actual->getOperand()))),ACCUM);
          break;
        case DIRECT:
          memory_->write (memory_->read (ACCUM) + memory_->read (stoi (actual->getOperand ())),ACCUM);
          break;
        case IMMEDIATE:
          memory_->write (memory_->read (ACCUM) + stoi (actual->getOperand ()),ACCUM);
          break;
        default:
          cout << "No se reconoce este tipo de SUB. Saliendo al menu..." << endl;
          error_ = true;
      }
    }
    else if (actual->getOp() == "sub") {
      switch (actual->getType()) {
        case INDIRECT:
          memory_->write(memory_->read (ACCUM) - memory_->read (memory_->read (stoi (actual->getOperand()))),ACCUM);
          break;
        case DIRECT:
          memory_->write (memory_->read (ACCUM) - memory_->read (stoi (actual->getOperand ())),ACCUM);
          break;
        case IMMEDIATE:
          memory_->write (memory_->read (ACCUM) - stoi (actual->getOperand ()),ACCUM);
          break;
        default:
          cout << "No se reconoce este tipo de SUB. Saliendo al menu..." << endl;
          error_ = true;
      }
    }
    else if (actual->getOp() == "mul") {
      switch (actual->getType()) {
        case INDIRECT:
          memory_->write(memory_->read (ACCUM) * memory_->read (memory_->read (stoi (actual->getOperand()))),ACCUM);
          break;
        case DIRECT:
          memory_->write (memory_->read (ACCUM) * memory_->read (stoi (actual->getOperand ())),ACCUM);
          break;
        case IMMEDIATE:
          memory_->write (memory_->read (ACCUM) * stoi (actual->getOperand ()),ACCUM);
          break;
        default:
          cout << "No se reconoce este tipo de MUL. Saliendo al menu..." << endl;
          error_ = true;
      }
    }
    else if (actual->getOp() == "div") {
      switch (actual->getType()) {
        case INDIRECT:
          memory_->write(memory_->read (ACCUM) / memory_->read (memory_->read (stoi (actual->getOperand()))),ACCUM);
          break;
        case DIRECT:
          memory_->write (memory_->read (ACCUM) / memory_->read (stoi (actual->getOperand ())),ACCUM);
          break;
        case IMMEDIATE:
          memory_->write (memory_->read (ACCUM) / stoi (actual->getOperand ()),ACCUM);
          break;
        default:
          cout << "No se reconoce este tipo de DIV. Saliendo al menu..." << endl;
          error_ = true;
      }
    }
    else if (actual->getOp () == "jump") {
      salto = true;
      jumpManager (actual);
    }
    else if (actual->getOp () == "jzero") {
      if (memory_->read (ACCUM) == 0) {
        salto = true;
        jumpManager (actual);
      }
    }
    else if (actual->getOp() == "jgtz") {
      if (memory_->read (ACCUM) > 0) {
        salto = true;
        jumpManager (actual);
      }
    }
    else if (actual->getOp() == "halt") {
      cout << "Se ha alcanzado HALT en la linea " << pc_ << ". Ahora se procedera a guardar el contenido en el fichero de salida." << endl;
      halt = true;
    }
    if (trace) {
      showActualState (actual);
    }
    if(error_) {
      cout << "We get error at line " << pc_ << endl;
      break;
    }
    if(!salto)
      pc_++;
  }
  saveToOutputTape ();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
andl $0x0, 0x20(%rdi)
movl %esi, 0x24(%rsp)
movb $0x0, 0x24(%rdi)
movq 0x8(%rdi), %rdi
callq 0x141b6
movq 0x10(%rbx), %rdi
callq 0x1435a
movq (%rbx), %rdi
callq 0x13f04
movq %rsp, %r14
cmpb $0x0, 0x24(%rbx)
jne 0x13858
movq 0x18(%rbx), %rdi
movl 0x20(%rbx), %esi
callq 0x6e36
movq %rax, %r13
leaq 0x28(%rax), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x5490
movq %r14, %rdi
leaq 0x25a0(%rip), %rsi      # 0x15348
callq 0x6fb5
movl %eax, %ebp
movq %r14, %rdi
callq 0x51a0
testb %bpl, %bpl
je 0x12e23
movq (%rbx), %rdi
callq 0x13e82
movl %eax, %r12d
movzbl 0x48(%r13), %eax
cmpl $0x64, %eax
je 0x12f58
cmpl $0x3d, %eax
je 0x12f45
cmpl $0x2a, %eax
jne 0x13024
movq 0x10(%rbx), %r15
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %r15, %rdi
movl %eax, %esi
callq 0x14342
movq %r15, %rdi
movl %r12d, %esi
movl %eax, %edx
callq 0x14338
jmp 0x13734
movq %r14, %rdi
movq %r12, %rsi
callq 0x5490
movq %r14, %rdi
leaq 0x2515(%rip), %rsi      # 0x1534d
callq 0x6fb5
movl %eax, %ebp
movq %r14, %rdi
callq 0x51a0
testb %bpl, %bpl
je 0x12eb3
movzbl 0x48(%r13), %eax
cmpl $0x64, %eax
je 0x13066
cmpl $0x3d, %eax
je 0x13037
cmpl $0x2a, %eax
jne 0x13147
movq 0x8(%rbx), %r12
movq 0x10(%rbx), %r15
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %r15, %rdi
movl %eax, %esi
callq 0x14342
movq %r15, %rdi
movl %eax, %esi
callq 0x14342
movq %r12, %rdi
movl %eax, %esi
callq 0x140bc
jmp 0x13734
movq %r14, %rdi
movq %r12, %rsi
callq 0x5490
movq %r14, %rdi
leaq 0x2475(%rip), %rsi      # 0x1533d
callq 0x6fb5
movl %eax, %ebp
movq %r14, %rdi
callq 0x51a0
testb %bpl, %bpl
je 0x12f8a
movzbl 0x48(%r13), %eax
cmpl $0x64, %eax
je 0x1318b
cmpl $0x3d, %eax
je 0x1315a
cmpl $0x2a, %eax
jne 0x1326d
movq 0x10(%rbx), %r12
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %r12, %rdi
movl %eax, %esi
callq 0x14342
movq %r12, %rdi
movl %eax, %esi
callq 0x14342
movq %r12, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x14338
jmp 0x13734
movq 0xe054(%rip), %rdi      # 0x20fa0
leaq 0x3316(%rip), %rsi      # 0x16269
jmp 0x13395
movq 0x10(%rbx), %r15
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %r15, %rdi
movl %r12d, %esi
movl %eax, %edx
callq 0x14338
jmp 0x13734
movq %r14, %rdi
movq %r12, %rsi
callq 0x5490
movq %r14, %rdi
leaq 0x23a3(%rip), %rsi      # 0x15342
callq 0x6fb5
movl %eax, %ebp
movq %r14, %rdi
callq 0x51a0
testb %bpl, %bpl
je 0x130a3
movzbl 0x48(%r13), %eax
cmpl $0x64, %eax
je 0x13293
cmpl $0x3d, %eax
je 0x13280
cmpl $0x2a, %eax
jne 0x13377
movq 0x10(%rbx), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x14342
movl %eax, %r12d
movq 0x10(%rbx), %rbp
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %rbp, %rdi
movl %eax, %esi
callq 0x14342
movq %r15, %rdi
movl %r12d, %esi
movl %eax, %edx
callq 0x14338
jmp 0x13734
movq 0xdf75(%rip), %rdi      # 0x20fa0
leaq 0x3284(%rip), %rsi      # 0x162b6
jmp 0x13395
movq 0x8(%rbx), %r15
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %r15, %rdi
movl %eax, %esi
callq 0x140bc
jmp 0x13734
movq 0x8(%rbx), %r15
movq 0x10(%rbx), %r12
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %r12, %rdi
movl %eax, %esi
callq 0x14342
movq %r15, %rdi
movl %eax, %esi
callq 0x140bc
jmp 0x13734
movq %r14, %rdi
movq %r12, %rsi
callq 0x5490
movq %r14, %rdi
leaq 0x2275(%rip), %rsi      # 0x1532d
callq 0x6fb5
movl %eax, %ebp
movq %r14, %rdi
callq 0x51a0
testb %bpl, %bpl
je 0x131c6
movzbl 0x48(%r13), %eax
cmpl $0x64, %eax
je 0x133ea
cmpl $0x3d, %eax
je 0x133ab
cmpl $0x2a, %eax
jne 0x13387
movq 0x10(%rbx), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x14342
movl %eax, %ebp
movq 0x10(%rbx), %r15
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %r15, %rdi
movl %eax, %esi
callq 0x14342
movq %r15, %rdi
movl %eax, %esi
callq 0x14342
addl %ebp, %eax
movq %r12, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x14338
jmp 0x13734
movq 0xde52(%rip), %rdi      # 0x20fa0
leaq 0x3197(%rip), %rsi      # 0x162ec
jmp 0x13395
movq 0x10(%rbx), %r15
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %r15, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x14338
jmp 0x13734
movq 0x10(%rbx), %r15
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %r15, %rdi
movl %eax, %esi
callq 0x14342
movq %r15, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x14338
jmp 0x13734
movq %r14, %rdi
movq %r12, %rsi
callq 0x5490
movq %r14, %rdi
leaq 0x2156(%rip), %rsi      # 0x15331
callq 0x6fb5
movl %eax, %ebp
movq %r14, %rdi
callq 0x51a0
testb %bpl, %bpl
je 0x132d2
movzbl 0x48(%r13), %eax
cmpl $0x64, %eax
je 0x13524
cmpl $0x3d, %eax
je 0x134e2
cmpl $0x2a, %eax
jne 0x13387
movq 0x10(%rbx), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x14342
movl %eax, %r12d
movq 0x10(%rbx), %r15
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %r15, %rdi
movl %eax, %esi
callq 0x14342
movq %r15, %rdi
movl %eax, %esi
callq 0x14342
subl %eax, %r12d
movq %rbp, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x14338
jmp 0x13734
movq 0xdd2c(%rip), %rdi      # 0x20fa0
leaq 0x30a8(%rip), %rsi      # 0x16323
jmp 0x13395
movq 0xdd19(%rip), %rdi      # 0x20fa0
leaq 0x30cb(%rip), %rsi      # 0x16359
jmp 0x13395
movq 0x10(%rbx), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x14342
movl %eax, %r12d
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %r15, %rdi
movl %r12d, %esi
movl %eax, %edx
callq 0x14338
jmp 0x13734
movq %r14, %rdi
movq %r12, %rsi
callq 0x5490
movq %r14, %rdi
leaq 0x204e(%rip), %rsi      # 0x15335
callq 0x6fb5
movl %eax, %ebp
movq %r14, %rdi
callq 0x51a0
testb %bpl, %bpl
je 0x13439
movzbl 0x48(%r13), %eax
cmpl $0x64, %eax
je 0x135f4
cmpl $0x3d, %eax
je 0x135b4
cmpl $0x2a, %eax
jne 0x13691
movq 0x10(%rbx), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x14342
movl %eax, %ebp
movq 0x10(%rbx), %r15
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %r15, %rdi
movl %eax, %esi
callq 0x14342
movq %r15, %rdi
movl %eax, %esi
callq 0x14342
imull %ebp, %eax
movq %r12, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x14338
jmp 0x13734
movq 0xdc22(%rip), %rdi      # 0x20fa0
leaq 0x3022(%rip), %rsi      # 0x163a7
jmp 0x13395
movq 0xdc12(%rip), %rdi      # 0x20fa0
leaq 0x3049(%rip), %rsi      # 0x163de
callq 0x5350
movq %rax, %rdi
callq 0x51c0
movb $0x1, 0x24(%rbx)
jmp 0x1373c
movq 0x10(%rbx), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x14342
movl %eax, %ebp
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
addl %ebp, %eax
movq %r15, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x14338
jmp 0x13734
movq 0x10(%rbx), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x14342
movl %eax, %r12d
movq 0x10(%rbx), %rbp
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %rbp, %rdi
movl %eax, %esi
callq 0x14342
addl %r12d, %eax
movq %r15, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x14338
jmp 0x13734
movq %r14, %rdi
movq %r12, %rsi
callq 0x5490
movq %r14, %rdi
leaq 0x1eeb(%rip), %rsi      # 0x15339
callq 0x6fb5
movl %eax, %ebp
movq %r14, %rdi
callq 0x51a0
testb %bpl, %bpl
je 0x13574
movzbl 0x48(%r13), %eax
cmpl $0x64, %eax
je 0x136e5
cmpl $0x3d, %eax
je 0x136a4
cmpl $0x2a, %eax
jne 0x137b3
movq 0x10(%rbx), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x14342
movl %eax, %ebp
movq 0x10(%rbx), %r15
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %r15, %rdi
movl %eax, %esi
callq 0x14342
movq %r15, %rdi
movl %eax, %esi
callq 0x14342
movl %eax, %ecx
movl %ebp, %eax
cltd
idivl %ecx
movq %r12, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x14338
jmp 0x13734
movq 0x10(%rbx), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x14342
movl %eax, %r12d
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
subl %eax, %r12d
movq %r15, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x14338
jmp 0x13734
movq 0x10(%rbx), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x14342
movl %eax, %r12d
movq 0x10(%rbx), %rbp
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %rbp, %rdi
movl %eax, %esi
callq 0x14342
subl %eax, %r12d
movq %r15, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x14338
jmp 0x13734
movq %r14, %rdi
movq %r12, %rsi
callq 0x5490
movq %r14, %rdi
leaq 0x1dca(%rip), %rsi      # 0x15353
callq 0x6fb5
movl %eax, %ebp
movq %r14, %rdi
callq 0x51a0
testb %bpl, %bpl
je 0x13644
movq %rbx, %rdi
movq %r13, %rsi
callq 0x138ac
movb $0x1, %bpl
jmp 0x1373e
movq 0x10(%rbx), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x14342
movl %eax, %ebp
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
imull %ebp, %eax
movq %r15, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x14338
jmp 0x13734
movq 0x10(%rbx), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x14342
movl %eax, %r12d
movq 0x10(%rbx), %rbp
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %rbp, %rdi
movl %eax, %esi
callq 0x14342
imull %r12d, %eax
movq %r15, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x14338
jmp 0x13734
movq %r14, %rdi
movq %r12, %rsi
callq 0x5490
movq %r14, %rdi
leaq 0x1d04(%rip), %rsi      # 0x1535d
callq 0x6fb5
movl %eax, %ebp
movq %r14, %rdi
callq 0x51a0
testb %bpl, %bpl
je 0x13773
movq 0x10(%rbx), %rdi
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x14342
movl $0x0, %r15d
testl %eax, %eax
jne 0x13741
jmp 0x135a1
movq 0xd908(%rip), %rdi      # 0x20fa0
leaq 0x2d74(%rip), %rsi      # 0x16413
jmp 0x13395
movq 0x10(%rbx), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x14342
movl %eax, %ebp
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movl %eax, %ecx
movl %ebp, %eax
cltd
idivl %ecx
movq %r15, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x14338
jmp 0x13734
movq 0x10(%rbx), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x14342
movl %eax, %r15d
movq 0x10(%rbx), %rbp
movq %r13, %rsi
addq $0x50, %rsi
movq %r14, %rdi
callq 0x5490
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x13c4a
movq %rbp, %rdi
movl %eax, %esi
callq 0x14342
movl %eax, %ecx
movl %r15d, %eax
cltd
idivl %ecx
movq %r12, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x14338
movq %r14, %rdi
callq 0x51a0
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpb $0x0, 0x24(%rsp)
je 0x13753
movq %rbx, %rdi
movq %r13, %rsi
callq 0x13974
cmpb $0x1, 0x24(%rbx)
je 0x13832
testb %bpl, %bpl
jne 0x13765
incl 0x20(%rbx)
testb %r15b, %r15b
je 0x12d76
jmp 0x13858
movq %r14, %rdi
movq %r12, %rsi
callq 0x5490
movq %r14, %rdi
leaq 0x1bd0(%rip), %rsi      # 0x15358
callq 0x6fb5
movl %eax, %ebp
movq %r14, %rdi
callq 0x51a0
testb %bpl, %bpl
je 0x137c6
movq 0x10(%rbx), %rdi
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x14342
testl %eax, %eax
jg 0x135a1
jmp 0x1373e
movq 0xd7e6(%rip), %rdi      # 0x20fa0
leaq 0x2c87(%rip), %rsi      # 0x16448
jmp 0x13395
movq %r14, %rdi
movq %r12, %rsi
callq 0x5490
movq %r14, %rdi
leaq 0x1bd9(%rip), %rsi      # 0x153b4
callq 0x6fb5
movl %eax, %ebp
movq %r14, %rdi
callq 0x51a0
testb %bpl, %bpl
je 0x1373c
movq 0xd7a6(%rip), %rdi      # 0x20fa0
leaq 0x2c7c(%rip), %rsi      # 0x1647d
callq 0x5350
movl 0x20(%rbx), %esi
movq %rax, %rdi
callq 0x5280
movq %rax, %rdi
leaq 0x2c84(%rip), %rsi      # 0x1649f
callq 0x5350
movq %rax, %rdi
callq 0x51c0
movb $0x1, %r15b
xorl %ebp, %ebp
jmp 0x13741
movq 0xd767(%rip), %rdi      # 0x20fa0
leaq 0x2ca4(%rip), %rsi      # 0x164e4
callq 0x5350
movl 0x20(%rbx), %esi
movq %rax, %rdi
callq 0x5280
movq %rax, %rdi
callq 0x51c0
movq %rbx, %rdi
callq 0x13a06
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
jmp 0x13899
movq %rax, %rbx
movq %rsp, %rdi
callq 0x51a0
movq %rbx, %rdi
callq 0x55c0