#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 size_t ssize_t;
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ close(int);
int connect(int, struct sockaddr *, int);
int /*<<< orphan*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ perror(char *);
scalar_t__ printf(char *, ...);
size_t recv(int, char *, int, int /*<<< orphan*/);
int send(int, char *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
int main(int argc, char *argv[]) {
  if (argc <= 1) {
    fprintf(stderr, "Usage: %s <socket>\n", argv[0]);
    return 1;
  }
  const char *path = argv[1];
  int remote_fd = socket(AF_UNIX, SOCK_STREAM, 0);
  if (remote_fd == -1) {
    perror("socket");
    return 1;
  }
  printf("Trying to connect...\n");
  struct sockaddr_un remote;
  remote.sun_family = AF_UNIX;
  if (strlen(path) >= 108) {
    fprintf(stderr, "Path %s is too long!", path);
    return 0;
  }
  strcpy(remote.sun_path, path);
  socklen_t len = strlen(remote.sun_path) + sizeof(remote.sun_family);
  if (connect(remote_fd, (struct sockaddr *)&remote, len) == -1) {
    perror("connect");
    return 1;
  }
  printf("Connected.\n");
  char buffer[100];
  while (printf("input> "), fgets(buffer, 100, stdin), !feof(stdin)) {
    if (send(remote_fd, buffer, strlen(buffer), 0) == -1) {
      perror("send");
      return 1;
    }
    ssize_t received = recv(remote_fd, buffer, 100, 0);
    if (received > 0) {
      buffer[received] = '\0';
      printf("echo > %s", buffer);
    } else {
      if (received < 0)
        perror("recv");
      else
        printf("Server closed connection\n");
      return 1;
    }
  }
  close(remote_fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     120b <main+0x4b>
mov    0x2de6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe06(%rip),%rsi
call   10a0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1449 <main+0x289>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    0x2dca(%rip),%rax
mov    (%rax),%edi
mov    0x2da1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1255 <main+0x95>
lea    0xdd0(%rip),%rdi
call   10c0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1449 <main+0x289>
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2d7e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x6c,%eax
jl     12a6 <main+0xe6>
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xd9c(%rip),%rsi
call   10a0 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1449 <main+0x289>
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
cltq
add    $0x4,%rax
mov    %eax,-0x34(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x34(%rbp),%edx
call   10d0 <connect@plt>
cmp    $0xffffffff,%eax
jne    12f5 <main+0x135>
lea    0xd62(%rip),%rdi
call   10c0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1449 <main+0x289>
lea    0xd52(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xd50(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xa0(%rbp),%rdi
mov    0x2cc1(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1090 <fgets@plt>
mov    0x2cae(%rip),%rax
mov    (%rax),%edi
call   10b0 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    134e <main+0x18e>
jmp    143a <main+0x27a>
mov    -0x1c(%rbp),%eax
mov    %eax,-0xb4(%rbp)
lea    -0xa0(%rbp),%rax
mov    %rax,-0xb0(%rbp)
lea    -0xa0(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0xb4(%rbp),%edi
mov    -0xb0(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
cmp    $0xffffffff,%eax
jne    13a8 <main+0x1e8>
lea    0xccb(%rip),%rdi
call   10c0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1449 <main+0x289>
mov    -0x1c(%rbp),%edi
lea    -0xa0(%rbp),%rsi
mov    $0x64,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %rax,-0xa8(%rbp)
cmpq   $0x0,-0xa8(%rbp)
jbe    13fc <main+0x23c>
mov    -0xa8(%rbp),%rax
movb   $0x0,-0xa0(%rbp,%rax,1)
lea    -0xa0(%rbp),%rsi
lea    0xc77(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1435 <main+0x275>
cmpq   $0x0,-0xa8(%rbp)
jae    141b <main+0x25b>
lea    0xc60(%rip),%rdi
call   10c0 <perror@plt>
jmp    1429 <main+0x269>
lea    0xc54(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1449 <main+0x289>
jmp    1303 <main+0x143>
mov    -0x1c(%rbp),%edi
call   1080 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
cmp    $0x1,%edi
jg     1206 <main+0x36>
mov    0x2de6(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xe0a(%rip),%rsi
call   10b0 <fprintf@plt>
mov    $0x1,%r14d
jmp    1366 <main+0x196>
mov    0x8(%rsi),%rbp
mov    0x2dd7(%rip),%r14
mov    (%r14),%edi
mov    0x2dad(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
cmp    $0xffffffff,%eax
je     1389 <main+0x1b9>
mov    %eax,%ebx
lea    0xe19(%rip),%rdi
call   1050 <puts@plt>
mov    (%r14),%eax
mov    %eax,0x8(%rsp)
mov    %rbp,%rdi
call   1060 <strlen@plt>
cmp    $0x6c,%eax
jl     126f <main+0x9f>
mov    0x2d7a(%rip),%rax
mov    (%rax),%edi
lea    0xdbc(%rip),%rsi
mov    %rbp,%rdx
call   10b0 <fprintf@plt>
xor    %r14d,%r14d
jmp    1366 <main+0x196>
mov    %rbp,%rsi
call   1040 <strcpy@plt>
call   1060 <strlen@plt>
lea    0x4(%rax),%edx
mov    %rsp,%rsi
mov    %ebx,%edi
call   10e0 <connect@plt>
cmp    $0xffffffff,%eax
je     1392 <main+0x1c2>
lea    0xdcb(%rip),%rdi
call   1050 <puts@plt>
lea    0xd93(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x2d2a(%rip),%r13
mov    0x0(%r13),%edx
lea    0x10(%rsp),%rdi
mov    $0x64,%esi
call   10a0 <fgets@plt>
mov    0x0(%r13),%edi
call   10c0 <feof@plt>
test   %eax,%eax
jne    135f <main+0x18f>
lea    0x10(%rsp),%rbp
lea    0xd5f(%rip),%r15
lea    0xd4b(%rip),%r12
nopl   (%rax)
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
cmp    $0xffffffff,%eax
je     13a3 <main+0x1d3>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0x64,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %rax,%rax
je     1378 <main+0x1a8>
movb   $0x0,0x10(%rsp,%rax,1)
mov    %r15,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x0(%r13),%edx
mov    %rbp,%rdi
mov    $0x64,%esi
call   10a0 <fgets@plt>
mov    0x0(%r13),%edi
call   10c0 <feof@plt>
test   %eax,%eax
je     12f0 <main+0x120>
mov    %ebx,%edi
call   1090 <close@plt>
mov    %r14d,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcf0(%rip),%rdi
call   1050 <puts@plt>
jmp    11fb <main+0x2b>
lea    0xc84(%rip),%rdi
jmp    1399 <main+0x1c9>
lea    0xc97(%rip),%rdi
call   10d0 <perror@plt>
jmp    11fb <main+0x2b>
lea    0xc96(%rip),%rdi
jmp    1399 <main+0x1c9>

LLVM IR (-O0):
%struct.sockaddr_un = type { i8*, i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s <socket>\0A\00"
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [7 x i8] c"socket\00"
@.str.2 = [22 x i8] c"Trying to connect...\0A\00"
@.str.3 = [21 x i8] c"Path %s is too long!\00"
@.str.4 = [8 x i8] c"connect\00"
@.str.5 = [12 x i8] c"Connected.\0A\00"
@.str.6 = [8 x i8] c"input> \00"
@stdin = global i32 0
@.str.7 = [5 x i8] c"send\00"
@.str.8 = [10 x i8] c"echo > %s\00"
@.str.9 = [5 x i8] c"recv\00"
@.str.10 = [26 x i8] c"Server closed connection\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.sockaddr_un
%9 = alloca i32
%10 = alloca [100 x i8]
%11 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp sle i32 %12, 1
br i1 %13, label %14, label %20
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %18)
store i32 1, i32* %3
br label %103
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
store i8* %23, i8** %6
%24 = load i32, i32* @AF_UNIX
%25 = load i32, i32* @SOCK_STREAM
%26 = call i32 @socket(i32 %24, i32 %25, i32 0)
store i32 %26, i32* %7
%27 = load i32, i32* %7
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %31
29: ; preds = %20
%30 = 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 %103
31: ; preds = %20
%32 = call i64 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%33 = load i32, i32* @AF_UNIX
%34 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %8, i32 0, i32 1
store i32 %33, i32* %34
%35 = load i8*, i8** %6
%36 = call i32 @strlen(i8* %35)
%37 = icmp sge i32 %36, 108
br i1 %37, label %38, label %42
38: ; preds = %31
%39 = load i32, i32* @stderr
%40 = load i8*, i8** %6
%41 = call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %40)
store i32 0, i32* %3
br label %103
42: ; preds = %31
%43 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %8, i32 0, i32 0
%44 = load i8*, i8** %43
%45 = load i8*, i8** %6
%46 = call i32 @strcpy(i8* %44, i8* %45)
%47 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %8, i32 0, i32 0
%48 = load i8*, i8** %47
%49 = call i32 @strlen(i8* %48)
%50 = sext i32 %49 to i64
%51 = add i64 %50, 4
%52 = trunc i64 %51 to i32
store i32 %52, i32* %9
%53 = load i32, i32* %7
%54 = bitcast %struct.sockaddr_un* %8 to %struct.sockaddr*
%55 = load i32, i32* %9
%56 = call i32 @connect(i32 %53, %struct.sockaddr* %54, i32 %55)
%57 = icmp eq i32 %56, -1
br i1 %57, label %58, label %60
58: ; preds = %42
%59 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %103
60: ; preds = %42
%61 = call i64 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %62
62: ; preds = %99, %60
%63 = call i64 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%64 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%65 = load i32, i32* @stdin
%66 = call i32 @fgets(i8* %64, i32 100, i32 %65)
%67 = load i32, i32* @stdin
%68 = call i32 @feof(i32 %67)
%69 = icmp ne i32 %68, 0
%70 = xor i1 %69, true
br i1 %70, label %71, label %100
71: ; preds = %62
%72 = load i32, i32* %7
%73 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%74 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%75 = call i32 @strlen(i8* %74)
%76 = call i32 @send(i32 %72, i8* %73, i32 %75, i32 0)
%77 = icmp eq i32 %76, -1
br i1 %77, label %78, label %80
78: ; preds = %71
%79 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %3
br label %103
80: ; preds = %71
%81 = load i32, i32* %7
%82 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%83 = call i64 @recv(i32 %81, i8* %82, i32 100, i32 0)
store i64 %83, i64* %11
%84 = load i64, i64* %11
%85 = icmp ugt i64 %84, 0
br i1 %85, label %86, label %91
86: ; preds = %80
%87 = load i64, i64* %11
%88 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 %87
store i8 0, i8* %88
%89 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%90 = call i64 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* %89)
br label %99
91: ; preds = %80
%92 = load i64, i64* %11
%93 = icmp ult i64 %92, 0
br i1 %93, label %94, label %96
94: ; preds = %91
%95 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
br label %98
96: ; preds = %91
%97 = call i64 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0))
br label %98
98: ; preds = %96, %94
store i32 1, i32* %3
br label %103
99: ; preds = %86
br label %62
100: ; preds = %62
%101 = load i32, i32* %7
%102 = call i32 @close(i32 %101)
store i32 0, i32* %3
br label %103
103: ; preds = %100, %98, %78, %58, %38, %29, %14
%104 = load i32, i32* %3
ret i32 %104
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i8*, i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s <socket>\0A\00"
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [7 x i8] c"socket\00"
@.str.3 = [21 x i8] c"Path %s is too long!\00"
@.str.4 = [8 x i8] c"connect\00"
@.str.6 = [8 x i8] c"input> \00"
@stdin = global i32 0
@.str.7 = [5 x i8] c"send\00"
@.str.8 = [10 x i8] c"echo > %s\00"
@str = [21 x i8] c"Trying to connect...\00"
@str.11 = [11 x i8] c"Connected.\00"
@str.12 = [25 x i8] c"Server closed connection\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_un
%4 = alloca [100 x i8]
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %73
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = load i32, i32* @AF_UNIX
%14 = load i32, i32* @SOCK_STREAM
%15 = tail call i32 @socket(i32 %13, i32 %14, i32 0)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %19
17: ; preds = %10
%18 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %73
19: ; preds = %10
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%21 = bitcast %struct.sockaddr_un* %3 to i8*
%22 = load i32, i32* @AF_UNIX
%23 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i64 0, i32 1
store i32 %22, i32* %23
%24 = tail call i32 @strlen(i8* %12)
%25 = icmp sgt i32 %24, 107
br i1 %25, label %26, label %29
26: ; preds = %19
%27 = load i32, i32* @stderr
%28 = tail call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %12)
br label %71
29: ; preds = %19
%30 = tail call i32 @strcpy(i8* undef, i8* %12)
%31 = tail call i32 @strlen(i8* undef)
%32 = add i32 %31, 4
%33 = bitcast %struct.sockaddr_un* %3 to %struct.sockaddr*
%34 = call i32 @connect(i32 %15, %struct.sockaddr* %33, i32 %32)
%35 = icmp eq i32 %34, -1
br i1 %35, label %36, label %38
36: ; preds = %29
%37 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
br label %71
38: ; preds = %29
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.11, i64 0, i64 0))
%40 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%41 = call i64 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%42 = load i32, i32* @stdin
%43 = call i32 @fgets(i8* %40, i32 100, i32 %42)
%44 = load i32, i32* @stdin
%45 = call i32 @feof(i32 %44)
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %67
47: ; preds = %38, %58
%48 = call i32 @strlen(i8* %40)
%49 = call i32 @send(i32 %15, i8* %40, i32 %48, i32 0)
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %69
53: ; preds = %47
%54 = call i64 @recv(i32 %15, i8* %40, i32 100, i32 0)
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.12, i64 0, i64 0))
br label %69
58: ; preds = %53
%59 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %54
store i8 0, i8* %59
%60 = call i64 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* %40)
%61 = call i64 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%62 = load i32, i32* @stdin
%63 = call i32 @fgets(i8* %40, i32 100, i32 %62)
%64 = load i32, i32* @stdin
%65 = call i32 @feof(i32 %64)
%66 = icmp eq i32 %65, 0
br i1 %66, label %47, label %67
67: ; preds = %58, %38
%68 = call i32 @close(i32 %15)
br label %69
69: ; preds = %56, %67, %51
%70 = phi i32 [ 1, %51 ], [ 0, %67 ], [ 1, %56 ]
br label %71
71: ; preds = %36, %69, %26
%72 = phi i32 [ 0, %26 ], [ 1, %36 ], [ %70, %69 ]
br label %73
73: ; preds = %17, %71, %6
%74 = phi i32 [ 1, %6 ], [ 1, %17 ], [ %72, %71 ]
ret i32 %74
}