#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_in {
  int /*<<< orphan*/ sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ optval;
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int atoi(char *);
scalar_t__ bind(int, struct sockaddr *, int);
scalar_t__ dup2(int, int);
scalar_t__ execvp(char *, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ htons(int);
scalar_t__ inet_aton(char *, int /*<<< orphan*/ *);
scalar_t__ listen(int, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ print_usage(int /*<<< orphan*/);
scalar_t__ setgid(int);
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
scalar_t__ setuid(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc < 7) {
    print_usage(stderr);
    exit(2);
  }
  char *host = argv[1];
  int port = atoi(argv[2]);
  int fd = atoi(argv[3]);
  int uid = atoi(argv[4]);
  int gid = atoi(argv[5]);
  char **cmd = &argv[6];
  int ofd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
  if (ofd < 0) {
    perror("Error creating socket");
    exit(1);
  }
  int optval = 1;
  if (setsockopt(ofd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) < 0) {
    perror("Can't reuse");
    exit(1);
  }
  struct sockaddr_in addr;
  addr.sin_family = AF_INET;
  addr.sin_port = htons(port);
  if (inet_aton(host, &addr.sin_addr) < 0) {
    perror("Bad address");
    exit(1);
  }
  if (bind(ofd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
    perror("Can't bind");
    exit(1);
  }
  if (listen(ofd, 128 << 10) < 0) {
    perror("Can't listen");
    exit(1);
  }
  if (setgid(gid) < 0) {
    perror("Can't set gid");
    exit(1);
  }
  if (setuid(uid) < 0) {
    perror("Can't set uid");
    exit(1);
  }
  if (dup2(ofd, fd) < 0) {
    perror("Cant' dup");
    exit(1);
  }
  if (execvp(cmd[0], cmd) < 0) {
    perror("Can't exec");
    exit(127);
  }
  perror("Something wrong");
  exit(127);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x7,-0x8(%rbp)
jge    1218 <main+0x38>
mov    0x2dc1(%rip),%rax
mov    (%rax),%edi
call   10e0 <print_usage@plt>
mov    $0x2,%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
add    $0x30,%rax
mov    %rax,-0x30(%rbp)
mov    0x2d69(%rip),%rax
mov    (%rax),%edi
mov    0x2d40(%rip),%rax
mov    (%rax),%esi
mov    0x2d4f(%rip),%rax
mov    (%rax),%edx
call   1100 <socket@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    12b3 <main+0xd3>
lea    0xd5c(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
movl   $0x1,-0x38(%rbp)
mov    -0x34(%rbp),%edi
mov    0x2d24(%rip),%rax
mov    (%rax),%esi
mov    0x2ceb(%rip),%rax
mov    (%rax),%edx
lea    -0x38(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0x0,%rax
jge    12fe <main+0x11e>
lea    0xd27(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    0x2cdb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <htons@plt>
mov    %eax,-0x44(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   1060 <inet_aton@plt>
cmp    $0x0,%rax
jge    1342 <main+0x162>
lea    0xcef(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x34(%rbp),%edi
lea    -0x48(%rbp),%rsi
mov    $0xc,%edx
call   1080 <bind@plt>
cmp    $0x0,%rax
jge    1373 <main+0x193>
lea    0xcca(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x34(%rbp),%edi
mov    $0x20000,%esi
call   1070 <listen@plt>
cmp    $0x0,%rax
jge    13a0 <main+0x1c0>
lea    0xca8(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x28(%rbp),%edi
call   1090 <setgid@plt>
cmp    $0x0,%rax
jge    13c8 <main+0x1e8>
lea    0xc8d(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x24(%rbp),%edi
call   10f0 <setuid@plt>
cmp    $0x0,%rax
jge    13f0 <main+0x210>
lea    0xc73(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x34(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1050 <dup2@plt>
cmp    $0x0,%rax
jge    141b <main+0x23b>
lea    0xc56(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
mov    -0x30(%rbp),%rsi
call   10b0 <execvp@plt>
cmp    $0x0,%rax
jge    144b <main+0x26b>
lea    0xc30(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x7f,%edi
call   10d0 <exit@plt>
lea    0xc25(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x7f,%edi
call   10d0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
cmp    $0x6,%edi
jg     120b <main+0x2b>
mov    0x2dce(%rip),%rax
mov    (%rax),%edi
call   10e0 <print_usage@plt>
mov    $0x2,%edi
call   10d0 <exit@plt>
mov    %rsi,%rbx
mov    0x8(%rsi),%r13
mov    0x10(%rsi),%rdi
call   10c0 <atoi@plt>
mov    %eax,%r14d
mov    0x18(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,0xc(%rsp)
mov    0x20(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,0x10(%rsp)
mov    0x28(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,%r12d
mov    0x2d95(%rip),%r15
mov    (%r15),%edi
mov    0x2d6b(%rip),%rax
mov    (%rax),%esi
mov    0x2d7a(%rip),%rax
mov    (%rax),%edx
call   1100 <socket@plt>
test   %eax,%eax
jns    1275 <main+0x95>
lea    0xd90(%rip),%rdi
jmp    135f <main+0x17f>
mov    %eax,%ebp
movl   $0x1,0x14(%rsp)
mov    0x2d62(%rip),%rax
mov    (%rax),%esi
mov    0x2d29(%rip),%rax
mov    (%rax),%edx
lea    0x14(%rsp),%rcx
mov    %ebp,%edi
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
test   %rax,%rax
jns    12b4 <main+0xd4>
lea    0xd67(%rip),%rdi
jmp    135f <main+0x17f>
mov    (%r15),%eax
mov    %eax,0x20(%rsp)
mov    %r14d,%edi
call   1040 <htons@plt>
mov    %eax,0x1c(%rsp)
lea    0x18(%rsp),%rsi
mov    %r13,%rdi
call   1060 <inet_aton@plt>
test   %rax,%rax
jns    12e2 <main+0x102>
lea    0xd42(%rip),%rdi
jmp    135f <main+0x17f>
lea    0x18(%rsp),%rsi
mov    %ebp,%edi
mov    $0xc,%edx
call   1080 <bind@plt>
test   %rax,%rax
jns    1301 <main+0x121>
lea    0xd2f(%rip),%rdi
jmp    135f <main+0x17f>
mov    %ebp,%edi
mov    $0x20000,%esi
call   1070 <listen@plt>
test   %rax,%rax
jns    131b <main+0x13b>
lea    0xd20(%rip),%rdi
jmp    135f <main+0x17f>
mov    %r12d,%edi
call   1090 <setgid@plt>
test   %rax,%rax
jns    1331 <main+0x151>
lea    0xd17(%rip),%rdi
jmp    135f <main+0x17f>
mov    0x10(%rsp),%edi
call   10f0 <setuid@plt>
test   %rax,%rax
jns    1348 <main+0x168>
lea    0xd0e(%rip),%rdi
jmp    135f <main+0x17f>
mov    %ebp,%edi
mov    0xc(%rsp),%esi
call   1050 <dup2@plt>
test   %rax,%rax
jns    136e <main+0x18e>
lea    0xd03(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
add    $0x30,%rbx
mov    (%rbx),%rdi
mov    %rbx,%rsi
call   10b0 <execvp@plt>
test   %rax,%rax
jns    138b <main+0x1ab>
lea    0xce3(%rip),%rdi
jmp    1392 <main+0x1b2>
lea    0xce5(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x7f,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [22 x i8] c"Error creating socket\00"
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.1 = [12 x i8] c"Can't reuse\00"
@.str.2 = [12 x i8] c"Bad address\00"
@.str.3 = [11 x i8] c"Can't bind\00"
@.str.4 = [13 x i8] c"Can't listen\00"
@.str.5 = [14 x i8] c"Can't set gid\00"
@.str.6 = [14 x i8] c"Can't set uid\00"
@.str.7 = [10 x i8] c"Cant' dup\00"
@.str.8 = [11 x i8] c"Can't exec\00"
@.str.9 = [16 x i8] c"Something wrong\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 i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8**
%12 = alloca i32
%13 = alloca i32
%14 = alloca %struct.sockaddr_in
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 7
br i1 %16, label %17, label %21
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = call i32 @print_usage(i32 %18)
%20 = call i32 @exit(i32 2)
unreachable
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
store i8* %24, i8** %6
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = call i32 @atoi(i8* %27)
store i32 %28, i32* %7
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 3
%31 = load i8*, i8** %30
%32 = call i32 @atoi(i8* %31)
store i32 %32, i32* %8
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 4
%35 = load i8*, i8** %34
%36 = call i32 @atoi(i8* %35)
store i32 %36, i32* %9
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 5
%39 = load i8*, i8** %38
%40 = call i32 @atoi(i8* %39)
store i32 %40, i32* %10
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 6
store i8** %42, i8*** %11
%43 = load i32, i32* @AF_INET
%44 = load i32, i32* @SOCK_STREAM
%45 = load i32, i32* @IPPROTO_TCP
%46 = call i32 @socket(i32 %43, i32 %44, i32 %45)
store i32 %46, i32* %12
%47 = load i32, i32* %12
%48 = icmp slt i32 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %21
%50 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%51 = call i32 @exit(i32 1)
unreachable
52: ; preds = %21
store i32 1, i32* %13
%53 = load i32, i32* %12
%54 = load i32, i32* @SOL_SOCKET
%55 = load i32, i32* @SO_REUSEADDR
%56 = call i64 @setsockopt(i32 %53, i32 %54, i32 %55, i32* %13, i32 4)
%57 = icmp slt i64 %56, 0
br i1 %57, label %58, label %61
58: ; preds = %52
%59 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%60 = call i32 @exit(i32 1)
unreachable
61: ; preds = %52
%62 = load i32, i32* @AF_INET
%63 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %14, i32 0, i32 2
store i32 %62, i32* %63
%64 = load i32, i32* %7
%65 = call i32 @htons(i32 %64)
%66 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %14, i32 0, i32 1
store i32 %65, i32* %66
%67 = load i8*, i8** %6
%68 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %14, i32 0, i32 0
%69 = call i64 @inet_aton(i8* %67, i32* %68)
%70 = icmp slt i64 %69, 0
br i1 %70, label %71, label %74
71: ; preds = %61
%72 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%73 = call i32 @exit(i32 1)
unreachable
74: ; preds = %61
%75 = load i32, i32* %12
%76 = bitcast %struct.sockaddr_in* %14 to %struct.sockaddr*
%77 = call i64 @bind(i32 %75, %struct.sockaddr* %76, i32 12)
%78 = icmp slt i64 %77, 0
br i1 %78, label %79, label %82
79: ; preds = %74
%80 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%81 = call i32 @exit(i32 1)
unreachable
82: ; preds = %74
%83 = load i32, i32* %12
%84 = call i64 @listen(i32 %83, i32 131072)
%85 = icmp slt i64 %84, 0
br i1 %85, label %86, label %89
86: ; preds = %82
%87 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%88 = call i32 @exit(i32 1)
unreachable
89: ; preds = %82
%90 = load i32, i32* %10
%91 = call i64 @setgid(i32 %90)
%92 = icmp slt i64 %91, 0
br i1 %92, label %93, label %96
93: ; preds = %89
%94 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%95 = call i32 @exit(i32 1)
unreachable
96: ; preds = %89
%97 = load i32, i32* %9
%98 = call i64 @setuid(i32 %97)
%99 = icmp slt i64 %98, 0
br i1 %99, label %100, label %103
100: ; preds = %96
%101 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%102 = call i32 @exit(i32 1)
unreachable
103: ; preds = %96
%104 = load i32, i32* %12
%105 = load i32, i32* %8
%106 = call i64 @dup2(i32 %104, i32 %105)
%107 = icmp slt i64 %106, 0
br i1 %107, label %108, label %111
108: ; preds = %103
%109 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%110 = call i32 @exit(i32 1)
unreachable
111: ; preds = %103
%112 = load i8**, i8*** %11
%113 = getelementptr inbounds i8*, i8** %112, i64 0
%114 = load i8*, i8** %113
%115 = load i8**, i8*** %11
%116 = call i64 @execvp(i8* %114, i8** %115)
%117 = icmp slt i64 %116, 0
br i1 %117, label %118, label %121
118: ; preds = %111
%119 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%120 = call i32 @exit(i32 127)
unreachable
121: ; preds = %111
%122 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%123 = call i32 @exit(i32 127)
unreachable
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [22 x i8] c"Error creating socket\00"
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.1 = [12 x i8] c"Can't reuse\00"
@.str.2 = [12 x i8] c"Bad address\00"
@.str.3 = [11 x i8] c"Can't bind\00"
@.str.4 = [13 x i8] c"Can't listen\00"
@.str.5 = [14 x i8] c"Can't set gid\00"
@.str.6 = [14 x i8] c"Can't set uid\00"
@.str.7 = [10 x i8] c"Cant' dup\00"
@.str.8 = [11 x i8] c"Can't exec\00"
@.str.9 = [16 x i8] c"Something wrong\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = icmp slt i32 %0, 7
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @print_usage(i32 %7)
%9 = tail call i32 @exit(i32 2)
unreachable
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = tail call i32 @atoi(i8* %14)
%16 = getelementptr inbounds i8*, i8** %1, i64 3
%17 = load i8*, i8** %16
%18 = tail call i32 @atoi(i8* %17)
%19 = getelementptr inbounds i8*, i8** %1, i64 4
%20 = load i8*, i8** %19
%21 = tail call i32 @atoi(i8* %20)
%22 = getelementptr inbounds i8*, i8** %1, i64 5
%23 = load i8*, i8** %22
%24 = tail call i32 @atoi(i8* %23)
%25 = getelementptr inbounds i8*, i8** %1, i64 6
%26 = load i32, i32* @AF_INET
%27 = load i32, i32* @SOCK_STREAM
%28 = load i32, i32* @IPPROTO_TCP
%29 = tail call i32 @socket(i32 %26, i32 %27, i32 %28)
%30 = icmp slt i32 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %10
%32 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%33 = tail call i32 @exit(i32 1)
unreachable
34: ; preds = %10
%35 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%36 = load i32, i32* @SOL_SOCKET
%37 = load i32, i32* @SO_REUSEADDR
%38 = call i64 @setsockopt(i32 %29, i32 %36, i32 %37, i32* %3, i32 4)
%39 = icmp slt i64 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %34
%41 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%42 = call i32 @exit(i32 1)
unreachable
43: ; preds = %34
%44 = bitcast %struct.sockaddr_in* %4 to i8*
%45 = load i32, i32* @AF_INET
%46 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 2
store i32 %45, i32* %46
%47 = call i32 @htons(i32 %15)
%48 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1
store i32 %47, i32* %48
%49 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
%50 = call i64 @inet_aton(i8* %12, i32* %49)
%51 = icmp slt i64 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %43
%53 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%54 = call i32 @exit(i32 1)
unreachable
55: ; preds = %43
%56 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%57 = call i64 @bind(i32 %29, %struct.sockaddr* %56, i32 12)
%58 = icmp slt i64 %57, 0
br i1 %58, label %59, label %62
59: ; preds = %55
%60 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%61 = call i32 @exit(i32 1)
unreachable
62: ; preds = %55
%63 = call i64 @listen(i32 %29, i32 131072)
%64 = icmp slt i64 %63, 0
br i1 %64, label %65, label %68
65: ; preds = %62
%66 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%67 = call i32 @exit(i32 1)
unreachable
68: ; preds = %62
%69 = call i64 @setgid(i32 %24)
%70 = icmp slt i64 %69, 0
br i1 %70, label %71, label %74
71: ; preds = %68
%72 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%73 = call i32 @exit(i32 1)
unreachable
74: ; preds = %68
%75 = call i64 @setuid(i32 %21)
%76 = icmp slt i64 %75, 0
br i1 %76, label %77, label %80
77: ; preds = %74
%78 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%79 = call i32 @exit(i32 1)
unreachable
80: ; preds = %74
%81 = call i64 @dup2(i32 %29, i32 %18)
%82 = icmp slt i64 %81, 0
br i1 %82, label %83, label %86
83: ; preds = %80
%84 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%85 = call i32 @exit(i32 1)
unreachable
86: ; preds = %80
%87 = load i8*, i8** %25
%88 = call i64 @execvp(i8* %87, i8** %25)
%89 = icmp slt i64 %88, 0
br i1 %89, label %90, label %93
90: ; preds = %86
%91 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%92 = call i32 @exit(i32 127)
unreachable
93: ; preds = %86
%94 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%95 = call i32 @exit(i32 127)
unreachable
}