#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ serv_addr;
typedef int /*<<< orphan*/ option;
typedef int /*<<< orphan*/ clnt_addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int accept(int, struct sockaddr *, int *);
int /*<<< orphan*/ atoi(char *);
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ error_handling(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int listen(int, int);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int read(int, char *, int);
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, void *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char *argv[]) {
  int serv_sock;
  int clnt_sock;
  int option = 1;
  struct sockaddr_in serv_addr;
  struct sockaddr_in clnt_addr;
  socklen_t clnt_addr_size;
  int fd;
  int str_len;
  char buffer[1024];
  int count = 0;
  if (argc != 3) {
    printf("Usage : %s <port> <file locate>\n", argv[0]);
    exit(1);
  }
  serv_sock = socket(PF_INET, SOCK_STREAM, 0);
  if (serv_sock == -1)
    error_handling("socket() error");
  if (setsockopt(serv_sock, SOL_SOCKET, SO_REUSEADDR, (void *)&option,
                 sizeof(option)))
    error_handling("setsockopt() error");
  memset(&serv_addr, 0, sizeof(serv_addr));
  serv_addr.sin_family = AF_INET;
  serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
  serv_addr.sin_port = htons(atoi(argv[1]));
  if (bind(serv_sock, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) == -1)
    error_handling("bind() error");
  if (listen(serv_sock, 5) == -1)
    error_handling("listen() error");
  clnt_addr_size = sizeof(clnt_addr);
  while (1) {
    clnt_sock =
        accept(serv_sock, (struct sockaddr *)&clnt_addr, &clnt_addr_size);
    if (clnt_sock == -1)
      error_handling("accept() error");
    read(clnt_sock, buffer, 100);
    fd = open(buffer, O_RDONLY);
    if (fd == -1)
      error_handling("open() error");
    while ((str_len = read(fd, buffer, 1024)) > 0) {
      write(clnt_sock, buffer, str_len);
    }
    close(fd);
    close(clnt_sock);
  }
  close(serv_sock);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x454(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1251 <main+0x51>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdbe(%rip),%rdi
call   1060 <printf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    0x2d60(%rip),%rax
mov    (%rax),%edi
mov    0x2d5f(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1283 <main+0x83>
lea    0xda3(%rip),%rdi
call   10b0 <error_handling@plt>
mov    -0x14(%rbp),%edi
mov    0x2d5b(%rip),%rax
mov    (%rax),%esi
mov    0x2d1a(%rip),%rax
mov    (%rax),%edx
lea    -0x1c(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0x0,%rax
je     12bd <main+0xbd>
lea    0xd78(%rip),%rdi
call   10b0 <error_handling@plt>
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1080 <memset@plt>
mov    0x2d0c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2cf0(%rip),%rax
mov    (%rax),%edi
call   1070 <htonl@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,%edi
call   1050 <htons@plt>
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0xc,%edx
call   10d0 <bind@plt>
cmp    $0xffffffff,%eax
jne    1327 <main+0x127>
lea    0xd21(%rip),%rdi
call   10b0 <error_handling@plt>
mov    -0x14(%rbp),%edi
mov    $0x5,%esi
call   10c0 <listen@plt>
cmp    $0xffffffff,%eax
jne    1349 <main+0x149>
lea    0xd0c(%rip),%rdi
call   10b0 <error_handling@plt>
movl   $0xc,-0x3c(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x38(%rbp),%rsi
lea    -0x3c(%rbp),%rdx
call   10f0 <accept@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1379 <main+0x179>
lea    0xceb(%rip),%rdi
call   10b0 <error_handling@plt>
mov    -0x18(%rbp),%edi
lea    -0x450(%rbp),%rsi
mov    $0x64,%edx
call   10a0 <read@plt>
lea    -0x450(%rbp),%rdi
mov    0x2c3d(%rip),%rax
mov    (%rax),%esi
call   10e0 <open@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0xffffffff,-0x40(%rbp)
jne    13bb <main+0x1bb>
lea    0xcb8(%rip),%rdi
call   10b0 <error_handling@plt>
jmp    13c0 <main+0x1c0>
mov    -0x40(%rbp),%edi
lea    -0x450(%rbp),%rsi
mov    $0x400,%edx
call   10a0 <read@plt>
mov    %eax,-0x44(%rbp)
cmp    $0x0,%eax
jle    13f7 <main+0x1f7>
mov    -0x18(%rbp),%edi
lea    -0x450(%rbp),%rsi
mov    -0x44(%rbp),%edx
call   1040 <write@plt>
jmp    13c0 <main+0x1c0>
mov    -0x40(%rbp),%edi
call   1090 <close@plt>
mov    -0x18(%rbp),%edi
call   1090 <close@plt>
jmp    1350 <main+0x150>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x438,%rsp
mov    %rsi,%r14
movl   $0x1,0xc(%rsp)
cmp    $0x3,%edi
jne    13c6 <main+0x1c6>
mov    0x2d8c(%rip),%rax
mov    (%rax),%edi
mov    0x2d8b(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1251 <main+0x51>
lea    0xdd5(%rip),%rdi
call   10b0 <error_handling@plt>
mov    0x2d90(%rip),%rax
mov    (%rax),%esi
mov    0x2d4f(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rcx
mov    %ebp,%edi
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
test   %rax,%rax
je     1286 <main+0x86>
lea    0xdaf(%rip),%rdi
call   10b0 <error_handling@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1080 <memset@plt>
mov    0x2d3f(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x18(%rsp)
mov    0x2d22(%rip),%rax
mov    (%rax),%edi
call   1070 <htonl@plt>
mov    %eax,0x14(%rsp)
mov    0x8(%r14),%rdi
call   1100 <atoi@plt>
mov    %eax,%edi
call   1050 <htons@plt>
mov    %eax,0x10(%rsp)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0xc,%edx
call   10d0 <bind@plt>
cmp    $0xffffffff,%eax
jne    12ed <main+0xed>
lea    0xd5b(%rip),%rdi
call   10b0 <error_handling@plt>
mov    %ebp,%edi
mov    $0x5,%esi
call   10c0 <listen@plt>
cmp    $0xffffffff,%eax
jne    130a <main+0x10a>
lea    0xd4b(%rip),%rdi
call   10b0 <error_handling@plt>
movl   $0xc,0x8(%rsp)
lea    0x8(%rsp),%r15
lea    0x30(%rsp),%rbx
mov    0x2cb5(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%edi
lea    0x20(%rsp),%rsi
mov    %r15,%rdx
call   10f0 <accept@plt>
mov    %eax,%r12d
cmp    $0xffffffff,%eax
jne    1353 <main+0x153>
lea    0xd11(%rip),%rdi
call   10b0 <error_handling@plt>
mov    %r12d,%edi
mov    %rbx,%rsi
mov    $0x64,%edx
call   10a0 <read@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
call   10e0 <open@plt>
mov    %eax,%r13d
cmp    $0xffffffff,%eax
jne    139d <main+0x19d>
lea    0xcf1(%rip),%rdi
call   10b0 <error_handling@plt>
jmp    139d <main+0x19d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   10a0 <read@plt>
test   %eax,%eax
jg     1390 <main+0x190>
mov    %r13d,%edi
call   1090 <close@plt>
mov    %r12d,%edi
call   1090 <close@plt>
jmp    1330 <main+0x130>
mov    (%r14),%rsi
lea    0xc30(%rip),%rdi
call   1060 <printf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [33 x i8] c"Usage : %s <port> <file locate>\0A\00"
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [15 x i8] c"socket() error\00"
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.2 = [19 x i8] c"setsockopt() error\00"
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
@.str.3 = [13 x i8] c"bind() error\00"
@.str.4 = [15 x i8] c"listen() error\00"
@.str.5 = [15 x i8] c"accept() error\00"
@O_RDONLY = global i32 0
@.str.6 = [13 x i8] c"open() error\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_in
%10 = alloca %struct.sockaddr_in
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [1024 x i8]
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %8
store i32 0, i32* %15
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 3
br i1 %17, label %18, label %24
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %2
%25 = load i32, i32* @PF_INET
%26 = load i32, i32* @SOCK_STREAM
%27 = call i32 @socket(i32 %25, i32 %26, i32 0)
store i32 %27, i32* %6
%28 = load i32, i32* %6
%29 = icmp eq i32 %28, -1
br i1 %29, label %30, label %32
30: ; preds = %24
%31 = call i32 @error_handling(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %32
32: ; preds = %30, %24
%33 = load i32, i32* %6
%34 = load i32, i32* @SOL_SOCKET
%35 = load i32, i32* @SO_REUSEADDR
%36 = bitcast i32* %8 to i8*
%37 = call i64 @setsockopt(i32 %33, i32 %34, i32 %35, i8* %36, i32 4)
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %32
%40 = call i32 @error_handling(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %41
41: ; preds = %39, %32
%42 = call i32 @memset(%struct.sockaddr_in* %9, i32 0, i32 12)
%43 = load i32, i32* @AF_INET
%44 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 2
store i32 %43, i32* %44
%45 = load i32, i32* @INADDR_ANY
%46 = call i32 @htonl(i32 %45)
%47 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 1
%48 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %47, i32 0, i32 0
store i32 %46, i32* %48
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 1
%51 = load i8*, i8** %50
%52 = call i32 @atoi(i8* %51)
%53 = call i32 @htons(i32 %52)
%54 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
store i32 %53, i32* %54
%55 = load i32, i32* %6
%56 = bitcast %struct.sockaddr_in* %9 to %struct.sockaddr*
%57 = call i32 @bind(i32 %55, %struct.sockaddr* %56, i32 12)
%58 = icmp eq i32 %57, -1
br i1 %58, label %59, label %61
59: ; preds = %41
%60 = call i32 @error_handling(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %61
61: ; preds = %59, %41
%62 = load i32, i32* %6
%63 = call i32 @listen(i32 %62, i32 5)
%64 = icmp eq i32 %63, -1
br i1 %64, label %65, label %67
65: ; preds = %61
%66 = call i32 @error_handling(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
br label %67
67: ; preds = %65, %61
store i32 12, i32* %11
br label %68
68: ; preds = %67, %98
%69 = load i32, i32* %6
%70 = bitcast %struct.sockaddr_in* %10 to %struct.sockaddr*
%71 = call i32 @accept(i32 %69, %struct.sockaddr* %70, i32* %11)
store i32 %71, i32* %7
%72 = load i32, i32* %7
%73 = icmp eq i32 %72, -1
br i1 %73, label %74, label %76
74: ; preds = %68
%75 = call i32 @error_handling(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
br label %76
76: ; preds = %74, %68
%77 = load i32, i32* %7
%78 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%79 = call i32 @read(i32 %77, i8* %78, i32 100)
%80 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%81 = load i32, i32* @O_RDONLY
%82 = call i32 @open(i8* %80, i32 %81)
store i32 %82, i32* %12
%83 = load i32, i32* %12
%84 = icmp eq i32 %83, -1
br i1 %84, label %85, label %87
85: ; preds = %76
%86 = call i32 @error_handling(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
br label %87
87: ; preds = %85, %76
br label %88
88: ; preds = %93, %87
%89 = load i32, i32* %12
%90 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%91 = call i32 @read(i32 %89, i8* %90, i32 1024)
store i32 %91, i32* %13
%92 = icmp sgt i32 %91, 0
br i1 %92, label %93, label %98
93: ; preds = %88
%94 = load i32, i32* %7
%95 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%96 = load i32, i32* %13
%97 = call i32 @write(i32 %94, i8* %95, i32 %96)
br label %88
98: ; preds = %88
%99 = load i32, i32* %12
%100 = call i32 @close(i32 %99)
%101 = load i32, i32* %7
%102 = call i32 @close(i32 %101)
br label %68
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [33 x i8] c"Usage : %s <port> <file locate>\0A\00"
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [15 x i8] c"socket() error\00"
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.2 = [19 x i8] c"setsockopt() error\00"
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
@.str.3 = [13 x i8] c"bind() error\00"
@.str.4 = [15 x i8] c"listen() error\00"
@.str.5 = [15 x i8] c"accept() error\00"
@O_RDONLY = global i32 0
@.str.6 = [13 x i8] c"open() error\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca %struct.sockaddr_in
%6 = alloca i32
%7 = alloca [1024 x i8]
%8 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%9 = bitcast %struct.sockaddr_in* %4 to i8*
%10 = bitcast %struct.sockaddr_in* %5 to i8*
%11 = bitcast i32* %6 to i8*
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%13 = icmp eq i32 %0, 3
br i1 %13, label %18, label %14
14: ; preds = %2
%15 = load i8*, i8** %1
%16 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = tail call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = load i32, i32* @PF_INET
%20 = load i32, i32* @SOCK_STREAM
%21 = tail call i32 @socket(i32 %19, i32 %20, i32 0)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = tail call i32 @error_handling(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %25
25: ; preds = %23, %18
%26 = load i32, i32* @SOL_SOCKET
%27 = load i32, i32* @SO_REUSEADDR
%28 = call i64 @setsockopt(i32 %21, i32 %26, i32 %27, i8* %8, i32 4)
%29 = icmp eq i64 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %25
%31 = call i32 @error_handling(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %32
32: ; preds = %30, %25
%33 = call i32 @memset(%struct.sockaddr_in* %4, i32 0, i32 12)
%34 = load i32, i32* @AF_INET
%35 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 2
store i32 %34, i32* %35
%36 = load i32, i32* @INADDR_ANY
%37 = call i32 @htonl(i32 %36)
%38 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1, i32 0
store i32 %37, i32* %38
%39 = getelementptr inbounds i8*, i8** %1, i64 1
%40 = load i8*, i8** %39
%41 = call i32 @atoi(i8* %40)
%42 = call i32 @htons(i32 %41)
%43 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
store i32 %42, i32* %43
%44 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%45 = call i32 @bind(i32 %21, %struct.sockaddr* %44, i32 12)
%46 = icmp eq i32 %45, -1
br i1 %46, label %47, label %49
47: ; preds = %32
%48 = call i32 @error_handling(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %49
49: ; preds = %47, %32
%50 = call i32 @listen(i32 %21, i32 5)
%51 = icmp eq i32 %50, -1
br i1 %51, label %52, label %54
52: ; preds = %49
%53 = call i32 @error_handling(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
br label %54
54: ; preds = %52, %49
store i32 12, i32* %6
%55 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
br label %56
56: ; preds = %76, %54
%57 = call i32 @accept(i32 %21, %struct.sockaddr* %55, i32* %6)
%58 = icmp eq i32 %57, -1
br i1 %58, label %59, label %61
59: ; preds = %56
%60 = call i32 @error_handling(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
br label %61
61: ; preds = %59, %56
%62 = call i32 @read(i32 %57, i8* %12, i32 100)
%63 = load i32, i32* @O_RDONLY
%64 = call i32 @open(i8* %12, i32 %63)
%65 = icmp eq i32 %64, -1
br i1 %65, label %66, label %68
66: ; preds = %61
%67 = call i32 @error_handling(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
br label %68
68: ; preds = %66, %61
%69 = call i32 @read(i32 %64, i8* %12, i32 1024)
%70 = icmp sgt i32 %69, 0
br i1 %70, label %71, label %76
71: ; preds = %68, %71
%72 = phi i32 [ %74, %71 ], [ %69, %68 ]
%73 = call i32 @write(i32 %57, i8* %12, i32 %72)
%74 = call i32 @read(i32 %64, i8* %12, i32 1024)
%75 = icmp sgt i32 %74, 0
br i1 %75, label %71, label %76
76: ; preds = %71, %68
%77 = call i32 @close(i32 %64)
%78 = call i32 @close(i32 %57)
br label %56
}