#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 uint8_t;
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ SPI_IOC_RD_BITS_PER_WORD;
int /*<<< orphan*/ SPI_IOC_RD_MAX_SPEED_HZ;
int /*<<< orphan*/ SPI_IOC_RD_MODE;
int /*<<< orphan*/ SPI_IOC_WR_BITS_PER_WORD;
int /*<<< orphan*/ SPI_IOC_WR_MAX_SPEED_HZ;
int /*<<< orphan*/ SPI_IOC_WR_MODE;
int /*<<< orphan*/ close(int);
int ioctl(int, int /*<<< orphan*/, int const *);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
scalar_t__ sprintf(char *, char *, int const, int const);
int32_t nrf24_spi_open(const uint32_t controller, const uint32_t device,
                       const uint32_t speed, const uint8_t bits,
                       const uint8_t mode) {
  int32_t fd = -1;
  int32_t result = 0;
  char devicefile[256] = {0};
  if (sprintf(devicefile, "/dev/spidev%d.%d", controller, device) >= 0) {
    fd = open(devicefile, O_RDWR);
  }
  if (fd < 0) {
    fd = -1;
    result = -102;
  }
  if (result == 0) {
    result = ioctl(fd, SPI_IOC_WR_MODE, &mode);
    if (result == -1) {
      result = -103;
      perror("can't set spi write mode");
    }
  }
  if (result == 0) {
    result = ioctl(fd, SPI_IOC_RD_MODE, &mode);
    if (result == -1) {
      result = -103;
      perror("can't set spi read mode");
    }
  }
  if (result == 0) {
    result = ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &bits);
    if (result == -1) {
      result = -103;
      perror("can't set write bits per word");
    }
  }
  if (result == 0) {
    result = ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits);
    if (result == -1) {
      result = -103;
      perror("can't set read bits per word");
    }
  }
  if (result == 0) {
    result = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed);
    if (result == -1) {
      result = -103;
      perror("can't set write max speed hz");
    }
  }
  if (result == 0) {
    result = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed);
    if (result == -1) {
      result = -103;
      perror("can't set read max speed hz");
    }
  }
  if (result < 0) {
    if (fd >= 0) {
      close(fd);
    }
    return result;
  }
  return fd;
}


