#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int O_NDELAY;
int O_RDWR;
int /*<<< orphan*/ TIOCMGET;
int /*<<< orphan*/ TIOCMSET;
int TIOCM_DTR;
int TIOCM_RTS;
int atoi(char *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int *);
int /*<<< orphan*/ iopl(int);
int open(char *, int);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int dac_arg;
  int dac_adr;
  int dac_num;
  int pow_lvl;
  int fd;
  int flags;
  int i;
  int count = 5;
  dac_arg = atoi(argv[1]);
  pow_lvl = atoi(argv[2]);
  if (dac_arg >= 0 && dac_arg < 8) {
    dac_adr = 0;
    dac_num = dac_arg;
  } else if (dac_arg >= 8 && dac_arg < 16) {
    dac_adr = 3;
    dac_num = dac_arg - 8;
  } else {
    fprintf(stderr, "DAC address must be in range 0-15\n");
    exit(1);
  }
  if (pow_lvl < 0 || pow_lvl > 255) {
    fprintf(stderr, "Power level must be in range 0-255\n");
    exit(1);
  }
  dac_adr = (dac_adr * 2) + 80;
  if ((fd = open("/dev/ttyS1", O_RDWR | O_NDELAY)) < 0) {
    fprintf(stderr, "device not found");
    exit(1);
  }
  iopl(3);
  ioctl(fd, TIOCMGET, &flags);
  flags &= ~TIOCM_RTS;
  flags &= ~TIOCM_DTR;
  ioctl(fd, TIOCMSET, &flags);
  delay(count);
  flags |= TIOCM_RTS;
  ioctl(fd, TIOCMSET, &flags);
  delay(count);
  flags |= TIOCM_DTR;
  ioctl(fd, TIOCMSET, &flags);
  delay(count);
  for (i = 7; i >= 0; i--) {
    if ((dac_adr >> i) & 1)
      flags &= ~TIOCM_RTS;
    else
      flags |= TIOCM_RTS;
    ioctl(fd, TIOCMSET, &flags);
    delay(count);
    flags &= ~TIOCM_DTR;
    ioctl(fd, TIOCMSET, &flags);
    delay(count);
    flags |= TIOCM_DTR;
    ioctl(fd, TIOCMSET, &flags);
    delay(count);
  }
  flags |= TIOCM_RTS;
  ioctl(fd, TIOCMSET, &flags);
  delay(count);
  flags &= ~TIOCM_DTR;
  ioctl(fd, TIOCMSET, &flags);
  delay(count);
  flags |= TIOCM_DTR;
  ioctl(fd, TIOCMSET, &flags);
  delay(count);
  for (i = 7; i >= 0; i--) {
    if ((dac_num >> i) & 1)
      flags &= ~TIOCM_RTS;
    else
      flags |= TIOCM_RTS;
    ioctl(fd, TIOCMSET, &flags);
    delay(count);
    flags &= ~TIOCM_DTR;
    ioctl(fd, TIOCMSET, &flags);
    delay(count);
    flags |= TIOCM_DTR;
    ioctl(fd, TIOCMSET, &flags);
    delay(count);
  }
  flags |= TIOCM_RTS;
  ioctl(fd, TIOCMSET, &flags);
  delay(count);
  flags &= ~TIOCM_DTR;
  ioctl(fd, TIOCMSET, &flags);
  delay(count);
  flags |= TIOCM_DTR;
  ioctl(fd, TIOCMSET, &flags);
  delay(count);
  for (i = 7; i >= 0; i--) {
    if ((pow_lvl >> i) & 1)
      flags &= ~TIOCM_RTS;
    else
      flags |= TIOCM_RTS;
    ioctl(fd, TIOCMSET, &flags);
    delay(count);
    flags &= ~TIOCM_DTR;
    ioctl(fd, TIOCMSET, &flags);
    delay(count);
    flags |= TIOCM_DTR;
    ioctl(fd, TIOCMSET, &flags);
    delay(count);
  }
  flags |= TIOCM_RTS;
  ioctl(fd, TIOCMSET, &flags);
  delay(count);
  flags &= ~TIOCM_DTR;
  ioctl(fd, TIOCMSET, &flags);
  delay(count);
  flags |= TIOCM_DTR;
  ioctl(fd, TIOCMSET, &flags);
  delay(count);
  flags &= ~TIOCM_DTR;
  ioctl(fd, TIOCMSET, &flags);
  delay(count);
  flags &= ~TIOCM_RTS;
  ioctl(fd, TIOCMSET, &flags);
  delay(count);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     11e3 <main+0x63>
