// File: jkingan[P]ladyheather/heather.cpp
// Function: init_com(unsigned int, int)
void init_com(unsigned port, int why)
{
int col, i;
int sync;

   // Initialize the serial device for asynchronous non-blocking communication
   // The device can be a serial port or ethernet connection
   if(port >= NUM_COM_PORTS) return;

   kill_com(port, why);   // in case COM port already open
   com[port].com_error = 0;
   if((port == RCVR_PORT) && (rcvr_type == NO_RCVR) && (enable_terminal == 0)) { // alternate ready/not ready each check
      return;
   }
if((port == RCVR_PORT) && (rcvr_type == TIDE_RCVR) && (enable_terminal == 0)) {
   return;
}

   crlf_seen = 0;
   if((com[port].com_port == 0) && (com[port].usb_port == 0) && com[port].IP_addr[0]) {
      //
      // TCP: In Windows, COM0 with process_com=TRUE means we're using TCP/IP
      //
      if(com[port].process_com) {
         init_tcpip(port);
         com[port].com_running = TCPIP_RUNNING;
         com[port].com_data_lost = 0;
         com[port].last_com_time = this_msec = GetMsecs();
         if(port == RCVR_PORT) first_request = 1;
         Sleep(COM_INIT_SLEEP);
      }
      return;
   }

   if((com[port].usb_port == USE_IDEV_NAME) && com[port].com_dev[0]) {  // user set com device name with -id=xxx command line option
   }
   else if(com[port].usb_port == USE_DEV_NAME) {  // use symlink to /dev/heather
      strcpy(com[port].com_dev, HEATHER_DEV);
   }
   else if(com[port].usb_port) {    // USB serial port
      #ifdef __MACH__
         if(com[port].usb_port <= 1) sprintf(com[port].com_dev, "/dev/tty.usbserial");
         else                        sprintf(com[port].com_dev, "/dev/tty.usbserial%d", com[port].usb_port-1);
      #elif defined(__linux__)
         sprintf(com[port].com_dev, "/dev/ttyUSB%d", com[port].usb_port-1);
      #elif defined(__FreeBSD__)
         sprintf(com[port].com_dev, "/dev/cuaU%d", com[port].usb_port-1);
      #else
         strcpy(com[port].com_dev, HEATHER_DEV);
      #endif
   }
   else if(com[port].com_port) {    // hardware serial port
      #ifdef __MACH__
         sprintf(com[port].com_dev, "/dev/ttys%d", com[port].com_port-1);
      #elif defined(__linux__)
         sprintf(com[port].com_dev, "/dev/ttyS%d", com[port].com_port-1);
      #elif defined(__FreeBSD__)
        sprintf(com[port].com_dev, "/dev/cuau%d", com[port].com_port-1);
      #else
        strcpy(com[port].com_dev, HEATHER_DEV);
      #endif
   }
   else {  // should never happen
      com[port].com_running = (-12); //NOT_RUNNING;
      com[port].process_com = 0;
      com[port].com_error |= INIT_ERR;
      if(port == RCVR_PORT) first_request = 1;
      return;
   }
printf("opening com[%d] device:%s\n", port, com[port].com_dev); // zork - show_debug_info
fflush(stdout);

//
// we init the com device here
//

/*
   #ifndef O_RSYNC
      sync = O_SYNC;
   #else
      sync = O_RSYNC;
   #endif
   sync = O_DSYNC | sync;
*/
sync = 0;

   com[port].com_fd = open(com[port].com_dev, O_RDWR | O_NOCTTY | O_NONBLOCK | sync);
   if(com[port].com_fd < 0) {
      printf("Com[%d] open failed:%d\n", port, com[port].com_fd);
      printf("\n");
      printf("Do you have permission to access the serial device?\n");
      printf("try:  sudo usermod -a -G dialout user_name\n");
      printf("      and then re-boot the system\n");
      com[port].process_com = 0;
      com[port].com_running = (-13); //NOT_RUNNING;
      com[port].com_error |= INIT_ERR;
      if(port == RCVR_PORT) first_request = 1;
      return;
   }

   tcgetattr(com[port].com_fd, &oldtio); /* save current port settings */

   /* set new port settings for non-canonical input processing */
   bzero(&newtio, sizeof(newtio));
   if     (com[port].data_bits == 7) newtio.c_cflag = CS7 | CLOCAL | CREAD;
   else if(com[port].data_bits == 6) newtio.c_cflag = CS6 | CLOCAL | CREAD;
   else if(com[port].data_bits == 5) newtio.c_cflag = CS5 | CLOCAL | CREAD;
   else                              newtio.c_cflag = CS8 | CLOCAL | CREAD;

   if(com[port].stop_bits == 2) newtio.c_cflag |= (CSTOPB);

   if(com[port].parity == ODD_PAR) {   // odd parity
      newtio.c_cflag |= (PARENB | PARODD);
   }
   else if(com[port].parity == EVEN_PAR) {  // even parity
      newtio.c_cflag |= (PARENB);
   }
   else {  // no parity
   }

   newtio.c_iflag = IGNPAR;   // ignore parity errors on reads
   newtio.c_oflag = 0;
   newtio.c_lflag = 0;
   newtio.c_cc[VMIN] = 0;
   newtio.c_cc[VTIME] = 0;

   if     (com[port].baud_rate == 150)    i = B150;
   else if(com[port].baud_rate == 300)    i = B300;
   else if(com[port].baud_rate == 600)    i = B600;
   else if(com[port].baud_rate == 1200)   i = B1200;
   else if(com[port].baud_rate == 2400)   i = B2400;
   else if(com[port].baud_rate == 4800)   i = B4800;
   else if(com[port].baud_rate == 9600)   i = B9600;
   else if(com[port].baud_rate == 19200)  i = B19200;
   else if(com[port].baud_rate == 38400)  i = B38400;
   else if(com[port].baud_rate == 57600)  i = B57600;
   else if(com[port].baud_rate == 115200) i = B115200;
   else if(com[port].baud_rate == 230400) i = B230400;
   else i = B9600;
   cfsetispeed(&newtio, i);
   cfsetospeed(&newtio, i);

   tcflush(com[port].com_fd, TCIFLUSH);
   tcsetattr(com[port].com_fd, TCSANOW, &newtio);
   fcntl(com[port].com_fd, F_SETFL, FNDELAY); // make sure port is in non-blocking mode

   SetDtrLine(port, 1);
   if((rcvr_type == ACRON_RCVR) && (port == RCVR_PORT)) {  // power up the RS-232 interface
      SetDtrLine(port, 1);  // drive +12V
      SetRtsLine(port, 0);  // drive -12V
      Sleep(500);
   }
   com[port].com_running = SERIAL_RUNNING;
   com[port].port_used = 2;  // serial port open
   if(port == RCVR_PORT) first_request = 1;
   Sleep(COM_INIT_SLEEP);

   if(modem_alarms) reset_alarm();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
cmpl $0x13, -0x4(%rbp)
jb 0xc0f9
jmp 0xcac7
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
callq 0xb900
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x3613b0(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movb $0x0, 0x2251(%rax)
cmpl $0xa, -0x4(%rbp)
jne 0xc142
cmpq $0x400, 0x26b97e(%rip) # imm = 0x400
jne 0xc142
cmpl $0x0, 0x291fd5(%rip)    # 0x29e110
jne 0xc142
jmp 0xcac7
cmpl $0xa, -0x4(%rbp)
jne 0xc163
cmpq $0x800000, 0x26b95d(%rip) # imm = 0x800000
jne 0xc163
cmpl $0x0, 0x291fb4(%rip)    # 0x29e110
jne 0xc163
jmp 0xcac7
movl $0x0, 0x292007(%rip)    # 0x29e174
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x361347(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x0, (%rax)
jne 0xc281
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x361328(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x0, 0x4(%rax)
jne 0xc281
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x361308(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpb $0x0, 0x10d(%rax)
je 0xc281
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x3612e5(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x0, 0x2234(%rax)
je 0xc27c
movl -0x4(%rbp), %edi
callq 0xb9f0
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x3612ba(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movl $0x2, 0x2230(%rax)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x36129a(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movb $0x0, 0x2250(%rax)
callq 0xb630
movsd %xmm0, 0x360704(%rip)   # 0x36c948
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x361270(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movsd %xmm0, 0x2248(%rax)
cmpl $0xa, -0x4(%rbp)
jne 0xc272
movl $0x1, 0x36038e(%rip)    # 0x36c600
movl $0xc8, %edi
callq 0xb8b0
jmp 0xcac7
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x361233(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x270f, 0x4(%rax)      # imm = 0x270F
jne 0xc2c1
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x361214(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpb $0x0, 0xc(%rax)
je 0xc2c1
jmp 0xc44b
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x3611f3(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x3e7, 0x4(%rax)       # imm = 0x3E7
jne 0xc309
movl -0x4(%rbp), %eax
leaq 0x3611d6(%rip), %rdi    # 0x36d4c0
imulq $0x2260, %rax, %rax     # imm = 0x2260
addq %rax, %rdi
addq $0xc, %rdi
leaq 0x163543(%rip), %rsi    # 0x16f842
callq 0x9350
jmp 0xc449
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x3611ab(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x0, 0x4(%rax)
je 0xc36c
movl -0x4(%rbp), %eax
leaq 0x361191(%rip), %rdi    # 0x36d4c0
imulq $0x2260, %rax, %rax     # imm = 0x2260
addq %rax, %rdi
addq $0xc, %rdi
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x361177(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movl 0x4(%rax), %edx
subl $0x1, %edx
leaq 0x1634ef(%rip), %rsi    # 0x16f84f
movb $0x0, %al
callq 0x9060
jmp 0xc447
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x361148(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x0, (%rax)
je 0xc3ca
movl -0x4(%rbp), %eax
leaq 0x36112f(%rip), %rdi    # 0x36d4c0
imulq $0x2260, %rax, %rax     # imm = 0x2260
addq %rax, %rdi
addq $0xc, %rdi
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x361115(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movl (%rax), %edx
subl $0x1, %edx
leaq 0x16349c(%rip), %rsi    # 0x16f85d
movb $0x0, %al
callq 0x9060
jmp 0xc445
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x3610ea(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movl $0xfffffff4, 0x2230(%rax) # imm = 0xFFFFFFF4
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x3610ca(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movl $0x0, 0x2234(%rax)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x3610aa(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movzbl 0x2251(%rax), %ecx
orl $0x4, %ecx
movb %cl, 0x2251(%rax)
cmpl $0xa, -0x4(%rbp)
jne 0xc440
movl $0x1, 0x3601c0(%rip)    # 0x36c600
jmp 0xcac7
jmp 0xc447
jmp 0xc449
jmp 0xc44b
movl -0x4(%rbp), %esi
movl -0x4(%rbp), %eax
leaq 0x361068(%rip), %rdx    # 0x36d4c0
imulq $0x2260, %rax, %rax     # imm = 0x2260
addq %rax, %rdx
addq $0xc, %rdx
leaq 0x1633fc(%rip), %rdi    # 0x16f869
movb $0x0, %al
callq 0x9030
movq 0x1a2b55(%rip), %rax    # 0x1aefd0
movq (%rax), %rdi
callq 0x9430
movl $0x0, -0x14(%rbp)
movl -0x4(%rbp), %eax
leaq 0x36102c(%rip), %rdi    # 0x36d4c0
imulq $0x2260, %rax, %rax     # imm = 0x2260
addq %rax, %rdi
addq $0xc, %rdi
movl -0x14(%rbp), %esi
orl $0x902, %esi            # imm = 0x902
movb $0x0, %al
callq 0x9240
movl %eax, %ecx
movl -0x4(%rbp), %eax
movl %eax, %edx
leaq 0x361000(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rdx, %rdx     # imm = 0x2260
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360fe7(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x0, 0x8(%rax)
jge 0xc5ca
movl -0x4(%rbp), %esi
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360fc4(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movl 0x8(%rax), %edx
leaq 0x163374(%rip), %rdi    # 0x16f884
movb $0x0, %al
callq 0x9030
leaq 0x18c108(%rip), %rdi    # 0x198626
movb $0x0, %al
callq 0x9030
leaq 0x163370(%rip), %rdi    # 0x16f89c
movb $0x0, %al
callq 0x9030
leaq 0x163397(%rip), %rdi    # 0x16f8d1
movb $0x0, %al
callq 0x9030
leaq 0x1633b5(%rip), %rdi    # 0x16f8fd
movb $0x0, %al
callq 0x9030
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360f65(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movl $0x0, 0x2234(%rax)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360f45(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movl $0xfffffff3, 0x2230(%rax) # imm = 0xFFFFFFF3
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360f25(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movzbl 0x2251(%rax), %ecx
orl $0x4, %ecx
movb %cl, 0x2251(%rax)
cmpl $0xa, -0x4(%rbp)
jne 0xc5c5
movl $0x1, 0x36003b(%rip)    # 0x36c600
jmp 0xcac7
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360eea(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movl 0x8(%rax), %edi
leaq 0x1c3af6(%rip), %rsi    # 0x1d00e0
callq 0x93f0
leaq 0x1c3b26(%rip), %rdi    # 0x1d011c
xorl %esi, %esi
movl $0x3c, %edx
callq 0x91a0
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360eb2(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x7, 0x214(%rax)
jne 0xc62d
movl $0x8a0, 0x1c3af9(%rip)  # imm = 0x8A0
jmp 0xc691
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360e87(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x6, 0x214(%rax)
jne 0xc658
movl $0x890, 0x1c3ace(%rip)  # imm = 0x890
jmp 0xc68f
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360e5c(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x5, 0x214(%rax)
jne 0xc683
movl $0x880, 0x1c3aa3(%rip)  # imm = 0x880
jmp 0xc68d
movl $0x8b0, 0x1c3a97(%rip)  # imm = 0x8B0
jmp 0xc68f
jmp 0xc691
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360e23(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x2, 0x218(%rax)
jne 0xc6bf
movl 0x1c3a6e(%rip), %eax    # 0x1d0124
orl $0x40, %eax
movl %eax, 0x1c3a65(%rip)    # 0x1d0124
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360df5(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x1, 0x21c(%rax)
jne 0xc6f1
movl 0x1c3a40(%rip), %eax    # 0x1d0124
orl $0x300, %eax            # imm = 0x300
movl %eax, 0x1c3a35(%rip)    # 0x1d0124
jmp 0xc727
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360dc3(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x2, 0x21c(%rax)
jne 0xc723
movl 0x1c3a0e(%rip), %eax    # 0x1d0124
orl $0x100, %eax            # imm = 0x100
movl %eax, 0x1c3a03(%rip)    # 0x1d0124
jmp 0xc725
jmp 0xc725
jmp 0xc727
movl $0x4, 0x1c39eb(%rip)    # 0x1d011c
movl $0x0, 0x1c39e5(%rip)    # 0x1d0120
movl $0x0, 0x1c39e3(%rip)    # 0x1d0128
movb $0x0, 0x1c39e7(%rip)    # 0x1d0133
movb $0x0, 0x1c39df(%rip)    # 0x1d0132
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360d61(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x96, 0x210(%rax)
jne 0xc781
movl $0x5, -0x10(%rbp)
jmp 0xc98f
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360d33(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x12c, 0x210(%rax)     # imm = 0x12C
jne 0xc7af
movl $0x7, -0x10(%rbp)
jmp 0xc98d
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360d05(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x258, 0x210(%rax)     # imm = 0x258
jne 0xc7dd
movl $0x8, -0x10(%rbp)
jmp 0xc98b
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360cd7(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x4b0, 0x210(%rax)     # imm = 0x4B0
jne 0xc80b
movl $0x9, -0x10(%rbp)
jmp 0xc989
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360ca9(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x960, 0x210(%rax)     # imm = 0x960
jne 0xc839
movl $0xb, -0x10(%rbp)
jmp 0xc987
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360c7b(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x12c0, 0x210(%rax)    # imm = 0x12C0
jne 0xc867
movl $0xc, -0x10(%rbp)
jmp 0xc985
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360c4d(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x2580, 0x210(%rax)    # imm = 0x2580
jne 0xc895
movl $0xd, -0x10(%rbp)
jmp 0xc983
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360c1f(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x4b00, 0x210(%rax)    # imm = 0x4B00
jne 0xc8c3
movl $0xe, -0x10(%rbp)
jmp 0xc981
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360bf1(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x9600, 0x210(%rax)    # imm = 0x9600
jne 0xc8f1
movl $0xf, -0x10(%rbp)
jmp 0xc97f
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360bc3(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0xe100, 0x210(%rax)    # imm = 0xE100
jne 0xc91c
movl $0x1001, -0x10(%rbp)    # imm = 0x1001
jmp 0xc97d
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360b98(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x1c200, 0x210(%rax)   # imm = 0x1C200
jne 0xc947
movl $0x1002, -0x10(%rbp)    # imm = 0x1002
jmp 0xc97b
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360b6d(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x38400, 0x210(%rax)   # imm = 0x38400
jne 0xc972
movl $0x1003, -0x10(%rbp)    # imm = 0x1003
jmp 0xc979
movl $0xd, -0x10(%rbp)
jmp 0xc97b
jmp 0xc97d
jmp 0xc97f
jmp 0xc981
jmp 0xc983
jmp 0xc985
jmp 0xc987
jmp 0xc989
jmp 0xc98b
jmp 0xc98d
jmp 0xc98f
movl -0x10(%rbp), %esi
leaq 0x1c3783(%rip), %rdi    # 0x1d011c
callq 0x9200
movl -0x10(%rbp), %esi
leaq 0x1c3774(%rip), %rdi    # 0x1d011c
callq 0x93c0
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360b07(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movl 0x8(%rax), %edi
xorl %esi, %esi
callq 0x95a0
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360ae7(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movl 0x8(%rax), %edi
xorl %esi, %esi
leaq 0x1c372d(%rip), %rdx    # 0x1d011c
callq 0x94c0
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360ac0(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movl 0x8(%rax), %edi
movl $0x4, %esi
movl $0x800, %edx            # imm = 0x800
movb $0x0, %al
callq 0x91e0
movl -0x4(%rbp), %edi
movl $0x1, %esi
callq 0xb660
cmpq $0x4000, 0x26b07a(%rip) # imm = 0x4000
jne 0xca5f
cmpl $0xa, -0x4(%rbp)
jne 0xca5f
movl -0x4(%rbp), %edi
movl $0x1, %esi
callq 0xb660
movl -0x4(%rbp), %edi
xorl %esi, %esi
callq 0xb700
movl $0x1f4, %edi            # imm = 0x1F4
callq 0xb8b0
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360a55(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movl $0x1, 0x2230(%rax)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x360a35(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
movl $0x2, 0x222c(%rax)
cmpl $0xa, -0x4(%rbp)
jne 0xcaaf
movl $0x1, 0x35fb51(%rip)    # 0x36c600
movl $0xc8, %edi
callq 0xb8b0
cmpl $0x0, 0x36066c(%rip)    # 0x36d12c
je 0xcac7
callq 0x1360d0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)