x86 assembly (clang, -O0):
<nrf24_spi_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
lea    -0x120(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1030 <memset@plt>
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe50(%rip),%rsi
call   1080 <sprintf@plt>
cmp    $0x0,%rax
jl     11d7 <nrf24_spi_open+0x77>
lea    -0x120(%rbp),%rdi
mov    0x2e1b(%rip),%rax
mov    (%rax),%esi
call   1060 <open@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    11ef <nrf24_spi_open+0x8f>
movl   $0xffffffff,-0x1c(%rbp)
movl   $0xffffff9a,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    1233 <nrf24_spi_open+0xd3>
mov    -0x1c(%rbp),%edi
mov    0x2db5(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rdx
call   1040 <ioctl@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    122e <nrf24_spi_open+0xce>
movl   $0xffffff99,-0x20(%rbp)
lea    0xde8(%rip),%rdi
call   1070 <perror@plt>
jmp    1233 <nrf24_spi_open+0xd3>
cmpl   $0x0,-0x20(%rbp)
jne    1277 <nrf24_spi_open+0x117>
mov    -0x1c(%rbp),%edi
mov    0x2d91(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rdx
call   1040 <ioctl@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    1272 <nrf24_spi_open+0x112>
movl   $0xffffff99,-0x20(%rbp)
lea    0xdbd(%rip),%rdi
call   1070 <perror@plt>
jmp    1277 <nrf24_spi_open+0x117>
cmpl   $0x0,-0x20(%rbp)
jne    12bb <nrf24_spi_open+0x15b>
mov    -0x1c(%rbp),%edi
mov    0x2d55(%rip),%rax
mov    (%rax),%esi
lea    -0x14(%rbp),%rdx
call   1040 <ioctl@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    12b6 <nrf24_spi_open+0x156>
movl   $0xffffff99,-0x20(%rbp)
lea    0xd91(%rip),%rdi
call   1070 <perror@plt>
jmp    12bb <nrf24_spi_open+0x15b>
cmpl   $0x0,-0x20(%rbp)
jne    12ff <nrf24_spi_open+0x19f>
mov    -0x1c(%rbp),%edi
mov    0x2d01(%rip),%rax
mov    (%rax),%esi
lea    -0x14(%rbp),%rdx
call   1040 <ioctl@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    12fa <nrf24_spi_open+0x19a>
movl   $0xffffff99,-0x20(%rbp)
lea    0xd6b(%rip),%rdi
call   1070 <perror@plt>
jmp    12ff <nrf24_spi_open+0x19f>
cmpl   $0x0,-0x20(%rbp)
jne    1343 <nrf24_spi_open+0x1e3>
mov    -0x1c(%rbp),%edi
mov    0x2c9d(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1040 <ioctl@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    133e <nrf24_spi_open+0x1de>
movl   $0xffffff99,-0x20(%rbp)
lea    0xd44(%rip),%rdi
call   1070 <perror@plt>
jmp    1343 <nrf24_spi_open+0x1e3>
cmpl   $0x0,-0x20(%rbp)
jne    1387 <nrf24_spi_open+0x227>
mov    -0x1c(%rbp),%edi
mov    0x2c69(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1040 <ioctl@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    1382 <nrf24_spi_open+0x222>
movl   $0xffffff99,-0x20(%rbp)
lea    0xd1d(%rip),%rdi
call   1070 <perror@plt>
jmp    1387 <nrf24_spi_open+0x227>
cmpl   $0x0,-0x20(%rbp)
jge    13ae <nrf24_spi_open+0x24e>
cmpl   $0x0,-0x1c(%rbp)
jl     13a3 <nrf24_spi_open+0x243>
mov    -0x1c(%rbp),%edi
call   1050 <close@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    13b4 <nrf24_spi_open+0x254>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf24_spi_open>:
push   %rbp
push   %rbx
sub    $0x118,%rsp
mov    %esi,%eax
mov    %edi,%ebp
mov    %edx,0xc(%rsp)
mov    %ecx,0x8(%rsp)
mov    %r8d,0x4(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0xe21(%rip),%rsi
lea    0x10(%rsp),%rdi
mov    %ebp,%edx
mov    %eax,%ecx
call   1070 <sprintf@plt>
mov    $0xffffff9a,%ebp
test   %rax,%rax
js     132f <nrf24_spi_open+0x1df>
mov    0x2de6(%rip),%rax
mov    (%rax),%esi
lea    0x10(%rsp),%rdi
call   1050 <open@plt>
test   %eax,%eax
js     132f <nrf24_spi_open+0x1df>
mov    %eax,%ebx
mov    0x2d99(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
test   %eax,%eax
je     1248 <nrf24_spi_open+0xf8>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    130f <nrf24_spi_open+0x1bf>
lea    0xdce(%rip),%rdi
jmp    131e <nrf24_spi_open+0x1ce>
mov    0x2d89(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
test   %eax,%eax
je     1278 <nrf24_spi_open+0x128>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    130f <nrf24_spi_open+0x1bf>
lea    0xdb7(%rip),%rdi
jmp    131e <nrf24_spi_open+0x1ce>
mov    0x2d61(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
test   %eax,%eax
je     12a1 <nrf24_spi_open+0x151>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    130f <nrf24_spi_open+0x1bf>
lea    0xda3(%rip),%rdi
jmp    131e <nrf24_spi_open+0x1ce>
mov    0x2d28(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
test   %eax,%eax
je     12ca <nrf24_spi_open+0x17a>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    130f <nrf24_spi_open+0x1bf>
lea    0xd98(%rip),%rdi
jmp    131e <nrf24_spi_open+0x1ce>
mov    0x2cdf(%rip),%rax
mov    (%rax),%esi
lea    0xc(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
test   %eax,%eax
je     12f3 <nrf24_spi_open+0x1a3>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    130f <nrf24_spi_open+0x1bf>
lea    0xd8c(%rip),%rdi
jmp    131e <nrf24_spi_open+0x1ce>
mov    0x2cc6(%rip),%rax
mov    (%rax),%esi
lea    0xc(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     1317 <nrf24_spi_open+0x1c7>
test   %ebp,%ebp
js     1328 <nrf24_spi_open+0x1d8>
mov    %ebx,%ebp
jmp    132f <nrf24_spi_open+0x1df>
lea    0xd7c(%rip),%rdi
call   1060 <perror@plt>
mov    $0xffffff99,%ebp
mov    %ebx,%edi
call   1040 <close@plt>
mov    %ebp,%eax
add    $0x118,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"/dev/spidev%d.%d\00"
@O_RDWR = global i32 0
@SPI_IOC_WR_MODE = global i32 0
@.str.1 = [25 x i8] c"can't set spi write mode\00"
@SPI_IOC_RD_MODE = global i32 0
@.str.2 = [24 x i8] c"can't set spi read mode\00"
@SPI_IOC_WR_BITS_PER_WORD = global i32 0
@.str.3 = [30 x i8] c"can't set write bits per word\00"
@SPI_IOC_RD_BITS_PER_WORD = global i32 0
@.str.4 = [29 x i8] c"can't set read bits per word\00"
@SPI_IOC_WR_MAX_SPEED_HZ = global i32 0
@.str.5 = [29 x i8] c"can't set write max speed hz\00"
@SPI_IOC_RD_MAX_SPEED_HZ = global i32 0
@.str.6 = [28 x i8] c"can't set read max speed hz\00"
define i32 @nrf24_spi_open(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [256 x i8]
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 -1, i32* %12
store i32 0, i32* %13
%15 = bitcast [256 x i8]* %14 to i8*
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = call i64 @sprintf(i8* %16, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18)
%20 = icmp sge i64 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %5
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%23 = load i32, i32* @O_RDWR
%24 = call i32 @open(i8* %22, i32 %23)
store i32 %24, i32* %12
br label %25
25: ; preds = %21, %5
%26 = load i32, i32* %12
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 -1, i32* %12
store i32 -102, i32* %13
br label %29
29: ; preds = %28, %25
%30 = load i32, i32* %13
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %41
32: ; preds = %29
%33 = load i32, i32* %12
%34 = load i32, i32* @SPI_IOC_WR_MODE
%35 = call i32 @ioctl(i32 %33, i32 %34, i32* %11)
store i32 %35, i32* %13
%36 = load i32, i32* %13
%37 = icmp eq i32 %36, -1
br i1 %37, label %38, label %40
38: ; preds = %32
store i32 -103, i32* %13
%39 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %40
40: ; preds = %38, %32
br label %41
41: ; preds = %40, %29
%42 = load i32, i32* %13
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %53
44: ; preds = %41
%45 = load i32, i32* %12
%46 = load i32, i32* @SPI_IOC_RD_MODE
%47 = call i32 @ioctl(i32 %45, i32 %46, i32* %11)
store i32 %47, i32* %13
%48 = load i32, i32* %13
%49 = icmp eq i32 %48, -1
br i1 %49, label %50, label %52
50: ; preds = %44
store i32 -103, i32* %13
%51 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %52
52: ; preds = %50, %44
br label %53
53: ; preds = %52, %41
%54 = load i32, i32* %13
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %65
56: ; preds = %53
%57 = load i32, i32* %12
%58 = load i32, i32* @SPI_IOC_WR_BITS_PER_WORD
%59 = call i32 @ioctl(i32 %57, i32 %58, i32* %10)
store i32 %59, i32* %13
%60 = load i32, i32* %13
%61 = icmp eq i32 %60, -1
br i1 %61, label %62, label %64
62: ; preds = %56
store i32 -103, i32* %13
%63 = call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
br label %64
64: ; preds = %62, %56
br label %65
65: ; preds = %64, %53
%66 = load i32, i32* %13
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %77
68: ; preds = %65
%69 = load i32, i32* %12
%70 = load i32, i32* @SPI_IOC_RD_BITS_PER_WORD
%71 = call i32 @ioctl(i32 %69, i32 %70, i32* %10)
store i32 %71, i32* %13
%72 = load i32, i32* %13
%73 = icmp eq i32 %72, -1
br i1 %73, label %74, label %76
74: ; preds = %68
store i32 -103, i32* %13
%75 = call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
br label %76
76: ; preds = %74, %68
br label %77
77: ; preds = %76, %65
%78 = load i32, i32* %13
%79 = icmp eq i32 %78, 0
br i1 %79, label %80, label %89
80: ; preds = %77
%81 = load i32, i32* %12
%82 = load i32, i32* @SPI_IOC_WR_MAX_SPEED_HZ
%83 = call i32 @ioctl(i32 %81, i32 %82, i32* %9)
store i32 %83, i32* %13
%84 = load i32, i32* %13
%85 = icmp eq i32 %84, -1
br i1 %85, label %86, label %88
86: ; preds = %80
store i32 -103, i32* %13
%87 = call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
br label %88
88: ; preds = %86, %80
br label %89
89: ; preds = %88, %77
%90 = load i32, i32* %13
%91 = icmp eq i32 %90, 0
br i1 %91, label %92, label %101
92: ; preds = %89
%93 = load i32, i32* %12
%94 = load i32, i32* @SPI_IOC_RD_MAX_SPEED_HZ
%95 = call i32 @ioctl(i32 %93, i32 %94, i32* %9)
store i32 %95, i32* %13
%96 = load i32, i32* %13
%97 = icmp eq i32 %96, -1
br i1 %97, label %98, label %100
98: ; preds = %92
store i32 -103, i32* %13
%99 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
br label %100
100: ; preds = %98, %92
br label %101
101: ; preds = %100, %89
%102 = load i32, i32* %13
%103 = icmp slt i32 %102, 0
br i1 %103, label %104, label %112
104: ; preds = %101
%105 = load i32, i32* %12
%106 = icmp sge i32 %105, 0
br i1 %106, label %107, label %110
107: ; preds = %104
%108 = load i32, i32* %12
%109 = call i32 @close(i32 %108)
br label %110
110: ; preds = %107, %104
%111 = load i32, i32* %13
store i32 %111, i32* %6
br label %114
112: ; preds = %101
%113 = load i32, i32* %12
store i32 %113, i32* %6
br label %114
114: ; preds = %112, %110
%115 = load i32, i32* %6
ret i32 %115
}

LLVM IR (-O2):
@.str = [17 x i8] c"/dev/spidev%d.%d\00"
@O_RDWR = global i32 0
@SPI_IOC_WR_MODE = global i32 0
@.str.1 = [25 x i8] c"can't set spi write mode\00"
@SPI_IOC_RD_MODE = global i32 0
@.str.2 = [24 x i8] c"can't set spi read mode\00"
@SPI_IOC_WR_BITS_PER_WORD = global i32 0
@.str.3 = [30 x i8] c"can't set write bits per word\00"
@SPI_IOC_RD_BITS_PER_WORD = global i32 0
@.str.4 = [29 x i8] c"can't set read bits per word\00"
@SPI_IOC_WR_MAX_SPEED_HZ = global i32 0
@.str.5 = [29 x i8] c"can't set write max speed hz\00"
@SPI_IOC_RD_MAX_SPEED_HZ = global i32 0
@.str.6 = [28 x i8] c"can't set read max speed hz\00"
define i32 @nrf24_spi_open(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [256 x i8]
store i32 %2, i32* %6
store i32 %3, i32* %7
store i32 %4, i32* %8
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%11 = call i64 @sprintf(i8* %10, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%12 = icmp sgt i64 %11, -1
br i1 %12, label %13, label %45
13: ; preds = %5
%14 = load i32, i32* @O_RDWR
%15 = call i32 @open(i8* %10, i32 %14)
%16 = icmp slt i32 %15, 0
br i1 %16, label %45, label %17
17: ; preds = %13
%18 = load i32, i32* @SPI_IOC_WR_MODE
%19 = call i32 @ioctl(i32 %15, i32 %18, i32* %8)
switch i32 %19, label %36 [
i32 -1, label %39
i32 0, label %20
]
20: ; preds = %17
%21 = load i32, i32* @SPI_IOC_RD_MODE
%22 = call i32 @ioctl(i32 %15, i32 %21, i32* %8)
switch i32 %22, label %36 [
i32 -1, label %39
i32 0, label %23
]
23: ; preds = %20
%24 = load i32, i32* @SPI_IOC_WR_BITS_PER_WORD
%25 = call i32 @ioctl(i32 %15, i32 %24, i32* %7)
switch i32 %25, label %36 [
i32 -1, label %39
i32 0, label %26
]
26: ; preds = %23
%27 = load i32, i32* @SPI_IOC_RD_BITS_PER_WORD
%28 = call i32 @ioctl(i32 %15, i32 %27, i32* %7)
switch i32 %28, label %36 [
i32 -1, label %39
i32 0, label %29
]
29: ; preds = %26
%30 = load i32, i32* @SPI_IOC_WR_MAX_SPEED_HZ
%31 = call i32 @ioctl(i32 %15, i32 %30, i32* %6)
switch i32 %31, label %36 [
i32 -1, label %39
i32 0, label %32
]
32: ; preds = %29
%33 = load i32, i32* @SPI_IOC_RD_MAX_SPEED_HZ
%34 = call i32 @ioctl(i32 %15, i32 %33, i32* %6)
%35 = icmp eq i32 %34, -1
br i1 %35, label %39, label %36
36: ; preds = %17, %29, %26, %23, %20, %32
%37 = phi i32 [ %34, %32 ], [ %22, %20 ], [ %25, %23 ], [ %28, %26 ], [ %31, %29 ], [ %19, %17 ]
%38 = icmp slt i32 %37, 0
br i1 %38, label %42, label %45
39: ; preds = %32, %29, %26, %23, %20, %17
%40 = phi i8* [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), %17 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), %20 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), %23 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), %26 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), %29 ], [ getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), %32 ]
%41 = call i32 @perror(i8* %40)
br label %42
42: ; preds = %39, %36
%43 = phi i32 [ %37, %36 ], [ -103, %39 ]
%44 = call i32 @close(i32 %15)
br label %45
45: ; preds = %13, %5, %36, %42
%46 = phi i32 [ %43, %42 ], [ %15, %36 ], [ -102, %5 ], [ -102, %13 ]
ret i32 %46
}