#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_in6 {
  int /*<<< orphan*/ sin6_addr;
  int /*<<< orphan*/ sin6_port;
  void *sin6_family;
};
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
struct addrinfo {
  scalar_t__ ai_addr;
  void *ai_socktype;
  void *ai_family;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ caller;

/* Variables and functions */
void *AF_INET;
void *AF_INET6;
int INET6_ADDRSTRLEN;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ PF_INET6;
void *SOCK_STREAM;
int accept(int, struct sockaddr *, int *);
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ bzero(struct addrinfo *, int);
int /*<<< orphan*/ close(int);
int connect(int, struct sockaddr *, int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
char *gai_strerror(int);
int getaddrinfo(char *, char *, struct addrinfo *, struct addrinfo **);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ in6addr_any;
int /*<<< orphan*/ inet_ntop(void *, scalar_t__, char *, int);
int listen(int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ send(int, char *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, void *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int strlen(char *);
int main(int argc, char const *argv[]) {
  int retour = 0;
  int sockServer = socket(PF_INET6, SOCK_STREAM, 0);
  struct sockaddr_in6 address_sock;
  address_sock.sin6_family = AF_INET6;
  address_sock.sin6_port = htons(4202);
  address_sock.sin6_addr = in6addr_any;
  retour = bind(sockServer, (struct sockaddr *)&address_sock,
                sizeof(struct sockaddr_in6));
  if (retour == -1) {
    perror(strerror(errno));
    exit(1);
  }
  retour = listen(sockServer, 0);
  if (retour == -1) {
    perror(strerror(errno));
    exit(1);
  }
  int pid = fork();
  if (pid == 0) {
    struct sockaddr_in6 caller;
    socklen_t size = sizeof(caller);
    int descSock = accept(sockServer, (struct sockaddr *)&caller, &size);
    if (retour == -1) {
      perror(strerror(errno));
      exit(1);
    }
    char *mess = "Confirmation!\n";
    send(descSock, mess, strlen(mess) * sizeof(char), 0);
    close(descSock);
    close(sockServer);
    exit(0);
  }
  close(sockServer);
  int retourClient = 0;
  struct sockaddr_in adress_sock_client;
  struct addrinfo *first_info;
  struct addrinfo hints;
  bzero(&hints, sizeof(struct addrinfo));
  hints.ai_family = AF_INET;
  hints.ai_socktype = SOCK_STREAM;
  retourClient = getaddrinfo("lucien", "4201", &hints, &first_info);
  if (retourClient != 0) {
    printf("%s\n", gai_strerror(retourClient));
    exit(1);
  }
  if (first_info != NULL) {
    adress_sock_client = *(struct sockaddr_in *)first_info->ai_addr;
  }
  int desc_sock = socket(PF_INET, SOCK_STREAM, 0);
  retourClient = connect(desc_sock, (struct sockaddr *)&adress_sock_client,
                         sizeof(struct sockaddr_in));
  if (retour == -1) {
    perror(strerror(errno));
    exit(1);
  }
  struct addrinfo *first_info2;
  struct addrinfo hints2;
  bzero(&hints2, sizeof(struct addrinfo));
  hints2.ai_family = AF_INET6;
  hints2.ai_socktype = SOCK_STREAM;
  retourClient = getaddrinfo("lucien", "daytime", &hints2, &first_info2);
  if (retourClient != 0) {
    printf("%s\n", gai_strerror(retourClient));
    exit(1);
  }
  if (first_info2 != NULL) {
    char test[INET6_ADDRSTRLEN];
    inet_ntop(AF_INET6, first_info2->ai_addr, test,
              sizeof(first_info2->ai_addr));
    printf("%s\n", test);
  }
  freeaddrinfo(first_info2);
  char *mess = "2001:660:3301:8070:215:c5ff:fee6:1f9a\n";
  send(desc_sock, mess, strlen(mess), 0);
  close(desc_sock);
  freeaddrinfo(first_info);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    0x2d81(%rip),%rax
mov    (%rax),%edi
mov    0x2d58(%rip),%rax
mov    (%rax),%rsi
xor    %edx,%edx
call   1150 <socket@plt>
mov    %eax,-0x18(%rbp)
mov    0x2d54(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    $0x106a,%edi
call   1050 <htons@plt>
mov    %eax,-0x24(%rbp)
mov    0x2d61(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0x10,%edx
call   10b0 <bind@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    12d1 <main+0xa1>
mov    0x2cf7(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
mov    %eax,%edi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x18(%rbp),%edi
xor    %esi,%esi
call   10a0 <listen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1307 <main+0xd7>
mov    0x2cc1(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
mov    %eax,%edi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    $0x0,%al
call   1130 <fork@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    13b9 <main+0x189>
movl   $0x10,-0x44(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x40(%rbp),%rsi
lea    -0x44(%rbp),%rdx
call   10e0 <accept@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    135e <main+0x12e>
mov    0x2c6a(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
mov    %eax,%edi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    0xc9b(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    -0x48(%rbp),%eax
mov    %eax,-0xc4(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0x50(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0xc4(%rbp),%edi
mov    -0xc0(%rbp),%rsi
cltq
shl    $0x0,%rax
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    -0x48(%rbp),%edi
call   1090 <close@plt>
mov    -0x18(%rbp),%edi
call   1090 <close@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
mov    -0x18(%rbp),%edi
call   1090 <close@plt>
movl   $0x0,-0x54(%rbp)
lea    -0x78(%rbp),%rdi
mov    $0x18,%esi
call   10d0 <bzero@plt>
mov    0x2bf3(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x68(%rbp)
mov    0x2bcd(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x70(%rbp)
lea    0xc16(%rip),%rdi
lea    0xc16(%rip),%rsi
lea    -0x78(%rbp),%rdx
lea    -0x60(%rbp),%rcx
call   1110 <getaddrinfo@plt>
mov    %eax,-0x54(%rbp)
cmpl   $0x0,-0x54(%rbp)
je     143b <main+0x20b>
mov    -0x54(%rbp),%edi
call   1080 <gai_strerror@plt>
mov    %rax,%rsi
lea    0xbef(%rip),%rdi
call   1070 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
cmpq   $0x0,-0x60(%rbp)
je     1452 <main+0x222>
mov    -0x60(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
mov    0x2b4f(%rip),%rax
mov    (%rax),%edi
mov    0x2b56(%rip),%rax
mov    (%rax),%rsi
xor    %edx,%edx
call   1150 <socket@plt>
mov    %eax,-0x7c(%rbp)
mov    -0x7c(%rbp),%edi
lea    -0x58(%rbp),%rsi
mov    $0x4,%edx
call   1100 <connect@plt>
mov    %eax,-0x54(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    14ac <main+0x27c>
mov    0x2b1c(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
mov    %eax,%edi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    -0xa0(%rbp),%rdi
mov    $0x18,%esi
call   10d0 <bzero@plt>
mov    0x2b04(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x90(%rbp)
mov    0x2ae3(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x98(%rbp)
lea    0xb29(%rip),%rdi
lea    0xb32(%rip),%rsi
lea    -0xa0(%rbp),%rdx
lea    -0x88(%rbp),%rcx
call   1110 <getaddrinfo@plt>
mov    %eax,-0x54(%rbp)
cmpl   $0x0,-0x54(%rbp)
je     152e <main+0x2fe>
mov    -0x54(%rbp),%edi
call   1080 <gai_strerror@plt>
mov    %rax,%rsi
lea    0xafc(%rip),%rdi
call   1070 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
cmpq   $0x0,-0x88(%rbp)
je     15ac <main+0x37c>
mov    0x2a9d(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0xa8(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0xd0(%rbp)
mov    %rdx,%rsp
mov    %rax,-0xb0(%rbp)
mov    0x2a50(%rip),%rax
mov    (%rax),%rdi
mov    -0x88(%rbp),%rax
mov    (%rax),%rsi
mov    $0x8,%ecx
call   1030 <inet_ntop@plt>
mov    -0xd0(%rbp),%rsi
lea    0xa7e(%rip),%rdi
call   1070 <printf@plt>
mov    -0xa8(%rbp),%rax
mov    %rax,%rsp
mov    -0x88(%rbp),%rdi
call   1140 <freeaddrinfo@plt>
lea    0xa68(%rip),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x7c(%rbp),%eax
mov    %eax,-0xdc(%rbp)
mov    -0xb8(%rbp),%rax
mov    %rax,-0xd8(%rbp)
mov    -0xb8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0xdc(%rbp),%edi
mov    -0xd8(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    -0x7c(%rbp),%edi
call   1090 <close@plt>
mov    -0x60(%rbp),%rdi
call   1140 <freeaddrinfo@plt>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x60,%rsp
mov    0x2d92(%rip),%rax
mov    (%rax),%edi
mov    0x2d69(%rip),%r12
mov    (%r12),%rsi
xor    %edx,%edx
call   1150 <socket@plt>
mov    %eax,%ebx
mov    0x2d65(%rip),%r15
mov    (%r15),%rax
mov    %rax,-0x40(%rbp)
mov    $0x106a,%edi
call   1050 <htons@plt>
mov    %eax,-0x44(%rbp)
mov    0x2d72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x48(%rbp)
lea    -0x48(%rbp),%rsi
mov    %ebx,%edi
mov    $0x10,%edx
call   10b0 <bind@plt>
cmp    $0xffffffff,%eax
je     141f <main+0x1ef>
mov    %ebx,%edi
xor    %esi,%esi
call   10a0 <listen@plt>
cmp    $0xffffffff,%eax
je     141f <main+0x1ef>
xor    %eax,%eax
call   1130 <fork@plt>
test   %eax,%eax
je     145e <main+0x22e>
mov    %ebx,%edi
call   1090 <close@plt>
lea    -0x78(%rbp),%rbx
mov    %rbx,%rdi
mov    $0x18,%esi
call   10d0 <bzero@plt>
mov    0x2cf4(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x68(%rbp)
mov    (%r12),%rax
mov    %rax,-0x70(%rbp)
lea    0xd1d(%rip),%rdi
lea    0xd1d(%rip),%rsi
lea    -0x38(%rbp),%rcx
mov    %rbx,%rdx
call   1110 <getaddrinfo@plt>
test   %eax,%eax
jne    143e <main+0x20e>
mov    -0x38(%rbp),%rax
test   %rax,%rax
je     131e <main+0xee>
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    0x2c83(%rip),%rax
mov    (%rax),%edi
mov    (%r12),%rsi
xor    %edx,%edx
call   1150 <socket@plt>
mov    %eax,%r14d
lea    -0x30(%rbp),%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   1100 <connect@plt>
lea    -0x60(%rbp),%rbx
mov    %rbx,%rdi
mov    $0x18,%esi
call   10d0 <bzero@plt>
mov    (%r15),%rax
mov    %rax,-0x50(%rbp)
mov    (%r12),%rax
mov    %rax,-0x58(%rbp)
lea    0xca3(%rip),%rdi
lea    0xcac(%rip),%rsi
lea    -0x28(%rbp),%rcx
mov    %rbx,%rdx
call   1110 <getaddrinfo@plt>
test   %eax,%eax
jne    143e <main+0x20e>
cmpq   $0x0,-0x28(%rbp)
je     13da <main+0x1aa>
mov    %rsp,%r12
mov    0x2c48(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    (%r15),%rdi
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
mov    %rbx,%rdx
mov    $0x8,%ecx
call   1030 <inet_ntop@plt>
lea    0xc52(%rip),%rdi
mov    %rbx,%rsi
call   1070 <printf@plt>
mov    %r12,%rsp
mov    -0x28(%rbp),%rdi
jmp    13dc <main+0x1ac>
xor    %edi,%edi
call   1140 <freeaddrinfo@plt>
lea    0xc3f(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    %r14d,%edi
call   1090 <close@plt>
mov    -0x38(%rbp),%rdi
call   1140 <freeaddrinfo@plt>
xor    %eax,%eax
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b8a(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
mov    %eax,%edi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    %eax,%edi
call   1080 <gai_strerror@plt>
lea    0xbcf(%rip),%rdi
mov    %rax,%rsi
call   1070 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
movl   $0x10,-0x60(%rbp)
lea    -0x78(%rbp),%rsi
lea    -0x60(%rbp),%rdx
mov    %ebx,%edi
call   10e0 <accept@plt>
mov    %eax,%r14d
lea    0xb82(%rip),%r15
mov    %r15,%rdi
call   1040 <strlen@plt>
mov    %r14d,%edi
mov    %r15,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    %r14d,%edi
call   1090 <close@plt>
mov    %ebx,%edi
call   1090 <close@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in6 = type { i32, i32, i8* }
%struct.sockaddr_in = type { i32 }
%struct.addrinfo = type { i64, i8*, i8* }
%struct.sockaddr = type { i32 }
@PF_INET6 = global i32 0
@SOCK_STREAM = global i8* null
@AF_INET6 = global i8* null
@in6addr_any = global i32 0
@errno = global i32 0
@.str = [15 x i8] c"Confirmation!\0A\00"
@AF_INET = global i8* null
@.str.1 = [7 x i8] c"lucien\00"
@.str.2 = [5 x i8] c"4201\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@PF_INET = global i32 0
@.str.4 = [8 x i8] c"daytime\00"
@INET6_ADDRSTRLEN = global i32 0
@.str.5 = [39 x i8] c"2001:660:3301:8070:215:c5ff:fee6:1f9a\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 %struct.sockaddr_in6
%9 = alloca i32
%10 = alloca %struct.sockaddr_in6
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32
%15 = alloca %struct.sockaddr_in
%16 = alloca %struct.addrinfo*
%17 = alloca %struct.addrinfo
%18 = alloca i32
%19 = alloca %struct.addrinfo*
%20 = alloca %struct.addrinfo
%21 = alloca i8*
%22 = alloca i64
%23 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%24 = load i32, i32* @PF_INET6
%25 = load i8*, i8** @SOCK_STREAM
%26 = call i32 @socket(i32 %24, i8* %25, i32 0)
store i32 %26, i32* %7
%27 = load i8*, i8** @AF_INET6
%28 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %8, i32 0, i32 2
store i8* %27, i8** %28
%29 = call i32 @htons(i32 4202)
%30 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %8, i32 0, i32 1
store i32 %29, i32* %30
%31 = load i32, i32* @in6addr_any
%32 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %8, i32 0, i32 0
store i32 %31, i32* %32
%33 = load i32, i32* %7
%34 = bitcast %struct.sockaddr_in6* %8 to %struct.sockaddr*
%35 = call i32 @bind(i32 %33, %struct.sockaddr* %34, i32 16)
store i32 %35, i32* %6
%36 = load i32, i32* %6
%37 = icmp eq i32 %36, -1
br i1 %37, label %38, label %43
38: ; preds = %2
%39 = load i32, i32* @errno
%40 = call i32 @strerror(i32 %39)
%41 = call i32 @perror(i32 %40)
%42 = call i32 @exit(i32 1)
unreachable
43: ; preds = %2
%44 = load i32, i32* %7
%45 = call i32 @listen(i32 %44, i32 0)
store i32 %45, i32* %6
%46 = load i32, i32* %6
%47 = icmp eq i32 %46, -1
br i1 %47, label %48, label %53
48: ; preds = %43
%49 = load i32, i32* @errno
%50 = call i32 @strerror(i32 %49)
%51 = call i32 @perror(i32 %50)
%52 = call i32 @exit(i32 1)
unreachable
53: ; preds = %43
%54 = call i32 (...) @fork()
store i32 %54, i32* %9
%55 = load i32, i32* %9
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %82
57: ; preds = %53
store i32 16, i32* %11
%58 = load i32, i32* %7
%59 = bitcast %struct.sockaddr_in6* %10 to %struct.sockaddr*
%60 = call i32 @accept(i32 %58, %struct.sockaddr* %59, i32* %11)
store i32 %60, i32* %12
%61 = load i32, i32* %6
%62 = icmp eq i32 %61, -1
br i1 %62, label %63, label %68
63: ; preds = %57
%64 = load i32, i32* @errno
%65 = call i32 @strerror(i32 %64)
%66 = call i32 @perror(i32 %65)
%67 = call i32 @exit(i32 1)
unreachable
68: ; preds = %57
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %13
%69 = load i32, i32* %12
%70 = load i8*, i8** %13
%71 = load i8*, i8** %13
%72 = call i32 @strlen(i8* %71)
%73 = sext i32 %72 to i64
%74 = mul i64 %73, 1
%75 = trunc i64 %74 to i32
%76 = call i32 @send(i32 %69, i8* %70, i32 %75, i32 0)
%77 = load i32, i32* %12
%78 = call i32 @close(i32 %77)
%79 = load i32, i32* %7
%80 = call i32 @close(i32 %79)
%81 = call i32 @exit(i32 0)
unreachable
82: ; preds = %53
%83 = load i32, i32* %7
%84 = call i32 @close(i32 %83)
store i32 0, i32* %14
%85 = call i32 @bzero(%struct.addrinfo* %17, i32 24)
%86 = load i8*, i8** @AF_INET
%87 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %17, i32 0, i32 2
store i8* %86, i8** %87
%88 = load i8*, i8** @SOCK_STREAM
%89 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %17, i32 0, i32 1
store i8* %88, i8** %89
%90 = call i32 @getaddrinfo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %struct.addrinfo* %17, %struct.addrinfo** %16)
store i32 %90, i32* %14
%91 = load i32, i32* %14
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %98
93: ; preds = %82
%94 = load i32, i32* %14
%95 = call i8* @gai_strerror(i32 %94)
%96 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %95)
%97 = call i32 @exit(i32 1)
unreachable
98: ; preds = %82
%99 = load %struct.addrinfo*, %struct.addrinfo** %16
%100 = icmp ne %struct.addrinfo* %99, null
br i1 %100, label %101, label %108
101: ; preds = %98
%102 = load %struct.addrinfo*, %struct.addrinfo** %16
%103 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %102, i32 0, i32 0
%104 = load i64, i64* %103
%105 = inttoptr i64 %104 to %struct.sockaddr_in*
%106 = bitcast %struct.sockaddr_in* %15 to i8*
%107 = bitcast %struct.sockaddr_in* %105 to i8*
br label %108
108: ; preds = %101, %98
%109 = load i32, i32* @PF_INET
%110 = load i8*, i8** @SOCK_STREAM
%111 = call i32 @socket(i32 %109, i8* %110, i32 0)
store i32 %111, i32* %18
%112 = load i32, i32* %18
%113 = bitcast %struct.sockaddr_in* %15 to %struct.sockaddr*
%114 = call i32 @connect(i32 %112, %struct.sockaddr* %113, i32 4)
store i32 %114, i32* %14
%115 = load i32, i32* %6
%116 = icmp eq i32 %115, -1
br i1 %116, label %117, label %122
117: ; preds = %108
%118 = load i32, i32* @errno
%119 = call i32 @strerror(i32 %118)
%120 = call i32 @perror(i32 %119)
%121 = call i32 @exit(i32 1)
unreachable
122: ; preds = %108
%123 = call i32 @bzero(%struct.addrinfo* %20, i32 24)
%124 = load i8*, i8** @AF_INET6
%125 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %20, i32 0, i32 2
store i8* %124, i8** %125
%126 = load i8*, i8** @SOCK_STREAM
%127 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %20, i32 0, i32 1
store i8* %126, i8** %127
%128 = call i32 @getaddrinfo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), %struct.addrinfo* %20, %struct.addrinfo** %19)
store i32 %128, i32* %14
%129 = load i32, i32* %14
%130 = icmp ne i32 %129, 0
br i1 %130, label %131, label %136
131: ; preds = %122
%132 = load i32, i32* %14
%133 = call i8* @gai_strerror(i32 %132)
%134 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %133)
%135 = call i32 @exit(i32 1)
unreachable
136: ; preds = %122
%137 = load %struct.addrinfo*, %struct.addrinfo** %19
%138 = icmp ne %struct.addrinfo* %137, null
br i1 %138, label %139, label %151
139: ; preds = %136
%140 = load i32, i32* @INET6_ADDRSTRLEN
%141 = zext i32 %140 to i64
%142 = call i8* @llvm.stacksave()
store i8* %142, i8** %21
%143 = alloca i8, i64 %141
store i64 %141, i64* %22
%144 = load i8*, i8** @AF_INET6
%145 = load %struct.addrinfo*, %struct.addrinfo** %19
%146 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %145, i32 0, i32 0
%147 = load i64, i64* %146
%148 = call i32 @inet_ntop(i8* %144, i64 %147, i8* %143, i32 8)
%149 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %143)
%150 = load i8*, i8** %21
br label %151
151: ; preds = %139, %136
%152 = load %struct.addrinfo*, %struct.addrinfo** %19
%153 = call i32 @freeaddrinfo(%struct.addrinfo* %152)
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8** %23
%154 = load i32, i32* %18
%155 = load i8*, i8** %23
%156 = load i8*, i8** %23
%157 = call i32 @strlen(i8* %156)
%158 = call i32 @send(i32 %154, i8* %155, i32 %157, i32 0)
%159 = load i32, i32* %18
%160 = call i32 @close(i32 %159)
%161 = load %struct.addrinfo*, %struct.addrinfo** %16
%162 = call i32 @freeaddrinfo(%struct.addrinfo* %161)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in6 = type { i32, i32, i8* }
%struct.sockaddr_in = type { i32 }
%struct.addrinfo = type { i64, i8*, i8* }
%struct.sockaddr = type { i32 }
@PF_INET6 = global i32 0
@SOCK_STREAM = global i8* null
@AF_INET6 = global i8* null
@in6addr_any = global i32 0
@errno = global i32 0
@.str = [15 x i8] c"Confirmation!\0A\00"
@AF_INET = global i8* null
@.str.1 = [7 x i8] c"lucien\00"
@.str.2 = [5 x i8] c"4201\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@PF_INET = global i32 0
@.str.4 = [8 x i8] c"daytime\00"
@INET6_ADDRSTRLEN = global i32 0
@.str.5 = [39 x i8] c"2001:660:3301:8070:215:c5ff:fee6:1f9a\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.sockaddr_in6
%4 = alloca %struct.sockaddr_in6
%5 = alloca i32
%6 = alloca %struct.sockaddr_in
%7 = alloca %struct.addrinfo*
%8 = alloca %struct.addrinfo
%9 = alloca %struct.addrinfo*
%10 = alloca %struct.addrinfo
%11 = load i32, i32* @PF_INET6
%12 = load i8*, i8** @SOCK_STREAM
%13 = tail call i32 @socket(i32 %11, i8* %12, i32 0)
%14 = bitcast %struct.sockaddr_in6* %3 to i8*
%15 = load i8*, i8** @AF_INET6
%16 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %3, i64 0, i32 2
store i8* %15, i8** %16
%17 = tail call i32 @htons(i32 4202)
%18 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %3, i64 0, i32 1
store i32 %17, i32* %18
%19 = load i32, i32* @in6addr_any
%20 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %3, i64 0, i32 0
store i32 %19, i32* %20
%21 = bitcast %struct.sockaddr_in6* %3 to %struct.sockaddr*
%22 = call i32 @bind(i32 %13, %struct.sockaddr* %21, i32 16)
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %29
24: ; preds = %2
%25 = load i32, i32* @errno
%26 = call i32 @strerror(i32 %25)
%27 = call i32 @perror(i32 %26)
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %2
%30 = call i32 @listen(i32 %13, i32 0)
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %37
32: ; preds = %29
%33 = load i32, i32* @errno
%34 = call i32 @strerror(i32 %33)
%35 = call i32 @perror(i32 %34)
%36 = call i32 @exit(i32 1)
unreachable
37: ; preds = %29
%38 = call i32 (...) @fork()
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %50
40: ; preds = %37
%41 = bitcast %struct.sockaddr_in6* %4 to i8*
%42 = bitcast i32* %5 to i8*
store i32 16, i32* %5
%43 = bitcast %struct.sockaddr_in6* %4 to %struct.sockaddr*
%44 = call i32 @accept(i32 %13, %struct.sockaddr* %43, i32* %5)
%45 = call i32 @strlen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%46 = call i32 @send(i32 %44, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %45, i32 0)
%47 = call i32 @close(i32 %44)
%48 = call i32 @close(i32 %13)
%49 = call i32 @exit(i32 0)
unreachable
50: ; preds = %37
%51 = call i32 @close(i32 %13)
%52 = bitcast %struct.sockaddr_in* %6 to i8*
%53 = bitcast %struct.addrinfo** %7 to i8*
%54 = bitcast %struct.addrinfo* %8 to i8*
%55 = call i32 @bzero(%struct.addrinfo* %8, i32 24)
%56 = load i8*, i8** @AF_INET
%57 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %8, i64 0, i32 2
store i8* %56, i8** %57
%58 = load i8*, i8** @SOCK_STREAM
%59 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %8, i64 0, i32 1
store i8* %58, i8** %59
%60 = call i32 @getaddrinfo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %struct.addrinfo* %8, %struct.addrinfo** %7)
%61 = icmp eq i32 %60, 0
br i1 %61, label %66, label %62
62: ; preds = %50
%63 = call i8* @gai_strerror(i32 %60)
%64 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %63)
%65 = call i32 @exit(i32 1)
unreachable
66: ; preds = %50
%67 = load %struct.addrinfo*, %struct.addrinfo** %7
%68 = icmp eq %struct.addrinfo* %67, null
br i1 %68, label %75, label %69
69: ; preds = %66
%70 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %67, i64 0, i32 0
%71 = load i64, i64* %70
%72 = inttoptr i64 %71 to i32*
%73 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 0
%74 = load i32, i32* %72
store i32 %74, i32* %73
br label %75
75: ; preds = %69, %66
%76 = load i32, i32* @PF_INET
%77 = load i8*, i8** @SOCK_STREAM
%78 = call i32 @socket(i32 %76, i8* %77, i32 0)
%79 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%80 = call i32 @connect(i32 %78, %struct.sockaddr* %79, i32 4)
%81 = bitcast %struct.addrinfo** %9 to i8*
%82 = bitcast %struct.addrinfo* %10 to i8*
%83 = call i32 @bzero(%struct.addrinfo* %10, i32 24)
%84 = load i8*, i8** @AF_INET6
%85 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %10, i64 0, i32 2
store i8* %84, i8** %85
%86 = load i8*, i8** @SOCK_STREAM
%87 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %10, i64 0, i32 1
store i8* %86, i8** %87
%88 = call i32 @getaddrinfo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), %struct.addrinfo* %10, %struct.addrinfo** %9)
%89 = icmp eq i32 %88, 0
br i1 %89, label %94, label %90
90: ; preds = %75
%91 = call i8* @gai_strerror(i32 %88)
%92 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %91)
%93 = call i32 @exit(i32 1)
unreachable
94: ; preds = %75
%95 = load %struct.addrinfo*, %struct.addrinfo** %9
%96 = icmp eq %struct.addrinfo* %95, null
br i1 %96, label %109, label %97
97: ; preds = %94
%98 = load i32, i32* @INET6_ADDRSTRLEN
%99 = zext i32 %98 to i64
%100 = call i8* @llvm.stacksave()
%101 = alloca i8, i64 %99
%102 = load i8*, i8** @AF_INET6
%103 = load %struct.addrinfo*, %struct.addrinfo** %9
%104 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %103, i64 0, i32 0
%105 = load i64, i64* %104
%106 = call i32 @inet_ntop(i8* %102, i64 %105, i8* %101, i32 8)
%107 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %101)
%108 = load %struct.addrinfo*, %struct.addrinfo** %9
br label %109
109: ; preds = %97, %94
%110 = phi %struct.addrinfo* [ %108, %97 ], [ null, %94 ]
%111 = call i32 @freeaddrinfo(%struct.addrinfo* %110)
%112 = call i32 @strlen(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0))
%113 = call i32 @send(i32 %78, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i32 %112, i32 0)
%114 = call i32 @close(i32 %78)
%115 = load %struct.addrinfo*, %struct.addrinfo** %7
%116 = call i32 @freeaddrinfo(%struct.addrinfo* %115)
ret i32 0
}