// File: /workspace/github_cpp_makefile_star2_O3/BruceHu1005[P]np-assignment1/clientmain.cpp
// Function: main
int main(int argc, char *argv[]){
  
  /* Do magic */
  int sock_fd, send_num, recv_num;
  struct addrinfo hints, *servinfo, *p;
  char send_buf[BUFF_LEN];
  char recv_buf[BUFF_LEN];

  if (argc != 2) {
	  fprintf(stderr,"usage: %s hostname (%d)\n",argv[0],argc);
	  exit(1);
	}
  memset(&hints, 0, sizeof hints);
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  

  if ((recv_num = getaddrinfo(argv[1], PORT, &hints, &servinfo)) != 0) {
        fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(recv_num));
        return 1;
  }

  for(p = servinfo; p != NULL; p = p->ai_next) {
    if ((sock_fd = socket(p->ai_family, p->ai_socktype,
      p->ai_protocol)) == -1) {
      perror("client: socket");
      continue;
    }

    if (connect(sock_fd, p->ai_addr, p->ai_addrlen) == -1) {
      close(sock_fd);
      perror("client: connect");
      continue;
    }
    break;
  }
  if (p == NULL) {
    fprintf(stderr, "client: failed to connect\n");
    return 2;
  }
  recv_num = recv(sock_fd, recv_buf, sizeof(recv_buf), 0);
  if(recv_num<0 ){
  perror("recvfrom error:");
  exit(1);
  }
  else {
    recv_buf[recv_num] = '\0';
    printf("client receive %d bytes: %s\n", recv_num, recv_buf);
  } 
  
  std::cin >> send_buf;
  send_num=send(sock_fd,send_buf, strlen(send_buf), 0);
  recv_num = recv(sock_fd, recv_buf, sizeof(recv_buf), 0);
  char dis[recv_num];
  sprintf(dis, "%s", "disconnected");
  recv_buf[recv_num] = '\0';
  printf("client receive %d bytes: %s\n", recv_num, recv_buf);
  
  if (strcmp(recv_buf, dis) == 0) {
    close(sock_fd);
    return 0;
  }
  
  string temp = recv_buf;
  string calc[3];
  istringstream is(temp);
  is>>calc[0]>>calc[1]>>calc[2];
  string ptr = calc[0];
  string num1 = calc[1];
  string num2 = calc[2]; 
 
  if(ptr[0]=='f'){
    if (ptr == "fadd")
    {
      sprintf(send_buf, "%8.8g\n", stod(num1) + stod(num2));
    }
    else if (ptr == "fsub")
    {
      sprintf(send_buf, "%8.8g\n", stod(num1) - stod(num2));
    }
    else if (ptr == "fmul")
    {
      sprintf(send_buf, "%8.8g\n", stod(num1) * stod(num2));
    }
    else if (ptr == "fdiv")
    {
      sprintf(send_buf, "%8.8g\n", stod(num1) / stod(num2));
    }
  }
  else{
    if (ptr == "add")
    {
      sprintf(send_buf, "%d\n", stoi(num1) + stoi(num2));
    }
    else if (ptr == "sub")
    {
      sprintf(send_buf, "%d\n", stoi(num1) - stoi(num2));
    }
    else if (ptr == "mul")
    {
      sprintf(send_buf, "%d\n", stoi(num1) * stoi(num2));
    }
    else if (ptr == "div")
    {
      sprintf(send_buf, "%d\n", stoi(num1) / stoi(num2));
    }
  }
  printf("Answer of Client is %s\n", send_buf);
  send_num=send(sock_fd, send_buf, strlen(send_buf), 0);
  recv_num = recv(sock_fd, recv_buf, sizeof(recv_buf), 0);
  recv_buf[recv_num] = '\0';
  printf("client receive %d bytes: %s\n", recv_num, recv_buf);

  close(sock_fd);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x6b8, %rsp            # imm = 0x6B8
