#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ s_addr;
};
struct sockaddr_in {
  TYPE_1__ 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*/ PF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ bzero(char **, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int /*<<< orphan*/ execv(char *, char **);
int /*<<< orphan*/ exit(int);
scalar_t__ geteuid();
scalar_t__ getuid();
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ perror(char *);
scalar_t__ seteuid(scalar_t__);
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main(int argc, char **argv) {
  int sock;
  if (0 > (sock = socket(PF_INET, SOCK_DGRAM, 0))) {
    perror("Cannot create socket");
    exit(1);
  }
  int optval = 1;
  if (0 !=
      setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval))) {
    perror("Cannot set socket to SO_REUSEADDR");
    exit(1);
  }
  struct sockaddr_in addr;
  addr.sin_family = AF_INET;
  addr.sin_port = htons(514);
  addr.sin_addr.s_addr = 0;
  if (0 != bind(sock, (struct sockaddr *)&addr, sizeof(addr))) {
    perror("Cannot bind socket to port");
    exit(1);
  }
  if (getuid() != geteuid()) {
    if (0 != seteuid(getuid())) {
      perror("Cannot drop priviledges");
      exit(1);
    }
  }
  if (sock != 3) {
    dup2(sock, 3);
    close(sock);
  }
  char *last_slash = argv[0];
  char *scan = argv[0];
  while (*scan) {
    if ((*scan) == '/')
      last_slash = scan + 1;
    scan++;
  }
  char newpath[512];
  bzero(&newpath, 512);
  int len_to_copy = last_slash - argv[0];
  if (len_to_copy >= 512)
    exit(1);
  memcpy(newpath, argv[0], len_to_copy);
  strncpy(newpath + len_to_copy, "mkeventd", 511 - len_to_copy);
  execv(newpath, argv);
  perror("Cannot execute mkeventd");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x250,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2db8(%rip),%rax
mov    (%rax),%edi
mov    0x2dbf(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
mov    %eax,%ecx
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
jle    1247 <main+0x57>
lea    0xdc8(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2d90(%rip),%rax
mov    (%rax),%esi
mov    0x2d5f(%rip),%rax
mov    (%rax),%edx
lea    -0x18(%rbp),%rcx
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1296 <main+0xa6>
lea    0xd8e(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    0x2d43(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x202,%edi
call   1060 <htons@plt>
mov    %eax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0x10,%edx
call   10b0 <bind@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     12ec <main+0xfc>
lea    0xd5a(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    $0x0,%al
call   1050 <getuid@plt>
mov    %rax,-0x250(%rbp)
mov    $0x0,%al
call   1080 <geteuid@plt>
mov    %rax,%rcx
mov    -0x250(%rbp),%rax
cmp    %rcx,%rax
je     134c <main+0x15c>
mov    $0x0,%al
call   1050 <getuid@plt>
mov    %rax,%rdi
call   1110 <seteuid@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1347 <main+0x157>
lea    0xd1a(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
jmp    134c <main+0x15c>
cmpl   $0x3,-0x14(%rbp)
je     136b <main+0x17b>
mov    -0x14(%rbp),%edi
mov    $0x3,%esi
call   1070 <dup2@plt>
mov    -0x14(%rbp),%edi
call   1090 <close@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmpb   $0x0,(%rax)
je     13bb <main+0x1cb>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    13aa <main+0x1ba>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1381 <main+0x191>
lea    -0x240(%rbp),%rdi
mov    $0x200,%esi
call   10d0 <bzero@plt>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
sub    %rcx,%rax
mov    %eax,-0x244(%rbp)
cmpl   $0x200,-0x244(%rbp)
jl     13fa <main+0x20a>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    -0x240(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x244(%rbp),%edx
call   10a0 <memcpy@plt>
lea    -0x240(%rbp),%rdi
movslq -0x244(%rbp),%rax
add    %rax,%rdi
mov    $0x1ff,%edx
sub    -0x244(%rbp),%edx
lea    0xc43(%rip),%rsi
call   1030 <strncpy@plt>
lea    -0x240(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10f0 <execv@plt>
lea    0xc18(%rip),%rdi
call   10c0 <perror@plt>
mov    -0x4(%rbp),%eax
add    $0x250,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x228,%rsp
mov    %rsi,%r14
mov    0x2dc1(%rip),%rax
mov    (%rax),%edi
mov    0x2dc8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
test   %eax,%eax
js     1375 <main+0x185>
mov    %eax,%ebp
movl   $0x1,0xc(%rsp)
mov    0x2db6(%rip),%rax
mov    (%rax),%esi
mov    0x2d85(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rcx
mov    %ebp,%edi
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
test   %rax,%rax
jne    137e <main+0x18e>
mov    0x2d81(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x1c(%rsp)
mov    $0x202,%edi
call   1060 <htons@plt>
mov    %eax,0x18(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x10(%rsp),%rsi
mov    %ebp,%edi
mov    $0x10,%edx
call   10b0 <bind@plt>
test   %rax,%rax
jne    1387 <main+0x197>
xor    %eax,%eax
call   1050 <getuid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1080 <geteuid@plt>
cmp    %rax,%rbx
je     12c4 <main+0xd4>
xor    %eax,%eax
call   1050 <getuid@plt>
mov    %rax,%rdi
call   1110 <seteuid@plt>
test   %rax,%rax
jne    139a <main+0x1aa>
cmp    $0x3,%ebp
je     12dc <main+0xec>
mov    %ebp,%edi
mov    $0x3,%esi
call   1070 <dup2@plt>
mov    %ebp,%edi
call   1090 <close@plt>
mov    (%r14),%rbx
lea    0x1(%rbx),%rax
mov    %rbx,%rbp
jmp    12f7 <main+0x107>
nopl   0x0(%rax,%rax,1)
mov    %rax,%rbp
add    $0x1,%rax
movzbl -0x1(%rax),%ecx
cmp    $0x2f,%cl
je     12f0 <main+0x100>
test   %cl,%cl
jne    12f3 <main+0x103>
lea    0x20(%rsp),%rdi
mov    $0x200,%esi
call   10d0 <bzero@plt>
sub    %rbx,%rbp
cmp    $0x200,%ebp
jge    1390 <main+0x1a0>
lea    0x20(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   10a0 <memcpy@plt>
movslq %ebp,%rax
lea    (%rsp,%rax,1),%rdi
add    $0x20,%rdi
mov    $0x1ff,%edx
sub    %ebp,%edx
lea    0xd30(%rip),%rsi
call   1030 <strncpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   10f0 <execv@plt>
lea    0xd0a(%rip),%rdi
call   10c0 <perror@plt>
xor    %eax,%eax
add    $0x228,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc84(%rip),%rdi
jmp    13a1 <main+0x1b1>
lea    0xc90(%rip),%rdi
jmp    13a1 <main+0x1b1>
lea    0xca9(%rip),%rdi
jmp    13a1 <main+0x1b1>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0xcb1(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i64 }
%struct.sockaddr = type { i32 }
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [21 x i8] c"Cannot create socket\00"
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.1 = [34 x i8] c"Cannot set socket to SO_REUSEADDR\00"
@AF_INET = global i32 0
@.str.2 = [27 x i8] c"Cannot bind socket to port\00"
@.str.3 = [24 x i8] c"Cannot drop priviledges\00"
@.str.4 = [9 x i8] c"mkeventd\00"
@.str.5 = [24 x i8] c"Cannot execute mkeventd\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_in
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca [512 x i8]
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* @PF_INET
%14 = load i32, i32* @SOCK_DGRAM
%15 = call i32 @socket(i32 %13, i32 %14, i32 0)
store i32 %15, i32* %6
%16 = icmp sgt i32 0, %15
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %2
store i32 1, i32* %7
%21 = load i32, i32* %6
%22 = load i32, i32* @SOL_SOCKET
%23 = load i32, i32* @SO_REUSEADDR
%24 = call i64 @setsockopt(i32 %21, i32 %22, i32 %23, i32* %7, i32 4)
%25 = icmp ne i64 0, %24
br i1 %25, label %26, label %29
26: ; preds = %20
%27 = call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %20
%30 = load i32, i32* @AF_INET
%31 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 2
store i32 %30, i32* %31
%32 = call i32 @htons(i32 514)
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 1
store i32 %32, i32* %33
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 0
%35 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %34, i32 0, i32 0
store i64 0, i64* %35
%36 = load i32, i32* %6
%37 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%38 = call i64 @bind(i32 %36, %struct.sockaddr* %37, i32 16)
%39 = icmp ne i64 0, %38
br i1 %39, label %40, label %43
40: ; preds = %29
%41 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%42 = call i32 @exit(i32 1)
unreachable
43: ; preds = %29
%44 = call i64 (...) @getuid()
%45 = call i64 (...) @geteuid()
%46 = icmp ne i64 %44, %45
br i1 %46, label %47, label %55
47: ; preds = %43
%48 = call i64 (...) @getuid()
%49 = call i64 @seteuid(i64 %48)
%50 = icmp ne i64 0, %49
br i1 %50, label %51, label %54
51: ; preds = %47
%52 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%53 = call i32 @exit(i32 1)
unreachable
54: ; preds = %47
br label %55
55: ; preds = %54, %43
%56 = load i32, i32* %6
%57 = icmp ne i32 %56, 3
br i1 %57, label %58, label %63
58: ; preds = %55
%59 = load i32, i32* %6
%60 = call i32 @dup2(i32 %59, i32 3)
%61 = load i32, i32* %6
%62 = call i32 @close(i32 %61)
br label %63
63: ; preds = %58, %55
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 0
%66 = load i8*, i8** %65
store i8* %66, i8** %9
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 0
%69 = load i8*, i8** %68
store i8* %69, i8** %10
br label %70
70: ; preds = %82, %63
%71 = load i8*, i8** %10
%72 = load i8, i8* %71
%73 = icmp ne i8 %72, 0
br i1 %73, label %74, label %85
74: ; preds = %70
%75 = load i8*, i8** %10
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = icmp eq i32 %77, 47
br i1 %78, label %79, label %82
79: ; preds = %74
%80 = load i8*, i8** %10
%81 = getelementptr inbounds i8, i8* %80, i64 1
store i8* %81, i8** %9
br label %82
82: ; preds = %79, %74
%83 = load i8*, i8** %10
%84 = getelementptr inbounds i8, i8* %83, i32 1
store i8* %84, i8** %10
br label %70
85: ; preds = %70
%86 = bitcast [512 x i8]* %11 to i8**
%87 = call i32 @bzero(i8** %86, i32 512)
%88 = load i8*, i8** %9
%89 = load i8**, i8*** %5
%90 = getelementptr inbounds i8*, i8** %89, i64 0
%91 = load i8*, i8** %90
%92 = ptrtoint i8* %88 to i64
%93 = ptrtoint i8* %91 to i64
%94 = sub i64 %92, %93
%95 = trunc i64 %94 to i32
store i32 %95, i32* %12
%96 = load i32, i32* %12
%97 = icmp sge i32 %96, 512
br i1 %97, label %98, label %100
98: ; preds = %85
%99 = call i32 @exit(i32 1)
unreachable
100: ; preds = %85
%101 = getelementptr inbounds [512 x i8], [512 x i8]* %11, i64 0, i64 0
%102 = load i8**, i8*** %5
%103 = getelementptr inbounds i8*, i8** %102, i64 0
%104 = load i8*, i8** %103
%105 = load i32, i32* %12
%106 = call i32 @memcpy(i8* %101, i8* %104, i32 %105)
%107 = getelementptr inbounds [512 x i8], [512 x i8]* %11, i64 0, i64 0
%108 = load i32, i32* %12
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8, i8* %107, i64 %109
%111 = load i32, i32* %12
%112 = sub nsw i32 511, %111
%113 = call i32 @strncpy(i8* %110, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %112)
%114 = getelementptr inbounds [512 x i8], [512 x i8]* %11, i64 0, i64 0
%115 = load i8**, i8*** %5
%116 = call i32 @execv(i8* %114, i8** %115)
%117 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%118 = load i32, i32* %3
ret i32 %118
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i64 }
%struct.sockaddr = type { i32 }
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [21 x i8] c"Cannot create socket\00"
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.1 = [34 x i8] c"Cannot set socket to SO_REUSEADDR\00"
@AF_INET = global i32 0
@.str.2 = [27 x i8] c"Cannot bind socket to port\00"
@.str.3 = [24 x i8] c"Cannot drop priviledges\00"
@.str.4 = [9 x i8] c"mkeventd\00"
@.str.5 = [24 x i8] c"Cannot execute mkeventd\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca [512 x i8]
%6 = load i32, i32* @PF_INET
%7 = load i32, i32* @SOCK_DGRAM
%8 = tail call i32 @socket(i32 %6, i32 %7, i32 0)
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%15 = load i32, i32* @SOL_SOCKET
%16 = load i32, i32* @SO_REUSEADDR
%17 = call i64 @setsockopt(i32 %8, i32 %15, i32 %16, i32* %3, i32 4)
%18 = icmp eq i64 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %13
%20 = call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %13
%23 = bitcast %struct.sockaddr_in* %4 to i8*
%24 = load i32, i32* @AF_INET
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 2
store i32 %24, i32* %25
%26 = call i32 @htons(i32 514)
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1
store i32 %26, i32* %27
%28 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0, i32 0
store i64 0, i64* %28
%29 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%30 = call i64 @bind(i32 %8, %struct.sockaddr* %29, i32 16)
%31 = icmp eq i64 %30, 0
br i1 %31, label %35, label %32
32: ; preds = %22
%33 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%34 = call i32 @exit(i32 1)
unreachable
35: ; preds = %22
%36 = call i64 (...) @getuid()
%37 = call i64 (...) @geteuid()
%38 = icmp eq i64 %36, %37
br i1 %38, label %46, label %39
39: ; preds = %35
%40 = call i64 (...) @getuid()
%41 = call i64 @seteuid(i64 %40)
%42 = icmp eq i64 %41, 0
br i1 %42, label %46, label %43
43: ; preds = %39
%44 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%45 = call i32 @exit(i32 1)
unreachable
46: ; preds = %39, %35
%47 = icmp eq i32 %8, 3
br i1 %47, label %51, label %48
48: ; preds = %46
%49 = call i32 @dup2(i32 %8, i32 3)
%50 = call i32 @close(i32 %8)
br label %51
51: ; preds = %48, %46
%52 = load i8*, i8** %1
br label %53
53: ; preds = %59, %51
%54 = phi i8* [ %52, %51 ], [ %61, %59 ]
%55 = phi i8* [ %52, %51 ], [ %60, %59 ]
%56 = load i8, i8* %54
switch i8 %56, label %59 [
i8 0, label %62
i8 47, label %57
]
57: ; preds = %53
%58 = getelementptr inbounds i8, i8* %54, i64 1
br label %59
59: ; preds = %53, %57
%60 = phi i8* [ %58, %57 ], [ %55, %53 ]
%61 = getelementptr inbounds i8, i8* %54, i64 1
br label %53
62: ; preds = %53
%63 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%64 = bitcast [512 x i8]* %5 to i8**
%65 = call i32 @bzero(i8** %64, i32 512)
%66 = ptrtoint i8* %55 to i64
%67 = ptrtoint i8* %52 to i64
%68 = sub i64 %66, %67
%69 = trunc i64 %68 to i32
%70 = icmp sgt i32 %69, 511
br i1 %70, label %71, label %73
71: ; preds = %62
%72 = call i32 @exit(i32 1)
unreachable
73: ; preds = %62
%74 = call i32 @memcpy(i8* %63, i8* %52, i32 %69)
%75 = shl i64 %68, 32
%76 = ashr exact i64 %75, 32
%77 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 %76
%78 = sub nsw i32 511, %69
%79 = call i32 @strncpy(i8* %77, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %78)
%80 = call i32 @execv(i8* %63, i8** %1)
%81 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}