#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 in6_addr {
  int dummy;
};
struct sockaddr_in6 {
  struct in6_addr sin6_addr;
  int /*<<< orphan*/ sin6_port;
  int /*<<< orphan*/ sin6_family;
};
struct sockaddr {
  int dummy;
};
struct hostent {
  scalar_t__ h_addr;
};
typedef int /*<<< orphan*/ serv_addr;

/* Variables and functions */
int /*<<< orphan*/ PF_INET6;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
scalar_t__ gethostbyname2(char *, int /*<<< orphan*/);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int readline(int, char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int /*<<< orphan*/ usage();
int writen(int, char *, int);
int main(int argc, char *argv[]) {
  int serverSocket, servlen, n, retread;
  struct sockaddr_in6 serv_addr;
  char fromServer[80];
  char fromUser[80];
  struct hostent *hp;
  if (argc != 3) {
    usage();
    exit(1);
  }
  memset((char *)&serv_addr, 0, sizeof(serv_addr));
  serv_addr.sin6_family = PF_INET6;
  serv_addr.sin6_port = htons(atoi(argv[2]));
  hp = (struct hostent *)gethostbyname2(argv[1], PF_INET6);
  if (hp == NULL) {
    fprintf(stderr, "%s: %s non trouve dans in /etc/hosts ou dans le DNS\n",
            argv[0], argv[1]);
    exit(1);
  }
  serv_addr.sin6_addr = *((struct in6_addr *)(hp->h_addr));
  if ((serverSocket = socket(PF_INET6, SOCK_STREAM, 0)) < 0) {
    perror("erreur socket");
    exit(1);
  }
  if (connect(serverSocket, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) <
      0) {
    perror("erreur connect");
    exit(1);
  }
  while ((retread = readline(serverSocket, fromServer, 80)) > 0) {
    printf("corr: %s", fromServer);
    if (strcmp(fromServer, "Au revoir\n") == 0)
      break;
    printf("vous: ");
    if (fgets(fromUser, 80, stdin) == NULL) {
      perror("erreur fgets \n");
      exit(1);
    }
    if ((n = writen(serverSocket, fromUser, strlen(fromUser))) !=
        strlen(fromUser)) {
      printf("erreur writen");
      exit(1);
    }
  }
  if (retread < 0) {
    perror("erreur readline \n");
  }
  close(serverSocket);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1244 <main+0x34>
mov    $0x0,%al
call   10d0 <usage@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1060 <memset@plt>
mov    0x2d8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,%edi
call   1040 <htons@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2d62(%rip),%rax
mov    (%rax),%esi
call   10a0 <gethostbyname2@plt>
mov    %rax,-0xd8(%rbp)
cmpq   $0x0,-0xd8(%rbp)
jne    12d0 <main+0xc0>
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
lea    0xd3f(%rip),%rsi
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0xd8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    0x2d02(%rip),%rax
mov    (%rax),%edi
mov    0x2cd9(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    131a <main+0x10a>
lea    0xd2a(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x14(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0xc,%edx
call   1120 <connect@plt>
cmp    $0x0,%rax
jge    134b <main+0x13b>
lea    0xd07(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
jmp    1350 <main+0x140>
mov    -0x14(%rbp),%edi
lea    -0x80(%rbp),%rsi
mov    $0x50,%edx
call   1070 <readline@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jle    145f <main+0x24f>
lea    -0x80(%rbp),%rsi
lea    0xcda(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x80(%rbp),%rdi
lea    0xcd1(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    139e <main+0x18e>
jmp    145f <main+0x24f>
lea    0xcc1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xd0(%rbp),%rdi
mov    0x2c26(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1090 <fgets@plt>
cmp    $0x0,%rax
jne    13e6 <main+0x1d6>
lea    0xc96(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0xec(%rbp)
lea    -0xd0(%rbp),%rax
mov    %rax,-0xe8(%rbp)
lea    -0xd0(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0xec(%rbp),%edi
mov    -0xe8(%rbp),%rsi
mov    %eax,%edx
call   10f0 <writen@plt>
mov    %eax,-0xdc(%rbp)
mov    %eax,-0x1c(%rbp)
lea    -0xd0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0xdc(%rbp),%eax
cmp    %ecx,%eax
je     145a <main+0x24a>
lea    0xc33(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
jmp    1350 <main+0x140>
cmpl   $0x0,-0x20(%rbp)
jge    1475 <main+0x265>
lea    0xc1a(%rip),%rdi
call   10e0 <perror@plt>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
mov    -0x4(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
cmp    $0x3,%edi
jne    13a9 <main+0x199>
mov    %rsi,%rbx
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1060 <memset@plt>
mov    0x2da5(%rip),%rbp
mov    0x0(%rbp),%eax
mov    %eax,0x8(%rsp)
mov    0x10(%rbx),%rdi
call   1100 <atoi@plt>
mov    %eax,%edi
call   1040 <htons@plt>
mov    %eax,0x4(%rsp)
mov    0x8(%rbx),%rdi
mov    0x0(%rbp),%esi
call   10a0 <gethostbyname2@plt>
test   %rax,%rax
je     13ba <main+0x1aa>
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    0x0(%rbp),%edi
mov    0x2d43(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
test   %eax,%eax
js     13e0 <main+0x1d0>
mov    %eax,%ebx
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0xc,%edx
call   1120 <connect@plt>
test   %rax,%rax
js     13e9 <main+0x1d9>
lea    0x60(%rsp),%r14
lea    0xd9f(%rip),%r12
mov    0x2d1d(%rip),%r13
lea    0x10(%rsp),%rbp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x50,%edx
call   1070 <readline@plt>
test   %eax,%eax
jle    1368 <main+0x158>
lea    0xd64(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     136a <main+0x15a>
lea    0xd57(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%r13),%edx
mov    %rbp,%rdi
mov    $0x50,%esi
call   1090 <fgets@plt>
test   %rax,%rax
je     1393 <main+0x183>
mov    %rbp,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   10f0 <writen@plt>
mov    %eax,%r15d
mov    %rbp,%rdi
call   1030 <strlen@plt>
cmp    %eax,%r15d
je     12d0 <main+0xc0>
lea    0xd25(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
js     1385 <main+0x175>
mov    %ebx,%edi
call   1080 <close@plt>
xor    %eax,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcfe(%rip),%rdi
call   10e0 <perror@plt>
jmp    136a <main+0x15a>
lea    0xcd3(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
xor    %eax,%eax
call   10d0 <usage@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    0x2c0f(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
mov    0x8(%rbx),%rcx
lea    0xc2f(%rip),%rsi
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
lea    0xc4e(%rip),%rdi
jmp    139a <main+0x18a>
lea    0xc53(%rip),%rdi
jmp    139a <main+0x18a>

LLVM IR (-O0):
%struct.sockaddr_in6 = type { %struct.in6_addr, i32, i32 }
%struct.in6_addr = type { i32 }
%struct.hostent = type { i64 }
%struct.sockaddr = type { i32 }
@PF_INET6 = global i32 0
@stderr = global i32 0
@.str = [53 x i8] c"%s: %s non trouve dans in /etc/hosts ou dans le DNS\0A\00"
@SOCK_STREAM = global i32 0
@.str.1 = [14 x i8] c"erreur socket\00"
@.str.2 = [15 x i8] c"erreur connect\00"
@.str.3 = [9 x i8] c"corr: %s\00"
@.str.4 = [11 x i8] c"Au revoir\0A\00"
@.str.5 = [7 x i8] c"vous: \00"
@stdin = global i32 0
@.str.6 = [15 x i8] c"erreur fgets \0A\00"
@.str.7 = [14 x i8] c"erreur writen\00"
@.str.8 = [18 x i8] c"erreur readline \0A\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 i32
%10 = alloca %struct.sockaddr_in6
%11 = alloca [80 x i8]
%12 = alloca [80 x i8]
%13 = alloca %struct.hostent*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 3
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = call i32 (...) @usage()
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %2
%20 = bitcast %struct.sockaddr_in6* %10 to i8*
%21 = call i32 @memset(i8* %20, i32 0, i32 12)
%22 = load i32, i32* @PF_INET6
%23 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %10, i32 0, i32 2
store i32 %22, i32* %23
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 2
%26 = load i8*, i8** %25
%27 = call i32 @atoi(i8* %26)
%28 = call i32 @htons(i32 %27)
%29 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %10, i32 0, i32 1
store i32 %28, i32* %29
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = load i32, i32* @PF_INET6
%34 = call i64 @gethostbyname2(i8* %32, i32 %33)
%35 = inttoptr i64 %34 to %struct.hostent*
store %struct.hostent* %35, %struct.hostent** %13
%36 = load %struct.hostent*, %struct.hostent** %13
%37 = icmp eq %struct.hostent* %36, null
br i1 %37, label %38, label %48
38: ; preds = %19
%39 = load i32, i32* @stderr
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 0
%42 = load i8*, i8** %41
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 1
%45 = load i8*, i8** %44
%46 = call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %42, i8* %45)
%47 = call i32 @exit(i32 1)
unreachable
48: ; preds = %19
%49 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %10, i32 0, i32 0
%50 = load %struct.hostent*, %struct.hostent** %13
%51 = getelementptr inbounds %struct.hostent, %struct.hostent* %50, i32 0, i32 0
%52 = load i64, i64* %51
%53 = inttoptr i64 %52 to %struct.in6_addr*
%54 = bitcast %struct.in6_addr* %49 to i8*
%55 = bitcast %struct.in6_addr* %53 to i8*
%56 = load i32, i32* @PF_INET6
%57 = load i32, i32* @SOCK_STREAM
%58 = call i32 @socket(i32 %56, i32 %57, i32 0)
store i32 %58, i32* %6
%59 = icmp slt i32 %58, 0
br i1 %59, label %60, label %63
60: ; preds = %48
%61 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%62 = call i32 @exit(i32 1)
unreachable
63: ; preds = %48
%64 = load i32, i32* %6
%65 = bitcast %struct.sockaddr_in6* %10 to %struct.sockaddr*
%66 = call i64 @connect(i32 %64, %struct.sockaddr* %65, i32 12)
%67 = icmp slt i64 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %63
%69 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%70 = call i32 @exit(i32 1)
unreachable
71: ; preds = %63
br label %72
72: ; preds = %105, %71
%73 = load i32, i32* %6
%74 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%75 = call i32 @readline(i32 %73, i8* %74, i32 80)
store i32 %75, i32* %9
%76 = icmp sgt i32 %75, 0
br i1 %76, label %77, label %106
77: ; preds = %72
%78 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %78)
%80 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%81 = call i64 @strcmp(i8* %80, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %84
83: ; preds = %77
br label %106
84: ; preds = %77
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%86 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%87 = load i32, i32* @stdin
%88 = call i32* @fgets(i8* %86, i32 80, i32 %87)
%89 = icmp eq i32* %88, null
br i1 %89, label %90, label %93
90: ; preds = %84
%91 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%92 = call i32 @exit(i32 1)
unreachable
93: ; preds = %84
%94 = load i32, i32* %6
%95 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%96 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%97 = call i32 @strlen(i8* %96)
%98 = call i32 @writen(i32 %94, i8* %95, i32 %97)
store i32 %98, i32* %8
%99 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%100 = call i32 @strlen(i8* %99)
%101 = icmp ne i32 %98, %100
br i1 %101, label %102, label %105
102: ; preds = %93
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%104 = call i32 @exit(i32 1)
unreachable
105: ; preds = %93
br label %72
106: ; preds = %83, %72
%107 = load i32, i32* %9
%108 = icmp slt i32 %107, 0
br i1 %108, label %109, label %111
109: ; preds = %106
%110 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
br label %111
111: ; preds = %109, %106
%112 = load i32, i32* %6
%113 = call i32 @close(i32 %112)
%114 = load i32, i32* %3
ret i32 %114
}

LLVM IR (-O2):
%struct.sockaddr_in6 = type { %struct.in6_addr, i32, i32 }
%struct.in6_addr = type { i32 }
%struct.hostent = type { i64 }
%struct.sockaddr = type { i32 }
@PF_INET6 = global i32 0
@stderr = global i32 0
@.str = [53 x i8] c"%s: %s non trouve dans in /etc/hosts ou dans le DNS\0A\00"
@SOCK_STREAM = global i32 0
@.str.1 = [14 x i8] c"erreur socket\00"
@.str.2 = [15 x i8] c"erreur connect\00"
@.str.3 = [9 x i8] c"corr: %s\00"
@.str.4 = [11 x i8] c"Au revoir\0A\00"
@.str.5 = [7 x i8] c"vous: \00"
@stdin = global i32 0
@.str.6 = [15 x i8] c"erreur fgets \0A\00"
@.str.7 = [14 x i8] c"erreur writen\00"
@.str.8 = [18 x i8] c"erreur readline \0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in6
%4 = alloca [80 x i8]
%5 = alloca [80 x i8]
%6 = bitcast %struct.sockaddr_in6* %3 to i8*
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%9 = icmp eq i32 %0, 3
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = tail call i32 (...) @usage()
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = call i32 @memset(i8* %6, i32 0, i32 12)
%15 = load i32, i32* @PF_INET6
%16 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %3, i64 0, i32 2
store i32 %15, i32* %16
%17 = getelementptr inbounds i8*, i8** %1, i64 2
%18 = load i8*, i8** %17
%19 = call i32 @atoi(i8* %18)
%20 = call i32 @htons(i32 %19)
%21 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %3, i64 0, i32 1
store i32 %20, i32* %21
%22 = getelementptr inbounds i8*, i8** %1, i64 1
%23 = load i8*, i8** %22
%24 = load i32, i32* @PF_INET6
%25 = call i64 @gethostbyname2(i8* %23, i32 %24)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %33
27: ; preds = %13
%28 = load i32, i32* @stderr
%29 = load i8*, i8** %1
%30 = load i8*, i8** %22
%31 = call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %29, i8* %30)
%32 = call i32 @exit(i32 1)
unreachable
33: ; preds = %13
%34 = inttoptr i64 %25 to %struct.hostent*
%35 = getelementptr inbounds %struct.hostent, %struct.hostent* %34, i64 0, i32 0
%36 = load i64, i64* %35
%37 = inttoptr i64 %36 to i32*
%38 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %3, i64 0, i32 0, i32 0
%39 = load i32, i32* %37
store i32 %39, i32* %38
%40 = load i32, i32* @PF_INET6
%41 = load i32, i32* @SOCK_STREAM
%42 = call i32 @socket(i32 %40, i32 %41, i32 0)
%43 = icmp slt i32 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %33
%45 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %33
%48 = bitcast %struct.sockaddr_in6* %3 to %struct.sockaddr*
%49 = call i64 @connect(i32 %42, %struct.sockaddr* %48, i32 12)
%50 = icmp slt i64 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %47
%52 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%53 = call i32 @exit(i32 1)
unreachable
54: ; preds = %47, %69
%55 = call i32 @readline(i32 %42, i8* %7, i32 80)
%56 = icmp sgt i32 %55, 0
br i1 %56, label %57, label %77
57: ; preds = %54
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %7)
%59 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %81, label %61
61: ; preds = %57
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%63 = load i32, i32* @stdin
%64 = call i32* @fgets(i8* %8, i32 80, i32 %63)
%65 = icmp eq i32* %64, null
br i1 %65, label %66, label %69
66: ; preds = %61
%67 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%68 = call i32 @exit(i32 1)
unreachable
69: ; preds = %61
%70 = call i32 @strlen(i8* %8)
%71 = call i32 @writen(i32 %42, i8* %8, i32 %70)
%72 = call i32 @strlen(i8* %8)
%73 = icmp eq i32 %71, %72
br i1 %73, label %54, label %74
74: ; preds = %69
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%76 = call i32 @exit(i32 1)
unreachable
77: ; preds = %54
%78 = icmp slt i32 %55, 0
br i1 %78, label %79, label %81
79: ; preds = %77
%80 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
br label %81
81: ; preds = %57, %79, %77
%82 = call i32 @close(i32 %42)
ret i32 0
}