cmpl   $0x8,-0x14(%rbp)
jge    11e3 <main+0x63>
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1230 <main+0xb0>
cmpl   $0x8,-0x14(%rbp)
jl     120c <main+0x8c>
cmpl   $0x10,-0x14(%rbp)
jge    120c <main+0x8c>
movl   $0x3,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x1c(%rbp)
jmp    122b <main+0xab>
mov    0x2da5(%rip),%rax
mov    (%rax),%edi
lea    0xde4(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
jmp    1230 <main+0xb0>
cmpl   $0x0,-0x20(%rbp)
jl     1247 <main+0xc7>
cmpl   $0xff,-0x20(%rbp)
jle    1266 <main+0xe6>
mov    0x2d6a(%rip),%rax
mov    (%rax),%edi
lea    0xdcc(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x18(%rbp),%eax
shl    $0x1,%eax
add    $0x50,%eax
mov    %eax,-0x18(%rbp)
mov    0x2d6f(%rip),%rax
mov    (%rax),%esi
mov    0x2d2e(%rip),%rax
or     (%rax),%esi
lea    0xdbc(%rip),%rdi
call   1080 <open@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
jge    12bb <main+0x13b>
mov    0x2d15(%rip),%rax
mov    (%rax),%edi
lea    0xda6(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    $0x3,%edi
call   1030 <iopl@plt>
mov    -0x24(%rbp),%edi
mov    0x2cf9(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    0x2cf7(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    0x2cdd(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2cd8(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    0x2cb6(%rip),%rax
mov    (%rax),%eax
or     -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2cac(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    0x2c82(%rip),%rax
mov    (%rax),%eax
or     -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2c80(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
movl   $0x7,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jl     1444 <main+0x2c4>
mov    -0x18(%rbp),%eax
mov    -0x2c(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     13af <main+0x22f>
mov    0x2c39(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    13be <main+0x23e>
mov    0x2c22(%rip),%rax
mov    (%rax),%eax
or     -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2c18(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    0x2bee(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2be9(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    0x2bbf(%rip),%rax
mov    (%rax),%eax
or     -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2bbd(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
jmp    137a <main+0x1fa>
mov    0x2b8d(%rip),%rax
mov    (%rax),%eax
or     -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2b83(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    0x2b59(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2b54(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    0x2b2a(%rip),%rax
mov    (%rax),%eax
or     -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2b28(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
movl   $0x7,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jl     159c <main+0x41c>
mov    -0x1c(%rbp),%eax
mov    -0x2c(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1507 <main+0x387>
mov    0x2ae1(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    1516 <main+0x396>
mov    0x2aca(%rip),%rax
mov    (%rax),%eax
or     -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2ac0(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    0x2a96(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2a91(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    0x2a67(%rip),%rax
mov    (%rax),%eax
or     -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2a65(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
jmp    14d2 <main+0x352>
mov    0x2a35(%rip),%rax
mov    (%rax),%eax
or     -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2a2b(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    0x2a01(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x29fc(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    0x29d2(%rip),%rax
mov    (%rax),%eax
or     -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x29d0(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
movl   $0x7,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jl     16f4 <main+0x574>
mov    -0x20(%rbp),%eax
mov    -0x2c(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     165f <main+0x4df>
mov    0x2989(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    166e <main+0x4ee>
mov    0x2972(%rip),%rax
mov    (%rax),%eax
or     -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2968(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    0x293e(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2939(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    0x290f(%rip),%rax
mov    (%rax),%eax
or     -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x290d(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
jmp    162a <main+0x4aa>
mov    0x28dd(%rip),%rax
mov    (%rax),%eax
or     -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x28d3(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    0x28a9(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x28a4(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    0x287a(%rip),%rax
mov    (%rax),%eax
or     -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2878(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    0x284e(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2849(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    0x2827(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    0x281a(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x30(%rbp),%edi
call   1060 <delay@plt>
mov    -0x24(%rbp),%edi
call   1050 <close@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1090 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1090 <atoi@plt>
cmp    $0x8,%ebp
jae    11b2 <main+0x32>
mov    $0x50,%r15d
jmp    11c9 <main+0x49>
mov    %ebp,%ecx
and    $0xfffffff8,%ecx
cmp    $0x8,%ecx
jne    1605 <main+0x485>
add    $0xfffffff8,%ebp
mov    $0x56,%r15d
cmp    $0x100,%eax
jae    15e1 <main+0x461>
mov    %ebp,0x14(%rsp)
mov    %eax,0x10(%rsp)
mov    0x2e05(%rip),%rax
mov    0x2dc6(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xe52(%rip),%rdi
call   1080 <open@plt>
test   %eax,%eax
js     15f3 <main+0x473>
mov    %eax,%ebx
mov    $0x3,%edi
call   1030 <iopl@plt>
mov    0x2db3(%rip),%rax
mov    (%rax),%esi
lea    0xc(%rsp),%rbp
mov    %ebx,%edi
mov    %rbp,%rdx
call   1040 <ioctl@plt>
mov    0x2dab(%rip),%r12
mov    (%r12),%eax
mov    0x2d98(%rip),%r14
or     (%r14),%eax
not    %eax
and    %eax,0xc(%rsp)
mov    0x2d98(%rip),%r13
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %rbp,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    (%r12),%eax
or     %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %rbp,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    (%r14),%eax
or     %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %rbp,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    $0x7,%r12d
jmp    1316 <main+0x196>
nopw   0x0(%rax,%rax,1)
or     0xc(%rsp),%eax
mov    %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %rbp,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    (%r14),%eax
not    %eax
and    %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %rbp,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    (%r14),%eax
or     %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %rbp,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
add    $0xffffffff,%r12d
jae    132d <main+0x1ad>
bt     %r12d,%r15d
mov    0x2cb7(%rip),%rax
mov    (%rax),%eax
jae    12b0 <main+0x130>
not    %eax
and    0xc(%rsp),%eax
jmp    12b4 <main+0x134>
mov    0x2ca4(%rip),%rax
mov    (%rax),%eax
or     %eax,0xc(%rsp)
mov    0x0(%r13),%esi
lea    0xc(%rsp),%r15
mov    %ebx,%edi
mov    %r15,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    (%r14),%eax
not    %eax
and    %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %r15,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    (%r14),%eax
or     %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %r15,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    $0x7,%ebp
mov    0x10(%rsp),%r12d
jmp    1415 <main+0x295>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
or     0xc(%rsp),%eax
mov    %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %r15,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    (%r14),%eax
not    %eax
and    %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %r15,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    (%r14),%eax
or     %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %r15,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
add    $0xffffffff,%ebp
jae    142f <main+0x2af>
mov    0x14(%rsp),%eax
bt     %ebp,%eax
mov    0x2bb5(%rip),%rax
mov    (%rax),%eax
jae    13b0 <main+0x230>
not    %eax
and    0xc(%rsp),%eax
jmp    13b4 <main+0x234>
mov    0x2ba2(%rip),%rax
mov    (%rax),%eax
or     %eax,0xc(%rsp)
mov    0x0(%r13),%esi
lea    0xc(%rsp),%r15
mov    %ebx,%edi
mov    %r15,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    (%r14),%eax
not    %eax
and    %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %r15,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    (%r14),%eax
or     %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %r15,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    $0x7,%ebp
jmp    1505 <main+0x385>
or     0xc(%rsp),%eax
mov    %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %r15,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    (%r14),%eax
not    %eax
and    %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %r15,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    (%r14),%eax
or     %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %r15,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
add    $0xffffffff,%ebp
jae    151c <main+0x39c>
bt     %ebp,%r12d
mov    0x2ac8(%rip),%rax
mov    (%rax),%eax
jae    14a0 <main+0x320>
not    %eax
and    0xc(%rsp),%eax
jmp    14a4 <main+0x324>
mov    0x2ab5(%rip),%r15
mov    (%r15),%eax
or     %eax,0xc(%rsp)
mov    0x0(%r13),%esi
lea    0xc(%rsp),%rbp
mov    %ebx,%edi
mov    %rbp,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    (%r14),%eax
not    %eax
and    %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %rbp,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    (%r14),%eax
or     %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %rbp,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    (%r14),%eax
not    %eax
and    %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %rbp,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    (%r15),%eax
not    %eax
and    %eax,0xc(%rsp)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %rbp,%rdx
call   1040 <ioctl@plt>
mov    $0x5,%edi
call   1060 <delay@plt>
mov    %ebx,%edi
call   1050 <close@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x29d0(%rip),%rax
mov    (%rax),%edi
lea    0xa32(%rip),%rsi
jmp    1615 <main+0x495>
mov    0x29be(%rip),%rax
mov    (%rax),%edi
lea    0xa4f(%rip),%rsi
jmp    1615 <main+0x495>
mov    0x29ac(%rip),%rax
mov    (%rax),%edi
lea    0x9eb(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"DAC address must be in range 0-15\0A\00"
@.str.1 = [36 x i8] c"Power level must be in range 0-255\0A\00"
@.str.2 = [11 x i8] c"/dev/ttyS1\00"
@O_RDWR = global i32 0
@O_NDELAY = global i32 0
@.str.3 = [17 x i8] c"device not found\00"
@TIOCMGET = global i32 0
@TIOCM_RTS = global i32 0
@TIOCM_DTR = global i32 0
@TIOCMSET = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %13
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %6
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = call i32 @atoi(i8* %20)
store i32 %21, i32* %9
%22 = load i32, i32* %6
%23 = icmp sge i32 %22, 0
br i1 %23, label %24, label %29
24: ; preds = %2
%25 = load i32, i32* %6
%26 = icmp slt i32 %25, 8
br i1 %26, label %27, label %29
27: ; preds = %24
store i32 0, i32* %7
%28 = load i32, i32* %6
store i32 %28, i32* %8
br label %43
29: ; preds = %24, %2
%30 = load i32, i32* %6
%31 = icmp sge i32 %30, 8
br i1 %31, label %32, label %38
32: ; preds = %29
%33 = load i32, i32* %6
%34 = icmp slt i32 %33, 16
br i1 %34, label %35, label %38
35: ; preds = %32
store i32 3, i32* %7
%36 = load i32, i32* %6
%37 = sub nsw i32 %36, 8
store i32 %37, i32* %8
br label %42
38: ; preds = %32, %29
%39 = load i32, i32* @stderr
%40 = call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%41 = call i32 @exit(i32 1)
unreachable
42: ; preds = %35
br label %43
43: ; preds = %42, %27
%44 = load i32, i32* %9
%45 = icmp slt i32 %44, 0
br i1 %45, label %49, label %46
46: ; preds = %43
%47 = load i32, i32* %9
%48 = icmp sgt i32 %47, 255
br i1 %48, label %49, label %53
49: ; preds = %46, %43
%50 = load i32, i32* @stderr
%51 = call i32 @fprintf(i32 %50, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%52 = call i32 @exit(i32 1)
unreachable
53: ; preds = %46
%54 = load i32, i32* %7
%55 = mul nsw i32 %54, 2
%56 = add nsw i32 %55, 80
store i32 %56, i32* %7
%57 = load i32, i32* @O_RDWR
%58 = load i32, i32* @O_NDELAY
%59 = or i32 %57, %58
%60 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %59)
store i32 %60, i32* %10
%61 = icmp slt i32 %60, 0
br i1 %61, label %62, label %66
62: ; preds = %53
%63 = load i32, i32* @stderr
%64 = call i32 @fprintf(i32 %63, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%65 = call i32 @exit(i32 1)
unreachable
66: ; preds = %53
%67 = call i32 @iopl(i32 3)
%68 = load i32, i32* %10
%69 = load i32, i32* @TIOCMGET
%70 = call i32 @ioctl(i32 %68, i32 %69, i32* %11)
%71 = load i32, i32* @TIOCM_RTS
%72 = xor i32 %71, -1
%73 = load i32, i32* %11
%74 = and i32 %73, %72
store i32 %74, i32* %11
%75 = load i32, i32* @TIOCM_DTR
%76 = xor i32 %75, -1
%77 = load i32, i32* %11
%78 = and i32 %77, %76
store i32 %78, i32* %11
%79 = load i32, i32* %10
%80 = load i32, i32* @TIOCMSET
%81 = call i32 @ioctl(i32 %79, i32 %80, i32* %11)
%82 = load i32, i32* %13
%83 = call i32 @delay(i32 %82)
%84 = load i32, i32* @TIOCM_RTS
%85 = load i32, i32* %11
%86 = or i32 %85, %84
store i32 %86, i32* %11
%87 = load i32, i32* %10
%88 = load i32, i32* @TIOCMSET
%89 = call i32 @ioctl(i32 %87, i32 %88, i32* %11)
%90 = load i32, i32* %13
%91 = call i32 @delay(i32 %90)
%92 = load i32, i32* @TIOCM_DTR
%93 = load i32, i32* %11
%94 = or i32 %93, %92
store i32 %94, i32* %11
%95 = load i32, i32* %10
%96 = load i32, i32* @TIOCMSET
%97 = call i32 @ioctl(i32 %95, i32 %96, i32* %11)
%98 = load i32, i32* %13
%99 = call i32 @delay(i32 %98)
store i32 7, i32* %12
br label %100
100: ; preds = %141, %66
%101 = load i32, i32* %12
%102 = icmp sge i32 %101, 0
br i1 %102, label %103, label %144
103: ; preds = %100
%104 = load i32, i32* %7
%105 = load i32, i32* %12
%106 = ashr i32 %104, %105
%107 = and i32 %106, 1
%108 = icmp ne i32 %107, 0
br i1 %108, label %109, label %114
109: ; preds = %103
%110 = load i32, i32* @TIOCM_RTS
%111 = xor i32 %110, -1
%112 = load i32, i32* %11
%113 = and i32 %112, %111
store i32 %113, i32* %11
br label %118
114: ; preds = %103
%115 = load i32, i32* @TIOCM_RTS
%116 = load i32, i32* %11
%117 = or i32 %116, %115
store i32 %117, i32* %11
br label %118
118: ; preds = %114, %109
%119 = load i32, i32* %10
%120 = load i32, i32* @TIOCMSET
%121 = call i32 @ioctl(i32 %119, i32 %120, i32* %11)
%122 = load i32, i32* %13
%123 = call i32 @delay(i32 %122)
%124 = load i32, i32* @TIOCM_DTR
%125 = xor i32 %124, -1
%126 = load i32, i32* %11
%127 = and i32 %126, %125
store i32 %127, i32* %11
%128 = load i32, i32* %10
%129 = load i32, i32* @TIOCMSET
%130 = call i32 @ioctl(i32 %128, i32 %129, i32* %11)
%131 = load i32, i32* %13
%132 = call i32 @delay(i32 %131)
%133 = load i32, i32* @TIOCM_DTR
%134 = load i32, i32* %11
%135 = or i32 %134, %133
store i32 %135, i32* %11
%136 = load i32, i32* %10
%137 = load i32, i32* @TIOCMSET
%138 = call i32 @ioctl(i32 %136, i32 %137, i32* %11)
%139 = load i32, i32* %13
%140 = call i32 @delay(i32 %139)
br label %141
141: ; preds = %118
%142 = load i32, i32* %12
%143 = add nsw i32 %142, -1
store i32 %143, i32* %12
br label %100
144: ; preds = %100
%145 = load i32, i32* @TIOCM_RTS
%146 = load i32, i32* %11
%147 = or i32 %146, %145
store i32 %147, i32* %11
%148 = load i32, i32* %10
%149 = load i32, i32* @TIOCMSET
%150 = call i32 @ioctl(i32 %148, i32 %149, i32* %11)
%151 = load i32, i32* %13
%152 = call i32 @delay(i32 %151)
%153 = load i32, i32* @TIOCM_DTR
%154 = xor i32 %153, -1
%155 = load i32, i32* %11
%156 = and i32 %155, %154
store i32 %156, i32* %11
%157 = load i32, i32* %10
%158 = load i32, i32* @TIOCMSET
%159 = call i32 @ioctl(i32 %157, i32 %158, i32* %11)
%160 = load i32, i32* %13
%161 = call i32 @delay(i32 %160)
%162 = load i32, i32* @TIOCM_DTR
%163 = load i32, i32* %11
%164 = or i32 %163, %162
store i32 %164, i32* %11
%165 = load i32, i32* %10
%166 = load i32, i32* @TIOCMSET
%167 = call i32 @ioctl(i32 %165, i32 %166, i32* %11)
%168 = load i32, i32* %13
%169 = call i32 @delay(i32 %168)
store i32 7, i32* %12
br label %170
170: ; preds = %211, %144
%171 = load i32, i32* %12
%172 = icmp sge i32 %171, 0
br i1 %172, label %173, label %214
173: ; preds = %170
%174 = load i32, i32* %8
%175 = load i32, i32* %12
%176 = ashr i32 %174, %175
%177 = and i32 %176, 1
%178 = icmp ne i32 %177, 0
br i1 %178, label %179, label %184
179: ; preds = %173
%180 = load i32, i32* @TIOCM_RTS
%181 = xor i32 %180, -1
%182 = load i32, i32* %11
%183 = and i32 %182, %181
store i32 %183, i32* %11
br label %188
184: ; preds = %173
%185 = load i32, i32* @TIOCM_RTS
%186 = load i32, i32* %11
%187 = or i32 %186, %185
store i32 %187, i32* %11
br label %188
188: ; preds = %184, %179
%189 = load i32, i32* %10
%190 = load i32, i32* @TIOCMSET
%191 = call i32 @ioctl(i32 %189, i32 %190, i32* %11)
%192 = load i32, i32* %13
%193 = call i32 @delay(i32 %192)
%194 = load i32, i32* @TIOCM_DTR
%195 = xor i32 %194, -1
%196 = load i32, i32* %11
%197 = and i32 %196, %195
store i32 %197, i32* %11
%198 = load i32, i32* %10
%199 = load i32, i32* @TIOCMSET
%200 = call i32 @ioctl(i32 %198, i32 %199, i32* %11)
%201 = load i32, i32* %13
%202 = call i32 @delay(i32 %201)
%203 = load i32, i32* @TIOCM_DTR
%204 = load i32, i32* %11
%205 = or i32 %204, %203
store i32 %205, i32* %11
%206 = load i32, i32* %10
%207 = load i32, i32* @TIOCMSET
%208 = call i32 @ioctl(i32 %206, i32 %207, i32* %11)
%209 = load i32, i32* %13
%210 = call i32 @delay(i32 %209)
br label %211
211: ; preds = %188
%212 = load i32, i32* %12
%213 = add nsw i32 %212, -1
store i32 %213, i32* %12
br label %170
214: ; preds = %170
%215 = load i32, i32* @TIOCM_RTS
%216 = load i32, i32* %11
%217 = or i32 %216, %215
store i32 %217, i32* %11
%218 = load i32, i32* %10
%219 = load i32, i32* @TIOCMSET
%220 = call i32 @ioctl(i32 %218, i32 %219, i32* %11)
%221 = load i32, i32* %13
%222 = call i32 @delay(i32 %221)
%223 = load i32, i32* @TIOCM_DTR
%224 = xor i32 %223, -1
%225 = load i32, i32* %11
%226 = and i32 %225, %224
store i32 %226, i32* %11
%227 = load i32, i32* %10
%228 = load i32, i32* @TIOCMSET
%229 = call i32 @ioctl(i32 %227, i32 %228, i32* %11)
%230 = load i32, i32* %13
%231 = call i32 @delay(i32 %230)
%232 = load i32, i32* @TIOCM_DTR
%233 = load i32, i32* %11
%234 = or i32 %233, %232
store i32 %234, i32* %11
%235 = load i32, i32* %10
%236 = load i32, i32* @TIOCMSET
%237 = call i32 @ioctl(i32 %235, i32 %236, i32* %11)
%238 = load i32, i32* %13
%239 = call i32 @delay(i32 %238)
store i32 7, i32* %12
br label %240
240: ; preds = %281, %214
%241 = load i32, i32* %12
%242 = icmp sge i32 %241, 0
br i1 %242, label %243, label %284
243: ; preds = %240
%244 = load i32, i32* %9
%245 = load i32, i32* %12
%246 = ashr i32 %244, %245
%247 = and i32 %246, 1
%248 = icmp ne i32 %247, 0
br i1 %248, label %249, label %254
249: ; preds = %243
%250 = load i32, i32* @TIOCM_RTS
%251 = xor i32 %250, -1
%252 = load i32, i32* %11
%253 = and i32 %252, %251
store i32 %253, i32* %11
br label %258
254: ; preds = %243
%255 = load i32, i32* @TIOCM_RTS
%256 = load i32, i32* %11
%257 = or i32 %256, %255
store i32 %257, i32* %11
br label %258
258: ; preds = %254, %249
%259 = load i32, i32* %10
%260 = load i32, i32* @TIOCMSET
%261 = call i32 @ioctl(i32 %259, i32 %260, i32* %11)
%262 = load i32, i32* %13
%263 = call i32 @delay(i32 %262)
%264 = load i32, i32* @TIOCM_DTR
%265 = xor i32 %264, -1
%266 = load i32, i32* %11
%267 = and i32 %266, %265
store i32 %267, i32* %11
%268 = load i32, i32* %10
%269 = load i32, i32* @TIOCMSET
%270 = call i32 @ioctl(i32 %268, i32 %269, i32* %11)
%271 = load i32, i32* %13
%272 = call i32 @delay(i32 %271)
%273 = load i32, i32* @TIOCM_DTR
%274 = load i32, i32* %11
%275 = or i32 %274, %273
store i32 %275, i32* %11
%276 = load i32, i32* %10
%277 = load i32, i32* @TIOCMSET
%278 = call i32 @ioctl(i32 %276, i32 %277, i32* %11)
%279 = load i32, i32* %13
%280 = call i32 @delay(i32 %279)
br label %281
281: ; preds = %258
%282 = load i32, i32* %12
%283 = add nsw i32 %282, -1
store i32 %283, i32* %12
br label %240
284: ; preds = %240
%285 = load i32, i32* @TIOCM_RTS
%286 = load i32, i32* %11
%287 = or i32 %286, %285
store i32 %287, i32* %11
%288 = load i32, i32* %10
%289 = load i32, i32* @TIOCMSET
%290 = call i32 @ioctl(i32 %288, i32 %289, i32* %11)
%291 = load i32, i32* %13
%292 = call i32 @delay(i32 %291)
%293 = load i32, i32* @TIOCM_DTR
%294 = xor i32 %293, -1
%295 = load i32, i32* %11
%296 = and i32 %295, %294
store i32 %296, i32* %11
%297 = load i32, i32* %10
%298 = load i32, i32* @TIOCMSET
%299 = call i32 @ioctl(i32 %297, i32 %298, i32* %11)
%300 = load i32, i32* %13
%301 = call i32 @delay(i32 %300)
%302 = load i32, i32* @TIOCM_DTR
%303 = load i32, i32* %11
%304 = or i32 %303, %302
store i32 %304, i32* %11
%305 = load i32, i32* %10
%306 = load i32, i32* @TIOCMSET
%307 = call i32 @ioctl(i32 %305, i32 %306, i32* %11)
%308 = load i32, i32* %13
%309 = call i32 @delay(i32 %308)
%310 = load i32, i32* @TIOCM_DTR
%311 = xor i32 %310, -1
%312 = load i32, i32* %11
%313 = and i32 %312, %311
store i32 %313, i32* %11
%314 = load i32, i32* %10
%315 = load i32, i32* @TIOCMSET
%316 = call i32 @ioctl(i32 %314, i32 %315, i32* %11)
%317 = load i32, i32* %13
%318 = call i32 @delay(i32 %317)
%319 = load i32, i32* @TIOCM_RTS
%320 = xor i32 %319, -1
%321 = load i32, i32* %11
%322 = and i32 %321, %320
store i32 %322, i32* %11
%323 = load i32, i32* %10
%324 = load i32, i32* @TIOCMSET
%325 = call i32 @ioctl(i32 %323, i32 %324, i32* %11)
%326 = load i32, i32* %13
%327 = call i32 @delay(i32 %326)
%328 = load i32, i32* %10
%329 = call i32 @close(i32 %328)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"DAC address must be in range 0-15\0A\00"
@.str.1 = [36 x i8] c"Power level must be in range 0-255\0A\00"
@.str.2 = [11 x i8] c"/dev/ttyS1\00"
@O_RDWR = global i32 0
@O_NDELAY = global i32 0
@.str.3 = [17 x i8] c"device not found\00"
@TIOCMGET = global i32 0
@TIOCM_RTS = global i32 0
@TIOCM_DTR = global i32 0
@TIOCMSET = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = icmp ult i32 %7, 8
br i1 %11, label %21, label %12
12: ; preds = %2
%13 = and i32 %7, -8
%14 = icmp eq i32 %13, 8
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = add nsw i32 %7, -8
br label %21
17: ; preds = %12
%18 = load i32, i32* @stderr
%19 = tail call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%20 = tail call i32 @exit(i32 1)
unreachable
21: ; preds = %2, %15
%22 = phi i32 [ %16, %15 ], [ %7, %2 ]
%23 = phi i32 [ 86, %15 ], [ 80, %2 ]
%24 = icmp ugt i32 %10, 255
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load i32, i32* @stderr
%27 = tail call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%28 = tail call i32 @exit(i32 1)
unreachable
29: ; preds = %21
%30 = load i32, i32* @O_RDWR
%31 = load i32, i32* @O_NDELAY
%32 = or i32 %31, %30
%33 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%34 = icmp slt i32 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %29
%36 = load i32, i32* @stderr
%37 = tail call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%38 = tail call i32 @exit(i32 1)
unreachable
39: ; preds = %29
%40 = tail call i32 @iopl(i32 3)
%41 = load i32, i32* @TIOCMGET
%42 = call i32 @ioctl(i32 %33, i32 %41, i32* %3)
%43 = load i32, i32* @TIOCM_RTS
%44 = load i32, i32* %3
%45 = load i32, i32* @TIOCM_DTR
%46 = or i32 %43, %45
%47 = xor i32 %46, -1
%48 = and i32 %44, %47
store i32 %48, i32* %3
%49 = load i32, i32* @TIOCMSET
%50 = call i32 @ioctl(i32 %33, i32 %49, i32* %3)
%51 = call i32 @delay(i32 5)
%52 = load i32, i32* @TIOCM_RTS
%53 = load i32, i32* %3
%54 = or i32 %53, %52
store i32 %54, i32* %3
%55 = load i32, i32* @TIOCMSET
%56 = call i32 @ioctl(i32 %33, i32 %55, i32* %3)
%57 = call i32 @delay(i32 5)
%58 = load i32, i32* @TIOCM_DTR
%59 = load i32, i32* %3
%60 = or i32 %59, %58
store i32 %60, i32* %3
%61 = load i32, i32* @TIOCMSET
%62 = call i32 @ioctl(i32 %33, i32 %61, i32* %3)
%63 = call i32 @delay(i32 5)
br label %64
64: ; preds = %39, %77
%65 = phi i32 [ 7, %39 ], [ %95, %77 ]
%66 = shl nuw i32 1, %65
%67 = and i32 %66, %23
%68 = icmp eq i32 %67, 0
%69 = load i32, i32* @TIOCM_RTS
br i1 %68, label %74, label %70
70: ; preds = %64
%71 = xor i32 %69, -1
%72 = load i32, i32* %3
%73 = and i32 %72, %71
br label %77
74: ; preds = %64
%75 = load i32, i32* %3
%76 = or i32 %75, %69
br label %77
77: ; preds = %74, %70
%78 = phi i32 [ %76, %74 ], [ %73, %70 ]
store i32 %78, i32* %3
%79 = load i32, i32* @TIOCMSET
%80 = call i32 @ioctl(i32 %33, i32 %79, i32* %3)
%81 = call i32 @delay(i32 5)
%82 = load i32, i32* @TIOCM_DTR
%83 = xor i32 %82, -1
%84 = load i32, i32* %3
%85 = and i32 %84, %83
store i32 %85, i32* %3
%86 = load i32, i32* @TIOCMSET
%87 = call i32 @ioctl(i32 %33, i32 %86, i32* %3)
%88 = call i32 @delay(i32 5)
%89 = load i32, i32* @TIOCM_DTR
%90 = load i32, i32* %3
%91 = or i32 %90, %89
store i32 %91, i32* %3
%92 = load i32, i32* @TIOCMSET
%93 = call i32 @ioctl(i32 %33, i32 %92, i32* %3)
%94 = call i32 @delay(i32 5)
%95 = add nsw i32 %65, -1
%96 = icmp eq i32 %65, 0
br i1 %96, label %97, label %64
97: ; preds = %77
%98 = load i32, i32* @TIOCM_RTS
%99 = load i32, i32* %3
%100 = or i32 %99, %98
store i32 %100, i32* %3
%101 = load i32, i32* @TIOCMSET
%102 = call i32 @ioctl(i32 %33, i32 %101, i32* %3)
%103 = call i32 @delay(i32 5)
%104 = load i32, i32* @TIOCM_DTR
%105 = xor i32 %104, -1
%106 = load i32, i32* %3
%107 = and i32 %106, %105
store i32 %107, i32* %3
%108 = load i32, i32* @TIOCMSET
%109 = call i32 @ioctl(i32 %33, i32 %108, i32* %3)
%110 = call i32 @delay(i32 5)
%111 = load i32, i32* @TIOCM_DTR
%112 = load i32, i32* %3
%113 = or i32 %112, %111
store i32 %113, i32* %3
%114 = load i32, i32* @TIOCMSET
%115 = call i32 @ioctl(i32 %33, i32 %114, i32* %3)
%116 = call i32 @delay(i32 5)
br label %117
117: ; preds = %97, %130
%118 = phi i32 [ 7, %97 ], [ %148, %130 ]
%119 = shl nuw i32 1, %118
%120 = and i32 %119, %22
%121 = icmp eq i32 %120, 0
%122 = load i32, i32* @TIOCM_RTS
br i1 %121, label %127, label %123
123: ; preds = %117
%124 = xor i32 %122, -1
%125 = load i32, i32* %3
%126 = and i32 %125, %124
br label %130
127: ; preds = %117
%128 = load i32, i32* %3
%129 = or i32 %128, %122
br label %130
130: ; preds = %127, %123
%131 = phi i32 [ %129, %127 ], [ %126, %123 ]
store i32 %131, i32* %3
%132 = load i32, i32* @TIOCMSET
%133 = call i32 @ioctl(i32 %33, i32 %132, i32* %3)
%134 = call i32 @delay(i32 5)
%135 = load i32, i32* @TIOCM_DTR
%136 = xor i32 %135, -1
%137 = load i32, i32* %3
%138 = and i32 %137, %136
store i32 %138, i32* %3
%139 = load i32, i32* @TIOCMSET
%140 = call i32 @ioctl(i32 %33, i32 %139, i32* %3)
%141 = call i32 @delay(i32 5)
%142 = load i32, i32* @TIOCM_DTR
%143 = load i32, i32* %3
%144 = or i32 %143, %142
store i32 %144, i32* %3
%145 = load i32, i32* @TIOCMSET
%146 = call i32 @ioctl(i32 %33, i32 %145, i32* %3)
%147 = call i32 @delay(i32 5)
%148 = add nsw i32 %118, -1
%149 = icmp eq i32 %118, 0
br i1 %149, label %150, label %117
150: ; preds = %130
%151 = load i32, i32* @TIOCM_RTS
%152 = load i32, i32* %3
%153 = or i32 %152, %151
store i32 %153, i32* %3
%154 = load i32, i32* @TIOCMSET
%155 = call i32 @ioctl(i32 %33, i32 %154, i32* %3)
%156 = call i32 @delay(i32 5)
%157 = load i32, i32* @TIOCM_DTR
%158 = xor i32 %157, -1
%159 = load i32, i32* %3
%160 = and i32 %159, %158
store i32 %160, i32* %3
%161 = load i32, i32* @TIOCMSET
%162 = call i32 @ioctl(i32 %33, i32 %161, i32* %3)
%163 = call i32 @delay(i32 5)
%164 = load i32, i32* @TIOCM_DTR
%165 = load i32, i32* %3
%166 = or i32 %165, %164
store i32 %166, i32* %3
%167 = load i32, i32* @TIOCMSET
%168 = call i32 @ioctl(i32 %33, i32 %167, i32* %3)
%169 = call i32 @delay(i32 5)
br label %170
170: ; preds = %150, %183
%171 = phi i32 [ 7, %150 ], [ %201, %183 ]
%172 = shl nuw i32 1, %171
%173 = and i32 %172, %10
%174 = icmp eq i32 %173, 0
%175 = load i32, i32* @TIOCM_RTS
br i1 %174, label %180, label %176
176: ; preds = %170
%177 = xor i32 %175, -1
%178 = load i32, i32* %3
%179 = and i32 %178, %177
br label %183
180: ; preds = %170
%181 = load i32, i32* %3
%182 = or i32 %181, %175
br label %183
183: ; preds = %180, %176
%184 = phi i32 [ %182, %180 ], [ %179, %176 ]
store i32 %184, i32* %3
%185 = load i32, i32* @TIOCMSET
%186 = call i32 @ioctl(i32 %33, i32 %185, i32* %3)
%187 = call i32 @delay(i32 5)
%188 = load i32, i32* @TIOCM_DTR
%189 = xor i32 %188, -1
%190 = load i32, i32* %3
%191 = and i32 %190, %189
store i32 %191, i32* %3
%192 = load i32, i32* @TIOCMSET
%193 = call i32 @ioctl(i32 %33, i32 %192, i32* %3)
%194 = call i32 @delay(i32 5)
%195 = load i32, i32* @TIOCM_DTR
%196 = load i32, i32* %3
%197 = or i32 %196, %195
store i32 %197, i32* %3
%198 = load i32, i32* @TIOCMSET
%199 = call i32 @ioctl(i32 %33, i32 %198, i32* %3)
%200 = call i32 @delay(i32 5)
%201 = add nsw i32 %171, -1
%202 = icmp eq i32 %171, 0
br i1 %202, label %203, label %170
203: ; preds = %183
%204 = load i32, i32* @TIOCM_RTS
%205 = load i32, i32* %3
%206 = or i32 %205, %204
store i32 %206, i32* %3
%207 = load i32, i32* @TIOCMSET
%208 = call i32 @ioctl(i32 %33, i32 %207, i32* %3)
%209 = call i32 @delay(i32 5)
%210 = load i32, i32* @TIOCM_DTR
%211 = xor i32 %210, -1
%212 = load i32, i32* %3
%213 = and i32 %212, %211
store i32 %213, i32* %3
%214 = load i32, i32* @TIOCMSET
%215 = call i32 @ioctl(i32 %33, i32 %214, i32* %3)
%216 = call i32 @delay(i32 5)
%217 = load i32, i32* @TIOCM_DTR
%218 = load i32, i32* %3
%219 = or i32 %218, %217
store i32 %219, i32* %3
%220 = load i32, i32* @TIOCMSET
%221 = call i32 @ioctl(i32 %33, i32 %220, i32* %3)
%222 = call i32 @delay(i32 5)
%223 = load i32, i32* @TIOCM_DTR
%224 = xor i32 %223, -1
%225 = load i32, i32* %3
%226 = and i32 %225, %224
store i32 %226, i32* %3
%227 = load i32, i32* @TIOCMSET
%228 = call i32 @ioctl(i32 %33, i32 %227, i32* %3)
%229 = call i32 @delay(i32 5)
%230 = load i32, i32* @TIOCM_RTS
%231 = xor i32 %230, -1
%232 = load i32, i32* %3
%233 = and i32 %232, %231
store i32 %233, i32* %3
%234 = load i32, i32* @TIOCMSET
%235 = call i32 @ioctl(i32 %33, i32 %234, i32* %3)
%236 = call i32 @delay(i32 5)
%237 = call i32 @close(i32 %33)
ret i32 0
}