// File: /workspace/github_c_makefile_star2_O0/patriciogonzalezvivo[P]tprint/include/serial/unix.cc
// Function: serial::Serial::SerialImpl::reconfigurePort()
void
Serial::SerialImpl::reconfigurePort ()
{
  if (fd_ == -1) {
    // Can only operate on a valid file descriptor
    THROW (IOException, "Invalid file descriptor, is the serial port open?");
  }

  struct termios options; // The options for the file descriptor

  if (tcgetattr(fd_, &options) == -1) {
    THROW (IOException, "::tcgetattr");
  }

  // set up raw mode / no echo / binary
  options.c_cflag |= (tcflag_t)  (CLOCAL | CREAD);
  options.c_lflag &= (tcflag_t) ~(ICANON | ECHO | ECHOE | ECHOK | ECHONL |
                                       ISIG | IEXTEN); //|ECHOPRT

  options.c_oflag &= (tcflag_t) ~(OPOST);
  options.c_iflag &= (tcflag_t) ~(INLCR | IGNCR | ICRNL | IGNBRK);
#ifdef IUCLC
  options.c_iflag &= (tcflag_t) ~IUCLC;
#endif
#ifdef PARMRK
  options.c_iflag &= (tcflag_t) ~PARMRK;
#endif

  // setup baud rate
  bool custom_baud = false;
  speed_t baud;
  switch (baudrate_) {
#ifdef B0
  case 0: baud = B0; break;
#endif
#ifdef B50
  case 50: baud = B50; break;
#endif
#ifdef B75
  case 75: baud = B75; break;
#endif
#ifdef B110
  case 110: baud = B110; break;
#endif
#ifdef B134
  case 134: baud = B134; break;
#endif
#ifdef B150
  case 150: baud = B150; break;
#endif
#ifdef B200
  case 200: baud = B200; break;
#endif
#ifdef B300
  case 300: baud = B300; break;
#endif
#ifdef B600
  case 600: baud = B600; break;
#endif
#ifdef B1200
  case 1200: baud = B1200; break;
#endif
#ifdef B1800
  case 1800: baud = B1800; break;
#endif
#ifdef B2400
  case 2400: baud = B2400; break;
#endif
#ifdef B4800
  case 4800: baud = B4800; break;
#endif
#ifdef B7200
  case 7200: baud = B7200; break;
#endif
#ifdef B9600
  case 9600: baud = B9600; break;
#endif
#ifdef B14400
  case 14400: baud = B14400; break;
#endif
#ifdef B19200
  case 19200: baud = B19200; break;
#endif
#ifdef B28800
  case 28800: baud = B28800; break;
#endif
#ifdef B57600
  case 57600: baud = B57600; break;
#endif
#ifdef B76800
  case 76800: baud = B76800; break;
#endif
#ifdef B38400
  case 38400: baud = B38400; break;
#endif
#ifdef B115200
  case 115200: baud = B115200; break;
#endif
#ifdef B128000
  case 128000: baud = B128000; break;
#endif
#ifdef B153600
  case 153600: baud = B153600; break;
#endif
#ifdef B230400
  case 230400: baud = B230400; break;
#endif
#ifdef B256000
  case 256000: baud = B256000; break;
#endif
#ifdef B460800
  case 460800: baud = B460800; break;
#endif
#ifdef B576000
  case 576000: baud = B576000; break;
#endif
#ifdef B921600
  case 921600: baud = B921600; break;
#endif
#ifdef B1000000
  case 1000000: baud = B1000000; break;
#endif
#ifdef B1152000
  case 1152000: baud = B1152000; break;
#endif
#ifdef B1500000
  case 1500000: baud = B1500000; break;
#endif
#ifdef B2000000
  case 2000000: baud = B2000000; break;
#endif
#ifdef B2500000
  case 2500000: baud = B2500000; break;
#endif
#ifdef B3000000
  case 3000000: baud = B3000000; break;
#endif
#ifdef B3500000
  case 3500000: baud = B3500000; break;
#endif
#ifdef B4000000
  case 4000000: baud = B4000000; break;
#endif
  default:
    custom_baud = true;
    // OS X support
#if defined(MAC_OS_X_VERSION_10_4) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4)
    // Starting with Tiger, the IOSSIOSPEED ioctl can be used to set arbitrary baud rates
    // other than those specified by POSIX. The driver for the underlying serial hardware
    // ultimately determines which baud rates can be used. This ioctl sets both the input
    // and output speed.
    speed_t new_baud = static_cast<speed_t> (baudrate_);
    if (-1 == ioctl (fd_, IOSSIOSPEED, &new_baud, 1)) {
      THROW (IOException, errno);
    }
    // Linux Support
#elif defined(__linux__) && defined (TIOCSSERIAL)
    struct serial_struct ser;

    if (-1 == ioctl (fd_, TIOCGSERIAL, &ser)) {
      THROW (IOException, errno);
    }

    // set custom divisor
    ser.custom_divisor = ser.baud_base / static_cast<int> (baudrate_);
    // update flags
    ser.flags &= ~ASYNC_SPD_MASK;
    ser.flags |= ASYNC_SPD_CUST;

    if (-1 == ioctl (fd_, TIOCSSERIAL, &ser)) {
      THROW (IOException, errno);
    }
#else
    throw invalid_argument ("OS does not currently support custom bauds");
#endif
  }
  if (custom_baud == false) {
#ifdef _BSD_SOURCE
    ::cfsetspeed(&options, baud);
#else
    ::cfsetispeed(&options, baud);
    ::cfsetospeed(&options, baud);
#endif
  }

  // setup char len
  options.c_cflag &= (tcflag_t) ~CSIZE;
  if (bytesize_ == eightbits)
    options.c_cflag |= CS8;
  else if (bytesize_ == sevenbits)
    options.c_cflag |= CS7;
  else if (bytesize_ == sixbits)
    options.c_cflag |= CS6;
  else if (bytesize_ == fivebits)
    options.c_cflag |= CS5;
  else
    throw invalid_argument ("invalid char len");
  // setup stopbits
  if (stopbits_ == stopbits_one)
    options.c_cflag &= (tcflag_t) ~(CSTOPB);
  else if (stopbits_ == stopbits_one_point_five)
    // ONE POINT FIVE same as TWO.. there is no POSIX support for 1.5
    options.c_cflag |=  (CSTOPB);
  else if (stopbits_ == stopbits_two)
    options.c_cflag |=  (CSTOPB);
  else
    throw invalid_argument ("invalid stop bit");
  // setup parity
  options.c_iflag &= (tcflag_t) ~(INPCK | ISTRIP);
  if (parity_ == parity_none) {
    options.c_cflag &= (tcflag_t) ~(PARENB | PARODD);
  } else if (parity_ == parity_even) {
    options.c_cflag &= (tcflag_t) ~(PARODD);
    options.c_cflag |=  (PARENB);
  } else if (parity_ == parity_odd) {
    options.c_cflag |=  (PARENB | PARODD);
  }
#ifdef CMSPAR
  else if (parity_ == parity_mark) {
    options.c_cflag |=  (PARENB | CMSPAR | PARODD);
  }
  else if (parity_ == parity_space) {
    options.c_cflag |=  (PARENB | CMSPAR);
    options.c_cflag &= (tcflag_t) ~(PARODD);
  }
#else
  // CMSPAR is not defined on OSX. So do not support mark or space parity.
  else if (parity_ == parity_mark || parity_ == parity_space) {
    throw invalid_argument ("OS does not support mark or space parity");
  }
#endif  // ifdef CMSPAR
  else {
    throw invalid_argument ("invalid parity");
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x148(%rbp)
cmpl $-0x1, 0x28(%rax)
jne 0x148f8
movb $0x1, -0x3d(%rbp)
movl $0x58, %edi
callq 0xd1e0
movq %rax, -0x158(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0xd760
movq -0x150(%rbp), %rdx
leaq 0x1894a(%rip), %rsi     # 0x2d1b1
leaq -0x28(%rbp), %rdi
callq 0xf2c0
jmp 0x14872
movq -0x158(%rbp), %rdi
leaq 0x18964(%rip), %rcx     # 0x2d1e4
leaq -0x28(%rbp), %rsi
movl $0xa5, %edx
callq 0x18170
jmp 0x14890
movq -0x158(%rbp), %rdi
movb $0x0, -0x3d(%rbp)
leaq 0x21416(%rip), %rsi     # 0x35cb8
leaq 0x3ac7(%rip), %rdx      # 0x18370
callq 0xd720
jmp 0x154e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x148d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xd240
leaq -0x29(%rbp), %rdi
callq 0xd430
testb $0x1, -0x3d(%rbp)
jne 0x148e7
jmp 0x148f3
movq -0x158(%rbp), %rdi
callq 0xd2c0
jmp 0x154de
movq -0x148(%rbp), %rax
movl 0x28(%rax), %edi
leaq -0x7c(%rbp), %rsi
callq 0xd490
cmpl $-0x1, %eax
jne 0x149f0
movb $0x1, -0xa2(%rbp)
movl $0x58, %edi
callq 0xd1e0
movq %rax, -0x168(%rbp)
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0xd760
movq -0x160(%rbp), %rdx
leaq 0x18864(%rip), %rsi     # 0x2d1b1
leaq -0xa0(%rbp), %rdi
callq 0xf2c0
jmp 0x1495b
movq -0x168(%rbp), %rdi
leaq 0x188ad(%rip), %rcx     # 0x2d216
leaq -0xa0(%rbp), %rsi
movl $0xab, %edx
callq 0x18170
jmp 0x1497c
movq -0x168(%rbp), %rdi
movb $0x0, -0xa2(%rbp)
leaq 0x21327(%rip), %rsi     # 0x35cb8
leaq 0x39d8(%rip), %rdx      # 0x18370
callq 0xd720
jmp 0x154e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x149c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0xd240
leaq -0xa1(%rbp), %rdi
callq 0xd430
testb $0x1, -0xa2(%rbp)
jne 0x149df
jmp 0x149eb
movq -0x168(%rbp), %rdi
callq 0xd2c0
jmp 0x154de
movq -0x148(%rbp), %rax
movl -0x74(%rbp), %ecx
orl $0x880, %ecx            # imm = 0x880
movl %ecx, -0x74(%rbp)
movl -0x70(%rbp), %ecx
andl $0xffff7f84, %ecx       # imm = 0xFFFF7F84
movl %ecx, -0x70(%rbp)
movb -0x78(%rbp), %cl
andb $-0x2, %cl
movb %cl, -0x78(%rbp)
movl -0x7c(%rbp), %ecx
andl $0xfffffe3e, %ecx       # imm = 0xFFFFFE3E
movl %ecx, -0x7c(%rbp)
movb -0x7b(%rbp), %cl
andb $-0x3, %cl
movb %cl, -0x7b(%rbp)
movb -0x7c(%rbp), %cl
andb $-0x9, %cl
movb %cl, -0x7c(%rbp)
movb $0x0, -0xa3(%rbp)
movq 0x48(%rax), %rax
movq %rax, -0x170(%rbp)
testq %rax, %rax
je 0x14cb1
jmp 0x14a53
movq -0x170(%rbp), %rax
subq $0x32, %rax
je 0x14cc0
jmp 0x14a66
movq -0x170(%rbp), %rax
subq $0x4b, %rax
je 0x14ccf
jmp 0x14a79
movq -0x170(%rbp), %rax
subq $0x6e, %rax
je 0x14cde
jmp 0x14a8c
movq -0x170(%rbp), %rax
subq $0x86, %rax
je 0x14ced
jmp 0x14aa1
movq -0x170(%rbp), %rax
subq $0x96, %rax
je 0x14cfc
jmp 0x14ab6
movq -0x170(%rbp), %rax
subq $0xc8, %rax
je 0x14d0b
jmp 0x14acb
movq -0x170(%rbp), %rax
subq $0x12c, %rax            # imm = 0x12C
je 0x14d1a
jmp 0x14ae0
movq -0x170(%rbp), %rax
subq $0x258, %rax            # imm = 0x258
je 0x14d29
jmp 0x14af5
movq -0x170(%rbp), %rax
subq $0x4b0, %rax            # imm = 0x4B0
je 0x14d38
jmp 0x14b0a
movq -0x170(%rbp), %rax
subq $0x708, %rax            # imm = 0x708
je 0x14d47
jmp 0x14b1f
movq -0x170(%rbp), %rax
subq $0x960, %rax            # imm = 0x960
je 0x14d56
jmp 0x14b34
movq -0x170(%rbp), %rax
subq $0x12c0, %rax           # imm = 0x12C0
je 0x14d65
jmp 0x14b49
movq -0x170(%rbp), %rax
subq $0x2580, %rax           # imm = 0x2580
je 0x14d74
jmp 0x14b5e
movq -0x170(%rbp), %rax
subq $0x4b00, %rax           # imm = 0x4B00
je 0x14d83
jmp 0x14b73
movq -0x170(%rbp), %rax
subq $0x9600, %rax           # imm = 0x9600
je 0x14da1
jmp 0x14b88
movq -0x170(%rbp), %rax
subq $0xe100, %rax           # imm = 0xE100
je 0x14d92
jmp 0x14b9d
movq -0x170(%rbp), %rax
subq $0x1c200, %rax          # imm = 0x1C200
je 0x14db0
jmp 0x14bb2
movq -0x170(%rbp), %rax
subq $0x38400, %rax          # imm = 0x38400
je 0x14dbf
jmp 0x14bc7
movq -0x170(%rbp), %rax
subq $0x70800, %rax          # imm = 0x70800
je 0x14dce
jmp 0x14bdc
movq -0x170(%rbp), %rax
subq $0x8ca00, %rax          # imm = 0x8CA00
je 0x14ddd
jmp 0x14bf1
movq -0x170(%rbp), %rax
subq $0xe1000, %rax          # imm = 0xE1000
je 0x14dec
jmp 0x14c06
movq -0x170(%rbp), %rax
subq $0xf4240, %rax          # imm = 0xF4240
je 0x14dfb
jmp 0x14c1b
movq -0x170(%rbp), %rax
subq $0x119400, %rax         # imm = 0x119400
je 0x14e0a
jmp 0x14c30
movq -0x170(%rbp), %rax
subq $0x16e360, %rax         # imm = 0x16E360
je 0x14e19
jmp 0x14c45
movq -0x170(%rbp), %rax
subq $0x1e8480, %rax         # imm = 0x1E8480
je 0x14e28
jmp 0x14c5a
movq -0x170(%rbp), %rax
subq $0x2625a0, %rax         # imm = 0x2625A0
je 0x14e37
jmp 0x14c6f
movq -0x170(%rbp), %rax
subq $0x2dc6c0, %rax         # imm = 0x2DC6C0
je 0x14e46
jmp 0x14c84
movq -0x170(%rbp), %rax
subq $0x3567e0, %rax         # imm = 0x3567E0
je 0x14e55
jmp 0x14c99
movq -0x170(%rbp), %rax
subq $0x3d0900, %rax         # imm = 0x3D0900
je 0x14e64
jmp 0x14e73
movl $0x0, -0xa8(%rbp)
jmp 0x150c9
movl $0x1, -0xa8(%rbp)
jmp 0x150c9
movl $0x2, -0xa8(%rbp)
jmp 0x150c9
movl $0x3, -0xa8(%rbp)
jmp 0x150c9
movl $0x4, -0xa8(%rbp)
jmp 0x150c9
movl $0x5, -0xa8(%rbp)
jmp 0x150c9
movl $0x6, -0xa8(%rbp)
jmp 0x150c9
movl $0x7, -0xa8(%rbp)
jmp 0x150c9
movl $0x8, -0xa8(%rbp)
jmp 0x150c9
movl $0x9, -0xa8(%rbp)
jmp 0x150c9
movl $0xa, -0xa8(%rbp)
jmp 0x150c9
movl $0xb, -0xa8(%rbp)
jmp 0x150c9
movl $0xc, -0xa8(%rbp)
jmp 0x150c9
movl $0xd, -0xa8(%rbp)
jmp 0x150c9
movl $0xe, -0xa8(%rbp)
jmp 0x150c9
movl $0x1001, -0xa8(%rbp)    # imm = 0x1001
jmp 0x150c9
movl $0xf, -0xa8(%rbp)
jmp 0x150c9
movl $0x1002, -0xa8(%rbp)    # imm = 0x1002
jmp 0x150c9
movl $0x1003, -0xa8(%rbp)    # imm = 0x1003
jmp 0x150c9
movl $0x1004, -0xa8(%rbp)    # imm = 0x1004
jmp 0x150c9
movl $0x1006, -0xa8(%rbp)    # imm = 0x1006
jmp 0x150c9
movl $0x1007, -0xa8(%rbp)    # imm = 0x1007
jmp 0x150c9
movl $0x1008, -0xa8(%rbp)    # imm = 0x1008
jmp 0x150c9
movl $0x1009, -0xa8(%rbp)    # imm = 0x1009
jmp 0x150c9
movl $0x100a, -0xa8(%rbp)    # imm = 0x100A
jmp 0x150c9
movl $0x100b, -0xa8(%rbp)    # imm = 0x100B
jmp 0x150c9
movl $0x100c, -0xa8(%rbp)    # imm = 0x100C
jmp 0x150c9
movl $0x100d, -0xa8(%rbp)    # imm = 0x100D
jmp 0x150c9
movl $0x100e, -0xa8(%rbp)    # imm = 0x100E
jmp 0x150c9
movl $0x100f, -0xa8(%rbp)    # imm = 0x100F
jmp 0x150c9
movq -0x148(%rbp), %rax
movb $0x1, -0xa3(%rbp)
movl 0x28(%rax), %edi
movl $0x541e, %esi           # imm = 0x541E
leaq -0xf0(%rbp), %rdx
movb $0x0, %al
callq 0xd5e0
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x14f82
movb $0x1, -0x112(%rbp)
movl $0x58, %edi
callq 0xd1e0
movq %rax, -0x180(%rbp)
leaq -0x111(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0xd760
movq -0x178(%rbp), %rdx
leaq 0x182d2(%rip), %rsi     # 0x2d1b1
leaq -0x110(%rbp), %rdi
callq 0xf2c0
jmp 0x14eed
callq 0xd060
movq -0x180(%rbp), %rdi
movl (%rax), %ecx
leaq -0x110(%rbp), %rsi
movl $0x140, %edx            # imm = 0x140
callq 0x183c0
jmp 0x14f0e
movq -0x180(%rbp), %rdi
movb $0x0, -0x112(%rbp)
leaq 0x20d95(%rip), %rsi     # 0x35cb8
leaq 0x3446(%rip), %rdx      # 0x18370
callq 0xd720
jmp 0x154e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x14f5a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x110(%rbp), %rdi
callq 0xd240
leaq -0x111(%rbp), %rdi
callq 0xd430
testb $0x1, -0x112(%rbp)
jne 0x14f71
jmp 0x14f7d
movq -0x180(%rbp), %rdi
callq 0xd2c0
jmp 0x154de
movq -0x148(%rbp), %rcx
movl -0xd4(%rbp), %eax
movq 0x48(%rcx), %rcx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x148(%rbp), %rax
movl %ecx, -0xd8(%rbp)
movl -0xe0(%rbp), %ecx
andl $0xffffefcf, %ecx       # imm = 0xFFFFEFCF
movl %ecx, -0xe0(%rbp)
movl -0xe0(%rbp), %ecx
orl $0x30, %ecx
movl %ecx, -0xe0(%rbp)
movl 0x28(%rax), %edi
movl $0x541f, %esi           # imm = 0x541F
leaq -0xf0(%rbp), %rdx
movb $0x0, %al
callq 0xd5e0
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x150c7
movb $0x1, -0x13a(%rbp)
movl $0x58, %edi
callq 0xd1e0
movq %rax, -0x190(%rbp)
leaq -0x139(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0xd760
movq -0x188(%rbp), %rdx
leaq 0x1818d(%rip), %rsi     # 0x2d1b1
leaq -0x138(%rbp), %rdi
callq 0xf2c0
jmp 0x15032
callq 0xd060
movq -0x190(%rbp), %rdi
movl (%rax), %ecx
leaq -0x138(%rbp), %rsi
movl $0x14a, %edx            # imm = 0x14A
callq 0x183c0
jmp 0x15053
movq -0x190(%rbp), %rdi
movb $0x0, -0x13a(%rbp)
leaq 0x20c50(%rip), %rsi     # 0x35cb8
leaq 0x3301(%rip), %rdx      # 0x18370
callq 0xd720
jmp 0x154e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x1509f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x138(%rbp), %rdi
callq 0xd240
leaq -0x139(%rbp), %rdi
callq 0xd430
testb $0x1, -0x13a(%rbp)
jne 0x150b6
jmp 0x150c2
movq -0x190(%rbp), %rdi
callq 0xd2c0
jmp 0x154de
jmp 0x150c9
movb -0xa3(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x150f7
movl -0xa8(%rbp), %esi
leaq -0x7c(%rbp), %rdi
callq 0xd230
movl -0xa8(%rbp), %esi
leaq -0x7c(%rbp), %rdi
callq 0xd460
movq -0x148(%rbp), %rax
movl -0x74(%rbp), %ecx
andl $-0x31, %ecx
movl %ecx, -0x74(%rbp)
cmpl $0x8, 0x58(%rax)
jne 0x1511b
movl -0x74(%rbp), %eax
orl $0x30, %eax
movl %eax, -0x74(%rbp)
jmp 0x151c8
movq -0x148(%rbp), %rax
cmpl $0x7, 0x58(%rax)
jne 0x15136
movl -0x74(%rbp), %eax
orl $0x20, %eax
movl %eax, -0x74(%rbp)
jmp 0x151c6
movq -0x148(%rbp), %rax
cmpl $0x6, 0x58(%rax)
jne 0x1514e
movl -0x74(%rbp), %eax
orl $0x10, %eax
movl %eax, -0x74(%rbp)
jmp 0x151c4
movq -0x148(%rbp), %rax
cmpl $0x5, 0x58(%rax)
jne 0x15166
movl -0x74(%rbp), %eax
orl $0x0, %eax
movl %eax, -0x74(%rbp)
jmp 0x151c2
movl $0x10, %edi
callq 0xd1e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x198(%rbp)
leaq 0x1809e(%rip), %rsi     # 0x2d222
callq 0xd7d0
jmp 0x1518b
movq -0x198(%rbp), %rdi
movq 0x20e3f(%rip), %rsi     # 0x35fd8
movq 0x20e28(%rip), %rdx     # 0x35fc8
callq 0xd720
movq -0x198(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0xd2c0
jmp 0x154de
jmp 0x151c4
jmp 0x151c6
jmp 0x151c8
movq -0x148(%rbp), %rax
cmpl $0x1, 0x5c(%rax)
jne 0x151e3
movl -0x74(%rbp), %eax
andl $-0x41, %eax
movl %eax, -0x74(%rbp)
jmp 0x15273
movq -0x148(%rbp), %rax
cmpl $0x3, 0x5c(%rax)
jne 0x151fb
movl -0x74(%rbp), %eax
orl $0x40, %eax
movl %eax, -0x74(%rbp)
jmp 0x15271
movq -0x148(%rbp), %rax
cmpl $0x2, 0x5c(%rax)
jne 0x15213
movl -0x74(%rbp), %eax
orl $0x40, %eax
movl %eax, -0x74(%rbp)
jmp 0x1526f
movl $0x10, %edi
callq 0xd1e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x1a0(%rbp)
leaq 0x18002(%rip), %rsi     # 0x2d233
callq 0xd7d0
jmp 0x15238
movq -0x1a0(%rbp), %rdi
movq 0x20d92(%rip), %rsi     # 0x35fd8
movq 0x20d7b(%rip), %rdx     # 0x35fc8
callq 0xd720
movq -0x1a0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0xd2c0
jmp 0x154de
jmp 0x15271
jmp 0x15273
movq -0x148(%rbp), %rax
movl -0x7c(%rbp), %ecx
andl $-0x31, %ecx
movl %ecx, -0x7c(%rbp)
cmpl $0x0, 0x54(%rax)
jne 0x15299
movl -0x74(%rbp), %eax
andl $0xfffffcff, %eax       # imm = 0xFFFFFCFF
movl %eax, -0x74(%rbp)
jmp 0x15384
movq -0x148(%rbp), %rax
cmpl $0x2, 0x54(%rax)
jne 0x152c1
movl -0x74(%rbp), %eax
andl $0xfffffdff, %eax       # imm = 0xFFFFFDFF
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
orl $0x100, %eax            # imm = 0x100
movl %eax, -0x74(%rbp)
jmp 0x15382
movq -0x148(%rbp), %rax
cmpl $0x1, 0x54(%rax)
jne 0x152de
movl -0x74(%rbp), %eax
orl $0x300, %eax            # imm = 0x300
movl %eax, -0x74(%rbp)
jmp 0x15380
movq -0x148(%rbp), %rax
cmpl $0x3, 0x54(%rax)
jne 0x152fb
movl -0x74(%rbp), %eax
orl $0x40000300, %eax       # imm = 0x40000300
movl %eax, -0x74(%rbp)
jmp 0x1537e
movq -0x148(%rbp), %rax
cmpl $0x4, 0x54(%rax)
jne 0x15320
movl -0x74(%rbp), %eax
orl $0x40000100, %eax       # imm = 0x40000100
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
andl $0xfffffdff, %eax       # imm = 0xFFFFFDFF
movl %eax, -0x74(%rbp)
jmp 0x1537c
movl $0x10, %edi
callq 0xd1e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x1a8(%rbp)
leaq 0x17f06(%rip), %rsi     # 0x2d244
callq 0xd7d0
jmp 0x15345
movq -0x1a8(%rbp), %rdi
movq 0x20c85(%rip), %rsi     # 0x35fd8
movq 0x20c6e(%rip), %rdx     # 0x35fc8
callq 0xd720
movq -0x1a8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0xd2c0
jmp 0x154de
jmp 0x1537e
jmp 0x15380
jmp 0x15382
jmp 0x15384
movq -0x148(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jne 0x153a0
movq -0x148(%rbp), %rax
movb $0x0, 0x2d(%rax)
movb $0x0, 0x2e(%rax)
movq -0x148(%rbp), %rax
cmpl $0x1, 0x60(%rax)
jne 0x153bc
movq -0x148(%rbp), %rax
movb $0x1, 0x2d(%rax)
movb $0x0, 0x2e(%rax)
movq -0x148(%rbp), %rax
cmpl $0x2, 0x60(%rax)
jne 0x153d8
movq -0x148(%rbp), %rax
movb $0x0, 0x2d(%rax)
movb $0x1, 0x2e(%rax)
movq -0x148(%rbp), %rax
testb $0x1, 0x2d(%rax)
je 0x153f2
movl -0x7c(%rbp), %eax
orl $0x1400, %eax           # imm = 0x1400
movl %eax, -0x7c(%rbp)
jmp 0x153fd
movl -0x7c(%rbp), %eax
andl $0xffffe3ff, %eax       # imm = 0xFFFFE3FF
movl %eax, -0x7c(%rbp)
movq -0x148(%rbp), %rax
testb $0x1, 0x2e(%rax)
je 0x15417
movl -0x74(%rbp), %eax
orl $0x80000000, %eax       # imm = 0x80000000
movl %eax, -0x74(%rbp)
jmp 0x15423
movl -0x74(%rbp), %eax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movl %eax, -0x74(%rbp)
movq -0x148(%rbp), %rax
movb $0x0, -0x65(%rbp)
movb $0x0, -0x66(%rbp)
movl 0x28(%rax), %edi
xorl %esi, %esi
leaq -0x7c(%rbp), %rdx
callq 0xd520
movq -0x148(%rbp), %rax
movq 0x48(%rax), %xmm1
movaps 0x17d0d(%rip), %xmm0    # 0x2d160
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x17d11(%rip), %xmm0    # 0x2d170
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movsd 0x17cca(%rip), %xmm0    # 0x2d140
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
movl %ecx, -0x140(%rbp)
movl -0x140(%rbp), %ecx
movl 0x58(%rax), %edx
addl $0x1, %edx
addl 0x54(%rax), %edx
addl 0x5c(%rax), %edx
imull %edx, %ecx
movl %ecx, 0x50(%rax)
cmpl $0x3, 0x5c(%rax)
jne 0x154d5
movq -0x148(%rbp), %rax
movl -0x140(%rbp), %ecx
cvtsi2sd %rcx, %xmm0
movl 0x50(%rax), %ecx
cvtsi2sd %rcx, %xmm1
movsd 0x17c93(%rip), %xmm2    # 0x2d158
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
movl %ecx, 0x50(%rax)
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0xd750
nopw (%rax,%rax)