#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;
  scalar_t__ ai_addr;
  int /*<<< orphan*/ ai_socktype;
  int /*<<< orphan*/ ai_family;
  scalar_t__ ai_protocol;
  int /*<<< orphan*/ ai_flags;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ cli;

/* Variables and functions */
int /*<<< orphan*/ AF_UNSPEC;
int /*<<< orphan*/ AI_PASSIVE;
int NI_MAXHOST;
int NI_MAXSERV;
int /*<<< orphan*/ NI_NUMERICHOST;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ STDOUT_FILENO;
int accept(int, struct sockaddr *, int *);
int /*<<< orphan*/ bind(int, struct sockaddr *, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int /*<<< orphan*/);
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
int /*<<< orphan*/ getaddrinfo(char *, char *, struct addrinfo *,
                               struct addrinfo **);
int /*<<< orphan*/ getnameinfo(struct sockaddr *, int, char *, int, char *, int,
                               int /*<<< orphan*/);
int /*<<< orphan*/ listen(int, int);
int /*<<< orphan*/ printf(char *, char *, char *);
int recv(int, char *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
char *strtok(char *, char *);
void main(int args, char *argv[]) {
  struct addrinfo hints, *res;
  struct sockaddr_storage cli;
  char host[NI_MAXHOST], serv[NI_MAXSERV];
  char buf[81];
  hints.ai_flags = AI_PASSIVE;
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  hints.ai_protocol = 0;
  getaddrinfo(argv[1], argv[2], &hints, &res);
  int sd = socket(res->ai_family, res->ai_socktype, 0);
  bind(sd, (struct sockaddr *)res->ai_addr, res->ai_addrlen);
  freeaddrinfo(res);
  listen(sd, 5);
  while (1) {
    socklen_t clen = sizeof(cli);
    int cli_sd = accept(sd, (struct sockaddr *)&cli, &clen);
    getnameinfo((struct sockaddr *)&cli, clen, host, NI_MAXHOST, serv,
                NI_MAXSERV, NI_NUMERICHOST);
    printf("%s %s\n", host, serv);
    int c = recv(cli_sd, buf, 80, 0);
    int i = 0;
    char *aux;
    aux = strtok(buf, " ");
    while (aux != NULL) {
      i++;
      aux = strtok(NULL, " ");
    }
    char *cmd[i + 1];
    i = 0;
    cmd[i] = strtok(buf, " ");
    while (aux != NULL) {
      i++;
      cmd[i] = strtok(NULL, " ");
    }
    cmd[i + 1] = NULL;
    dup2(cli_sd, STDOUT_FILENO);
    execvp(cmd[0], cmd);
    close(cli_sd);
  }
  close(sd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2dc7(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x100(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x58(%rbp)
mov    0x2db8(%rip),%rax
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xf8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x60(%rbp)
mov    0x2da0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    0x2d8c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    0x2d68(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x40(%rbp),%rcx
call   10d0 <getaddrinfo@plt>
mov    -0x40(%rbp),%rax
mov    0x14(%rax),%edi
mov    -0x40(%rbp),%rax
mov    0x10(%rax),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
mov    %eax,-0xc4(%rbp)
mov    -0xc4(%rbp),%edi
mov    -0x40(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x40(%rbp),%rax
mov    (%rax),%edx
call   1090 <bind@plt>
mov    -0x40(%rbp),%rdi
call   10e0 <freeaddrinfo@plt>
mov    -0xc4(%rbp),%edi
mov    $0x5,%esi
call   1080 <listen@plt>
jmp    12d4 <main+0x104>
movl   $0x4,-0xc8(%rbp)
mov    -0xc4(%rbp),%edi
lea    -0x48(%rbp),%rsi
lea    -0xc8(%rbp),%rdx
call   10b0 <accept@plt>
mov    -0x100(%rbp),%rdx
mov    -0xf8(%rbp),%r8
mov    %eax,-0xcc(%rbp)
lea    -0x48(%rbp),%rdi
mov    -0xc8(%rbp),%esi
mov    0x2c97(%rip),%rax
mov    (%rax),%ecx
mov    0x2cae(%rip),%rax
mov    (%rax),%r9d
mov    0x2c8c(%rip),%rax
mov    (%rax),%eax
sub    $0x10,%rsp
mov    %eax,(%rsp)
call   1070 <getnameinfo@plt>
mov    -0x100(%rbp),%rsi
mov    -0xf8(%rbp),%rdx
add    $0x10,%rsp
lea    0xcad(%rip),%rdi
call   1050 <printf@plt>
mov    -0xcc(%rbp),%edi
lea    -0xc0(%rbp),%rsi
mov    $0x50,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0xd0(%rbp)
movl   $0x0,-0xd4(%rbp)
lea    -0xc0(%rbp),%rdi
lea    0xc78(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,-0xe0(%rbp)
cmpq   $0x0,-0xe0(%rbp)
je     13d4 <main+0x204>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xc44(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,-0xe0(%rbp)
jmp    139b <main+0x1cb>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0xe8(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x108(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xf0(%rbp)
movl   $0x0,-0xd4(%rbp)
lea    -0xc0(%rbp),%rdi
lea    0xbe5(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,%rdx
mov    -0x108(%rbp),%rax
movslq -0xd4(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
cmpq   $0x0,-0xe0(%rbp)
je     1483 <main+0x2b3>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xba3(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,%rdx
mov    -0x108(%rbp),%rax
movslq -0xd4(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
jmp    143c <main+0x26c>
mov    -0x108(%rbp),%rax
mov    -0xd4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0xcc(%rbp),%edi
mov    0x2b45(%rip),%rax
mov    (%rax),%esi
call   1040 <dup2@plt>
mov    -0x108(%rbp),%rsi
mov    (%rsi),%rdi
call   10c0 <execvp@plt>
mov    -0xcc(%rbp),%edi
call   1060 <close@plt>
mov    -0xe8(%rbp),%rax
mov    %rax,%rsp
jmp    12cf <main+0xff>

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    0x2dc5(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rcx,%rsp
mov    0x2dc7(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    0x2db9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x70(%rbp)
mov    0x2da5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x7c(%rbp)
mov    0x2d81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x80(%rbp)
movq   $0x0,-0x78(%rbp)
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
lea    -0x90(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   10d0 <getaddrinfo@plt>
mov    -0x38(%rbp),%rax
mov    0x10(%rax),%esi
mov    0x14(%rax),%edi
xor    %edx,%edx
call   10f0 <socket@plt>
mov    %eax,%ebx
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rsi
mov    (%rax),%edx
mov    %ebx,%edi
call   1090 <bind@plt>
mov    -0x38(%rbp),%rdi
call   10e0 <freeaddrinfo@plt>
mov    %ebx,-0x3c(%rbp)
mov    %ebx,%edi
mov    $0x5,%esi
call   1080 <listen@plt>
lea    -0xf0(%rbp),%r13
lea    0xd59(%rip),%r15
jmp    1319 <main+0x149>
mov    %rsp,-0x60(%rbp)
mov    %ebx,%eax
mov    %rsp,%r14
mov    %r14,-0x58(%rbp)
lea    0x17(,%rax,8),%r13
and    $0xfffffffffffffff0,%r13
sub    %r13,%r14
mov    %r14,%rsp
neg    %r13
mov    %r12,%rdi
mov    %r15,%rsi
call   10a0 <strtok@plt>
mov    %rax,(%r14)
movq   $0x0,0x8(%r14)
mov    0x2d01(%rip),%rax
mov    (%rax),%esi
mov    -0x40(%rbp),%ebx
mov    %ebx,%edi
call   1040 <dup2@plt>
mov    -0x58(%rbp),%rax
mov    (%rax,%r13,1),%rdi
mov    %r12,%r13
mov    %r14,%rsi
call   10c0 <execvp@plt>
mov    %ebx,%edi
call   1060 <close@plt>
mov    -0x60(%rbp),%rsp
movl   $0x4,-0x2c(%rbp)
mov    -0x3c(%rbp),%edi
lea    -0x68(%rbp),%rbx
mov    %rbx,%rsi
lea    -0x2c(%rbp),%rdx
call   10b0 <accept@plt>
mov    %eax,%r12d
mov    -0x2c(%rbp),%esi
mov    0x2c70(%rip),%rax
mov    (%rax),%ecx
mov    0x2c87(%rip),%rax
mov    (%rax),%r9d
mov    0x2c65(%rip),%rax
mov    (%rax),%eax
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    -0x50(%rbp),%r14
mov    %r14,%rdx
mov    -0x48(%rbp),%rbx
mov    %rbx,%r8
push   %rax
call   1070 <getnameinfo@plt>
add    $0x10,%rsp
lea    0xc85(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <printf@plt>
mov    %r12d,-0x40(%rbp)
mov    %r12d,%edi
mov    %r13,%rsi
mov    $0x50,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %r13,%r12
mov    %r13,%rdi
mov    %r15,%rsi
call   10a0 <strtok@plt>
mov    $0x0,%ebx
test   %rax,%rax
je     12b0 <main+0xe0>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
xor    %edi,%edi
mov    %r15,%rsi
call   10a0 <strtok@plt>
test   %rax,%rax
jne    13c0 <main+0x1f0>
jmp    12b0 <main+0xe0>

LLVM IR (-O0):
%struct.addrinfo = type { i32, i64, i32, i32, i64, i32 }
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
@NI_MAXHOST = global i32 0
@NI_MAXSERV = global i32 0
@AI_PASSIVE = global i32 0
@AF_UNSPEC = global i32 0
@SOCK_STREAM = global i32 0
@NI_NUMERICHOST = global i32 0
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [2 x i8] c" \00"
@STDOUT_FILENO = global i32 0
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca %struct.addrinfo
%6 = alloca %struct.addrinfo*
%7 = alloca %struct.sockaddr_storage
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
%11 = alloca [81 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i64
store i32 %0, i32* %3
store i8** %1, i8*** %4
%20 = load i32, i32* @NI_MAXHOST
%21 = zext i32 %20 to i64
%22 = call i8* @llvm.stacksave()
store i8* %22, i8** %8
%23 = alloca i8, i64 %21
store i64 %21, i64* %9
%24 = load i32, i32* @NI_MAXSERV
%25 = zext i32 %24 to i64
%26 = alloca i8, i64 %25
store i64 %25, i64* %10
%27 = load i32, i32* @AI_PASSIVE
%28 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %5, i32 0, i32 5
store i32 %27, i32* %28
%29 = load i32, i32* @AF_UNSPEC
%30 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %5, i32 0, i32 3
store i32 %29, i32* %30
%31 = load i32, i32* @SOCK_STREAM
%32 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %5, i32 0, i32 2
store i32 %31, i32* %32
%33 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %5, i32 0, i32 4
store i64 0, i64* %33
%34 = load i8**, i8*** %4
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = load i8**, i8*** %4
%38 = getelementptr inbounds i8*, i8** %37, i64 2
%39 = load i8*, i8** %38
%40 = call i32 @getaddrinfo(i8* %36, i8* %39, %struct.addrinfo* %5, %struct.addrinfo** %6)
%41 = load %struct.addrinfo*, %struct.addrinfo** %6
%42 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %41, i32 0, i32 3
%43 = load i32, i32* %42
%44 = load %struct.addrinfo*, %struct.addrinfo** %6
%45 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %44, i32 0, i32 2
%46 = load i32, i32* %45
%47 = call i32 @socket(i32 %43, i32 %46, i32 0)
store i32 %47, i32* %12
%48 = load i32, i32* %12
%49 = load %struct.addrinfo*, %struct.addrinfo** %6
%50 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %49, i32 0, i32 1
%51 = load i64, i64* %50
%52 = inttoptr i64 %51 to %struct.sockaddr*
%53 = load %struct.addrinfo*, %struct.addrinfo** %6
%54 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %53, i32 0, i32 0
%55 = load i32, i32* %54
%56 = call i32 @bind(i32 %48, %struct.sockaddr* %52, i32 %55)
%57 = load %struct.addrinfo*, %struct.addrinfo** %6
%58 = call i32 @freeaddrinfo(%struct.addrinfo* %57)
%59 = load i32, i32* %12
%60 = call i32 @listen(i32 %59, i32 5)
br label %61
61: ; preds = %106, %2
br label %62
62: ; preds = %61
store i32 4, i32* %13
%63 = load i32, i32* %12
%64 = bitcast %struct.sockaddr_storage* %7 to %struct.sockaddr*
%65 = call i32 @accept(i32 %63, %struct.sockaddr* %64, i32* %13)
store i32 %65, i32* %14
%66 = bitcast %struct.sockaddr_storage* %7 to %struct.sockaddr*
%67 = load i32, i32* %13
%68 = load i32, i32* @NI_MAXHOST
%69 = load i32, i32* @NI_MAXSERV
%70 = load i32, i32* @NI_NUMERICHOST
%71 = call i32 @getnameinfo(%struct.sockaddr* %66, i32 %67, i8* %23, i32 %68, i8* %26, i32 %69, i32 %70)
%72 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %23, i8* %26)
%73 = load i32, i32* %14
%74 = getelementptr inbounds [81 x i8], [81 x i8]* %11, i64 0, i64 0
%75 = call i32 @recv(i32 %73, i8* %74, i32 80, i32 0)
store i32 %75, i32* %15
store i32 0, i32* %16
%76 = getelementptr inbounds [81 x i8], [81 x i8]* %11, i64 0, i64 0
%77 = call i8* @strtok(i8* %76, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %77, i8** %17
br label %78
78: ; preds = %81, %62
%79 = load i8*, i8** %17
%80 = icmp ne i8* %79, null
br i1 %80, label %81, label %85
81: ; preds = %78
%82 = load i32, i32* %16
%83 = add nsw i32 %82, 1
store i32 %83, i32* %16
%84 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %84, i8** %17
br label %78
85: ; preds = %78
%86 = load i32, i32* %16
%87 = add nsw i32 %86, 1
%88 = zext i32 %87 to i64
%89 = call i8* @llvm.stacksave()
store i8* %89, i8** %18
%90 = alloca i8*, i64 %88
store i64 %88, i64* %19
store i32 0, i32* %16
%91 = getelementptr inbounds [81 x i8], [81 x i8]* %11, i64 0, i64 0
%92 = call i8* @strtok(i8* %91, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%93 = load i32, i32* %16
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i8*, i8** %90, i64 %94
store i8* %92, i8** %95
br label %96
96: ; preds = %99, %85
%97 = load i8*, i8** %17
%98 = icmp ne i8* %97, null
br i1 %98, label %99, label %106
99: ; preds = %96
%100 = load i32, i32* %16
%101 = add nsw i32 %100, 1
store i32 %101, i32* %16
%102 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%103 = load i32, i32* %16
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i8*, i8** %90, i64 %104
store i8* %102, i8** %105
br label %96
106: ; preds = %96
%107 = load i32, i32* %16
%108 = add nsw i32 %107, 1
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8*, i8** %90, i64 %109
store i8* null, i8** %110
%111 = load i32, i32* %14
%112 = load i32, i32* @STDOUT_FILENO
%113 = call i32 @dup2(i32 %111, i32 %112)
%114 = getelementptr inbounds i8*, i8** %90, i64 0
%115 = load i8*, i8** %114
%116 = call i32 @execvp(i8* %115, i8** %90)
%117 = load i32, i32* %14
%118 = call i32 @close(i32 %117)
%119 = load i8*, i8** %18
br label %61
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i64, i32, i32, i64, i32 }
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
@NI_MAXHOST = global i32 0
@NI_MAXSERV = global i32 0
@AI_PASSIVE = global i32 0
@AF_UNSPEC = global i32 0
@SOCK_STREAM = global i32 0
@NI_NUMERICHOST = global i32 0
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [2 x i8] c" \00"
@STDOUT_FILENO = global i32 0
define void @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.addrinfo
%4 = alloca %struct.addrinfo*
%5 = alloca %struct.sockaddr_storage
%6 = alloca [81 x i8]
%7 = alloca i32
%8 = bitcast %struct.addrinfo* %3 to i8*
%9 = bitcast %struct.addrinfo** %4 to i8*
%10 = bitcast %struct.sockaddr_storage* %5 to i8*
%11 = load i32, i32* @NI_MAXHOST
%12 = zext i32 %11 to i64
%13 = alloca i8, i64 %12
%14 = load i32, i32* @NI_MAXSERV
%15 = zext i32 %14 to i64
%16 = alloca i8, i64 %15
%17 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%18 = load i32, i32* @AI_PASSIVE
%19 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 5
store i32 %18, i32* %19
%20 = load i32, i32* @AF_UNSPEC
%21 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 3
store i32 %20, i32* %21
%22 = load i32, i32* @SOCK_STREAM
%23 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 2
store i32 %22, i32* %23
%24 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 4
store i64 0, i64* %24
%25 = getelementptr inbounds i8*, i8** %1, i64 1
%26 = load i8*, i8** %25
%27 = getelementptr inbounds i8*, i8** %1, i64 2
%28 = load i8*, i8** %27
%29 = call i32 @getaddrinfo(i8* %26, i8* %28, %struct.addrinfo* %3, %struct.addrinfo** %4)
%30 = load %struct.addrinfo*, %struct.addrinfo** %4
%31 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %30, i64 0, i32 3
%32 = load i32, i32* %31
%33 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %30, i64 0, i32 2
%34 = load i32, i32* %33
%35 = call i32 @socket(i32 %32, i32 %34, i32 0)
%36 = load %struct.addrinfo*, %struct.addrinfo** %4
%37 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %36, i64 0, i32 1
%38 = load i64, i64* %37
%39 = inttoptr i64 %38 to %struct.sockaddr*
%40 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %36, i64 0, i32 0
%41 = load i32, i32* %40
%42 = call i32 @bind(i32 %35, %struct.sockaddr* %39, i32 %41)
%43 = load %struct.addrinfo*, %struct.addrinfo** %4
%44 = call i32 @freeaddrinfo(%struct.addrinfo* %43)
%45 = call i32 @listen(i32 %35, i32 5)
%46 = bitcast i32* %7 to i8*
%47 = bitcast %struct.sockaddr_storage* %5 to %struct.sockaddr*
br label %48
48: ; preds = %64, %2
store i32 4, i32* %7
%49 = call i32 @accept(i32 %35, %struct.sockaddr* %47, i32* %7)
%50 = load i32, i32* %7
%51 = load i32, i32* @NI_MAXHOST
%52 = load i32, i32* @NI_MAXSERV
%53 = load i32, i32* @NI_NUMERICHOST
%54 = call i32 @getnameinfo(%struct.sockaddr* %47, i32 %50, i8* %13, i32 %51, i8* %16, i32 %52, i32 %53)
%55 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %16)
%56 = call i32 @recv(i32 %49, i8* %17, i32 80, i32 0)
%57 = call i8* @strtok(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%58 = icmp eq i8* %57, null
br i1 %58, label %64, label %59
59: ; preds = %48, %59
%60 = phi i32 [ %61, %59 ], [ 0, %48 ]
%61 = add nuw nsw i32 %60, 1
%62 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%63 = icmp eq i8* %62, null
br i1 %63, label %64, label %59
64: ; preds = %59, %48
%65 = phi i32 [ 0, %48 ], [ %61, %59 ]
%66 = add nuw nsw i32 %65, 1
%67 = zext i32 %66 to i64
%68 = call i8* @llvm.stacksave()
%69 = alloca i8*, i64 %67
%70 = call i8* @strtok(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %70, i8** %69
%71 = getelementptr inbounds i8*, i8** %69, i64 1
store i8* null, i8** %71
%72 = load i32, i32* @STDOUT_FILENO
%73 = call i32 @dup2(i32 %49, i32 %72)
%74 = load i8*, i8** %69
%75 = call i32 @execvp(i8* %74, i8** %69)
%76 = call i32 @close(i32 %49)
br label %48
}