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

/* Variables and functions */
int ENOENT;
int EXIT_FAILURE;
int EXIT_SUCCESS;
int O_CREAT;
int O_RDWR;
int O_TRUNC;
int /*<<< orphan*/ SEEK_SET;
int atoi(int /*<<< orphan*/);
scalar_t__ close(int);
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(unsigned int *);
int getopt(int, char **, char *);
scalar_t__ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ malloc(unsigned int);
int open(char *, int, int);
int /*<<< orphan*/ optarg;
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ remove(char *);
char *strerror(int);
int /*<<< orphan*/ usage();
scalar_t__ write(int, unsigned int *, unsigned int);
int main(int argc, char *argv[]) {
  int fd = -1;
  ssize_t bytes_wrote;
  unsigned int *buf = NULL;
  unsigned int n, u, i;
  int temp;
  unsigned int iterations = 0;
  unsigned int num = 0;
  int opt = 0;
  if (argc != 5) {
    usage();
    exit(EXIT_FAILURE);
  }
  while ((opt = getopt(argc, argv, "n:i:")) != -1) {
    switch (opt) {
    case 'n':
      if ((temp = atoi(optarg)) < 0) {
        usage();
        exit(EXIT_FAILURE);
      }
      num = (unsigned int)temp;
      break;
    case 'i':
      if ((temp = atoi(optarg)) < 0) {
        usage();
        exit(EXIT_FAILURE);
      }
      iterations = (unsigned int)temp;
      break;
    default:
      printf("Invalid option encountered\n");
      break;
    }
  }
  printf("WRITER: # of integers to write = %u; # of iterations = %d\n", num,
         iterations);
  if (remove("atomic_data") < 0) {
    if (errno == ENOENT)
      printf("WRITER: remove %s--%s\n", "atomic_data", strerror(errno));
    else {
      printf("WRITER: error from remove: %d--%s\n", errno, strerror(errno));
      goto error;
    }
  } else
    printf("WRITER: %s is removed\n", "atomic_data");
  if ((fd = open("atomic_data", O_RDWR | O_TRUNC | O_CREAT, 0664)) < 0) {
    printf("WRITER: error from open\n");
    goto error;
  }
  if ((buf = (unsigned int *)malloc(num * sizeof(unsigned int))) == NULL) {
    printf("WRITER: error from malloc\n");
    if (fd >= 0 && close(fd) < 0)
      printf("WRITER: error from close\n");
    goto error;
  }
  printf("\n");
  for (i = 1; i <= iterations; i++) {
    printf("WRITER: *****start iteration %u*****\n", i);
    for (n = 0; n < num; n++) {
      for (u = 0; u < num; u++)
        buf[u] = n;
      if (lseek(fd, (off_t)(n * sizeof(unsigned int)), SEEK_SET) < 0) {
        printf("WRITER: error from lseek\n");
        goto error;
      }
      if ((bytes_wrote = write(fd, buf, ((num - n) * sizeof(unsigned int)))) <
          0) {
        printf("WRITER: error from write\n");
        goto error;
      }
      if (bytes_wrote != (ssize_t)((num - n) * sizeof(unsigned int))) {
        printf("WRITER: error from bytes written\n");
        goto error;
      }
    }
    printf("WRITER: *****end iteration %u*****\n\n", i);
  }
  if (close(fd) < 0) {
    printf("WRITER: error from close\n");
    goto error;
  }
  if (buf)
    free(buf);
  return EXIT_SUCCESS;
error:
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     1229 <main+0x59>
mov    $0x0,%al
call   10a0 <usage@plt>
mov    0x2d8e(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
jmp    122e <main+0x5e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xdc4(%rip),%rdx
call   10c0 <getopt@plt>
mov    %eax,-0x44(%rbp)
cmp    $0xffffffff,%eax
je     12f9 <main+0x129>
mov    -0x44(%rbp),%eax
mov    %eax,-0x48(%rbp)
sub    $0x69,%eax
je     12ac <main+0xdc>
jmp    1261 <main+0x91>
mov    -0x48(%rbp),%eax
sub    $0x6e,%eax
jne    12e6 <main+0x116>
jmp    1272 <main+0xa2>
mov    0x2d77(%rip),%rax
mov    (%rax),%edi
call   10d0 <atoi@plt>
mov    %eax,-0x38(%rbp)
cmp    $0x0,%eax
jge    12a1 <main+0xd1>
mov    $0x0,%al
call   10a0 <usage@plt>
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x40(%rbp)
jmp    12f4 <main+0x124>
mov    0x2d3d(%rip),%rax
mov    (%rax),%edi
call   10d0 <atoi@plt>
mov    %eax,-0x38(%rbp)
cmp    $0x0,%eax
jge    12db <main+0x10b>
mov    $0x0,%al
call   10a0 <usage@plt>
mov    0x2cdc(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    12f4 <main+0x124>
lea    0xd18(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    122e <main+0x5e>
mov    -0x40(%rbp),%esi
mov    -0x3c(%rbp),%edx
lea    0xd1b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd48(%rip),%rdi
call   1040 <remove@plt>
cmp    $0x0,%rax
jge    139e <main+0x1ce>
mov    0x2c96(%rip),%rax
mov    (%rax),%eax
mov    0x2c65(%rip),%rcx
cmp    (%rcx),%eax
jne    1366 <main+0x196>
mov    0x2c7e(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    %rax,%rdx
lea    0xd15(%rip),%rdi
lea    0xd02(%rip),%rsi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1399 <main+0x1c9>
mov    0x2c53(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    0x2c47(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    -0x4c(%rbp),%esi
mov    %rax,%rdx
lea    0xcf2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    15e4 <main+0x414>
jmp    13b3 <main+0x1e3>
lea    0xcfd(%rip),%rdi
lea    0xcb0(%rip),%rsi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2c16(%rip),%rax
mov    (%rax),%esi
mov    0x2c25(%rip),%rax
or     (%rax),%esi
mov    0x2c2c(%rip),%rax
or     (%rax),%esi
lea    0xc87(%rip),%rdi
mov    $0x1b4,%edx
call   10b0 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    13fe <main+0x22e>
lea    0xcc7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    15e4 <main+0x414>
mov    -0x40(%rbp),%eax
shl    $0x2,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1457 <main+0x287>
lea    0xcb1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
jl     1452 <main+0x282>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
cmp    $0x0,%rax
jge    1452 <main+0x282>
lea    0xca2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    15e4 <main+0x414>
lea    0xd48(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x3c(%rbp),%eax
ja     159a <main+0x3ca>
mov    -0x34(%rbp),%esi
lea    0xc85(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x40(%rbp),%eax
jae    157b <main+0x3ab>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x40(%rbp),%eax
jae    14ca <main+0x2fa>
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    14a3 <main+0x2d3>
mov    -0x14(%rbp),%edi
mov    -0x2c(%rbp),%eax
shl    $0x2,%rax
mov    %eax,%esi
mov    0x2adb(%rip),%rax
mov    (%rax),%edx
call   1070 <lseek@plt>
cmp    $0x0,%rax
jge    1501 <main+0x331>
lea    0xc38(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    15e4 <main+0x414>
mov    -0x14(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x40(%rbp),%eax
sub    -0x2c(%rbp),%eax
mov    %eax,%eax
shl    $0x2,%rax
mov    %eax,%edx
call   1050 <write@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jge    153c <main+0x36c>
lea    0xc17(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    15e4 <main+0x414>
mov    -0x20(%rbp),%rax
mov    -0x40(%rbp),%ecx
sub    -0x2c(%rbp),%ecx
mov    %ecx,%ecx
shl    $0x2,%rcx
cmp    %rcx,%rax
je     1568 <main+0x398>
lea    0xc05(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    15e4 <main+0x414>
jmp    156d <main+0x39d>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1490 <main+0x2c0>
mov    -0x34(%rbp),%esi
lea    0xbfe(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    146c <main+0x29c>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
cmp    $0x0,%rax
jge    15bf <main+0x3ef>
lea    0xb3a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    15e4 <main+0x414>
cmpq   $0x0,-0x28(%rbp)
je     15d3 <main+0x403>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    0x29ce(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15f0 <main+0x420>
mov    0x29c5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
cmp    $0x5,%edi
jne    1279 <main+0x89>
mov    %rsi,%rbp
movl   $0x0,(%rsp)
lea    0xdec(%rip),%rbx
mov    0x2dd5(%rip),%r14
lea    0xf64(%rip),%r15
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x5,%edi
mov    %rbp,%rsi
mov    %rbx,%rdx
call   10e0 <getopt@plt>
cmp    $0xffffffff,%eax
je     128e <main+0x9e>
cmp    $0x69,%eax
je     1259 <main+0x69>
cmp    $0x6e,%eax
je     126a <main+0x7a>
mov    %r15,%rdi
call   1060 <puts@plt>
jmp    1230 <main+0x40>
mov    (%r14),%edi
call   10f0 <atoi@plt>
mov    %eax,(%rsp)
test   %eax,%eax
jns    1230 <main+0x40>
jmp    1279 <main+0x89>
mov    (%r14),%edi
call   10f0 <atoi@plt>
mov    %eax,%r12d
test   %eax,%eax
jns    1230 <main+0x40>
xor    %eax,%eax
call   10c0 <usage@plt>
mov    0x2d29(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
lea    0xd70(%rip),%rdi
mov    %r12d,%esi
mov    (%rsp),%edx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd97(%rip),%rdi
call   1050 <remove@plt>
test   %rax,%rax
js     12ca <main+0xda>
lea    0xdcc(%rip),%rdi
lea    0xd7f(%rip),%rsi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    1303 <main+0x113>
mov    0x2cef(%rip),%rax
mov    (%rax),%ebx
mov    0x2cbe(%rip),%rax
mov    (%rax),%ebp
mov    %ebx,%edi
call   1110 <strerror@plt>
cmp    %ebp,%ebx
jne    15ec <main+0x3fc>
lea    0xd5a(%rip),%rdi
lea    0xd47(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x2cc6(%rip),%rax
mov    0x2cd7(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2cdc(%rip),%rax
or     (%rax),%esi
lea    0xd1b(%rip),%rdi
mov    $0x1b4,%edx
call   10d0 <open@plt>
test   %eax,%eax
js     15b0 <main+0x3c0>
mov    %eax,%r13d
lea    0x0(,%r12,4),%edi
call   10b0 <malloc@plt>
test   %rax,%rax
je     15be <main+0x3ce>
mov    %rax,%rbp
mov    $0xa,%edi
call   1040 <putchar@plt>
cmpl   $0x0,(%rsp)
je     158e <main+0x39e>
mov    %r12d,%ebx
mov    %ebx,%eax
and    $0xfffffff8,%eax
mov    %rax,0x30(%rsp)
add    $0xfffffffffffffff8,%rax
mov    %rax,0x28(%rsp)
shr    $0x3,%rax
add    $0x1,%rax
mov    %eax,%ecx
and    $0x7,%ecx
and    $0xfffffffffffffff8,%rax
mov    %rax,0x8(%rsp)
mov    %rbp,%rax
add    $0x10,%rax
mov    %rax,0x10(%rsp)
mov    %rcx,0x20(%rsp)
shl    $0x5,%rcx
mov    %rcx,0x18(%rsp)
mov    $0x1,%r14d
lea    0xce3(%rip),%rdi
mov    %r14d,0x4(%rsp)
mov    %r14d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
test   %r12d,%r12d
je     1563 <main+0x373>
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x8,%r12d
jae    13f0 <main+0x200>
xor    %eax,%eax
jmp    14f0 <main+0x300>
nopl   (%rax)
movd   %r15d,%xmm0
pshufd $0x0,%xmm0,%xmm0
cmpq   $0x38,0x28(%rsp)
mov    0x18(%rsp),%rdx
jae    1410 <main+0x220>
xor    %eax,%eax
jmp    14a6 <main+0x2b6>
xchg   %ax,%ax
mov    0x8(%rsp),%rcx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movdqu %xmm0,0x0(%rbp,%rax,4)
movdqu %xmm0,0x10(%rbp,%rax,4)
movdqu %xmm0,0x20(%rbp,%rax,4)
movdqu %xmm0,0x30(%rbp,%rax,4)
movdqu %xmm0,0x40(%rbp,%rax,4)
movdqu %xmm0,0x50(%rbp,%rax,4)
movdqu %xmm0,0x60(%rbp,%rax,4)
movdqu %xmm0,0x70(%rbp,%rax,4)
movdqu %xmm0,0x80(%rbp,%rax,4)
movdqu %xmm0,0x90(%rbp,%rax,4)
movdqu %xmm0,0xa0(%rbp,%rax,4)
movdqu %xmm0,0xb0(%rbp,%rax,4)
movdqu %xmm0,0xc0(%rbp,%rax,4)
movdqu %xmm0,0xd0(%rbp,%rax,4)
movdqu %xmm0,0xe0(%rbp,%rax,4)
movdqu %xmm0,0xf0(%rbp,%rax,4)
add    $0x40,%rax
add    $0xfffffffffffffff8,%rcx
jne    1420 <main+0x230>
cmpq   $0x0,0x20(%rsp)
je     14d4 <main+0x2e4>
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,4),%rax
xor    %ecx,%ecx
nopl   0x0(%rax)
movdqu %xmm0,-0x10(%rax,%rcx,1)
movdqu %xmm0,(%rax,%rcx,1)
add    $0x20,%rcx
cmp    %rcx,%rdx
jne    14c0 <main+0x2d0>
mov    0x30(%rsp),%rcx
mov    %rcx,%rax
cmp    %rbx,%rcx
je     14fe <main+0x30e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15d,0x0(%rbp,%rax,4)
add    $0x1,%rax
cmp    %rax,%rbx
jne    14f0 <main+0x300>
lea    0x0(,%r15,4),%esi
mov    0x2aab(%rip),%rax
mov    (%rax),%edx
mov    %r13d,%edi
call   1090 <lseek@plt>
test   %rax,%rax
js     1617 <main+0x427>
mov    %r13d,%edi
mov    %r12,%r14
mov    %r12d,%r13d
sub    %r15d,%r13d
shl    $0x2,%r13
mov    %edi,%r12d
mov    %rbp,%rsi
mov    %r13d,%edx
call   1070 <write@plt>
test   %rax,%rax
js     1620 <main+0x430>
cmp    %r13,%rax
jne    1629 <main+0x439>
add    $0x1,%r15
cmp    %rbx,%r15
mov    %r12d,%r13d
mov    %r14,%r12
jne    13e0 <main+0x1f0>
lea    0xb59(%rip),%rdi
mov    0x4(%rsp),%r14d
mov    %r14d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
add    $0x1,%r14d
cmp    (%rsp),%r14d
lea    0xb15(%rip),%rdi
jbe    13ba <main+0x1ca>
mov    %r13d,%edi
call   10a0 <close@plt>
test   %rax,%rax
js     1632 <main+0x442>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    0x29fa(%rip),%rbx
jmp    1606 <main+0x416>
lea    0xbb7(%rip),%rdi
call   1060 <puts@plt>
jmp    15ff <main+0x40f>
lea    0xb76(%rip),%rdi
call   1060 <puts@plt>
mov    %r13d,%edi
call   10a0 <close@plt>
mov    0x29d7(%rip),%rbx
test   %rax,%rax
jns    1606 <main+0x416>
lea    0xb70(%rip),%rdi
call   1060 <puts@plt>
jmp    1606 <main+0x416>
lea    0xa70(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x29aa(%rip),%rbx
mov    (%rbx),%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xb04(%rip),%rdi
jmp    15b7 <main+0x3c7>
lea    0xae2(%rip),%rdi
jmp    15b7 <main+0x3c7>
lea    0xab8(%rip),%rdi
jmp    15b7 <main+0x3c7>
lea    0xb1c(%rip),%rdi
jmp    15b7 <main+0x3c7>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [5 x i8] c"n:i:\00"
@optarg = global i32 0
@.str.1 = [28 x i8] c"Invalid option encountered\0A\00"
@.str.2 = [59 x i8] c"WRITER: # of integers to write = %u; # of iterations = %d\0A\00"
@.str.3 = [12 x i8] c"atomic_data\00"
@errno = global i32 0
@ENOENT = global i32 0
@.str.4 = [23 x i8] c"WRITER: remove %s--%s\0A\00"
@.str.5 = [35 x i8] c"WRITER: error from remove: %d--%s\0A\00"
@.str.6 = [23 x i8] c"WRITER: %s is removed\0A\00"
@O_RDWR = global i32 0
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
@.str.7 = [25 x i8] c"WRITER: error from open\0A\00"
@.str.8 = [27 x i8] c"WRITER: error from malloc\0A\00"
@.str.9 = [26 x i8] c"WRITER: error from close\0A\00"
@.str.10 = [2 x i8] c"\0A\00"
@.str.11 = [38 x i8] c"WRITER: *****start iteration %u*****\0A\00"
@SEEK_SET = global i32 0
@.str.12 = [26 x i8] c"WRITER: error from lseek\0A\00"
@.str.13 = [26 x i8] c"WRITER: error from write\0A\00"
@.str.14 = [34 x i8] c"WRITER: error from bytes written\0A\00"
@.str.15 = [37 x i8] c"WRITER: *****end iteration %u*****\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %6
store i32* null, i32** %8
store i32 0, i32* %13
store i32 0, i32* %14
store i32 0, i32* %15
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 5
br i1 %17, label %18, label %22
18: ; preds = %2
%19 = call i32 (...) @usage()
%20 = load i32, i32* @EXIT_FAILURE
%21 = call i32 @exit(i32 %20)
unreachable
22: ; preds = %2
br label %23
23: ; preds = %52, %22
%24 = load i32, i32* %4
%25 = load i8**, i8*** %5
%26 = call i32 @getopt(i32 %24, i8** %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %26, i32* %15
%27 = icmp ne i32 %26, -1
br i1 %27, label %28, label %53
28: ; preds = %23
%29 = load i32, i32* %15
switch i32 %29, label %50 [
i32 110, label %30
i32 105, label %40
]
30: ; preds = %28
%31 = load i32, i32* @optarg
%32 = call i32 @atoi(i32 %31)
store i32 %32, i32* %12
%33 = icmp slt i32 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %30
%35 = call i32 (...) @usage()
%36 = load i32, i32* @EXIT_FAILURE
%37 = call i32 @exit(i32 %36)
unreachable
38: ; preds = %30
%39 = load i32, i32* %12
store i32 %39, i32* %14
br label %52
40: ; preds = %28
%41 = load i32, i32* @optarg
%42 = call i32 @atoi(i32 %41)
store i32 %42, i32* %12
%43 = icmp slt i32 %42, 0
br i1 %43, label %44, label %48
44: ; preds = %40
%45 = call i32 (...) @usage()
%46 = load i32, i32* @EXIT_FAILURE
%47 = call i32 @exit(i32 %46)
unreachable
48: ; preds = %40
%49 = load i32, i32* %12
store i32 %49, i32* %13
br label %52
50: ; preds = %28
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %52
52: ; preds = %50, %48, %38
br label %23
53: ; preds = %23
%54 = load i32, i32* %14
%55 = load i32, i32* %13
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0), i32 %54, i32 %55)
%57 = call i64 @remove(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%58 = icmp slt i64 %57, 0
br i1 %58, label %59, label %73
59: ; preds = %53
%60 = load i32, i32* @errno
%61 = load i32, i32* @ENOENT
%62 = icmp eq i32 %60, %61
br i1 %62, label %63, label %67
63: ; preds = %59
%64 = load i32, i32* @errno
%65 = call i8* @strerror(i32 %64)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %65)
br label %72
67: ; preds = %59
%68 = load i32, i32* @errno
%69 = load i32, i32* @errno
%70 = call i8* @strerror(i32 %69)
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i32 %68, i8* %70)
br label %189
72: ; preds = %63
br label %75
73: ; preds = %53
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %75
75: ; preds = %73, %72
%76 = load i32, i32* @O_RDWR
%77 = load i32, i32* @O_TRUNC
%78 = or i32 %76, %77
%79 = load i32, i32* @O_CREAT
%80 = or i32 %78, %79
%81 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %80, i32 436)
store i32 %81, i32* %6
%82 = icmp slt i32 %81, 0
br i1 %82, label %83, label %85
83: ; preds = %75
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
br label %189
85: ; preds = %75
%86 = load i32, i32* %14
%87 = zext i32 %86 to i64
%88 = mul i64 %87, 4
%89 = trunc i64 %88 to i32
%90 = call i64 @malloc(i32 %89)
%91 = inttoptr i64 %90 to i32*
store i32* %91, i32** %8
%92 = icmp eq i32* %91, null
br i1 %92, label %93, label %104
93: ; preds = %85
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
%95 = load i32, i32* %6
%96 = icmp sge i32 %95, 0
br i1 %96, label %97, label %103
97: ; preds = %93
%98 = load i32, i32* %6
%99 = call i64 @close(i32 %98)
%100 = icmp slt i64 %99, 0
br i1 %100, label %101, label %103
101: ; preds = %97
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0))
br label %103
103: ; preds = %101, %97, %93
br label %189
104: ; preds = %85
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32 1, i32* %11
br label %106
106: ; preds = %172, %104
%107 = load i32, i32* %11
%108 = load i32, i32* %13
%109 = icmp ule i32 %107, %108
br i1 %109, label %110, label %175
110: ; preds = %106
%111 = load i32, i32* %11
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.11, i64 0, i64 0), i32 %111)
store i32 0, i32* %9
br label %113
113: ; preds = %166, %110
%114 = load i32, i32* %9
%115 = load i32, i32* %14
%116 = icmp ult i32 %114, %115
br i1 %116, label %117, label %169
117: ; preds = %113
store i32 0, i32* %10
br label %118
118: ; preds = %128, %117
%119 = load i32, i32* %10
%120 = load i32, i32* %14
%121 = icmp ult i32 %119, %120
br i1 %121, label %122, label %131
122: ; preds = %118
%123 = load i32, i32* %9
%124 = load i32*, i32** %8
%125 = load i32, i32* %10
%126 = zext i32 %125 to i64
%127 = getelementptr inbounds i32, i32* %124, i64 %126
store i32 %123, i32* %127
br label %128
128: ; preds = %122
%129 = load i32, i32* %10
%130 = add i32 %129, 1
store i32 %130, i32* %10
br label %118
131: ; preds = %118
%132 = load i32, i32* %6
%133 = load i32, i32* %9
%134 = zext i32 %133 to i64
%135 = mul i64 %134, 4
%136 = trunc i64 %135 to i32
%137 = load i32, i32* @SEEK_SET
%138 = call i64 @lseek(i32 %132, i32 %136, i32 %137)
%139 = icmp slt i64 %138, 0
br i1 %139, label %140, label %142
140: ; preds = %131
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0))
br label %189
142: ; preds = %131
%143 = load i32, i32* %6
%144 = load i32*, i32** %8
%145 = load i32, i32* %14
%146 = load i32, i32* %9
%147 = sub i32 %145, %146
%148 = zext i32 %147 to i64
%149 = mul i64 %148, 4
%150 = trunc i64 %149 to i32
%151 = call i64 @write(i32 %143, i32* %144, i32 %150)
store i64 %151, i64* %7
%152 = icmp slt i64 %151, 0
br i1 %152, label %153, label %155
153: ; preds = %142
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0))
br label %189
155: ; preds = %142
%156 = load i64, i64* %7
%157 = load i32, i32* %14
%158 = load i32, i32* %9
%159 = sub i32 %157, %158
%160 = zext i32 %159 to i64
%161 = mul i64 %160, 4
%162 = icmp ne i64 %156, %161
br i1 %162, label %163, label %165
163: ; preds = %155
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0))
br label %189
165: ; preds = %155
br label %166
166: ; preds = %165
%167 = load i32, i32* %9
%168 = add i32 %167, 1
store i32 %168, i32* %9
br label %113
169: ; preds = %113
%170 = load i32, i32* %11
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.15, i64 0, i64 0), i32 %170)
br label %172
172: ; preds = %169
%173 = load i32, i32* %11
%174 = add i32 %173, 1
store i32 %174, i32* %11
br label %106
175: ; preds = %106
%176 = load i32, i32* %6
%177 = call i64 @close(i32 %176)
%178 = icmp slt i64 %177, 0
br i1 %178, label %179, label %181
179: ; preds = %175
%180 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0))
br label %189
181: ; preds = %175
%182 = load i32*, i32** %8
%183 = icmp ne i32* %182, null
br i1 %183, label %184, label %187
184: ; preds = %181
%185 = load i32*, i32** %8
%186 = call i32 @free(i32* %185)
br label %187
187: ; preds = %184, %181
%188 = load i32, i32* @EXIT_SUCCESS
store i32 %188, i32* %3
br label %191
189: ; preds = %179, %163, %153, %140, %103, %83, %67
%190 = load i32, i32* @EXIT_FAILURE
store i32 %190, i32* %3
br label %191
191: ; preds = %189, %187
%192 = load i32, i32* %3
ret i32 %192
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [5 x i8] c"n:i:\00"
@optarg = global i32 0
@.str.2 = [59 x i8] c"WRITER: # of integers to write = %u; # of iterations = %d\0A\00"
@.str.3 = [12 x i8] c"atomic_data\00"
@errno = global i32 0
@ENOENT = global i32 0
@.str.4 = [23 x i8] c"WRITER: remove %s--%s\0A\00"
@.str.5 = [35 x i8] c"WRITER: error from remove: %d--%s\0A\00"
@.str.6 = [23 x i8] c"WRITER: %s is removed\0A\00"
@O_RDWR = global i32 0
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
@.str.11 = [38 x i8] c"WRITER: *****start iteration %u*****\0A\00"
@SEEK_SET = global i32 0
@.str.15 = [37 x i8] c"WRITER: *****end iteration %u*****\0A\0A\00"
@EXIT_SUCCESS = global i32 0
@str.16 = [33 x i8] c"WRITER: error from bytes written\00"
@str.17 = [25 x i8] c"WRITER: error from write\00"
@str.18 = [25 x i8] c"WRITER: error from lseek\00"
@str.19 = [26 x i8] c"WRITER: error from malloc\00"
@str.20 = [25 x i8] c"WRITER: error from close\00"
@str.21 = [24 x i8] c"WRITER: error from open\00"
@str.22 = [27 x i8] c"Invalid option encountered\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 5
br i1 %3, label %24, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage()
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %14, %31
%9 = tail call i32 @getopt(i32 5, i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
switch i32 %9, label %31 [
i32 -1, label %33
i32 110, label %10
i32 105, label %20
]
10: ; preds = %8
%11 = load i32, i32* @optarg
%12 = tail call i32 @atoi(i32 %11)
%13 = icmp slt i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %24, %10
%15 = phi i32 [ %26, %24 ], [ %12, %10 ]
br label %8
16: ; preds = %10
%17 = tail call i32 (...) @usage()
%18 = load i32, i32* @EXIT_FAILURE
%19 = tail call i32 @exit(i32 %18)
unreachable
20: ; preds = %8
%21 = load i32, i32* @optarg
%22 = tail call i32 @atoi(i32 %21)
%23 = icmp slt i32 %22, 0
br i1 %23, label %27, label %24
24: ; preds = %2, %20
%25 = phi i32 [ %22, %20 ], [ 0, %2 ]
%26 = phi i32 [ %15, %20 ], [ 0, %2 ]
br label %14
27: ; preds = %20
%28 = tail call i32 (...) @usage()
%29 = load i32, i32* @EXIT_FAILURE
%30 = tail call i32 @exit(i32 %29)
unreachable
31: ; preds = %8
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.22, i64 0, i64 0))
br label %8
33: ; preds = %8
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 %25)
%35 = tail call i64 @remove(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%36 = icmp slt i64 %35, 0
br i1 %36, label %37, label %46
37: ; preds = %33
%38 = load i32, i32* @errno
%39 = load i32, i32* @ENOENT
%40 = icmp eq i32 %38, %39
%41 = tail call i8* @strerror(i32 %38)
br i1 %40, label %42, label %44
42: ; preds = %37
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %41)
br label %48
44: ; preds = %37
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i32 %38, i8* %41)
br label %197
46: ; preds = %33
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %48
48: ; preds = %46, %42
%49 = load i32, i32* @O_RDWR
%50 = load i32, i32* @O_TRUNC
%51 = or i32 %50, %49
%52 = load i32, i32* @O_CREAT
%53 = or i32 %51, %52
%54 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %53, i32 436)
%55 = icmp slt i32 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %48
%57 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.21, i64 0, i64 0))
br label %197
58: ; preds = %48
%59 = shl i32 %15, 2
%60 = tail call i64 @malloc(i32 %59)
%61 = inttoptr i64 %60 to i32*
%62 = icmp eq i64 %60, 0
br i1 %62, label %63, label %69
63: ; preds = %58
%64 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.19, i64 0, i64 0))
%65 = tail call i64 @close(i32 %54)
%66 = icmp slt i64 %65, 0
br i1 %66, label %67, label %197
67: ; preds = %63
%68 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.20, i64 0, i64 0))
br label %197
69: ; preds = %58
%70 = tail call i32 @putchar(i32 10)
%71 = icmp eq i32 %25, 0
br i1 %71, label %190, label %72
72: ; preds = %69
%73 = icmp eq i32 %15, 0
%74 = zext i32 %15 to i64
%75 = and i64 %74, 4294967288
%76 = add nsw i64 %75, -8
%77 = lshr exact i64 %76, 3
%78 = add nuw nsw i64 %77, 1
%79 = icmp ult i32 %15, 8
%80 = and i64 %74, 4294967288
%81 = and i64 %78, 7
%82 = icmp ult i64 %76, 56
%83 = and i64 %78, 4611686018427387896
%84 = icmp eq i64 %81, 0
%85 = icmp eq i64 %80, %74
br label %86
86: ; preds = %72, %186
%87 = phi i32 [ 1, %72 ], [ %188, %186 ]
%88 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.11, i64 0, i64 0), i32 %87)
br i1 %73, label %186, label %91
89: ; preds = %181
%90 = icmp eq i64 %183, %74
br i1 %90, label %186, label %91
91: ; preds = %86, %89
%92 = phi i64 [ %183, %89 ], [ 0, %86 ]
%93 = trunc i64 %92 to i32
br i1 %79, label %157, label %94
94: ; preds = %91
%95 = insertelement <4 x i32> poison, i32 %93, i64 0
%96 = shufflevector <4 x i32> %95, <4 x i32> poison, <4 x i32> zeroinitializer
%97 = insertelement <4 x i32> poison, i32 %93, i64 0
%98 = shufflevector <4 x i32> %97, <4 x i32> poison, <4 x i32> zeroinitializer
br i1 %82, label %144, label %99
99: ; preds = %94, %99
%100 = phi i64 [ %141, %99 ], [ 0, %94 ]
%101 = phi i64 [ %142, %99 ], [ 0, %94 ]
%102 = getelementptr inbounds i32, i32* %61, i64 %100
%103 = bitcast i32* %102 to <4 x i32>*
store <4 x i32> %96, <4 x i32>* %103
%104 = getelementptr inbounds i32, i32* %102, i64 4
%105 = bitcast i32* %104 to <4 x i32>*
store <4 x i32> %98, <4 x i32>* %105
%106 = or i64 %100, 8
%107 = getelementptr inbounds i32, i32* %61, i64 %106
%108 = bitcast i32* %107 to <4 x i32>*
store <4 x i32> %96, <4 x i32>* %108
%109 = getelementptr inbounds i32, i32* %107, i64 4
%110 = bitcast i32* %109 to <4 x i32>*
store <4 x i32> %98, <4 x i32>* %110
%111 = or i64 %100, 16
%112 = getelementptr inbounds i32, i32* %61, i64 %111
%113 = bitcast i32* %112 to <4 x i32>*
store <4 x i32> %96, <4 x i32>* %113
%114 = getelementptr inbounds i32, i32* %112, i64 4
%115 = bitcast i32* %114 to <4 x i32>*
store <4 x i32> %98, <4 x i32>* %115
%116 = or i64 %100, 24
%117 = getelementptr inbounds i32, i32* %61, i64 %116
%118 = bitcast i32* %117 to <4 x i32>*
store <4 x i32> %96, <4 x i32>* %118
%119 = getelementptr inbounds i32, i32* %117, i64 4
%120 = bitcast i32* %119 to <4 x i32>*
store <4 x i32> %98, <4 x i32>* %120
%121 = or i64 %100, 32
%122 = getelementptr inbounds i32, i32* %61, i64 %121
%123 = bitcast i32* %122 to <4 x i32>*
store <4 x i32> %96, <4 x i32>* %123
%124 = getelementptr inbounds i32, i32* %122, i64 4
%125 = bitcast i32* %124 to <4 x i32>*
store <4 x i32> %98, <4 x i32>* %125
%126 = or i64 %100, 40
%127 = getelementptr inbounds i32, i32* %61, i64 %126
%128 = bitcast i32* %127 to <4 x i32>*
store <4 x i32> %96, <4 x i32>* %128
%129 = getelementptr inbounds i32, i32* %127, i64 4
%130 = bitcast i32* %129 to <4 x i32>*
store <4 x i32> %98, <4 x i32>* %130
%131 = or i64 %100, 48
%132 = getelementptr inbounds i32, i32* %61, i64 %131
%133 = bitcast i32* %132 to <4 x i32>*
store <4 x i32> %96, <4 x i32>* %133
%134 = getelementptr inbounds i32, i32* %132, i64 4
%135 = bitcast i32* %134 to <4 x i32>*
store <4 x i32> %98, <4 x i32>* %135
%136 = or i64 %100, 56
%137 = getelementptr inbounds i32, i32* %61, i64 %136
%138 = bitcast i32* %137 to <4 x i32>*
store <4 x i32> %96, <4 x i32>* %138
%139 = getelementptr inbounds i32, i32* %137, i64 4
%140 = bitcast i32* %139 to <4 x i32>*
store <4 x i32> %98, <4 x i32>* %140
%141 = add nuw i64 %100, 64
%142 = add nuw i64 %101, 8
%143 = icmp eq i64 %142, %83
br i1 %143, label %144, label %99
144: ; preds = %99, %94
%145 = phi i64 [ 0, %94 ], [ %141, %99 ]
br i1 %84, label %156, label %146
146: ; preds = %144, %146
%147 = phi i64 [ %153, %146 ], [ %145, %144 ]
%148 = phi i64 [ %154, %146 ], [ 0, %144 ]
%149 = getelementptr inbounds i32, i32* %61, i64 %147
%150 = bitcast i32* %149 to <4 x i32>*
store <4 x i32> %96, <4 x i32>* %150
%151 = getelementptr inbounds i32, i32* %149, i64 4
%152 = bitcast i32* %151 to <4 x i32>*
store <4 x i32> %98, <4 x i32>* %152
%153 = add nuw i64 %147, 8
%154 = add i64 %148, 1
%155 = icmp eq i64 %154, %81
br i1 %155, label %156, label %146
156: ; preds = %146, %144
br i1 %85, label %164, label %157
157: ; preds = %91, %156
%158 = phi i64 [ 0, %91 ], [ %80, %156 ]
br label %159
159: ; preds = %157, %159
%160 = phi i64 [ %162, %159 ], [ %158, %157 ]
%161 = getelementptr inbounds i32, i32* %61, i64 %160
store i32 %93, i32* %161
%162 = add nuw nsw i64 %160, 1
%163 = icmp eq i64 %162, %74
br i1 %163, label %164, label %159
164: ; preds = %159, %156
%165 = trunc i64 %92 to i32
%166 = shl i32 %165, 2
%167 = load i32, i32* @SEEK_SET
%168 = tail call i64 @lseek(i32 %54, i32 %166, i32 %167)
%169 = icmp slt i64 %168, 0
br i1 %169, label %170, label %172
170: ; preds = %164
%171 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.18, i64 0, i64 0))
br label %197
172: ; preds = %164
%173 = sub i32 %15, %165
%174 = zext i32 %173 to i64
%175 = shl nuw nsw i64 %174, 2
%176 = trunc i64 %175 to i32
%177 = tail call i64 @write(i32 %54, i32* %61, i32 %176)
%178 = icmp slt i64 %177, 0
br i1 %178, label %179, label %181
179: ; preds = %172
%180 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.17, i64 0, i64 0))
br label %197
181: ; preds = %172
%182 = icmp eq i64 %177, %175
%183 = add nuw nsw i64 %92, 1
br i1 %182, label %89, label %184
184: ; preds = %181
%185 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.16, i64 0, i64 0))
br label %197
186: ; preds = %89, %86
%187 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.15, i64 0, i64 0), i32 %87)
%188 = add i32 %87, 1
%189 = icmp ugt i32 %188, %25
br i1 %189, label %190, label %86
190: ; preds = %186, %69
%191 = tail call i64 @close(i32 %54)
%192 = icmp slt i64 %191, 0
br i1 %192, label %193, label %195
193: ; preds = %190
%194 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.20, i64 0, i64 0))
br label %197
195: ; preds = %190
%196 = tail call i32 @free(i32* %61)
br label %197
197: ; preds = %44, %56, %170, %179, %184, %193, %67, %63, %195
%198 = phi i32* [ @EXIT_SUCCESS, %195 ], [ @EXIT_FAILURE, %63 ], [ @EXIT_FAILURE, %67 ], [ @EXIT_FAILURE, %193 ], [ @EXIT_FAILURE, %184 ], [ @EXIT_FAILURE, %179 ], [ @EXIT_FAILURE, %170 ], [ @EXIT_FAILURE, %56 ], [ @EXIT_FAILURE, %44 ]
%199 = load i32, i32* %198
ret i32 %199
}