// File: jpbalarini[P]otsus/./framework/CInspector.cpp
// Function: CInspector::process_input(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, CFramework*)
int CInspector::process_input(string input, CFramework *fw) {
  vector<string> tokens;

  int num_tokens = read_tokens(&tokens, input);
  if (num_tokens == 0) return INSPECTOR_OK; // just pressed <ENTER>

  string command = tokens[0];
  if (!check_command_arguments(command, num_tokens)) {
    return INSPECTOR_ERR_BAD_ARGUMENTS;
  }

  if (command == "l" || command == "list") {
    fw->print_matrix_list();
    return INSPECTOR_OK;
  }

  if (command == "u" || command == "use") {
    if (tokens.size() != 2) {
      return INSPECTOR_ERR_NO_MATRIX_ARGUMENT;
    }
    string name = tokens[1];

    MatrixInfo *matrix = fw->find_matrix_by_list_pos(atoi(name.c_str()));
    //MatrixInfo *matrix = fw->find_matrix(name);
    if (matrix == NULL) {
      return INSPECTOR_ERR_MATRIX_DOES_NOT_EXIST;
    }
    //
    G_using_matrix = matrix;
    describe_matrix(matrix);

    CInspector::prod_dims = new int[matrix->num_dims];
    acc_product_of_dims(matrix, CInspector::prod_dims);
  }

  if (command == "bt") {
    printf("Backtrace:\n");
    fw->print_backtrace(stdout);
    return INSPECTOR_OK;
  }


  if (command == "desc") {
    describe_matrix(G_using_matrix);
    return INSPECTOR_OK;
  }

  if (command == "g" || command == "get") {
    if (G_using_matrix == NULL) {
      return INSPECTOR_ERR_NO_MATRIX_SELECTED_YET;
    }

    // Check number of coordinates
    int num_coords = tokens.size() - 1;
    if (num_coords != G_using_matrix->num_dims) {
      return INSPECTOR_ERR_COORDINATES_ARGUMENT;
    }

    int coords[num_coords];
    for (int i = 0; i < num_coords; i++) {
      int coord = atoi(tokens[i+1].c_str());
      if (coord >= G_using_matrix->N[i]) {
        return INSPECTOR_ERR_OUT_OF_BOUNDS;
      }
      coords[i] = coord;
    }
    //
    int pos = get_pos_by_coordinates(coords, G_using_matrix);

    char coords_buffer[1024];
    list_of_ints(coords_buffer, ", ", coords, num_coords);


    printf("Matrix_%d[%s] == %f (pos %d).\n", G_using_matrix->id, coords_buffer, G_using_matrix->data[pos], pos);
    return INSPECTOR_OK;
  }

  if (command == "s" || command == "set") {
    if (G_using_matrix == NULL) {
      return INSPECTOR_ERR_NO_MATRIX_SELECTED_YET;
    }

    // Check number of coordinates
    int num_coords = tokens.size() - 2;
    if (num_coords != G_using_matrix->num_dims) {
      return INSPECTOR_ERR_COORDINATES_ARGUMENT;
    }

    int coords[num_coords];
    for (int i = 0; i < num_coords; i++) {
      int coord = atoi(tokens[i+1].c_str());
      if (coord >= G_using_matrix->N[i]) {
        return INSPECTOR_ERR_OUT_OF_BOUNDS;
      }
      coords[i] = coord;
    }
    //
    int pos = get_pos_by_coordinates(coords, G_using_matrix);
    float new_value = atof(tokens[num_coords+1].c_str());

    char coords_buffer[1024];
    list_of_ints(coords_buffer, ", ", coords, num_coords);

    printf("Before: M_%d[%s] == %f (pos %d).\n", G_using_matrix->id, coords_buffer, G_using_matrix->data[pos], pos);
    G_using_matrix->data[pos] = new_value;
    printf("After: M_%d[%s] == %f (pos %d).\n", G_using_matrix->id, coords_buffer, G_using_matrix->data[pos], pos);
    return INSPECTOR_OK;
  }

  if (command == "mem") {
    rusage usage;
    int status = getrusage(RUSAGE_SELF, &usage);
    if (status == 0) {
      printf("maximum resident set size: %lu\n", usage.ru_maxrss);
      printf("integral shared memory size: %lu\n", usage.ru_ixrss);
      printf("integral unshared data size: %lu\n", usage.ru_idrss);
      printf("integral unshared stack size: %lu\n", usage.ru_isrss);
      printf("page reclaims (soft page faults): %lu\n", usage.ru_minflt);
      printf("page faults (hard page faults): %lu\n", usage.ru_majflt);
      printf("swaps: %lu\n", usage.ru_nswap);
      printf("block input operations: %lu\n", usage.ru_inblock);
      printf("block output operations: %lu\n", usage.ru_oublock);
      printf("IPC messages sent: %lu\n", usage.ru_msgsnd);
      printf("IPC messages received: %lu\n", usage.ru_msgrcv);
      printf("signals received: %lu\n", usage.ru_nsignals);
      printf("voluntary context switches: %lu\n", usage.ru_nvcsw);
      printf("involuntary context switches: %lu\n", usage.ru_nivcsw);
    }
    return INSPECTOR_OK;
  }

  if (command == "save") {
    if (G_using_matrix == NULL)
      return INSPECTOR_ERR_NO_MATRIX_SELECTED_YET;
    if (tokens.size() != 2)
      return INSPECTOR_ERR_NO_FILENAME;
    //
    char *filename = (char*)tokens[1].c_str();
    int id = G_using_matrix->id;
    fw->save_matrix(G_using_matrix, filename);
    G_using_matrix = fw->find_matrix(id);
    return INSPECTOR_OK;
  }

  if (command == "load") {
    if (G_using_matrix == NULL)
      return INSPECTOR_ERR_NO_MATRIX_SELECTED_YET;
    if (tokens.size() != 2)
      return INSPECTOR_ERR_NO_FILENAME;
    //
    char *filename = (char*)tokens[1].c_str();
    int status = fw->load_matrix(G_using_matrix, filename);
    switch (status) {
      case  0: return INSPECTOR_OK; break;
      case -1: return INSPECTOR_ERR_CAN_NOT_OPEN_FILE; break;
      case -2: return INSPECTOR_ERR_INCOMPATIBLE_DIMENSIONS; break;
      case -3: return INSPECTOR_ERR_READ_ERROR; break;
    }
    return INSPECTOR_OK;
  }


  if (command == "h" || command == "help") {
    printf("Framework CLI inpector. Help not available yet, sorry.\n");
    return INSPECTOR_OK;
  }

  return INSPECTOR_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa70, %rsp            # imm = 0xA70
movq %rdi, -0x9f0(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x99d0
movq -0x9f0(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x3180
jmp 0x86e5
leaq -0x30(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x82e0
movl %eax, -0x9f4(%rbp)
jmp 0x86fa
leaq -0x58(%rbp), %rdi
callq 0x3200
movl -0x9f4(%rbp), %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x8750
movl $0x0, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x93b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x93c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3200
jmp 0x93c4
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x99f0
movq %rax, %rsi
leaq -0x88(%rbp), %rdi
callq 0x3180
jmp 0x876e
leaq -0xa8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3180
jmp 0x8783
movl -0x34(%rbp), %esi
leaq -0xa8(%rbp), %rdi
callq 0x8570
movb %al, -0x9f5(%rbp)
jmp 0x879a
movb -0x9f5(%rbp), %al
xorb $-0x1, %al
movb %al, -0x9f6(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x3200
movb -0x9f6(%rbp), %al
testb $0x1, %al
jne 0x87c0
jmp 0x8801
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x68(%rbp)
jmp 0x9397
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x93a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x3200
jmp 0x93a5
leaq 0x4ed1(%rip), %rsi      # 0xd6d9
leaq -0x88(%rbp), %rdi
callq 0x99a0
movb %al, -0x9f7(%rbp)
jmp 0x881c
movb -0x9f7(%rbp), %al
testb $0x1, %al
jne 0x884f
jmp 0x8828
leaq 0x4ea1(%rip), %rsi      # 0xd6d0
leaq -0x88(%rbp), %rdi
callq 0x99a0
movb %al, -0x9f8(%rbp)
jmp 0x8843
movb -0x9f8(%rbp), %al
testb $0x1, %al
jne 0x884f
jmp 0x886d
movq -0x18(%rbp), %rdi
callq 0x3960
jmp 0x885a
movl $0x0, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x9397
leaq 0x4e67(%rip), %rsi      # 0xd6db
leaq -0x88(%rbp), %rdi
callq 0x99a0
movb %al, -0x9f9(%rbp)
jmp 0x8888
movb -0x9f9(%rbp), %al
testb $0x1, %al
jne 0x88be
jmp 0x8894
leaq 0x4e3a(%rip), %rsi      # 0xd6d5
leaq -0x88(%rbp), %rdi
callq 0x99a0
movb %al, -0x9fa(%rbp)
jmp 0x88af
movb -0x9fa(%rbp), %al
testb $0x1, %al
jne 0x88be
jmp 0x8a0b
leaq -0x30(%rbp), %rdi
callq 0x9980
cmpq $0x2, %rax
je 0x88e0
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
movl $0x1, -0x68(%rbp)
jmp 0x9397
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x99f0
movq %rax, %rsi
leaq -0xc8(%rbp), %rdi
callq 0x3180
jmp 0x88ff
movq -0x18(%rbp), %rax
movq %rax, -0xa10(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x3170
movq %rax, %rdi
callq 0x34e0
movq -0xa10(%rbp), %rdi
movl %eax, %esi
callq 0x3ee0
movq %rax, -0xa08(%rbp)
jmp 0x8935
movq -0xa08(%rbp), %rax
movq %rax, -0xd0(%rbp)
cmpq $0x0, -0xd0(%rbp)
jne 0x897d
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
movl $0x1, -0x68(%rbp)
jmp 0x89f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x3200
jmp 0x93a5
movq -0xd0(%rbp), %rax
movq %rax, 0xa9bd(%rip)      # 0x13348
movq -0xd0(%rbp), %rdi
callq 0x84f0
jmp 0x8999
movq -0xd0(%rbp), %rax
movslq 0xc(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3030
movq %rax, -0xa18(%rbp)
jmp 0x89c8
movq -0xa18(%rbp), %rax
movq %rax, 0xa97a(%rip)      # 0x13350
movq -0xd0(%rbp), %rdi
movq 0xa96c(%rip), %rsi      # 0x13350
callq 0x85e0
movl $0x0, -0x68(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x3200
movl -0x68(%rbp), %eax
testl %eax, %eax
jne 0x9397
jmp 0x8a09
jmp 0x8a0b
leaq 0x4ccb(%rip), %rsi      # 0xd6dd
leaq -0x88(%rbp), %rdi
callq 0x99a0
movb %al, -0xa19(%rbp)
jmp 0x8a26
movb -0xa19(%rbp), %al
testb $0x1, %al
jne 0x8a32
jmp 0x8a6a
leaq 0x4ca7(%rip), %rdi      # 0xd6e0
xorl %eax, %eax
callq 0x3070
jmp 0x8a42
movq -0x18(%rbp), %rdi
movq 0xa533(%rip), %rax      # 0x12f80
movq (%rax), %rsi
callq 0x4220
jmp 0x8a57
movl $0x0, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x9397
leaq 0x4c7b(%rip), %rsi      # 0xd6ec
leaq -0x88(%rbp), %rdi
callq 0x99a0
movb %al, -0xa1a(%rbp)
jmp 0x8a85
movb -0xa1a(%rbp), %al
testb $0x1, %al
jne 0x8a91
jmp 0x8ab2
movq 0xa8b0(%rip), %rdi      # 0x13348
callq 0x84f0
jmp 0x8a9f
movl $0x0, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x9397
leaq 0x4c38(%rip), %rsi      # 0xd6f1
leaq -0x88(%rbp), %rdi
callq 0x99a0
movb %al, -0xa1b(%rbp)
jmp 0x8acd
movb -0xa1b(%rbp), %al
testb $0x1, %al
jne 0x8b03
jmp 0x8ad9
leaq 0x4c13(%rip), %rsi      # 0xd6f3
leaq -0x88(%rbp), %rdi
callq 0x99a0
movb %al, -0xa1c(%rbp)
jmp 0x8af4
movb -0xa1c(%rbp), %al
testb $0x1, %al
jne 0x8b03
jmp 0x8cc1
cmpq $0x0, 0xa83d(%rip)      # 0x13348
jne 0x8b20
movl $0xfffffffc, -0x4(%rbp) # imm = 0xFFFFFFFC
movl $0x1, -0x68(%rbp)
jmp 0x9397
leaq -0x30(%rbp), %rdi
callq 0x9980
subq $0x1, %rax
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
movq 0xa808(%rip), %rcx      # 0x13348
cmpl 0xc(%rcx), %eax
je 0x8b58
movl $0xfffffffb, -0x4(%rbp) # imm = 0xFFFFFFFB
movl $0x1, -0x68(%rbp)
jmp 0x9397
movl -0xd4(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0xe0(%rbp)
leaq 0xf(,%rax,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0xa28(%rbp)
movq %rcx, %rsp
movq %rax, -0xe8(%rbp)
movl $0x0, -0xec(%rbp)
movl -0xec(%rbp), %eax
cmpl -0xd4(%rbp), %eax
jge 0x8c2d
movl -0xec(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
leaq -0x30(%rbp), %rdi
callq 0x99f0
movq %rax, %rdi
callq 0x3170
movq %rax, %rdi
callq 0x34e0
movl %eax, -0xf0(%rbp)
movl -0xf0(%rbp), %eax
movq 0xa769(%rip), %rcx      # 0x13348
movq 0x10(%rcx), %rcx
movslq -0xec(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jl 0x8c02
movl $0xfffffffa, -0x4(%rbp) # imm = 0xFFFFFFFA
movl $0x1, -0x68(%rbp)
jmp 0x8cb2
movq -0xa28(%rbp), %rax
movl -0xf0(%rbp), %edx
movslq -0xec(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0xec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xec(%rbp)
jmp 0x8b95
movq -0xa28(%rbp), %rdi
movq 0xa70d(%rip), %rsi      # 0x13348
callq 0x8650
movq -0xa28(%rbp), %rdx
movl %eax, -0xf4(%rbp)
movl -0xd4(%rbp), %ecx
leaq 0x4a9d(%rip), %rsi      # 0xd6f7
leaq -0x500(%rbp), %rdi
movq %rdi, -0xa30(%rbp)
callq 0x8440
movq -0xa30(%rbp), %rdx
movq 0xa6cd(%rip), %rax      # 0x13348
movl 0x8(%rax), %esi
movq 0x18(%rax), %rax
movslq -0xf4(%rbp), %rdi
movl %edi, %ecx
movss (%rax,%rdi,4), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x4a5f(%rip), %rdi      # 0xd6fa
movb $0x1, %al
callq 0x3070
jmp 0x8ca4
movl $0x0, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, %rsp
jmp 0x9397
leaq 0x44fa(%rip), %rsi      # 0xd1c2
leaq -0x88(%rbp), %rdi
callq 0x99a0
movb %al, -0xa31(%rbp)
jmp 0x8cdc
movb -0xa31(%rbp), %al
testb $0x1, %al
jne 0x8d12
jmp 0x8ce8
leaq 0x4a2a(%rip), %rsi      # 0xd719
leaq -0x88(%rbp), %rdi
callq 0x99a0
movb %al, -0xa32(%rbp)
jmp 0x8d03
movb -0xa32(%rbp), %al
testb $0x1, %al
jne 0x8d12
jmp 0x8f56
cmpq $0x0, 0xa62e(%rip)      # 0x13348
jne 0x8d2f
movl $0xfffffffc, -0x4(%rbp) # imm = 0xFFFFFFFC
movl $0x1, -0x68(%rbp)
jmp 0x9397
leaq -0x30(%rbp), %rdi
callq 0x9980
subq $0x2, %rax
movl %eax, -0x504(%rbp)
movl -0x504(%rbp), %eax
movq 0xa5f9(%rip), %rcx      # 0x13348
cmpl 0xc(%rcx), %eax
je 0x8d67
movl $0xfffffffb, -0x4(%rbp) # imm = 0xFFFFFFFB
movl $0x1, -0x68(%rbp)
jmp 0x9397
movl -0x504(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x510(%rbp)
leaq 0xf(,%rax,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0xa40(%rbp)
movq %rcx, %rsp
movq %rax, -0x518(%rbp)
movl $0x0, -0x51c(%rbp)
movl -0x51c(%rbp), %eax
cmpl -0x504(%rbp), %eax
jge 0x8e3c
movl -0x51c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
leaq -0x30(%rbp), %rdi
callq 0x99f0
movq %rax, %rdi
callq 0x3170
movq %rax, %rdi
callq 0x34e0
movl %eax, -0x520(%rbp)
movl -0x520(%rbp), %eax
movq 0xa55a(%rip), %rcx      # 0x13348
movq 0x10(%rcx), %rcx
movslq -0x51c(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jl 0x8e11
movl $0xfffffffa, -0x4(%rbp) # imm = 0xFFFFFFFA
movl $0x1, -0x68(%rbp)
jmp 0x8f47
movq -0xa40(%rbp), %rax
movl -0x520(%rbp), %edx
movslq -0x51c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x51c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x51c(%rbp)
jmp 0x8da4
movq -0xa40(%rbp), %rdi
movq 0xa4fe(%rip), %rsi      # 0x13348
callq 0x8650
movl %eax, -0x524(%rbp)
movl -0x504(%rbp), %eax
incl %eax
movslq %eax, %rsi
leaq -0x30(%rbp), %rdi
callq 0x99f0
movq %rax, %rdi
callq 0x3170
movq %rax, %rdi
callq 0x3410
movq -0xa40(%rbp), %rdx
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x528(%rbp)
movl -0x504(%rbp), %ecx
leaq 0x485e(%rip), %rsi      # 0xd6f7
leaq -0x930(%rbp), %rdi
movq %rdi, -0xa48(%rbp)
callq 0x8440
movq -0xa48(%rbp), %rdx
movq 0xa48e(%rip), %rax      # 0x13348
movl 0x8(%rax), %esi
movq 0x18(%rax), %rax
movslq -0x524(%rbp), %rdi
movl %edi, %ecx
movss (%rax,%rdi,4), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x4843(%rip), %rdi      # 0xd71d
movb $0x1, %al
callq 0x3070
jmp 0x8ee3
movss -0x528(%rbp), %xmm0
movq 0xa456(%rip), %rax      # 0x13348
movq 0x18(%rax), %rax
movslq -0x524(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq 0xa43f(%rip), %rax      # 0x13348
movl 0x8(%rax), %esi
movq 0x18(%rax), %rax
movslq -0x524(%rbp), %rdx
movl %edx, %ecx
movss (%rax,%rdx,4), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x4816(%rip), %rdi      # 0xd73f
leaq -0x930(%rbp), %rdx
movb $0x1, %al
callq 0x3070
jmp 0x8f39
movl $0x0, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
movq -0x510(%rbp), %rax
movq %rax, %rsp
jmp 0x9397
leaq 0x4803(%rip), %rsi      # 0xd760
leaq -0x88(%rbp), %rdi
callq 0x99a0
movb %al, -0xa49(%rbp)
jmp 0x8f71
movb -0xa49(%rbp), %al
testb $0x1, %al
jne 0x8f80
jmp 0x90f8
xorl %edi, %edi
leaq -0x9c0(%rbp), %rsi
callq 0x31c0
movl %eax, -0x9c4(%rbp)
cmpl $0x0, -0x9c4(%rbp)
jne 0x90e5
movq -0x9a0(%rbp), %rsi
leaq 0x47b5(%rip), %rdi      # 0xd764
xorl %eax, %eax
callq 0x3070
jmp 0x8fb8
movq -0x998(%rbp), %rsi
leaq 0x47be(%rip), %rdi      # 0xd784
xorl %eax, %eax
callq 0x3070
jmp 0x8fcf
movq -0x990(%rbp), %rsi
leaq 0x47c9(%rip), %rdi      # 0xd7a6
xorl %eax, %eax
callq 0x3070
jmp 0x8fe6
movq -0x988(%rbp), %rsi
leaq 0x47d4(%rip), %rdi      # 0xd7c8
xorl %eax, %eax
callq 0x3070
jmp 0x8ffd
movq -0x980(%rbp), %rsi
leaq 0x47e0(%rip), %rdi      # 0xd7eb
xorl %eax, %eax
callq 0x3070
jmp 0x9014
movq -0x978(%rbp), %rsi
leaq 0x47f0(%rip), %rdi      # 0xd812
xorl %eax, %eax
callq 0x3070
jmp 0x902b
movq -0x970(%rbp), %rsi
leaq 0x47fe(%rip), %rdi      # 0xd837
xorl %eax, %eax
callq 0x3070
jmp 0x9042
movq -0x968(%rbp), %rsi
leaq 0x47f3(%rip), %rdi      # 0xd843
xorl %eax, %eax
callq 0x3070
jmp 0x9059
movq -0x960(%rbp), %rsi
leaq 0x47f9(%rip), %rdi      # 0xd860
xorl %eax, %eax
callq 0x3070
jmp 0x9070
movq -0x958(%rbp), %rsi
leaq 0x4800(%rip), %rdi      # 0xd87e
xorl %eax, %eax
callq 0x3070
jmp 0x9087
movq -0x950(%rbp), %rsi
leaq 0x4801(%rip), %rdi      # 0xd896
xorl %eax, %eax
callq 0x3070
jmp 0x909e
movq -0x948(%rbp), %rsi
leaq 0x4806(%rip), %rdi      # 0xd8b2
xorl %eax, %eax
callq 0x3070
jmp 0x90b5
movq -0x940(%rbp), %rsi
leaq 0x4808(%rip), %rdi      # 0xd8cb
xorl %eax, %eax
callq 0x3070
jmp 0x90cc
movq -0x938(%rbp), %rsi
leaq 0x47ef(%rip), %rdi      # 0xd8c9
xorl %eax, %eax
callq 0x3070
jmp 0x90e3
jmp 0x90e5
movl $0x0, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x9397
leaq 0x47ed(%rip), %rsi      # 0xd8ec
leaq -0x88(%rbp), %rdi
callq 0x99a0
movb %al, -0xa4a(%rbp)
jmp 0x9113
movb -0xa4a(%rbp), %al
testb $0x1, %al
jne 0x9122
jmp 0x91e0
cmpq $0x0, 0xa21e(%rip)      # 0x13348
jne 0x913f
movl $0xfffffffc, -0x4(%rbp) # imm = 0xFFFFFFFC
movl $0x1, -0x68(%rbp)
jmp 0x9397
leaq -0x30(%rbp), %rdi
callq 0x9980
cmpq $0x2, %rax
je 0x9161
movl $0xfffffff9, -0x4(%rbp) # imm = 0xFFFFFFF9
movl $0x1, -0x68(%rbp)
jmp 0x9397
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x99f0
movq %rax, %rdi
callq 0x3170
movq %rax, -0x9d0(%rbp)
movq 0xa1c3(%rip), %rax      # 0x13348
movl 0x8(%rax), %eax
movl %eax, -0x9d4(%rbp)
movq -0x18(%rbp), %rdi
movq 0xa1af(%rip), %rsi      # 0x13348
movq -0x9d0(%rbp), %rdx
callq 0x3f80
jmp 0x91a7
movq -0x18(%rbp), %rdi
movl -0x9d4(%rbp), %esi
callq 0x3dc0
movq %rax, -0xa58(%rbp)
jmp 0x91bf
movq -0xa58(%rbp), %rax
movq %rax, 0xa17b(%rip)      # 0x13348
movl $0x0, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x9397
leaq 0x470a(%rip), %rsi      # 0xd8f1
leaq -0x88(%rbp), %rdi
callq 0x99a0
movb %al, -0xa59(%rbp)
jmp 0x91fb
movb -0xa59(%rbp), %al
testb $0x1, %al
jne 0x920a
jmp 0x931b
cmpq $0x0, 0xa136(%rip)      # 0x13348
jne 0x9227
movl $0xfffffffc, -0x4(%rbp) # imm = 0xFFFFFFFC
movl $0x1, -0x68(%rbp)
jmp 0x9397
leaq -0x30(%rbp), %rdi
callq 0x9980
cmpq $0x2, %rax
je 0x9249
movl $0xfffffff9, -0x4(%rbp) # imm = 0xFFFFFFF9
movl $0x1, -0x68(%rbp)
jmp 0x9397
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x99f0
movq %rax, %rdi
callq 0x3170
movq %rax, -0x9e0(%rbp)
movq -0x18(%rbp), %rdi
movq 0xa0d7(%rip), %rsi      # 0x13348
movq -0x9e0(%rbp), %rdx
callq 0x40a0
movl %eax, -0xa60(%rbp)
jmp 0x9285
movl -0xa60(%rbp), %eax
movl %eax, -0x9e4(%rbp)
movl -0x9e4(%rbp), %eax
addl $0x3, %eax
movl %eax, %ecx
movq %rcx, -0xa68(%rbp)
subl $0x3, %eax
ja 0x930b
movq -0xa68(%rbp), %rax
leaq 0x4396(%rip), %rcx      # 0xd64c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x9397
movl $0xfffffff6, -0x4(%rbp) # imm = 0xFFFFFFF6
movl $0x1, -0x68(%rbp)
jmp 0x9397
movl $0xfffffff5, -0x4(%rbp) # imm = 0xFFFFFFF5
movl $0x1, -0x68(%rbp)
jmp 0x9397
movl $0xfffffff7, -0x4(%rbp) # imm = 0xFFFFFFF7
movl $0x1, -0x68(%rbp)
jmp 0x9397
movl $0x0, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x9397
leaq 0x45d4(%rip), %rsi      # 0xd8f6
leaq -0x88(%rbp), %rdi
callq 0x99a0
movb %al, -0xa69(%rbp)
jmp 0x9336
movb -0xa69(%rbp), %al
testb $0x1, %al
jne 0x9369
jmp 0x9342
leaq 0x45af(%rip), %rsi      # 0xd8f8
leaq -0x88(%rbp), %rdi
callq 0x99a0
movb %al, -0xa6a(%rbp)
jmp 0x935d
movb -0xa6a(%rbp), %al
testb $0x1, %al
jne 0x9369
jmp 0x9389
leaq 0x458d(%rip), %rdi      # 0xd8fd
xorl %eax, %eax
callq 0x3070
jmp 0x9379
movl $0x0, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x9397
movl $0x0, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x3200
jmp 0x93b3
leaq -0x88(%rbp), %rdi
callq 0x3200
jmp 0x93c4
leaq -0x30(%rbp), %rdi
callq 0x9a10
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x9a10
movq -0x60(%rbp), %rdi
callq 0x3560
nopw %cs:(%rax,%rax)