#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 /*<<< orphan*/ server;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ htons(int);
int listen(int, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int recv(int, unsigned char *, int, int /*<<< orphan*/);
int shutdown(int, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  unsigned char buf[100];
  int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
  if (sock == -1) {
    perror("socket error");
    return 1;
  } else {
    printf("socket ok\n");
  }
  struct sockaddr_in server = {.sin_family = AF_INET,
                               .sin_addr.s_addr = INADDR_ANY,
                               .sin_port = htons(1100)};
  if (bind(sock, (struct sockaddr *)&server, sizeof(server)) == -1) {
    perror("bind error");
    close(sock);
    return 1;
  } else {
    printf("bind ok\n");
  }
  if (listen(sock, 10) == -1) {
    perror("listen error");
    close(sock);
    return 1;
  } else {
    printf("listen ok\n");
  }
  int msgsock = accept(sock, NULL, NULL);
  if (msgsock == -1) {
    perror("accept error");
    close(sock);
    return 1;
  } else {
    printf("accept ok\n");
  }
  int numread = recv(msgsock, buf, 100, 0);
  if (numread == -1) {
    perror("recv error");
  } else {
    printf("recv %d bytes\n", numread);
    for (int i = 0; i < numread; i++) {
      printf("0x%02X ", buf[i]);
    }
    printf("\n");
  }
  if (shutdown(msgsock, 2) == -1) {
    perror("shutdown error");
    close(msgsock);
    close(sock);
    return 1;
  } else {
    printf("shutdown ok\n");
  }
  close(msgsock);
  close(sock);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
mov    0x2e06(%rip),%rax
mov    (%rax),%esi
mov    0x2e0d(%rip),%rax
mov    (%rax),%edx
call   10c0 <socket@plt>
mov    %eax,-0x74(%rbp)
cmpl   $0xffffffff,-0x74(%rbp)
jne    11f7 <main+0x57>
lea    0xe1a(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1418 <main+0x278>
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x44c,%edi
call   1050 <htons@plt>
mov    %eax,-0x80(%rbp)
mov    0x2dc7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x7c(%rbp)
mov    0x2dc3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x78(%rbp)
mov    -0x74(%rbp),%edi
lea    -0x80(%rbp),%rsi
mov    $0xc,%edx
call   1090 <bind@plt>
cmp    $0xffffffff,%eax
jne    1264 <main+0xc4>
lea    0xdcd(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x74(%rbp),%edi
call   1070 <close@plt>
movl   $0x1,-0x4(%rbp)
jmp    1418 <main+0x278>
lea    0xdb8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x74(%rbp),%edi
mov    $0xa,%esi
call   1080 <listen@plt>
cmp    $0xffffffff,%eax
jne    12a8 <main+0x108>
lea    0xd9d(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x74(%rbp),%edi
call   1070 <close@plt>
movl   $0x1,-0x4(%rbp)
jmp    1418 <main+0x278>
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x74(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   10b0 <accept@plt>
mov    %eax,-0x84(%rbp)
cmpl   $0xffffffff,-0x84(%rbp)
jne    12f8 <main+0x158>
lea    0xd65(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x74(%rbp),%edi
call   1070 <close@plt>
movl   $0x1,-0x4(%rbp)
jmp    1418 <main+0x278>
lea    0xd52(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x84(%rbp),%edi
lea    -0x70(%rbp),%rsi
mov    $0x64,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x88(%rbp)
cmpl   $0xffffffff,-0x88(%rbp)
jne    1340 <main+0x1a0>
lea    0xd26(%rip),%rdi
call   10a0 <perror@plt>
jmp    13ac <main+0x20c>
mov    -0x88(%rbp),%esi
lea    0xd1a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
cmp    -0x88(%rbp),%eax
jge    139e <main+0x1fe>
movslq -0x8c(%rbp),%rax
movzbl -0x70(%rbp,%rax,1),%esi
lea    0xcf3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    135e <main+0x1be>
lea    0xc85(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x84(%rbp),%edi
mov    $0x2,%esi
call   1040 <shutdown@plt>
cmp    $0xffffffff,%eax
jne    13f0 <main+0x250>
lea    0xcb2(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x84(%rbp),%edi
call   1070 <close@plt>
mov    -0x74(%rbp),%edi
call   1070 <close@plt>
movl   $0x1,-0x4(%rbp)
jmp    1418 <main+0x278>
lea    0xc96(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x84(%rbp),%edi
call   1070 <close@plt>
mov    -0x74(%rbp),%edi
call   1070 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x80,%rsp
mov    0x2e12(%rip),%rbx
mov    (%rbx),%edi
mov    0x2de9(%rip),%rax
mov    (%rax),%esi
mov    0x2df0(%rip),%rax
mov    (%rax),%edx
call   10e0 <socket@plt>
cmp    $0xffffffff,%eax
je     1334 <main+0x174>
mov    %eax,%r14d
lea    0xe61(%rip),%rdi
call   1050 <puts@plt>
mov    $0x44c,%edi
call   1070 <htons@plt>
mov    %eax,(%rsp)
mov    0x2dc5(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    (%rbx),%eax
mov    %eax,0x8(%rsp)
mov    %rsp,%rsi
mov    %r14d,%edi
mov    $0xc,%edx
call   10b0 <bind@plt>
cmp    $0xffffffff,%eax
je     1347 <main+0x187>
lea    0xe26(%rip),%rdi
call   1050 <puts@plt>
mov    %r14d,%edi
mov    $0xa,%esi
call   10a0 <listen@plt>
cmp    $0xffffffff,%eax
je     1350 <main+0x190>
lea    0xe0c(%rip),%rdi
call   1050 <puts@plt>
mov    %r14d,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10d0 <accept@plt>
cmp    $0xffffffff,%eax
je     1359 <main+0x199>
mov    %eax,%r15d
lea    0xdf2(%rip),%rdi
call   1050 <puts@plt>
lea    0x10(%rsp),%rsi
mov    %r15d,%edi
mov    $0x64,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
je     136c <main+0x1ac>
mov    %eax,%ebx
lea    0xd85(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
test   %ebx,%ebx
jle    12e8 <main+0x128>
mov    %ebx,%ebp
lea    0xd7e(%rip),%r12
xor    %ebx,%ebx
movzbl 0x10(%rsp,%rbx,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    12d0 <main+0x110>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %r15d,%edi
mov    $0x2,%esi
call   1060 <shutdown@plt>
cmp    $0xffffffff,%eax
je     137d <main+0x1bd>
lea    0xd7e(%rip),%rdi
call   1050 <puts@plt>
mov    %r15d,%edi
call   1090 <close@plt>
xor    %ebp,%ebp
mov    %r14d,%edi
call   1090 <close@plt>
mov    %ebp,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcc5(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%ebp
jmp    1322 <main+0x162>
lea    0xcbf(%rip),%rdi
jmp    1360 <main+0x1a0>
lea    0xcc1(%rip),%rdi
jmp    1360 <main+0x1a0>
lea    0xcc5(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%ebp
jmp    131a <main+0x15a>
lea    0xcbf(%rip),%rdi
call   10c0 <perror@plt>
jmp    12f2 <main+0x132>
lea    0xcd0(%rip),%rdi
call   10c0 <perror@plt>
mov    %r15d,%edi
call   1090 <close@plt>
mov    $0x1,%ebp
jmp    131a <main+0x15a>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [13 x i8] c"socket error\00"
@.str.1 = [11 x i8] c"socket ok\0A\00"
@INADDR_ANY = global i32 0
@.str.2 = [11 x i8] c"bind error\00"
@.str.3 = [9 x i8] c"bind ok\0A\00"
@.str.4 = [13 x i8] c"listen error\00"
@.str.5 = [11 x i8] c"listen ok\0A\00"
@.str.6 = [13 x i8] c"accept error\00"
@.str.7 = [11 x i8] c"accept ok\0A\00"
@.str.8 = [11 x i8] c"recv error\00"
@.str.9 = [15 x i8] c"recv %d bytes\0A\00"
@.str.10 = [8 x i8] c"0x%02X \00"
@.str.11 = [2 x i8] c"\0A\00"
@.str.12 = [15 x i8] c"shutdown error\00"
@.str.13 = [13 x i8] c"shutdown ok\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = load i32, i32* @AF_INET
%9 = load i32, i32* @SOCK_STREAM
%10 = load i32, i32* @IPPROTO_TCP
%11 = call i32 @socket(i32 %8, i32 %9, i32 %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %101
16: ; preds = %0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16
%19 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
%20 = call i32 @htons(i32 1100)
store i32 %20, i32* %19
%21 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 1
%22 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %21, i32 0, i32 0
%23 = load i32, i32* @INADDR_ANY
store i32 %23, i32* %22
%24 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 2
%25 = load i32, i32* @AF_INET
store i32 %25, i32* %24
%26 = load i32, i32* %3
%27 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%28 = call i32 @bind(i32 %26, %struct.sockaddr* %27, i32 12)
%29 = icmp eq i32 %28, -1
br i1 %29, label %30, label %34
30: ; preds = %18
%31 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%32 = load i32, i32* %3
%33 = call i32 @close(i32 %32)
store i32 1, i32* %1
br label %101
34: ; preds = %18
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %36
36: ; preds = %34
%37 = load i32, i32* %3
%38 = call i32 @listen(i32 %37, i32 10)
%39 = icmp eq i32 %38, -1
br i1 %39, label %40, label %44
40: ; preds = %36
%41 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%42 = load i32, i32* %3
%43 = call i32 @close(i32 %42)
store i32 1, i32* %1
br label %101
44: ; preds = %36
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
br label %46
46: ; preds = %44
%47 = load i32, i32* %3
%48 = call i32 @accept(i32 %47, i32* null, i32* null)
store i32 %48, i32* %5
%49 = load i32, i32* %5
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %55
51: ; preds = %46
%52 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%53 = load i32, i32* %3
%54 = call i32 @close(i32 %53)
store i32 1, i32* %1
br label %101
55: ; preds = %46
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %57
57: ; preds = %55
%58 = load i32, i32* %5
%59 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%60 = call i32 @recv(i32 %58, i8* %59, i32 100, i32 0)
store i32 %60, i32* %6
%61 = load i32, i32* %6
%62 = icmp eq i32 %61, -1
br i1 %62, label %63, label %65
63: ; preds = %57
%64 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
br label %84
65: ; preds = %57
%66 = load i32, i32* %6
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 %66)
store i32 0, i32* %7
br label %68
68: ; preds = %79, %65
%69 = load i32, i32* %7
%70 = load i32, i32* %6
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %82
72: ; preds = %68
%73 = load i32, i32* %7
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %74
%76 = load i8, i8* %75
%77 = zext i8 %76 to i32
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 %77)
br label %79
79: ; preds = %72
%80 = load i32, i32* %7
%81 = add nsw i32 %80, 1
store i32 %81, i32* %7
br label %68
82: ; preds = %68
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %84
84: ; preds = %82, %63
%85 = load i32, i32* %5
%86 = call i32 @shutdown(i32 %85, i32 2)
%87 = icmp eq i32 %86, -1
br i1 %87, label %88, label %94
88: ; preds = %84
%89 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0))
%90 = load i32, i32* %5
%91 = call i32 @close(i32 %90)
%92 = load i32, i32* %3
%93 = call i32 @close(i32 %92)
store i32 1, i32* %1
br label %101
94: ; preds = %84
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0))
br label %96
96: ; preds = %94
%97 = load i32, i32* %5
%98 = call i32 @close(i32 %97)
%99 = load i32, i32* %3
%100 = call i32 @close(i32 %99)
store i32 0, i32* %1
br label %101
101: ; preds = %96, %88, %51, %40, %30, %14
%102 = load i32, i32* %1
ret i32 %102
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [13 x i8] c"socket error\00"
@INADDR_ANY = global i32 0
@.str.2 = [11 x i8] c"bind error\00"
@.str.4 = [13 x i8] c"listen error\00"
@.str.6 = [13 x i8] c"accept error\00"
@.str.8 = [11 x i8] c"recv error\00"
@.str.9 = [15 x i8] c"recv %d bytes\0A\00"
@.str.10 = [8 x i8] c"0x%02X \00"
@.str.12 = [15 x i8] c"shutdown error\00"
@str = [10 x i8] c"socket ok\00"
@str.14 = [8 x i8] c"bind ok\00"
@str.15 = [10 x i8] c"listen ok\00"
@str.16 = [10 x i8] c"accept ok\00"
@str.17 = [12 x i8] c"shutdown ok\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca %struct.sockaddr_in
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @AF_INET
%5 = load i32, i32* @SOCK_STREAM
%6 = load i32, i32* @IPPROTO_TCP
%7 = tail call i32 @socket(i32 %4, i32 %5, i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %70
11: ; preds = %0
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%13 = bitcast %struct.sockaddr_in* %2 to i8*
%14 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
%15 = tail call i32 @htons(i32 1100)
store i32 %15, i32* %14
%16 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 1, i32 0
%17 = load i32, i32* @INADDR_ANY
store i32 %17, i32* %16
%18 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 2
%19 = load i32, i32* @AF_INET
store i32 %19, i32* %18
%20 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%21 = call i32 @bind(i32 %7, %struct.sockaddr* %20, i32 12)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %25
23: ; preds = %11
%24 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %67
25: ; preds = %11
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.14, i64 0, i64 0))
%27 = call i32 @listen(i32 %7, i32 10)
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %67
31: ; preds = %25
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.15, i64 0, i64 0))
%33 = call i32 @accept(i32 %7, i32* null, i32* null)
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
br label %67
37: ; preds = %31
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.16, i64 0, i64 0))
%39 = call i32 @recv(i32 %33, i8* %3, i32 100, i32 0)
%40 = icmp eq i32 %39, -1
br i1 %40, label %41, label %43
41: ; preds = %37
%42 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
br label %58
43: ; preds = %37
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 %39)
%45 = icmp sgt i32 %39, 0
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = zext i32 %39 to i64
br label %50
48: ; preds = %50, %43
%49 = call i32 @putchar(i32 10)
br label %58
50: ; preds = %46, %50
%51 = phi i64 [ 0, %46 ], [ %56, %50 ]
%52 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %51
%53 = load i8, i8* %52
%54 = zext i8 %53 to i32
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 %54)
%56 = add nuw nsw i64 %51, 1
%57 = icmp eq i64 %56, %47
br i1 %57, label %48, label %50
58: ; preds = %48, %41
%59 = call i32 @shutdown(i32 %33, i32 2)
%60 = icmp eq i32 %59, -1
br i1 %60, label %61, label %64
61: ; preds = %58
%62 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0))
%63 = call i32 @close(i32 %33)
br label %67
64: ; preds = %58
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.17, i64 0, i64 0))
%66 = call i32 @close(i32 %33)
br label %67
67: ; preds = %35, %64, %61, %29, %23
%68 = phi i32 [ 1, %23 ], [ 1, %29 ], [ 1, %35 ], [ 1, %61 ], [ 0, %64 ]
%69 = call i32 @close(i32 %7)
br label %70
70: ; preds = %67, %9
%71 = phi i32 [ 1, %9 ], [ %68, %67 ]
ret i32 %71
}