#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 /*<<< orphan*/ ai_addrlen;
  int /*<<< orphan*/ ai_addr;
  int /*<<< orphan*/ ai_flags;
  scalar_t__ ai_protocol;
  int /*<<< orphan*/ ai_socktype;
  int /*<<< orphan*/ ai_family;
};
struct sockaddr {
  int dummy;
};
struct addrinfo {
  int /*<<< orphan*/ ai_addrlen;
  int /*<<< orphan*/ ai_addr;
  int /*<<< orphan*/ ai_flags;
  scalar_t__ ai_protocol;
  int /*<<< orphan*/ ai_socktype;
  int /*<<< orphan*/ ai_family;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ sa;
typedef int /*<<< orphan*/ hints;

/* Variables and functions */
int /*<<< orphan*/ AF_UNSPEC;
int /*<<< orphan*/ AI_PASSIVE;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int *);
int /*<<< orphan*/ assert(int);
int bind(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int getaddrinfo(int /*<<< orphan*/ *, char *, struct sockaddr_storage *,
                struct sockaddr_storage **);
int listen(int, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(struct sockaddr_storage *, int /*<<< orphan*/, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
char *strdup(char *);
int main(int argc, char *argv[]) {
  int status;
  char *port;
  int sl, sc;
  int arg;
  char *cmd;
  char **args;
  struct addrinfo hints, *ai;
  struct sockaddr_storage sa;
  socklen_t salen;
  if (argc < 3) {
    fprintf(stderr, "usage: %s portno command [arg0 .. argn]\n", argv[0]);
    exit(1);
  }
  port = argv[1];
  cmd = argv[2];
  args = (char **)malloc(sizeof(char *) * (argc - 1));
  args[0] = strdup(cmd);
  for (arg = 1; arg < argc - 1; arg++) {
    args[arg] = argv[arg + 2] ? strdup(argv[arg + 2]) : NULL;
  }
  sl = socket(AF_UNSPEC, SOCK_STREAM, 0);
  assert(sl > 0);
  memset(&hints, 0, sizeof(hints));
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  hints.ai_protocol = 0;
  hints.ai_flags = (AI_PASSIVE);
  status = getaddrinfo(NULL, port, &hints, &ai);
  assert(status == 0);
  status = bind(sl, ai->ai_addr, ai->ai_addrlen);
  assert(status == 0);
  status = listen(sl, 1);
  assert(status == 0);
  salen = sizeof(sa);
  memset(&sa, 0, salen);
  sc = accept(sl, (struct sockaddr *)&sa, &salen);
  assert(sc > 0);
  dup2(sc, 0);
  dup2(sc, 1);
  dup2(sc, 2);
  close(sc);
  execvp(cmd, args);
  assert(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1229 <main+0x49>
mov    0x2dc6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xde6(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rdi
call   10f0 <strdup@plt>
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12ec <main+0x10c>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     12bd <main+0xdd>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   10f0 <strdup@plt>
mov    %rax,-0x98(%rbp)
jmp    12cb <main+0xeb>
xor    %eax,%eax
mov    %rax,-0x98(%rbp)
jmp    12cb <main+0xeb>
mov    -0x98(%rbp),%rdx
mov    -0x40(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1272 <main+0x92>
mov    0x2ced(%rip),%rax
mov    (%rax),%edi
mov    0x2ccc(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
mov    0x2cb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    0x2c8c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
mov    0x2c98(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
mov    -0x20(%rbp),%rsi
lea    -0x60(%rbp),%rdx
lea    -0x68(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edi
call   10e0 <getaddrinfo@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x24(%rbp),%edi
mov    -0x68(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x68(%rbp),%rax
mov    (%rax),%edx
call   10a0 <bind@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x24(%rbp),%edi
mov    $0x1,%esi
call   1090 <listen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movl   $0x20,-0x8c(%rbp)
mov    -0x8c(%rbp),%edx
lea    -0x88(%rbp),%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x24(%rbp),%edi
lea    -0x88(%rbp),%rsi
lea    -0x8c(%rbp),%rdx
call   10b0 <accept@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x28(%rbp),%edi
xor    %esi,%esi
call   1030 <dup2@plt>
mov    -0x28(%rbp),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    -0x28(%rbp),%edi
mov    $0x2,%esi
call   1030 <dup2@plt>
mov    -0x28(%rbp),%edi
call   1050 <close@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   10c0 <execvp@plt>
xor    %edi,%edi
call   1060 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%r12
cmp    $0x2,%edi
jle    1391 <main+0x1b1>
mov    0x8(%r12),%r15
mov    0x10(%r12),%rbp
mov    %edi,%ebx
add    $0xffffffff,%ebx
lea    -0x8(,%rdi,8),%edi
call   1080 <malloc@plt>
mov    %rax,%r14
mov    %rbp,0x8(%rsp)
mov    %rbp,%rdi
call   10f0 <strdup@plt>
mov    %rax,(%r14)
mov    $0x1,%ebp
jmp    1242 <main+0x62>
nop
call   10f0 <strdup@plt>
mov    %rax,(%r14,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%rbx
je     1250 <main+0x70>
mov    0x10(%r12,%rbp,8),%rdi
test   %rdi,%rdi
jne    1230 <main+0x50>
xor    %eax,%eax
jmp    1235 <main+0x55>
mov    0x2d89(%rip),%rbx
mov    (%rbx),%edi
mov    0x2d68(%rip),%rbp
mov    0x0(%rbp),%esi
xor    %edx,%edx
call   1100 <socket@plt>
mov    %eax,%r13d
xor    %edi,%edi
test   %eax,%eax
setg   %dil
call   1060 <assert@plt>
lea    0x18(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
mov    (%rbx),%eax
mov    %eax,0x34(%rsp)
mov    0x0(%rbp),%eax
mov    %eax,0x30(%rsp)
movq   $0x0,0x28(%rsp)
mov    0x2d3d(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x20(%rsp)
lea    0x10(%rsp),%rcx
xor    %edi,%edi
mov    %r15,%rsi
mov    %r12,%rdx
call   10e0 <getaddrinfo@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
mov    0x10(%rsp),%rax
mov    (%rax),%edx
mov    0x4(%rax),%esi
mov    %r13d,%edi
call   10a0 <bind@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
mov    %r13d,%edi
mov    $0x1,%esi
call   1090 <listen@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
movl   $0x20,0x4(%rsp)
lea    0x38(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    0x4(%rsp),%rdx
mov    %r13d,%edi
mov    %rbp,%rsi
call   10b0 <accept@plt>
mov    %eax,%ebp
xor    %edi,%edi
test   %eax,%eax
setg   %dil
call   1060 <assert@plt>
mov    %ebp,%edi
xor    %esi,%esi
call   1030 <dup2@plt>
mov    %ebp,%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    %ebp,%edi
mov    $0x2,%esi
call   1030 <dup2@plt>
mov    %ebp,%edi
call   1050 <close@plt>
mov    0x8(%rsp),%rdi
mov    %r14,%rsi
call   10c0 <execvp@plt>
xor    %edi,%edi
call   1060 <assert@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c38(%rip),%rax
mov    (%rax),%edi
mov    (%r12),%rdx
lea    0xc5b(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32, i32, i32, i64, i32, i32 }
%struct.sockaddr_storage = type { i32, i32, i32, i64, i32, i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [41 x i8] c"usage: %s portno command [arg0 .. argn]\0A\00"
@AF_UNSPEC = global i32 0
@SOCK_STREAM = global i32 0
@AI_PASSIVE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8**
%13 = alloca %struct.addrinfo
%14 = alloca %struct.addrinfo*
%15 = alloca %struct.sockaddr_storage
%16 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 3
br i1 %18, label %19, label %26
19: ; preds = %2
%20 = load i32, i32* @stderr
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %23)
%25 = call i32 @exit(i32 1)
unreachable
26: ; preds = %2
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
store i8* %29, i8** %7
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
store i8* %32, i8** %11
%33 = load i32, i32* %4
%34 = sub nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = mul i64 8, %35
%37 = trunc i64 %36 to i32
%38 = call i64 @malloc(i32 %37)
%39 = inttoptr i64 %38 to i8**
store i8** %39, i8*** %12
%40 = load i8*, i8** %11
%41 = call i8* @strdup(i8* %40)
%42 = load i8**, i8*** %12
%43 = getelementptr inbounds i8*, i8** %42, i64 0
store i8* %41, i8** %43
store i32 1, i32* %10
br label %44
44: ; preds = %72, %26
%45 = load i32, i32* %10
%46 = load i32, i32* %4
%47 = sub nsw i32 %46, 1
%48 = icmp slt i32 %45, %47
br i1 %48, label %49, label %75
49: ; preds = %44
%50 = load i8**, i8*** %5
%51 = load i32, i32* %10
%52 = add nsw i32 %51, 2
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8*, i8** %50, i64 %53
%55 = load i8*, i8** %54
%56 = icmp ne i8* %55, null
br i1 %56, label %57, label %65
57: ; preds = %49
%58 = load i8**, i8*** %5
%59 = load i32, i32* %10
%60 = add nsw i32 %59, 2
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8*, i8** %58, i64 %61
%63 = load i8*, i8** %62
%64 = call i8* @strdup(i8* %63)
br label %66
65: ; preds = %49
br label %66
66: ; preds = %65, %57
%67 = phi i8* [ %64, %57 ], [ null, %65 ]
%68 = load i8**, i8*** %12
%69 = load i32, i32* %10
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8*, i8** %68, i64 %70
store i8* %67, i8** %71
br label %72
72: ; preds = %66
%73 = load i32, i32* %10
%74 = add nsw i32 %73, 1
store i32 %74, i32* %10
br label %44
75: ; preds = %44
%76 = load i32, i32* @AF_UNSPEC
%77 = load i32, i32* @SOCK_STREAM
%78 = call i32 @socket(i32 %76, i32 %77, i32 0)
store i32 %78, i32* %8
%79 = load i32, i32* %8
%80 = icmp sgt i32 %79, 0
%81 = zext i1 %80 to i32
%82 = call i32 @assert(i32 %81)
%83 = bitcast %struct.addrinfo* %13 to %struct.sockaddr_storage*
%84 = call i32 @memset(%struct.sockaddr_storage* %83, i32 0, i32 32)
%85 = load i32, i32* @AF_UNSPEC
%86 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %13, i32 0, i32 5
store i32 %85, i32* %86
%87 = load i32, i32* @SOCK_STREAM
%88 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %13, i32 0, i32 4
store i32 %87, i32* %88
%89 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %13, i32 0, i32 3
store i64 0, i64* %89
%90 = load i32, i32* @AI_PASSIVE
%91 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %13, i32 0, i32 2
store i32 %90, i32* %91
%92 = load i8*, i8** %7
%93 = bitcast %struct.addrinfo* %13 to %struct.sockaddr_storage*
%94 = bitcast %struct.addrinfo** %14 to %struct.sockaddr_storage**
%95 = call i32 @getaddrinfo(i32* null, i8* %92, %struct.sockaddr_storage* %93, %struct.sockaddr_storage** %94)
store i32 %95, i32* %6
%96 = load i32, i32* %6
%97 = icmp eq i32 %96, 0
%98 = zext i1 %97 to i32
%99 = call i32 @assert(i32 %98)
%100 = load i32, i32* %8
%101 = load %struct.addrinfo*, %struct.addrinfo** %14
%102 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %101, i32 0, i32 1
%103 = load i32, i32* %102
%104 = load %struct.addrinfo*, %struct.addrinfo** %14
%105 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %104, i32 0, i32 0
%106 = load i32, i32* %105
%107 = call i32 @bind(i32 %100, i32 %103, i32 %106)
store i32 %107, i32* %6
%108 = load i32, i32* %6
%109 = icmp eq i32 %108, 0
%110 = zext i1 %109 to i32
%111 = call i32 @assert(i32 %110)
%112 = load i32, i32* %8
%113 = call i32 @listen(i32 %112, i32 1)
store i32 %113, i32* %6
%114 = load i32, i32* %6
%115 = icmp eq i32 %114, 0
%116 = zext i1 %115 to i32
%117 = call i32 @assert(i32 %116)
store i32 32, i32* %16
%118 = load i32, i32* %16
%119 = call i32 @memset(%struct.sockaddr_storage* %15, i32 0, i32 %118)
%120 = load i32, i32* %8
%121 = bitcast %struct.sockaddr_storage* %15 to %struct.sockaddr*
%122 = call i32 @accept(i32 %120, %struct.sockaddr* %121, i32* %16)
store i32 %122, i32* %9
%123 = load i32, i32* %9
%124 = icmp sgt i32 %123, 0
%125 = zext i1 %124 to i32
%126 = call i32 @assert(i32 %125)
%127 = load i32, i32* %9
%128 = call i32 @dup2(i32 %127, i32 0)
%129 = load i32, i32* %9
%130 = call i32 @dup2(i32 %129, i32 1)
%131 = load i32, i32* %9
%132 = call i32 @dup2(i32 %131, i32 2)
%133 = load i32, i32* %9
%134 = call i32 @close(i32 %133)
%135 = load i8*, i8** %11
%136 = load i8**, i8*** %12
%137 = call i32 @execvp(i8* %135, i8** %136)
%138 = call i32 @assert(i32 0)
%139 = load i32, i32* %3
ret i32 %139
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i32, i32, i64, i32, i32 }
%struct.sockaddr_storage = type { i32, i32, i32, i64, i32, i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [41 x i8] c"usage: %s portno command [arg0 .. argn]\0A\00"
@AF_UNSPEC = global i32 0
@SOCK_STREAM = global i32 0
@AI_PASSIVE = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.addrinfo
%4 = alloca %struct.addrinfo*
%5 = alloca %struct.sockaddr_storage
%6 = alloca i32
%7 = bitcast %struct.addrinfo* %3 to i8*
%8 = bitcast %struct.addrinfo** %4 to i8*
%9 = bitcast %struct.sockaddr_storage* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = icmp slt i32 %0, 3
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %1
%15 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8*, i8** %1, i64 2
%21 = load i8*, i8** %20
%22 = add nsw i32 %0, -1
%23 = shl i32 %22, 3
%24 = tail call i64 @malloc(i32 %23)
%25 = inttoptr i64 %24 to i8**
%26 = tail call i8* @strdup(i8* %21)
store i8* %26, i8** %25
%27 = zext i32 %22 to i64
br label %28
28: ; preds = %17, %36
%29 = phi i64 [ 1, %17 ], [ %39, %36 ]
%30 = add nuw nsw i64 %29, 2
%31 = getelementptr inbounds i8*, i8** %1, i64 %30
%32 = load i8*, i8** %31
%33 = icmp eq i8* %32, null
br i1 %33, label %36, label %34
34: ; preds = %28
%35 = tail call i8* @strdup(i8* %32)
br label %36
36: ; preds = %28, %34
%37 = phi i8* [ %35, %34 ], [ null, %28 ]
%38 = getelementptr inbounds i8*, i8** %25, i64 %29
store i8* %37, i8** %38
%39 = add nuw nsw i64 %29, 1
%40 = icmp eq i64 %39, %27
br i1 %40, label %41, label %28
41: ; preds = %36
%42 = load i32, i32* @AF_UNSPEC
%43 = load i32, i32* @SOCK_STREAM
%44 = tail call i32 @socket(i32 %42, i32 %43, i32 0)
%45 = icmp sgt i32 %44, 0
%46 = zext i1 %45 to i32
%47 = tail call i32 @assert(i32 %46)
%48 = bitcast %struct.addrinfo* %3 to %struct.sockaddr_storage*
%49 = call i32 @memset(%struct.sockaddr_storage* %48, i32 0, i32 32)
%50 = load i32, i32* @AF_UNSPEC
%51 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 5
store i32 %50, i32* %51
%52 = load i32, i32* @SOCK_STREAM
%53 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 4
store i32 %52, i32* %53
%54 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 3
store i64 0, i64* %54
%55 = load i32, i32* @AI_PASSIVE
%56 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 2
store i32 %55, i32* %56
%57 = bitcast %struct.addrinfo** %4 to %struct.sockaddr_storage**
%58 = call i32 @getaddrinfo(i32* null, i8* %19, %struct.sockaddr_storage* %48, %struct.sockaddr_storage** %57)
%59 = icmp eq i32 %58, 0
%60 = zext i1 %59 to i32
%61 = call i32 @assert(i32 %60)
%62 = load %struct.addrinfo*, %struct.addrinfo** %4
%63 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %62, i64 0, i32 1
%64 = load i32, i32* %63
%65 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %62, i64 0, i32 0
%66 = load i32, i32* %65
%67 = call i32 @bind(i32 %44, i32 %64, i32 %66)
%68 = icmp eq i32 %67, 0
%69 = zext i1 %68 to i32
%70 = call i32 @assert(i32 %69)
%71 = call i32 @listen(i32 %44, i32 1)
%72 = icmp eq i32 %71, 0
%73 = zext i1 %72 to i32
%74 = call i32 @assert(i32 %73)
store i32 32, i32* %6
%75 = call i32 @memset(%struct.sockaddr_storage* %5, i32 0, i32 32)
%76 = bitcast %struct.sockaddr_storage* %5 to %struct.sockaddr*
%77 = call i32 @accept(i32 %44, %struct.sockaddr* %76, i32* %6)
%78 = icmp sgt i32 %77, 0
%79 = zext i1 %78 to i32
%80 = call i32 @assert(i32 %79)
%81 = call i32 @dup2(i32 %77, i32 0)
%82 = call i32 @dup2(i32 %77, i32 1)
%83 = call i32 @dup2(i32 %77, i32 2)
%84 = call i32 @close(i32 %77)
%85 = call i32 @execvp(i8* %21, i8** %25)
%86 = call i32 @assert(i32 0)
ret i32 0
}