#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 */
struct sockaddr_un {
  char *sun_path;
  int /*<<< orphan*/ sun_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int /*<<< orphan*/ *);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int listen(int, int);
int /*<<< orphan*/ parse(char *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ recv(int, char *, int, int /*<<< orphan*/);
scalar_t__ send(int, char *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ unlink(char *);
int main(int argc, char *argv[]) {
  int pipe_sock, pipe_sock2;
  socklen_t sock2_size;
  struct sockaddr_un local, remote;
  if ((pipe_sock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
    printf("Error while creating socket\n");
    perror("socket");
    return 1;
  }
  local.sun_family = AF_UNIX;
  strcpy(local.sun_path, "overhaul_pipe");
  unlink(local.sun_path);
  int len = strlen(local.sun_path) + sizeof(local.sun_family);
  if (bind(pipe_sock, (struct sockaddr *)&local, len) < 0) {
    printf("Error while binding to socket\n");
    perror("bind");
    return 2;
  }
  int ls;
  if ((ls = listen(pipe_sock, 5)) < 0) {
    printf("Error while listening (%d)\n", ls);
    perror("listen");
    return 3;
  }
  char msg[1024];
  for (;;) {
    printf("Waiting for connection...\n");
    if ((pipe_sock2 =
             accept(pipe_sock, (struct sockaddr *)&remote, &sock2_size)) < 0) {
      printf("Error accepting socket\n");
      perror("accept");
      continue;
    }
    printf("Accepted connection\n");
    if (recv(pipe_sock2, msg, 1024, 0) < 0) {
      printf("Error receiving\n");
      perror("recv");
      continue;
    }
    char output[1024];
    parse(msg, output);
    if (send(pipe_sock2, output, strlen(output), 0) < 0) {
      printf("Error sending\n");
      perror("send");
      continue;
    }
    close(pipe_sock2);
  }
  close(pipe_sock);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x860,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
mov    0x2ddf(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1234 <main+0x64>
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xdfa(%rip),%rdi
call   10c0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1409 <main+0x239>
mov    0x2dad(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xdd9(%rip),%rsi
call   1050 <strcpy@plt>
mov    -0x30(%rbp),%rdi
call   1040 <unlink@plt>
mov    -0x30(%rbp),%rdi
call   1060 <strlen@plt>
cltq
add    $0x4,%rax
mov    %eax,-0x44(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x44(%rbp),%edx
call   10b0 <bind@plt>
cmp    $0x0,%rax
jge    12aa <main+0xda>
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xdb8(%rip),%rdi
call   10c0 <perror@plt>
movl   $0x2,-0x4(%rbp)
jmp    1409 <main+0x239>
mov    -0x14(%rbp),%edi
mov    $0x5,%esi
call   10a0 <listen@plt>
mov    %eax,-0x48(%rbp)
cmp    $0x0,%eax
jge    12ec <main+0x11c>
mov    -0x48(%rbp),%esi
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xd97(%rip),%rdi
call   10c0 <perror@plt>
movl   $0x3,-0x4(%rbp)
jmp    1409 <main+0x239>
jmp    12f1 <main+0x121>
lea    0xd81(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0x40(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   10d0 <accept@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    133a <main+0x16a>
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xd7c(%rip),%rdi
call   10c0 <perror@plt>
jmp    12f1 <main+0x121>
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x18(%rbp),%edi
lea    -0x450(%rbp),%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0x0,%rax
jge    1387 <main+0x1b7>
lea    0xd59(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xd5c(%rip),%rdi
call   10c0 <perror@plt>
jmp    12f1 <main+0x121>
lea    -0x450(%rbp),%rdi
lea    -0x850(%rbp),%rsi
call   10e0 <parse@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x85c(%rbp)
lea    -0x850(%rbp),%rax
mov    %rax,-0x858(%rbp)
lea    -0x850(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x85c(%rbp),%edi
mov    -0x858(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
cmp    $0x0,%rax
jge    13fc <main+0x22c>
lea    0xcfa(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xcfb(%rip),%rdi
call   10c0 <perror@plt>
jmp    12f1 <main+0x121>
mov    -0x18(%rbp),%edi
call   1090 <close@plt>
jmp    12f1 <main+0x121>
mov    -0x4(%rbp),%eax
add    $0x860,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x838,%rsp
mov    0x2df0(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2dd6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
test   %eax,%eax
js     135c <main+0x17c>
mov    %eax,%r14d
mov    0x0(%rbp),%eax
mov    %eax,0x18(%rsp)
lea    0xddc(%rip),%rsi
call   1050 <strcpy@plt>
call   1040 <unlink@plt>
call   1070 <strlen@plt>
lea    0x4(%rax),%edx
lea    0x10(%rsp),%rsi
mov    %r14d,%edi
call   10c0 <bind@plt>
test   %rax,%rax
js     137b <main+0x19b>
mov    %r14d,%edi
mov    $0x5,%esi
call   10b0 <listen@plt>
test   %eax,%eax
js     139a <main+0x1ba>
lea    0xddf(%rip),%r15
lea    0x20(%rsp),%r12
lea    0xc(%rsp),%rbx
mov    %r14d,0x8(%rsp)
jmp    1298 <main+0xb8>
nopl   0x0(%rax)
lea    0xe0c(%rip),%rdi
call   1060 <puts@plt>
lea    0xda3(%rip),%rdi
call   10d0 <perror@plt>
mov    %r15,%rdi
call   1060 <puts@plt>
mov    %r14d,%edi
mov    %r12,%rsi
mov    %rbx,%rdx
call   10e0 <accept@plt>
test   %eax,%eax
js     1280 <main+0xa0>
mov    %eax,%ebp
lea    0xda6(%rip),%rdi
call   1060 <puts@plt>
mov    %ebp,%edi
lea    0x430(%rsp),%r13
mov    %r13,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %rax,%rax
jns    1300 <main+0x120>
lea    0xd9e(%rip),%rdi
call   1060 <puts@plt>
lea    0xd4c(%rip),%rdi
call   10d0 <perror@plt>
jmp    1298 <main+0xb8>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%r14
mov    %r13,%rdi
lea    0x30(%rsp),%rbx
mov    %rbx,%rsi
call   10f0 <parse@plt>
mov    %rbx,%rdi
call   1070 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
test   %rax,%rax
jns    1348 <main+0x168>
lea    0xd40(%rip),%rdi
call   1060 <puts@plt>
lea    0xd01(%rip),%rdi
call   10d0 <perror@plt>
jmp    134f <main+0x16f>
mov    %ebp,%edi
call   10a0 <close@plt>
mov    %r14,%rbx
mov    0x8(%rsp),%r14d
jmp    1298 <main+0xb8>
lea    0xd65(%rip),%rdi
call   1060 <puts@plt>
lea    0xd6e(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%eax
jmp    13bb <main+0x1db>
lea    0xd28(%rip),%rdi
call   1060 <puts@plt>
lea    0xc80(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x2,%eax
jmp    13bb <main+0x1db>
lea    0xc72(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xc7e(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x3,%eax
add    $0x838,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_un = type { i8*, i32 }
%struct.sockaddr = type { i32 }
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str = [29 x i8] c"Error while creating socket\0A\00"
@.str.1 = [7 x i8] c"socket\00"
@.str.2 = [14 x i8] c"overhaul_pipe\00"
@.str.3 = [31 x i8] c"Error while binding to socket\0A\00"
@.str.4 = [5 x i8] c"bind\00"
@.str.5 = [28 x i8] c"Error while listening (%d)\0A\00"
@.str.6 = [7 x i8] c"listen\00"
@.str.7 = [27 x i8] c"Waiting for connection...\0A\00"
@.str.8 = [24 x i8] c"Error accepting socket\0A\00"
@.str.9 = [7 x i8] c"accept\00"
@.str.10 = [21 x i8] c"Accepted connection\0A\00"
@.str.11 = [17 x i8] c"Error receiving\0A\00"
@.str.12 = [5 x i8] c"recv\00"
@.str.13 = [15 x i8] c"Error sending\0A\00"
@.str.14 = [5 x i8] c"send\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.sockaddr_un
%10 = alloca %struct.sockaddr_un
%11 = alloca i32
%12 = alloca i32
%13 = alloca [1024 x i8]
%14 = alloca [1024 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* @AF_UNIX
%16 = load i32, i32* @SOCK_STREAM
%17 = call i32 @socket(i32 %15, i32 %16, i32 0)
store i32 %17, i32* %6
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %2
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %88
22: ; preds = %2
%23 = load i32, i32* @AF_UNIX
%24 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %9, i32 0, i32 1
store i32 %23, i32* %24
%25 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %9, i32 0, i32 0
%26 = load i8*, i8** %25
%27 = call i32 @strcpy(i8* %26, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%28 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %9, i32 0, i32 0
%29 = load i8*, i8** %28
%30 = call i32 @unlink(i8* %29)
%31 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %9, i32 0, i32 0
%32 = load i8*, i8** %31
%33 = call i32 @strlen(i8* %32)
%34 = sext i32 %33 to i64
%35 = add i64 %34, 4
%36 = trunc i64 %35 to i32
store i32 %36, i32* %11
%37 = load i32, i32* %6
%38 = bitcast %struct.sockaddr_un* %9 to %struct.sockaddr*
%39 = load i32, i32* %11
%40 = call i64 @bind(i32 %37, %struct.sockaddr* %38, i32 %39)
%41 = icmp slt i64 %40, 0
br i1 %41, label %42, label %45
42: ; preds = %22
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%44 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i32 2, i32* %3
br label %88
45: ; preds = %22
%46 = load i32, i32* %6
%47 = call i32 @listen(i32 %46, i32 5)
store i32 %47, i32* %12
%48 = icmp slt i32 %47, 0
br i1 %48, label %49, label %53
49: ; preds = %45
%50 = load i32, i32* %12
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 %50)
%52 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
store i32 3, i32* %3
br label %88
53: ; preds = %45
br label %54
54: ; preds = %85, %82, %69, %60, %53
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%56 = load i32, i32* %6
%57 = bitcast %struct.sockaddr_un* %10 to %struct.sockaddr*
%58 = call i32 @accept(i32 %56, %struct.sockaddr* %57, i32* %8)
store i32 %58, i32* %7
%59 = icmp slt i32 %58, 0
br i1 %59, label %60, label %63
60: ; preds = %54
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0))
%62 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
br label %54
63: ; preds = %54
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0))
%65 = load i32, i32* %7
%66 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%67 = call i64 @recv(i32 %65, i8* %66, i32 1024, i32 0)
%68 = icmp slt i64 %67, 0
br i1 %68, label %69, label %72
69: ; preds = %63
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0))
%71 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
br label %54
72: ; preds = %63
%73 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%74 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%75 = call i32 @parse(i8* %73, i8* %74)
%76 = load i32, i32* %7
%77 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%78 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%79 = call i32 @strlen(i8* %78)
%80 = call i64 @send(i32 %76, i8* %77, i32 %79, i32 0)
%81 = icmp slt i64 %80, 0
br i1 %81, label %82, label %85
82: ; preds = %72
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0))
%84 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
br label %54
85: ; preds = %72
%86 = load i32, i32* %7
%87 = call i32 @close(i32 %86)
br label %54
88: ; preds = %49, %42, %19
%89 = load i32, i32* %3
ret i32 %89
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i8*, i32 }
%struct.sockaddr = type { i32 }
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [7 x i8] c"socket\00"
@.str.2 = [14 x i8] c"overhaul_pipe\00"
@.str.4 = [5 x i8] c"bind\00"
@.str.5 = [28 x i8] c"Error while listening (%d)\0A\00"
@.str.6 = [7 x i8] c"listen\00"
@.str.9 = [7 x i8] c"accept\00"
@.str.12 = [5 x i8] c"recv\00"
@.str.14 = [5 x i8] c"send\00"
@str = [26 x i8] c"Waiting for connection...\00"
@str.15 = [20 x i8] c"Accepted connection\00"
@str.16 = [14 x i8] c"Error sending\00"
@str.17 = [16 x i8] c"Error receiving\00"
@str.18 = [23 x i8] c"Error accepting socket\00"
@str.19 = [30 x i8] c"Error while binding to socket\00"
@str.20 = [28 x i8] c"Error while creating socket\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_un
%5 = alloca %struct.sockaddr_un
%6 = alloca [1024 x i8]
%7 = alloca [1024 x i8]
%8 = bitcast i32* %3 to i8*
%9 = bitcast %struct.sockaddr_un* %4 to i8*
%10 = bitcast %struct.sockaddr_un* %5 to i8*
%11 = load i32, i32* @AF_UNIX
%12 = load i32, i32* @SOCK_STREAM
%13 = tail call i32 @socket(i32 %11, i32 %12, i32 0)
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.20, i64 0, i64 0))
%17 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %67
18: ; preds = %2
%19 = load i32, i32* @AF_UNIX
%20 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %4, i64 0, i32 1
store i32 %19, i32* %20
%21 = tail call i32 @strcpy(i8* undef, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%22 = tail call i32 @unlink(i8* undef)
%23 = tail call i32 @strlen(i8* undef)
%24 = add i32 %23, 4
%25 = bitcast %struct.sockaddr_un* %4 to %struct.sockaddr*
%26 = call i64 @bind(i32 %13, %struct.sockaddr* %25, i32 %24)
%27 = icmp slt i64 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %18
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.19, i64 0, i64 0))
%30 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %67
31: ; preds = %18
%32 = call i32 @listen(i32 %13, i32 5)
%33 = icmp slt i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 %32)
%36 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %67
37: ; preds = %31
%38 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%39 = bitcast %struct.sockaddr_un* %5 to %struct.sockaddr*
%40 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
br label %41
41: ; preds = %48, %37
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%43 = call i32 @accept(i32 %13, %struct.sockaddr* %39, i32* %3)
%44 = icmp slt i32 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %41
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.18, i64 0, i64 0))
%47 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
br label %48
48: ; preds = %45, %53, %66
br label %41
49: ; preds = %41
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.15, i64 0, i64 0))
%51 = call i64 @recv(i32 %43, i8* %38, i32 1024, i32 0)
%52 = icmp slt i64 %51, 0
br i1 %52, label %53, label %56
53: ; preds = %49
%54 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.17, i64 0, i64 0))
%55 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
br label %48
56: ; preds = %49
%57 = call i32 @parse(i8* %38, i8* %40)
%58 = call i32 @strlen(i8* %40)
%59 = call i64 @send(i32 %43, i8* %40, i32 %58, i32 0)
%60 = icmp slt i64 %59, 0
br i1 %60, label %61, label %64
61: ; preds = %56
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.16, i64 0, i64 0))
%63 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
br label %66
64: ; preds = %56
%65 = call i32 @close(i32 %43)
br label %66
66: ; preds = %64, %61
br label %48
67: ; preds = %28, %34, %15
%68 = phi i32 [ 1, %15 ], [ 2, %28 ], [ 3, %34 ]
ret i32 %68
}