#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_storage {
  int dummy;
};
struct sockaddr {
  int dummy;
};
struct addrinfo {
  int /*<<< orphan*/ ai_addrlen;
  int /*<<< orphan*/ ai_addr;
  int /*<<< orphan*/ ai_protocol;
  int /*<<< orphan*/ ai_socktype;
  int /*<<< orphan*/ ai_family;
  int /*<<< orphan*/ ai_flags;
};
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ AI_PASSIVE;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int accept(int, struct sockaddr *, int *);
int bind(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
char *gai_strerror(int);
int getaddrinfo(int /*<<< orphan*/ *, char *, struct addrinfo *,
                struct addrinfo **);
int /*<<< orphan*/ listen(int, int);
int /*<<< orphan*/ memset(struct addrinfo *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int read(int, char *, int);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int write(int, char *, int);
int server_loop_tcp(char *server_port) {
  int sockfd, rc;
  int yes = 1;
  struct addrinfo hints, *server;
  char message[256];
  memset(&hints, 0, sizeof hints);
  hints.ai_family = AF_INET;
  hints.ai_socktype = SOCK_STREAM;
  hints.ai_flags = AI_PASSIVE;
  if ((rc = getaddrinfo(NULL, server_port, &hints, &server)) != 0) {
    perror(gai_strerror(rc));
    exit(-1);
  }
  sockfd = socket(server->ai_family, server->ai_socktype, server->ai_protocol);
  if (sockfd == -1) {
    perror("ERROR opening socket");
    exit(-1);
  }
  if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1) {
    perror("ERROR on setsockopt");
    exit(-1);
  }
  rc = bind(sockfd, server->ai_addr, server->ai_addrlen);
  if (rc == -1) {
    perror("ERROR on connect");
    close(sockfd);
    exit(-1);
  }
  listen(sockfd, 10);
  while (1) {
    struct sockaddr_storage client_addr;
    socklen_t addr_size;
    int clientfd;
    int bytes_read, bytes_write;
    addr_size = sizeof client_addr;
    clientfd = accept(sockfd, (struct sockaddr *)&client_addr, &addr_size);
    while (1) {
      bytes_read = read(clientfd, message, sizeof message);
      if (bytes_read < 0) {
        perror("ERROR reading socket");
      }
      if (bytes_read == 0)
        break;
      bytes_write = write(clientfd, message, bytes_read);
      if (bytes_write < 0) {
        perror("ERROR writing socket");
      }
    }
    printf("Connection dropped!\n");
    close(clientfd);
  }
  freeaddrinfo(server);
  close(sockfd);
  return 0;
}


x86 assembly (clang, -O0):
<server_loop_tcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0x14(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1070 <memset@plt>
mov    0x2dcb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2daf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    0x2dbb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
lea    -0x30(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   10f0 <getaddrinfo@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1265 <server_loop_tcp+0x85>
mov    -0x10(%rbp),%edi
call   1060 <gai_strerror@plt>
mov    %rax,%rdi
call   10c0 <perror@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>
mov    -0x38(%rbp),%rax
mov    0x10(%rax),%edi
mov    -0x38(%rbp),%rax
mov    0xc(%rax),%esi
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%edx
call   1100 <socket@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    12a2 <server_loop_tcp+0xc2>
lea    0xd6d(%rip),%rdi
call   10c0 <perror@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>
mov    -0xc(%rbp),%edi
mov    0x2d3c(%rip),%rax
mov    (%rax),%esi
mov    0x2d0b(%rip),%rax
mov    (%rax),%edx
lea    -0x14(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    12e5 <server_loop_tcp+0x105>
lea    0xd3f(%rip),%rdi
call   10c0 <perror@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>
mov    -0xc(%rbp),%edi
mov    -0x38(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x38(%rbp),%rax
mov    (%rax),%edx
call   10b0 <bind@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    1325 <server_loop_tcp+0x145>
lea    0xd1b(%rip),%rdi
call   10c0 <perror@plt>
mov    -0xc(%rbp),%edi
call   1080 <close@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>
mov    -0xc(%rbp),%edi
mov    $0xa,%esi
call   10a0 <listen@plt>
movl   $0x4,-0x14c(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x148(%rbp),%rsi
lea    -0x14c(%rbp),%rdx
call   10d0 <accept@plt>
mov    %eax,-0x150(%rbp)
mov    -0x150(%rbp),%edi
lea    -0x140(%rbp),%rsi
mov    $0x100,%edx
call   1090 <read@plt>
mov    %eax,-0x154(%rbp)
cmpl   $0x0,-0x154(%rbp)
jge    138e <server_loop_tcp+0x1ae>
lea    0xcb1(%rip),%rdi
call   10c0 <perror@plt>
cmpl   $0x0,-0x154(%rbp)
jne    13a0 <server_loop_tcp+0x1c0>
jmp    13dc <server_loop_tcp+0x1fc>
mov    -0x150(%rbp),%edi
lea    -0x140(%rbp),%rsi
mov    -0x154(%rbp),%edx
call   1040 <write@plt>
mov    %eax,-0x158(%rbp)
cmpl   $0x0,-0x158(%rbp)
jge    13d7 <server_loop_tcp+0x1f7>
lea    0xc7d(%rip),%rdi
call   10c0 <perror@plt>
jmp    1358 <server_loop_tcp+0x178>
lea    0xc81(%rip),%rdi
call   1050 <printf@plt>
mov    -0x150(%rbp),%edi
call   1080 <close@plt>
jmp    1332 <server_loop_tcp+0x152>

x86 assembly (clang, -O2):
<server_loop_tcp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x138,%rsp
mov    %rdi,%rbx
movl   $0x1,0x4(%rsp)
lea    0x18(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1070 <memset@plt>
mov    0x2dc1(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x28(%rsp)
mov    0x2da4(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x24(%rsp)
mov    0x2daf(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x2c(%rsp)
lea    0x8(%rsp),%rcx
xor    %edi,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   10f0 <getaddrinfo@plt>
test   %eax,%eax
jne    134c <server_loop_tcp+0x16c>
mov    0x8(%rsp),%rax
mov    0x10(%rax),%edi
mov    0x8(%rax),%edx
mov    0xc(%rax),%esi
call   1100 <socket@plt>
cmp    $0xffffffff,%eax
je     1358 <server_loop_tcp+0x178>
mov    %eax,%ebp
mov    0x2d72(%rip),%rax
mov    (%rax),%esi
mov    0x2d41(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    %ebp,%edi
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
cmp    $0xffffffff,%eax
je     1361 <server_loop_tcp+0x181>
mov    0x8(%rsp),%rax
mov    (%rax),%edx
mov    0x4(%rax),%esi
mov    %ebp,%edi
call   10b0 <bind@plt>
cmp    $0xffffffff,%eax
je     1377 <server_loop_tcp+0x197>
mov    %ebp,%edi
mov    $0xa,%esi
call   10a0 <listen@plt>
lea    0x30(%rsp),%rbx
lea    0xd81(%rip),%r13
lea    0xd8f(%rip),%r12
jmp    12f0 <server_loop_tcp+0x110>
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r14d,%edi
call   1080 <close@plt>
movl   $0x4,(%rsp)
mov    %ebp,%edi
lea    0x10(%rsp),%rsi
mov    %rsp,%rdx
call   10d0 <accept@plt>
mov    %eax,%r14d
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x100,%edx
call   1090 <read@plt>
mov    %eax,%r15d
test   %eax,%eax
js     133e <server_loop_tcp+0x15e>
je     12e0 <server_loop_tcp+0x100>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %r15d,%edx
call   1050 <write@plt>
test   %eax,%eax
jns    1309 <server_loop_tcp+0x129>
mov    %r13,%rdi
call   10c0 <perror@plt>
jmp    1309 <server_loop_tcp+0x129>
lea    0xcf5(%rip),%rdi
call   10c0 <perror@plt>
jmp    1322 <server_loop_tcp+0x142>
mov    %eax,%edi
call   1060 <gai_strerror@plt>
mov    %rax,%rdi
jmp    1368 <server_loop_tcp+0x188>
lea    0xca1(%rip),%rdi
jmp    1368 <server_loop_tcp+0x188>
lea    0xcad(%rip),%rdi
call   10c0 <perror@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>
lea    0xcab(%rip),%rdi
call   10c0 <perror@plt>
mov    %ebp,%edi
call   1080 <close@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32, i32, i32, i32, i32, i32 }
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@AI_PASSIVE = global i32 0
@.str = [21 x i8] c"ERROR opening socket\00"
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.1 = [20 x i8] c"ERROR on setsockopt\00"
@.str.2 = [17 x i8] c"ERROR on connect\00"
@.str.3 = [21 x i8] c"ERROR reading socket\00"
@.str.4 = [21 x i8] c"ERROR writing socket\00"
@.str.5 = [21 x i8] c"Connection dropped!\0A\00"
define i32 @server_loop_tcp(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.addrinfo
%7 = alloca %struct.addrinfo*
%8 = alloca [256 x i8]
%9 = alloca %struct.sockaddr_storage
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %5
%14 = call i32 @memset(%struct.addrinfo* %6, i32 0, i32 24)
%15 = load i32, i32* @AF_INET
%16 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 4
store i32 %15, i32* %16
%17 = load i32, i32* @SOCK_STREAM
%18 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 3
store i32 %17, i32* %18
%19 = load i32, i32* @AI_PASSIVE
%20 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 5
store i32 %19, i32* %20
%21 = load i8*, i8** %2
%22 = call i32 @getaddrinfo(i32* null, i8* %21, %struct.addrinfo* %6, %struct.addrinfo** %7)
store i32 %22, i32* %4
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %29
24: ; preds = %1
%25 = load i32, i32* %4
%26 = call i8* @gai_strerror(i32 %25)
%27 = call i32 @perror(i8* %26)
%28 = call i32 @exit(i32 -1)
unreachable
29: ; preds = %1
%30 = load %struct.addrinfo*, %struct.addrinfo** %7
%31 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %30, i32 0, i32 4
%32 = load i32, i32* %31
%33 = load %struct.addrinfo*, %struct.addrinfo** %7
%34 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %33, i32 0, i32 3
%35 = load i32, i32* %34
%36 = load %struct.addrinfo*, %struct.addrinfo** %7
%37 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %36, i32 0, i32 2
%38 = load i32, i32* %37
%39 = call i32 @socket(i32 %32, i32 %35, i32 %38)
store i32 %39, i32* %3
%40 = load i32, i32* %3
%41 = icmp eq i32 %40, -1
br i1 %41, label %42, label %45
42: ; preds = %29
%43 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%44 = call i32 @exit(i32 -1)
unreachable
45: ; preds = %29
%46 = load i32, i32* %3
%47 = load i32, i32* @SOL_SOCKET
%48 = load i32, i32* @SO_REUSEADDR
%49 = call i32 @setsockopt(i32 %46, i32 %47, i32 %48, i32* %5, i32 4)
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %54
51: ; preds = %45
%52 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%53 = call i32 @exit(i32 -1)
unreachable
54: ; preds = %45
%55 = load i32, i32* %3
%56 = load %struct.addrinfo*, %struct.addrinfo** %7
%57 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %56, i32 0, i32 1
%58 = load i32, i32* %57
%59 = load %struct.addrinfo*, %struct.addrinfo** %7
%60 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %59, i32 0, i32 0
%61 = load i32, i32* %60
%62 = call i32 @bind(i32 %55, i32 %58, i32 %61)
store i32 %62, i32* %4
%63 = load i32, i32* %4
%64 = icmp eq i32 %63, -1
br i1 %64, label %65, label %70
65: ; preds = %54
%66 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%67 = load i32, i32* %3
%68 = call i32 @close(i32 %67)
%69 = call i32 @exit(i32 -1)
unreachable
70: ; preds = %54
%71 = load i32, i32* %3
%72 = call i32 @listen(i32 %71, i32 10)
br label %73
73: ; preds = %70, %99
store i32 4, i32* %10
%74 = load i32, i32* %3
%75 = bitcast %struct.sockaddr_storage* %9 to %struct.sockaddr*
%76 = call i32 @accept(i32 %74, %struct.sockaddr* %75, i32* %10)
store i32 %76, i32* %11
br label %77
77: ; preds = %73, %98
%78 = load i32, i32* %11
%79 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%80 = call i32 @read(i32 %78, i8* %79, i32 256)
store i32 %80, i32* %12
%81 = load i32, i32* %12
%82 = icmp slt i32 %81, 0
br i1 %82, label %83, label %85
83: ; preds = %77
%84 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %85
85: ; preds = %83, %77
%86 = load i32, i32* %12
%87 = icmp eq i32 %86, 0
br i1 %87, label %88, label %89
88: ; preds = %85
br label %99
89: ; preds = %85
%90 = load i32, i32* %11
%91 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%92 = load i32, i32* %12
%93 = call i32 @write(i32 %90, i8* %91, i32 %92)
store i32 %93, i32* %13
%94 = load i32, i32* %13
%95 = icmp slt i32 %94, 0
br i1 %95, label %96, label %98
96: ; preds = %89
%97 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
br label %98
98: ; preds = %96, %89
br label %77
99: ; preds = %88
%100 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%101 = load i32, i32* %11
%102 = call i32 @close(i32 %101)
br label %73
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i32, i32, i32, i32, i32 }
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@AI_PASSIVE = global i32 0
@.str = [21 x i8] c"ERROR opening socket\00"
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.1 = [20 x i8] c"ERROR on setsockopt\00"
@.str.2 = [17 x i8] c"ERROR on connect\00"
@.str.3 = [21 x i8] c"ERROR reading socket\00"
@.str.4 = [21 x i8] c"ERROR writing socket\00"
@str = [20 x i8] c"Connection dropped!\00"
define i32 @server_loop_tcp(i8* %0) {
%2 = alloca i32
%3 = alloca %struct.addrinfo
%4 = alloca %struct.addrinfo*
%5 = alloca [256 x i8]
%6 = alloca %struct.sockaddr_storage
%7 = alloca i32
%8 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%9 = bitcast %struct.addrinfo* %3 to i8*
%10 = bitcast %struct.addrinfo** %4 to i8*
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%12 = call i32 @memset(%struct.addrinfo* %3, i32 0, i32 24)
%13 = load i32, i32* @AF_INET
%14 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 4
store i32 %13, i32* %14
%15 = load i32, i32* @SOCK_STREAM
%16 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 3
store i32 %15, i32* %16
%17 = load i32, i32* @AI_PASSIVE
%18 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 5
store i32 %17, i32* %18
%19 = call i32 @getaddrinfo(i32* null, i8* %0, %struct.addrinfo* %3, %struct.addrinfo** %4)
%20 = icmp eq i32 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %1
%22 = call i8* @gai_strerror(i32 %19)
%23 = call i32 @perror(i8* %22)
%24 = call i32 @exit(i32 -1)
unreachable
25: ; preds = %1
%26 = load %struct.addrinfo*, %struct.addrinfo** %4
%27 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %26, i64 0, i32 4
%28 = load i32, i32* %27
%29 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %26, i64 0, i32 3
%30 = load i32, i32* %29
%31 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %26, i64 0, i32 2
%32 = load i32, i32* %31
%33 = call i32 @socket(i32 %28, i32 %30, i32 %32)
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %38
35: ; preds = %25
%36 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%37 = call i32 @exit(i32 -1)
unreachable
38: ; preds = %25
%39 = load i32, i32* @SOL_SOCKET
%40 = load i32, i32* @SO_REUSEADDR
%41 = call i32 @setsockopt(i32 %33, i32 %39, i32 %40, i32* %2, i32 4)
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %46
43: ; preds = %38
%44 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%45 = call i32 @exit(i32 -1)
unreachable
46: ; preds = %38
%47 = load %struct.addrinfo*, %struct.addrinfo** %4
%48 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %47, i64 0, i32 1
%49 = load i32, i32* %48
%50 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %47, i64 0, i32 0
%51 = load i32, i32* %50
%52 = call i32 @bind(i32 %33, i32 %49, i32 %51)
%53 = icmp eq i32 %52, -1
br i1 %53, label %54, label %58
54: ; preds = %46
%55 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%56 = call i32 @close(i32 %33)
%57 = call i32 @exit(i32 -1)
unreachable
58: ; preds = %46
%59 = call i32 @listen(i32 %33, i32 10)
%60 = bitcast %struct.sockaddr_storage* %6 to i8*
%61 = bitcast i32* %7 to i8*
%62 = bitcast %struct.sockaddr_storage* %6 to %struct.sockaddr*
br label %63
63: ; preds = %78, %58
store i32 4, i32* %7
%64 = call i32 @accept(i32 %33, %struct.sockaddr* %62, i32* %7)
br label %65
65: ; preds = %77, %63
%66 = call i32 @read(i32 %64, i8* %11, i32 256)
%67 = icmp slt i32 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %65
%69 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %72
70: ; preds = %65
%71 = icmp eq i32 %66, 0
br i1 %71, label %78, label %72
72: ; preds = %68, %70
%73 = call i32 @write(i32 %64, i8* %11, i32 %66)
%74 = icmp slt i32 %73, 0
br i1 %74, label %75, label %77
75: ; preds = %72
%76 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
br label %77
77: ; preds = %75, %72
br label %65
78: ; preds = %70
%79 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%80 = call i32 @close(i32 %64)
br label %63
}