// File: /workspace/github_c_makefile_star2_O3/patriciogonzalezvivo[P]tprint/include/serial/unix.cc
// Function: serial::Serial::SerialImpl::setRTS(bool)
void
Serial::SerialImpl::setRTS (bool level)
{
  if (is_open_ == false) {
    throw PortNotOpenedException ("Serial::setRTS");
  }

  int command = TIOCM_RTS;

  if (level) {
    if (-1 == ioctl (fd_, TIOCMBIS, &command))
    {
      stringstream ss;
      ss << "setRTS failed on a call to ioctl(TIOCMBIS): " << errno << " " << strerror(errno);
      throw(SerialException(ss.str().c_str()));
    }
  } else {
    if (-1 == ioctl (fd_, TIOCMBIC, &command))
    {
      stringstream ss;
      ss << "setRTS failed on a call to ioctl(TIOCMBIC): " << errno << " " << strerror(errno);
      throw(SerialException(ss.str().c_str()));
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
cmpb $0x0, 0x2c(%rdi)
je 0xd2ff
movl $0x4, -0x1c(%rbp)
movl 0x28(%rdi), %edi
leaq -0x1c(%rbp), %rdx
testb %sil, %sil
je 0xd2e0
movl $0x5416, %esi           # imm = 0x5416
xorl %eax, %eax
callq 0x8470
cmpl $-0x1, %eax
jne 0xd2f1
leaq -0x1c8(%rbp), %rdi
callq 0x8220
leaq -0x1b8(%rbp), %r14
leaq 0x13345(%rip), %rsi     # 0x20593
movl $0x2c, %edx
movq %r14, %rdi
callq 0x83b0
callq 0x8060
movq %rax, %rbx
movl (%rax), %esi
movq %r14, %rdi
callq 0x85c0
movq %rax, %r14
leaq 0x133dd(%rip), %rsi     # 0x20654
movl $0x1, %edx
movq %rax, %rdi
callq 0x83b0
movl (%rbx), %edi
callq 0x8110
movq %r14, %rdi
movq %rax, %rsi
callq 0x82e0
movl $0x28, %edi
callq 0x8190
movq %rax, %r14
leaq -0x1b0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x8550
movb $0x1, %r15b
movq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0xe0e2
xorl %r15d, %r15d
leaq 0x199bc(%rip), %rsi     # 0x26c88
leaq 0xf77(%rip), %rdx       # 0xe24a
movq %r14, %rdi
callq 0x85b0
jmp 0xd3d8
movl $0x5417, %esi           # imm = 0x5417
xorl %eax, %eax
callq 0x8470
cmpl $-0x1, %eax
je 0xd331
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x8190
movq %rax, %r14
leaq 0x13271(%rip), %rsi     # 0x20584
movq %rax, %rdi
callq 0xe70c
leaq 0x19996(%rip), %rsi     # 0x26cb8
leaq 0x154b(%rip), %rdx      # 0xe874
movq %r14, %rdi
callq 0x85b0
leaq -0x1c8(%rbp), %rdi
callq 0x8220
leaq -0x1b8(%rbp), %r14
leaq 0x13275(%rip), %rsi     # 0x205c0
movl $0x2c, %edx
movq %r14, %rdi
callq 0x83b0
callq 0x8060
movq %rax, %rbx
movl (%rax), %esi
movq %r14, %rdi
callq 0x85c0
movq %rax, %r14
leaq 0x132e0(%rip), %rsi     # 0x20654
movl $0x1, %edx
movq %rax, %rdi
callq 0x83b0
movl (%rbx), %edi
callq 0x8110
movq %r14, %rdi
movq %rax, %rsi
callq 0x82e0
movl $0x28, %edi
callq 0x8190
movq %rax, %r14
leaq -0x1b0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x8550
movb $0x1, %r15b
movq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0xe0e2
xorl %r15d, %r15d
leaq 0x198bf(%rip), %rsi     # 0x26c88
leaq 0xe7a(%rip), %rdx       # 0xe24a
movq %r14, %rdi
callq 0x85b0
jmp 0xd3da
movq %rax, %rbx
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd3f6
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x8310
testb %r15b, %r15b
jne 0xd402
jmp 0xd411
jmp 0xd3ff
movq %rax, %rbx
movq %r14, %rdi
callq 0x8240
jmp 0xd411
jmp 0xd40e
movq %rax, %rbx
movq 0x19b88(%rip), %rsi     # 0x26fa0
leaq -0x1c8(%rbp), %rdi
callq 0x8260
leaq -0x148(%rbp), %rdi
callq 0x8100
jmp 0xd43d
movq %rax, %rbx
movq %r14, %rdi
callq 0x8240
movq %rbx, %rdi
callq 0x85f0
nop