cmpl $0x2, %edi
jne 0x2fe2
xorpd %xmm0, %xmm0
leaq -0x360(%rbp), %rdx
movapd %xmm0, (%rdx)
movapd %xmm0, 0x20(%rdx)
movapd %xmm0, 0x10(%rdx)
movl $0x1, 0x8(%rdx)
movq 0x8(%rsi), %rdi
leaq 0x1acf(%rip), %rsi      # 0x403d
leaq -0xd0(%rbp), %rcx
callq 0x2180
testl %eax, %eax
jne 0x2c15
movq -0xd0(%rbp), %r14
testq %r14, %r14
je 0x25e3
leaq 0x1abe(%rip), %r15      # 0x4053
leaq 0x1ac6(%rip), %r12      # 0x4062
movl 0x4(%r14), %edi
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
callq 0x2060
movq %r15, %rdi
cmpl $-0x1, %eax
je 0x25d5
movl %eax, %ebx
movq 0x18(%r14), %rsi
movl 0x10(%r14), %edx
movl %eax, %edi
callq 0x2110
cmpl $-0x1, %eax
jne 0x25f2
movl %ebx, %edi
callq 0x2270
movq %r12, %rdi
callq 0x2120
movq 0x28(%r14), %r14
testq %r14, %r14
jne 0x259c
callq 0x2333
movl $0x2, %eax
jmp 0x2fc9
leaq -0x560(%rbp), %rsi
movl $0x200, %edx            # imm = 0x200
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x2090
testl %eax, %eax
js 0x2fee
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movb $0x0, -0x560(%rbp,%rcx)
leaq 0x1a77(%rip), %rdi      # 0x409d
leaq -0x560(%rbp), %rdx
movl %eax, %esi
xorl %eax, %eax
callq 0x2040
movq 0x39a3(%rip), %r14      # 0x5fe0
movq (%r14), %rax
movq -0x18(%rax), %rax
movq $-0x201, %r15           # imm = 0xFDFF
addq 0x10(%r14,%rax), %r15
leaq -0x330(%rbp), %rsi
movl $0x200, %edx            # imm = 0x200
movq %r14, %rdi
callq 0x2230
movq (%r14), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x20(%r14,%rax)
jne 0x2692
cmpq $-0x201, %r15           # imm = 0xFDFF
ja 0x2692
movq 0xe8(%r14,%rax), %rdi
movq 0x10(%rdi), %rax
cmpq 0x18(%rdi), %rax
jae 0x2fd8
leaq -0x330(%rbp), %r14
movq %r14, %rdi
callq 0x20b0
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x20c0
leaq -0x560(%rbp), %r14
movl $0x200, %edx            # imm = 0x200
movl %ebx, %edi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x2090
movq %rsp, %r13
movl %eax, %ecx
addq $0xf, %rcx
andq $-0x10, %rcx
movq %rsp, %rdx
movq %rdx, %r15
subq %rcx, %r15
negq %rcx
movq %r15, %rsp
movabsq $0x656e6e6f63736964, %rsi # imm = 0x656E6E6F63736964
movq %rsi, (%rdx,%rcx)
movabsq $0x64657463656e6e, %rcx # imm = 0x64657463656E6E
movq %rcx, 0x5(%r15)
movslq %eax, %rsi
movb $0x0, -0x560(%rbp,%rsi)
leaq 0x198b(%rip), %rdi      # 0x409d
movq %r14, %rdx
xorl %eax, %eax
callq 0x2040
movq %r14, %rdi
movq %r15, %rsi
callq 0x21b0
testl %eax, %eax
je 0x28f3
leaq -0xb8(%rbp), %r15
movq %r15, -0x10(%r15)
movq %r14, %rdi
callq 0x20b0
leaq (%rax,%rbp), %rdx
addq $-0x560, %rdx           # imm = 0xFAA0
leaq -0xc8(%rbp), %rdi
movq %r14, %rsi
callq 0x33b8
movl $0x10, %eax
leaq (%rax,%rbp), %rcx
addq $-0x130, %rcx           # imm = 0xFED0
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rax
cmpq $0x70, %rax
jne 0x2761
leaq -0x6e0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
movl $0x8, %edx
callq 0x2210
leaq -0x6e0(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x2190
leaq -0x110(%rbp), %rsi
movq %rax, %rdi
callq 0x2190
leaq -0xf0(%rbp), %rsi
movq %rax, %rdi
callq 0x2190
leaq -0x58(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x130(%rbp), %rsi
movq -0x128(%rbp), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %rdi
callq 0x331a
leaq -0x98(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rdx
addq %rsi, %rdx
leaq -0xa8(%rbp), %rdi
callq 0x331a
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %rdi
callq 0x331a
movq -0x68(%rbp), %rax
cmpb $0x66, (%rax)
jne 0x28ff
leaq 0x17c3(%rip), %rsi      # 0x4015
leaq -0x68(%rbp), %rdi
callq 0x2080
testl %eax, %eax
je 0x29ac
leaq 0x17a6(%rip), %rsi      # 0x4010
leaq -0x68(%rbp), %rdi
callq 0x2080
testl %eax, %eax
je 0x2ad8
leaq 0x179d(%rip), %rsi      # 0x401f
leaq -0x68(%rbp), %rdi
callq 0x2080
testl %eax, %eax
je 0x2c84
leaq 0x1780(%rip), %rsi      # 0x401a
leaq -0x68(%rbp), %rdi
callq 0x2080
testl %eax, %eax
jne 0x2ea0
leaq -0xa8(%rbp), %rdi
xorl %esi, %esi
callq 0x31ef
movsd %xmm0, -0x40(%rbp)
leaq -0x88(%rbp), %rdi
xorl %esi, %esi
callq 0x31ef
movsd -0x40(%rbp), %xmm1
divsd %xmm0, %xmm1
leaq 0x17de(%rip), %rsi      # 0x40ba
leaq -0x330(%rbp), %rdi
movapd %xmm1, %xmm0
movb $0x1, %al
callq 0x2050
jmp 0x2ea0
movl %ebx, %edi
callq 0x2270
jmp 0x2fc4
leaq 0x1710(%rip), %rsi      # 0x4016
leaq -0x68(%rbp), %rdi
callq 0x2080
testl %eax, %eax
je 0x2a0b
leaq 0x16f3(%rip), %rsi      # 0x4011
leaq -0x68(%rbp), %rdi
callq 0x2080
testl %eax, %eax
je 0x2b37
leaq 0x16ea(%rip), %rsi      # 0x4020
leaq -0x68(%rbp), %rdi
callq 0x2080
testl %eax, %eax
je 0x2ce3
leaq 0x16cd(%rip), %rsi      # 0x401b
leaq -0x68(%rbp), %rdi
callq 0x2080
testl %eax, %eax
jne 0x2ea0
leaq -0xa8(%rbp), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x3279
movl %eax, %r14d
leaq -0x88(%rbp), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x3279
movl %eax, %ecx
movl %r14d, %eax
cltd
idivl %ecx
leaq 0x172a(%rip), %rsi      # 0x40c1
leaq -0x330(%rbp), %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x2050
jmp 0x2ea0
movq %r13, -0x40(%rbp)
movq -0xa8(%rbp), %r15
callq 0x2030
movq %rax, %r14
movl (%rax), %eax
movl %eax, -0x34(%rbp)
movl $0x0, (%r14)
leaq -0x48(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x20f0
cmpq %r15, (%r12)
je 0x2ff3
movl (%r14), %r13d
testl %r13d, %r13d
movsd %xmm0, -0x30(%rbp)
je 0x2c26
cmpl $0x22, %r13d
jne 0x2c2d
leaq 0x16d7(%rip), %rdi      # 0x40dd
callq 0x21f0
movq %r13, -0x40(%rbp)
movq -0xa8(%rbp), %r12
callq 0x2030
movq %rax, %r14
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movl $0x0, (%r14)
leaq -0x48(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x21c0
cmpq %r12, (%r13)
je 0x2fff
movq %rax, %r15
movslq %r15d, %rax
cmpq %r15, %rax
jne 0x300b
movl (%r14), %eax
cmpl $0x22, %eax
je 0x300b
testl %eax, %eax
jne 0x2a6d
movl -0x30(%rbp), %eax
movl %eax, (%r14)
movl %eax, -0x30(%rbp)
movq -0x88(%rbp), %r12
movl $0x0, (%r14)
movq %r12, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x21c0
cmpq %r12, (%r13)
je 0x3023
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%rax), %rdx
cmpq %rcx, %rdx
leaq -0x58(%rbp), %r12
movq -0x40(%rbp), %r13
jb 0x302f
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x302f
testl %ecx, %ecx
jne 0x2ad0
movl -0x30(%rbp), %ecx
movl %ecx, (%r14)
addl %r15d, %eax
jmp 0x2dac
movq %r13, -0x40(%rbp)
movq -0xa8(%rbp), %r15
callq 0x2030
movq %rax, %r14
movl (%rax), %eax
movl %eax, -0x34(%rbp)
movl $0x0, (%r14)
leaq -0x48(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x20f0
cmpq %r15, (%r12)
je 0x303b
movl (%r14), %r13d
testl %r13d, %r13d
movsd %xmm0, -0x30(%rbp)
je 0x2dcf
cmpl $0x22, %r13d
jne 0x2dd6
leaq 0x15ab(%rip), %rdi      # 0x40dd
callq 0x21f0
movq %r13, -0x40(%rbp)
movq -0xa8(%rbp), %r12
callq 0x2030
movq %rax, %r14
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movl $0x0, (%r14)
leaq -0x48(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x21c0
cmpq %r12, (%r13)
je 0x3047
movq %rax, %r15
movslq %r15d, %rax
cmpq %r15, %rax
jne 0x3053
movl (%r14), %eax
cmpl $0x22, %eax
je 0x3053
testl %eax, %eax
jne 0x2b99
movl -0x30(%rbp), %eax
movl %eax, (%r14)
movl %eax, -0x30(%rbp)
movq -0x88(%rbp), %r12
movl $0x0, (%r14)
movq %r12, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x21c0
cmpq %r12, (%r13)
je 0x306b
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%rax), %rdx
cmpq %rcx, %rdx
leaq -0x58(%rbp), %r12
movq -0x40(%rbp), %r13
jb 0x3077
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x3077
testl %ecx, %ecx
jne 0x2bfc
movl -0x30(%rbp), %ecx
movl %ecx, (%r14)
subl %eax, %r15d
leaq 0x14bb(%rip), %rsi      # 0x40c1
leaq -0x330(%rbp), %rdi
movl %r15d, %edx
jmp 0x2dbc
movl %eax, %edi
callq 0x22bc
movl $0x1, %eax
jmp 0x2fc9
movl -0x34(%rbp), %r13d
movl %r13d, (%r14)
movq -0x88(%rbp), %r15
movl $0x0, (%r14)
movq %r15, %rdi
movq %r12, %rsi
callq 0x20f0
cmpq %r15, (%r12)
je 0x3017
movl (%r14), %eax
testl %eax, %eax
leaq -0xb8(%rbp), %r15
leaq -0x58(%rbp), %r12
je 0x2c73
cmpl $0x22, %eax
jne 0x2c76
leaq 0x146f(%rip), %rdi      # 0x40dd
callq 0x21f0
movl %r13d, (%r14)
movsd -0x30(%rbp), %xmm1
addsd %xmm0, %xmm1
jmp 0x2e83
movq %r13, -0x40(%rbp)
movq -0xa8(%rbp), %r15
callq 0x2030
movq %rax, %r14
movl (%rax), %eax
movl %eax, -0x34(%rbp)
movl $0x0, (%r14)
leaq -0x48(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x20f0
cmpq %r15, (%r12)
je 0x3083
movl (%r14), %r13d
testl %r13d, %r13d
movsd %xmm0, -0x30(%rbp)
je 0x2e2a
cmpl $0x22, %r13d
jne 0x2e31
leaq 0x13ff(%rip), %rdi      # 0x40dd
callq 0x21f0
movq %r13, -0x40(%rbp)
movq -0xa8(%rbp), %r12
callq 0x2030
movq %rax, %r14
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movl $0x0, (%r14)
leaq -0x48(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x21c0
cmpq %r12, (%r13)
je 0x308f
movq %rax, %r15
movslq %r15d, %rax
cmpq %r15, %rax
jne 0x309b
movl (%r14), %eax
cmpl $0x22, %eax
je 0x309b
testl %eax, %eax
jne 0x2d45
movl -0x30(%rbp), %eax
movl %eax, (%r14)
movl %eax, -0x30(%rbp)
movq -0x88(%rbp), %r12
movl $0x0, (%r14)
movq %r12, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x21c0
cmpq %r12, (%r13)
je 0x30b3
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%rax), %rdx
cmpq %rcx, %rdx
leaq -0x58(%rbp), %r12
movq -0x40(%rbp), %r13
jb 0x30bf
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x30bf
testl %ecx, %ecx
jne 0x2da8
movl -0x30(%rbp), %ecx
movl %ecx, (%r14)
imull %r15d, %eax
leaq 0x130e(%rip), %rsi      # 0x40c1
leaq -0x330(%rbp), %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x2050
leaq -0xb8(%rbp), %r15
jmp 0x2ea0
movl -0x34(%rbp), %r13d
movl %r13d, (%r14)
movq -0x88(%rbp), %r15
movl $0x0, (%r14)
movq %r15, %rdi
movq %r12, %rsi
callq 0x20f0
cmpq %r15, (%r12)
je 0x305f
movl (%r14), %eax
testl %eax, %eax
leaq -0xb8(%rbp), %r15
leaq -0x58(%rbp), %r12
je 0x2e1c
cmpl $0x22, %eax
jne 0x2e1f
leaq 0x12c6(%rip), %rdi      # 0x40dd
callq 0x21f0
movl %r13d, (%r14)
movsd -0x30(%rbp), %xmm1
subsd %xmm0, %xmm1
jmp 0x2e83
movl -0x34(%rbp), %r13d
movl %r13d, (%r14)
movq -0x88(%rbp), %r15
movl $0x0, (%r14)
movq %r15, %rdi
movq %r12, %rsi
callq 0x20f0
cmpq %r15, (%r12)
je 0x30a7
movl (%r14), %eax
testl %eax, %eax
leaq -0xb8(%rbp), %r15
leaq -0x58(%rbp), %r12
je 0x2e77
cmpl $0x22, %eax
jne 0x2e7a
leaq 0x126b(%rip), %rdi      # 0x40dd
callq 0x21f0
movl %r13d, (%r14)
movsd -0x30(%rbp), %xmm1
mulsd %xmm0, %xmm1
leaq 0x1230(%rip), %rsi      # 0x40ba
leaq -0x330(%rbp), %rdi
movapd %xmm1, %xmm0
movb $0x1, %al
callq 0x2050
movq -0x40(%rbp), %r13
leaq 0x121e(%rip), %rdi      # 0x40c5
leaq -0x330(%rbp), %r14
movq %r14, %rsi
xorl %eax, %eax
callq 0x2040
movq %r14, %rdi
callq 0x20b0
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x20c0
leaq -0x560(%rbp), %rsi
movl $0x200, %edx            # imm = 0x200
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x2090
movslq %eax, %rsi
movb $0x0, -0x560(%rbp,%rsi)
leaq 0x11a7(%rip), %rdi      # 0x409d
leaq -0x560(%rbp), %rdx
xorl %eax, %eax
callq 0x2040
movl %ebx, %edi
callq 0x2270
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x2f27
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2160
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x2f49
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2160
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x2f5e
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2160
movq 0x3063(%rip), %rsi      # 0x5fc8
leaq -0x6e0(%rbp), %rdi
callq 0x21d0
leaq -0x668(%rbp), %rdi
callq 0x20a0
movq $-0x60, %rbx
leaq -0xe0(%rbp), %r14
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x2f9f
movq (%r14), %rsi
incq %rsi
callq 0x2160
addq $-0x20, %r14
addq $0x20, %rbx
jne 0x2f8b
movq -0xc8(%rbp), %rdi
cmpq %r15, %rdi
je 0x2fc4
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x2160
movq %r13, %rsp
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x22ec
jmp 0x2692
movl %edi, %eax
movq %rsi, %rdi
movl %eax, %esi
callq 0x2290
callq 0x231b
leaq 0x10e3(%rip), %rdi      # 0x40dd
callq 0x20d0
leaq 0x10dc(%rip), %rdi      # 0x40e2
callq 0x20d0
leaq 0x10d0(%rip), %rdi      # 0x40e2
callq 0x21f0
leaq 0x10bf(%rip), %rdi      # 0x40dd
callq 0x20d0
leaq 0x10b8(%rip), %rdi      # 0x40e2
callq 0x20d0
leaq 0x10ac(%rip), %rdi      # 0x40e2
callq 0x21f0
leaq 0x109b(%rip), %rdi      # 0x40dd
callq 0x20d0
leaq 0x1094(%rip), %rdi      # 0x40e2
callq 0x20d0
leaq 0x1088(%rip), %rdi      # 0x40e2
callq 0x21f0
leaq 0x1077(%rip), %rdi      # 0x40dd
callq 0x20d0
leaq 0x1070(%rip), %rdi      # 0x40e2
callq 0x20d0
leaq 0x1064(%rip), %rdi      # 0x40e2
callq 0x21f0
leaq 0x1053(%rip), %rdi      # 0x40dd
callq 0x20d0
leaq 0x104c(%rip), %rdi      # 0x40e2
callq 0x20d0
leaq 0x1040(%rip), %rdi      # 0x40e2
callq 0x21f0
leaq 0x102f(%rip), %rdi      # 0x40dd
callq 0x20d0
leaq 0x1028(%rip), %rdi      # 0x40e2
callq 0x20d0
leaq 0x101c(%rip), %rdi      # 0x40e2
callq 0x21f0
jmp 0x30db
jmp 0x30e9
jmp 0x30f9
jmp 0x30f9
jmp 0x30db
jmp 0x30e9
jmp 0x30f9
jmp 0x30f9
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x3123
movl %r13d, (%r14)
jmp 0x3123
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x3123
movl -0x34(%rbp), %eax
jmp 0x3105
jmp 0x30f9
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x3123
movl -0x30(%rbp), %eax
movl %eax, (%r14)
jmp 0x3123
movq %rax, %rbx
jmp 0x313f
movq %rax, %rbx
jmp 0x3161
jmp 0x311b
movq %rax, %rbx
jmp 0x3199
movq %rax, %rbx
jmp 0x317a
movq %rax, %rbx
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x313f
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2160
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x3161
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2160
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x317a
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2160
movq 0x2e47(%rip), %rsi      # 0x5fc8
leaq -0x6e0(%rbp), %rdi
callq 0x21d0
leaq -0x668(%rbp), %rdi
callq 0x20a0
movq $-0x60, %r14
leaq -0xe0(%rbp), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x31bb
movq (%r15), %rsi
incq %rsi
callq 0x2160
addq $-0x20, %r15
addq $0x20, %r14
jne 0x31a7
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x31e7
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x2240