#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 */
typedef int ssize_t;
typedef scalar_t__ off_t;

/* Variables and functions */
int O_RDONLY;
int O_WRONLY;
int /*<<< orphan*/ SEEK_SET;
int STDIN_FILENO;
int STDOUT_FILENO;
int /*<<< orphan*/ exit(int);
int ioctl(int, int, int /*<<< orphan*/ *);
scalar_t__ lseek(int, int, int /*<<< orphan*/);
int open(char const *, int);
scalar_t__ parse_double(char *, double *);
scalar_t__ parse_ssize(char *, int *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sleep_for(double);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ transfer(int, int, int);
int /*<<< orphan*/ transfer_zero(int, int);
int /*<<< orphan*/ usage(int);
int main(int argc, char *argv[]) {
  char *newarg;
  int devfd, ofd;
  int i, r, timeout = 0, zero = 0;
  int mode = O_RDONLY, dolock = 0, dotrylock = 0;
  ssize_t size = -1;
  ssize_t offset = 0;
  double delay = 0;
  double lock_delay = 0;
  const char *devname = "/dev/osprda";
flag:
  if (argc >= 2 && strcmp(argv[1], "-r") == 0) {
    mode = O_RDONLY;
    argv++, argc--;
    if (argc >= 2 && parse_ssize(argv[1], &size))
      argv++, argc--;
    goto flag;
  } else if (argc >= 2 && strcmp(argv[1], "-w") == 0) {
    mode = O_WRONLY;
    argv++, argc--;
    if (argc >= 2 && parse_ssize(argv[1], &size))
      argv++, argc--;
    goto flag;
  }
  if (argc >= 2 && strcmp(argv[1], "-o") == 0) {
    if (argc < 2 || !parse_ssize(argv[2], &offset))
      usage(1);
    argv += 2, argc -= 2;
    goto flag;
  }
  if (argc >= 2 && strcmp(argv[1], "-l") == 0) {
    dolock = 1;
    dotrylock = 0;
    argv++, argc--;
    if (argc >= 2 && parse_double(argv[1], &lock_delay))
      argv++, argc--;
    goto flag;
  }
  if (argc >= 2 && strcmp(argv[1], "-L") == 0) {
    dotrylock = 1;
    dolock = 0;
    argv++, argc--;
    if (argc >= 2 && parse_double(argv[1], &lock_delay))
      argv++, argc--;
    goto flag;
  }
  if (argc >= 2 && strcmp(argv[1], "-d") == 0) {
    argv++, argc--;
    if (argc >= 2 && parse_double(argv[1], &delay))
      argv++, argc--;
    goto flag;
  }
  if (argc >= 2 && strcmp(argv[1], "-z") == 0) {
    zero = 1;
    argv++, argc--;
    goto flag;
  }
  if (argc >= 2 &&
      (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0))
    usage(0);
  if (argc >= 2 && argv[1][1] != '-') {
    devname = argv[1];
    argv++, argc--;
  }
  devfd = open(devname, mode);
  if (devfd == -1) {
    perror("open");
    exit(1);
  }
  if (dolock || dotrylock) {
    if (lock_delay >= 0)
      sleep_for(lock_delay);
    if (dolock && ioctl(devfd, 42, NULL) == -1) {
      perror("ioctl OSPRDIOCACQUIRE");
      exit(1);
    } else if (dotrylock && ioctl(devfd, 43, NULL) == -1) {
      perror("ioctl OSPRDIOCTRYACQUIRE");
      exit(1);
    }
  }
  if (delay >= 0)
    sleep_for(delay);
  if (argc > 1)
    goto flag;
  if (lseek(devfd, offset, SEEK_SET) == (off_t)-1) {
    perror("lseek");
    exit(1);
  }
  if ((mode & O_WRONLY) && zero)
    transfer_zero(devfd, size);
  else if (mode & O_WRONLY)
    transfer(STDIN_FILENO, devfd, size);
  else
    transfer(devfd, STDOUT_FILENO, size);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    0x2df5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0xffffffff,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
lea    0xddd(%rip),%rax
mov    %rax,-0x60(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     12af <main+0xef>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdcc(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12af <main+0xef>
mov    0x2d8a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     12aa <main+0xea>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x40(%rbp),%rsi
call   1080 <parse_ssize@plt>
cmp    $0x0,%rax
je     12aa <main+0xea>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1227 <main+0x67>
cmpl   $0x2,-0x8(%rbp)
jl     1337 <main+0x177>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd47(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1337 <main+0x177>
mov    0x2cda(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1332 <main+0x172>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x40(%rbp),%rsi
call   1080 <parse_ssize@plt>
cmp    $0x0,%rax
je     1332 <main+0x172>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1227 <main+0x67>
jmp    133c <main+0x17c>
cmpl   $0x2,-0x8(%rbp)
jl     13ad <main+0x1ed>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xcbd(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    13ad <main+0x1ed>
cmpl   $0x2,-0x8(%rbp)
jl     1389 <main+0x1c9>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x44(%rbp),%rsi
call   1080 <parse_ssize@plt>
cmp    $0x0,%rax
jne    1393 <main+0x1d3>
mov    $0x1,%edi
call   1090 <usage@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1227 <main+0x67>
cmpl   $0x2,-0x8(%rbp)
jl     1437 <main+0x277>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xc4f(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1437 <main+0x277>
movl   $0x1,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1432 <main+0x272>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x58(%rbp),%rsi
call   1070 <parse_double@plt>
cmp    $0x0,%rax
je     1432 <main+0x272>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1227 <main+0x67>
cmpl   $0x2,-0x8(%rbp)
jl     14c1 <main+0x301>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xbc8(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    14c1 <main+0x301>
movl   $0x1,-0x3c(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     14bc <main+0x2fc>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x58(%rbp),%rsi
call   1070 <parse_double@plt>
cmp    $0x0,%rax
je     14bc <main+0x2fc>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1227 <main+0x67>
cmpl   $0x2,-0x8(%rbp)
jl     153d <main+0x37d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xb41(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    153d <main+0x37d>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1538 <main+0x378>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x50(%rbp),%rsi
call   1070 <parse_double@plt>
cmp    $0x0,%rax
je     1538 <main+0x378>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1227 <main+0x67>
cmpl   $0x2,-0x8(%rbp)
jl     1586 <main+0x3c6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xac8(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1586 <main+0x3c6>
movl   $0x1,-0x30(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1227 <main+0x67>
cmpl   $0x2,-0x8(%rbp)
jl     15d3 <main+0x413>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xa82(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     15cc <main+0x40c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xa67(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    15d3 <main+0x413>
xor    %edi,%edi
call   1090 <usage@plt>
cmpl   $0x2,-0x8(%rbp)
jl     1613 <main+0x453>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2d,%eax
je     1613 <main+0x453>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   10a0 <open@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1642 <main+0x482>
lea    0x9f8(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
cmpl   $0x0,-0x38(%rbp)
jne    1656 <main+0x496>
cmpl   $0x0,-0x3c(%rbp)
je     16f0 <main+0x530>
movsd  -0x58(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1672 <main+0x4b2>
movsd  -0x58(%rbp),%xmm0
call   10c0 <sleep_for@plt>
cmpl   $0x0,-0x38(%rbp)
je     16ac <main+0x4ec>
mov    -0x1c(%rbp),%edi
mov    $0x2a,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    16ac <main+0x4ec>
lea    0x993(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
cmpl   $0x0,-0x3c(%rbp)
je     16e6 <main+0x526>
mov    -0x1c(%rbp),%edi
mov    $0x2b,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    16e6 <main+0x526>
lea    0x96f(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
jmp    16eb <main+0x52b>
jmp    16f0 <main+0x530>
movsd  -0x50(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     170c <main+0x54c>
movsd  -0x50(%rbp),%xmm0
call   10c0 <sleep_for@plt>
cmpl   $0x1,-0x8(%rbp)
jle    171b <main+0x55b>
jmp    1227 <main+0x67>
mov    -0x1c(%rbp),%edi
mov    -0x44(%rbp),%esi
mov    0x28a8(%rip),%rax
mov    (%rax),%edx
call   1040 <lseek@plt>
cmp    $0xffffffffffffffff,%rax
jne    174f <main+0x58f>
lea    0x91f(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x34(%rbp),%eax
mov    0x285f(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     177e <main+0x5be>
cmpl   $0x0,-0x30(%rbp)
je     177e <main+0x5be>
mov    -0x1c(%rbp),%edi
mov    -0x40(%rbp),%esi
call   1030 <transfer_zero@plt>
jmp    17c5 <main+0x605>
mov    -0x34(%rbp),%eax
mov    0x2830(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     17ac <main+0x5ec>
mov    0x282e(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%esi
mov    -0x40(%rbp),%edx
call   10e0 <transfer@plt>
jmp    17c0 <main+0x600>
mov    -0x1c(%rbp),%edi
mov    0x283a(%rip),%rax
mov    (%rax),%esi
mov    -0x40(%rbp),%edx
call   10e0 <transfer@plt>
jmp    17c5 <main+0x605>
xor    %edi,%edi
call   10d0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r15
mov    %edi,%ebp
mov    0x2e06(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
movl   $0xffffffff,0x10(%rsp)
ff
movl   $0x0,0x14(%rsp)
movq   $0x0,0x30(%rsp)
movq   $0x0,0x18(%rsp)
lea    0xdff(%rip),%rax
mov    %rax,0x28(%rsp)
xor    %eax,%eax
mov    %rax,0x20(%rsp)
xor    %r14d,%r14d
jmp    1229 <main+0x69>
nopw   0x0(%rax,%rax,1)
mov    %al,%cl
lea    (%rcx,%r12,1),%ebp
add    $0xfffffffe,%ebp
xor    %r13d,%r13d
jmp    1239 <main+0x79>
xchg   %ax,%ax
cmp    $0x1,%ebp
jle    1538 <main+0x378>
mov    %ebp,%r12d
mov    %r15,%rbx
cmp    $0x2,%ebp
jl     1340 <main+0x180>
lea    0x8(%rbx),%r15
mov    0x8(%rbx),%rdi
lea    0xdbd(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     13d5 <main+0x215>
mov    (%r15),%rdi
lea    0xda8(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     13de <main+0x21e>
mov    (%r15),%rdi
lea    0xd93(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1427 <main+0x267>
mov    (%r15),%rdi
lea    0xd7e(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1457 <main+0x297>
mov    (%r15),%rdi
lea    0xd69(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1477 <main+0x2b7>
mov    (%r15),%rdi
lea    0xd54(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     14c2 <main+0x302>
mov    (%r15),%rdi
lea    0xd3f(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     14e4 <main+0x324>
mov    (%r15),%rdi
lea    0xd2a(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     131d <main+0x15d>
mov    (%r15),%rdi
lea    0xd19(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1324 <main+0x164>
xor    %edi,%edi
call   1090 <usage@plt>
mov    (%r15),%rax
cmpb   $0x2d,0x1(%rax)
jne    14fa <main+0x33a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%r15
mov    %r12d,%ebp
mov    0x28(%rsp),%rdi
mov    0xc(%rsp),%esi
call   10a0 <open@plt>
cmp    $0xffffffff,%eax
je     155c <main+0x39c>
mov    %eax,%r12d
mov    %r14d,%eax
or     %r13d,%eax
je     13b7 <main+0x1f7>
movsd  0x18(%rsp),%xmm0
ucomisd 0xc8a(%rip),%xmm0
jb     137d <main+0x1bd>
call   10c0 <sleep_for@plt>
test   %r14d,%r14d
je     139a <main+0x1da>
mov    %r12d,%edi
mov    $0x2a,%esi
xor    %edx,%edx
call   1050 <ioctl@plt>
cmp    $0xffffffff,%eax
je     158e <main+0x3ce>
test   %r13d,%r13d
je     13b7 <main+0x1f7>
mov    %r12d,%edi
mov    $0x2b,%esi
xor    %edx,%edx
call   1050 <ioctl@plt>
cmp    $0xffffffff,%eax
je     1597 <main+0x3d7>
movsd  0x30(%rsp),%xmm0
ucomisd 0xc3b(%rip),%xmm0
jb     1230 <main+0x70>
call   10c0 <sleep_for@plt>
jmp    1230 <main+0x70>
mov    0x2c04(%rip),%rax
jmp    13e5 <main+0x225>
mov    0x2bd3(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
mov    $0x1,%ebp
cmp    $0x3,%r12d
jb     1239 <main+0x79>
mov    0x10(%rbx),%rdi
lea    0x10(%rsp),%rsi
call   1080 <parse_ssize@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %al
je     1419 <main+0x259>
add    $0x10,%rbx
mov    %rbx,%r15
mov    %al,%cl
lea    (%rcx,%r12,1),%ebp
add    $0xfffffffe,%ebp
jmp    1239 <main+0x79>
mov    0x10(%rbx),%rdi
lea    0x14(%rsp),%rsi
call   1080 <parse_ssize@plt>
test   %rax,%rax
jne    1444 <main+0x284>
mov    $0x1,%edi
call   1090 <usage@plt>
add    $0x10,%rbx
add    $0xfffffffe,%r12d
mov    %rbx,%r15
mov    %r12d,%ebp
jmp    1239 <main+0x79>
mov    $0x1,%r14d
mov    $0x1,%ebp
mov    $0x0,%r13d
cmp    $0x3,%r12d
jb     1239 <main+0x79>
jmp    1510 <main+0x350>
mov    $0x1,%r13d
mov    $0x1,%ebp
mov    $0x0,%r14d
cmp    $0x3,%r12d
jb     1239 <main+0x79>
mov    0x10(%rbx),%rdi
lea    0x18(%rsp),%rsi
call   1070 <parse_double@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %al
je     14b1 <main+0x2f1>
add    $0x10,%rbx
mov    %rbx,%r15
mov    %al,%cl
lea    (%rcx,%r12,1),%ebp
add    $0xfffffffe,%ebp
xor    %r14d,%r14d
jmp    1239 <main+0x79>
mov    $0x1,%ebp
cmp    $0x3,%r12d
jb     1239 <main+0x79>
mov    0x10(%rbx),%rdi
lea    0x30(%rsp),%rsi
call   1070 <parse_double@plt>
jmp    1408 <main+0x248>
add    $0xffffffff,%r12d
mov    $0x1,%eax
mov    %rax,0x20(%rsp)
mov    %r12d,%ebp
jmp    1239 <main+0x79>
add    $0xffffffff,%r12d
mov    %r12d,%ebp
mov    %rax,0x28(%rsp)
jmp    1346 <main+0x186>
nopl   0x0(%rax,%rax,1)
mov    0x10(%rbx),%rdi
lea    0x18(%rsp),%rsi
call   1070 <parse_double@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %al
je     1220 <main+0x60>
add    $0x10,%rbx
mov    %rbx,%r15
jmp    1220 <main+0x60>
mov    0x14(%rsp),%esi
mov    0x2a8d(%rip),%rax
mov    (%rax),%edx
mov    %r12d,%edi
call   1040 <lseek@plt>
cmp    $0xffffffffffffffff,%rax
jne    1565 <main+0x3a5>
lea    0xb0d(%rip),%rdi
jmp    159e <main+0x3de>
lea    0xad0(%rip),%rdi
jmp    159e <main+0x3de>
mov    0x2a4c(%rip),%rax
mov    (%rax),%eax
test   %eax,0xc(%rsp)
je     15ad <main+0x3ed>
cmpl   $0x0,0x20(%rsp)
je     15ad <main+0x3ed>
mov    0x10(%rsp),%esi
mov    %r12d,%edi
call   1030 <transfer_zero@plt>
xor    %edi,%edi
call   10d0 <exit@plt>
lea    0xaa3(%rip),%rdi
jmp    159e <main+0x3de>
lea    0xab0(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
test   %eax,0xc(%rsp)
je     15c5 <main+0x405>
mov    0x2a0e(%rip),%rax
mov    (%rax),%edi
mov    0x10(%rsp),%edx
mov    %r12d,%esi
jmp    15d5 <main+0x415>
mov    0x2a24(%rip),%rax
mov    (%rax),%esi
mov    0x10(%rsp),%edx
mov    %r12d,%edi
call   10e0 <transfer@plt>
xor    %edi,%edi
call   10d0 <exit@plt>

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

LLVM IR (-O2):
@O_RDONLY = global i32 0
@.str = [12 x i8] c"/dev/osprda\00"
@.str.1 = [3 x i8] c"-r\00"
@.str.2 = [3 x i8] c"-w\00"
@O_WRONLY = global i32 0
@.str.3 = [3 x i8] c"-o\00"
@.str.4 = [3 x i8] c"-l\00"
@.str.5 = [3 x i8] c"-L\00"
@.str.6 = [3 x i8] c"-d\00"
@.str.7 = [3 x i8] c"-z\00"
@.str.8 = [3 x i8] c"-h\00"
@.str.9 = [7 x i8] c"--help\00"
@.str.10 = [5 x i8] c"open\00"
@.str.11 = [22 x i8] c"ioctl OSPRDIOCACQUIRE\00"
@.str.12 = [25 x i8] c"ioctl OSPRDIOCTRYACQUIRE\00"
@SEEK_SET = global i32 0
@.str.13 = [6 x i8] c"lseek\00"
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = load i32, i32* @O_RDONLY
%8 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
%9 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%10 = bitcast double* %5 to i8*
store double 0.000000e+00, double* %5
%11 = bitcast double* %6 to i8*
store double 0.000000e+00, double* %6
br label %12
12: ; preds = %99, %2
%13 = phi i8** [ %1, %2 ], [ %100, %99 ]
%14 = phi i32 [ %0, %2 ], [ %101, %99 ]
%15 = phi i32 [ 0, %2 ], [ %102, %99 ]
%16 = phi i32 [ %7, %2 ], [ %103, %99 ]
%17 = phi i32 [ 0, %2 ], [ %104, %99 ]
%18 = phi i32 [ 0, %2 ], [ %105, %99 ]
%19 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %2 ], [ %106, %99 ]
%20 = icmp sgt i32 %14, 1
br i1 %20, label %21, label %138
21: ; preds = %12
%22 = getelementptr inbounds i8*, i8** %13, i64 1
%23 = load i8*, i8** %22
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %37
26: ; preds = %21
%27 = load i32, i32* @O_RDONLY
%28 = icmp ugt i32 %14, 2
br i1 %28, label %29, label %99
29: ; preds = %26
%30 = getelementptr inbounds i8*, i8** %13, i64 2
%31 = load i8*, i8** %30
%32 = call i64 @parse_ssize(i8* %31, i32* %3)
%33 = icmp eq i64 %32, 0
%34 = select i1 %33, i8** %22, i8** %30
%35 = select i1 %33, i32 -1, i32 -2
%36 = add nsw i32 %35, %14
br label %99
37: ; preds = %21
%38 = load i8*, i8** %22
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %52
41: ; preds = %37
%42 = load i32, i32* @O_WRONLY
%43 = icmp ugt i32 %14, 2
br i1 %43, label %44, label %99
44: ; preds = %41
%45 = getelementptr inbounds i8*, i8** %13, i64 2
%46 = load i8*, i8** %45
%47 = call i64 @parse_ssize(i8* %46, i32* %3)
%48 = icmp eq i64 %47, 0
%49 = select i1 %48, i8** %22, i8** %45
%50 = select i1 %48, i32 -1, i32 -2
%51 = add nsw i32 %50, %14
br label %99
52: ; preds = %37
%53 = load i8*, i8** %22
%54 = call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %65
56: ; preds = %52
%57 = getelementptr inbounds i8*, i8** %13, i64 2
%58 = load i8*, i8** %57
%59 = call i64 @parse_ssize(i8* %58, i32* %4)
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %56
%62 = call i32 @usage(i32 1)
br label %63
63: ; preds = %61, %56
%64 = add nsw i32 %14, -2
br label %99
65: ; preds = %52
%66 = load i8*, i8** %22
%67 = call i64 @strcmp(i8* %66, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %79
69: ; preds = %65
%70 = icmp ugt i32 %14, 2
br i1 %70, label %71, label %99
71: ; preds = %69
%72 = getelementptr inbounds i8*, i8** %13, i64 2
%73 = load i8*, i8** %72
%74 = call i64 @parse_double(i8* %73, double* %6)
%75 = icmp eq i64 %74, 0
%76 = select i1 %75, i8** %22, i8** %72
%77 = select i1 %75, i32 -1, i32 -2
%78 = add nsw i32 %77, %14
br label %99
79: ; preds = %65
%80 = load i8*, i8** %22
%81 = call i64 @strcmp(i8* %80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %93
83: ; preds = %79
%84 = icmp ugt i32 %14, 2
br i1 %84, label %85, label %99
85: ; preds = %83
%86 = getelementptr inbounds i8*, i8** %13, i64 2
%87 = load i8*, i8** %86
%88 = call i64 @parse_double(i8* %87, double* %6)
%89 = icmp eq i64 %88, 0
%90 = select i1 %89, i8** %22, i8** %86
%91 = select i1 %89, i32 -1, i32 -2
%92 = add nsw i32 %91, %14
br label %99
93: ; preds = %79
%94 = load i8*, i8** %22
%95 = call i64 @strcmp(i8* %94, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
br i1 %96, label %97, label %115
97: ; preds = %93
%98 = icmp ugt i32 %14, 2
br i1 %98, label %107, label %99
99: ; preds = %97, %107, %83, %85, %69, %71, %41, %44, %26, %29, %63, %119, %175
%100 = phi i8** [ %57, %63 ], [ %22, %119 ], [ %139, %175 ], [ %22, %26 ], [ %34, %29 ], [ %22, %41 ], [ %49, %44 ], [ %22, %69 ], [ %76, %71 ], [ %22, %83 ], [ %90, %85 ], [ %22, %97 ], [ %112, %107 ]
%101 = phi i32 [ %64, %63 ], [ %120, %119 ], [ %140, %175 ], [ 1, %26 ], [ %36, %29 ], [ 1, %41 ], [ %51, %44 ], [ 1, %69 ], [ %78, %71 ], [ 1, %83 ], [ %92, %85 ], [ 1, %97 ], [ %114, %107 ]
%102 = phi i32 [ %15, %63 ], [ 1, %119 ], [ %15, %175 ], [ %15, %26 ], [ %15, %29 ], [ %15, %41 ], [ %15, %44 ], [ %15, %69 ], [ %15, %71 ], [ %15, %83 ], [ %15, %85 ], [ %15, %97 ], [ %15, %107 ]
%103 = phi i32 [ %16, %63 ], [ %16, %119 ], [ %16, %175 ], [ %27, %26 ], [ %27, %29 ], [ %42, %41 ], [ %42, %44 ], [ %16, %69 ], [ %16, %71 ], [ %16, %83 ], [ %16, %85 ], [ %16, %97 ], [ %16, %107 ]
%104 = phi i32 [ %17, %63 ], [ %17, %119 ], [ %17, %175 ], [ %17, %26 ], [ %17, %29 ], [ %17, %41 ], [ %17, %44 ], [ 1, %69 ], [ 1, %71 ], [ 0, %83 ], [ 0, %85 ], [ %17, %97 ], [ %17, %107 ]
%105 = phi i32 [ %18, %63 ], [ %18, %119 ], [ %18, %175 ], [ %18, %26 ], [ %18, %29 ], [ %18, %41 ], [ %18, %44 ], [ 0, %69 ], [ 0, %71 ], [ 1, %83 ], [ 1, %85 ], [ %18, %97 ], [ %18, %107 ]
%106 = phi i8* [ %19, %63 ], [ %19, %119 ], [ %141, %175 ], [ %19, %26 ], [ %19, %29 ], [ %19, %41 ], [ %19, %44 ], [ %19, %69 ], [ %19, %71 ], [ %19, %83 ], [ %19, %85 ], [ %19, %97 ], [ %19, %107 ]
br label %12
107: ; preds = %97
%108 = getelementptr inbounds i8*, i8** %13, i64 2
%109 = load i8*, i8** %108
%110 = call i64 @parse_double(i8* %109, double* %5)
%111 = icmp eq i64 %110, 0
%112 = select i1 %111, i8** %22, i8** %108
%113 = select i1 %111, i32 -1, i32 -2
%114 = add nsw i32 %113, %14
br label %99
115: ; preds = %93
%116 = load i8*, i8** %22
%117 = call i64 @strcmp(i8* %116, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%118 = icmp eq i64 %117, 0
br i1 %118, label %119, label %121
119: ; preds = %115
%120 = add nsw i32 %14, -1
br label %99
121: ; preds = %115
%122 = load i8*, i8** %22
%123 = call i64 @strcmp(i8* %122, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%124 = icmp eq i64 %123, 0
br i1 %124, label %129, label %125
125: ; preds = %121
%126 = load i8*, i8** %22
%127 = call i64 @strcmp(i8* %126, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%128 = icmp eq i64 %127, 0
br i1 %128, label %129, label %131
129: ; preds = %125, %121
%130 = call i32 @usage(i32 0)
br label %131
131: ; preds = %125, %129
%132 = load i8*, i8** %22
%133 = getelementptr inbounds i8, i8* %132, i64 1
%134 = load i8, i8* %133
%135 = icmp eq i8 %134, 45
br i1 %135, label %138, label %136
136: ; preds = %131
%137 = add nsw i32 %14, -1
br label %138
138: ; preds = %12, %136, %131
%139 = phi i8** [ %22, %136 ], [ %13, %131 ], [ %13, %12 ]
%140 = phi i32 [ %137, %136 ], [ %14, %131 ], [ %14, %12 ]
%141 = phi i8* [ %132, %136 ], [ %19, %131 ], [ %19, %12 ]
%142 = call i32 @open(i8* %141, i32 %16)
%143 = icmp eq i32 %142, -1
br i1 %143, label %144, label %147
144: ; preds = %138
%145 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%146 = call i32 @exit(i32 1)
unreachable
147: ; preds = %138
%148 = icmp ne i32 %17, 0
%149 = icmp ne i32 %18, 0
%150 = select i1 %148, i1 true, i1 %149
br i1 %150, label %151, label %170
151: ; preds = %147
%152 = load double, double* %6
%153 = fcmp ult double %152, 0.000000e+00
br i1 %153, label %156, label %154
154: ; preds = %151
%155 = call i32 @sleep_for(double %152)
br label %156
156: ; preds = %154, %151
br i1 %148, label %157, label %163
157: ; preds = %156
%158 = call i32 @ioctl(i32 %142, i32 42, i32* null)
%159 = icmp eq i32 %158, -1
br i1 %159, label %160, label %163
160: ; preds = %157
%161 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0))
%162 = call i32 @exit(i32 1)
unreachable
163: ; preds = %157, %156
br i1 %149, label %164, label %170
164: ; preds = %163
%165 = call i32 @ioctl(i32 %142, i32 43, i32* null)
%166 = icmp eq i32 %165, -1
br i1 %166, label %167, label %170
167: ; preds = %164
%168 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0))
%169 = call i32 @exit(i32 1)
unreachable
170: ; preds = %164, %163, %147
%171 = load double, double* %5
%172 = fcmp ult double %171, 0.000000e+00
br i1 %172, label %175, label %173
173: ; preds = %170
%174 = call i32 @sleep_for(double %171)
br label %175
175: ; preds = %173, %170
%176 = icmp sgt i32 %140, 1
br i1 %176, label %99, label %177
177: ; preds = %175
%178 = load i32, i32* %4
%179 = load i32, i32* @SEEK_SET
%180 = call i64 @lseek(i32 %142, i32 %178, i32 %179)
%181 = icmp eq i64 %180, -1
br i1 %181, label %182, label %185
182: ; preds = %177
%183 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%184 = call i32 @exit(i32 1)
unreachable
185: ; preds = %177
%186 = load i32, i32* @O_WRONLY
%187 = and i32 %186, %16
%188 = icmp ne i32 %187, 0
%189 = icmp ne i32 %15, 0
%190 = select i1 %188, i1 %189, i1 false
br i1 %190, label %191, label %194
191: ; preds = %185
%192 = load i32, i32* %3
%193 = call i32 @transfer_zero(i32 %142, i32 %192)
br label %203
194: ; preds = %185
br i1 %188, label %195, label %199
195: ; preds = %194
%196 = load i32, i32* @STDIN_FILENO
%197 = load i32, i32* %3
%198 = call i32 @transfer(i32 %196, i32 %142, i32 %197)
br label %203
199: ; preds = %194
%200 = load i32, i32* @STDOUT_FILENO
%201 = load i32, i32* %3
%202 = call i32 @transfer(i32 %142, i32 %200, i32 %201)
br label %203
203: ; preds = %195, %199, %191
%204 = call i32 @exit(i32 0)
unreachable
}