#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 */

/* Variables and functions */
int /*<<< orphan*/ errno;
int execv(char *, char **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ setenv(char *, char *, int);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  setenv("IacmpDir", "/pub/ia/sys/shell/iacmp", 1);
  setenv("LD_LIBRARY_PATH", "/pub/ia/sys/shell/iacmp/lib", 1);
  if (execv("/pub/ia/sys/shell/iacmp/iacmp", argv) == -1) {
    fprintf(stderr, "%s: pb execv : %s\n", argv[0], strerror(errno));
    return (1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
lea    0xea5(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
lea    0xeac(%rip),%rdi
lea    0xeb5(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1060 <execv@plt>
cmp    $0xffffffff,%eax
jne    11e6 <main+0xa6>
mov    0x2e3a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e1b(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xe96(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11ed <main+0xad>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
lea    0xeb3(%rip),%rdi
lea    0xeb5(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
lea    0xebc(%rip),%rdi
lea    0xec5(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
call   1060 <execv@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
jne    11c1 <main+0x81>
mov    0x2e4b(%rip),%rax
mov    (%rax),%ebp
mov    (%rbx),%rbx
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xebc(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"IacmpDir\00"
@.str.1 = [24 x i8] c"/pub/ia/sys/shell/iacmp\00"
@.str.2 = [16 x i8] c"LD_LIBRARY_PATH\00"
@.str.3 = [28 x i8] c"/pub/ia/sys/shell/iacmp/lib\00"
@.str.4 = [30 x i8] c"/pub/ia/sys/shell/iacmp/iacmp\00"
@stderr = global i32 0
@.str.5 = [19 x i8] c"%s: pb execv : %s\0A\00"
@errno = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @setenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 1)
%7 = call i32 @setenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 1)
%8 = load i8**, i8*** %5
%9 = call i32 @execv(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8** %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = load i32, i32* @errno
%17 = call i8* @strerror(i32 %16)
%18 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* %15, i8* %17)
store i32 1, i32* %3
br label %20
19: ; preds = %2
store i32 0, i32* %3
br label %20
20: ; preds = %19, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [9 x i8] c"IacmpDir\00"
@.str.1 = [24 x i8] c"/pub/ia/sys/shell/iacmp\00"
@.str.2 = [16 x i8] c"LD_LIBRARY_PATH\00"
@.str.3 = [28 x i8] c"/pub/ia/sys/shell/iacmp/lib\00"
@.str.4 = [30 x i8] c"/pub/ia/sys/shell/iacmp/iacmp\00"
@stderr = global i32 0
@.str.5 = [19 x i8] c"%s: pb execv : %s\0A\00"
@errno = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @setenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 1)
%4 = tail call i32 @setenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 1)
%5 = tail call i32 @execv(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8** %1)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %1
%10 = load i32, i32* @errno
%11 = tail call i8* @strerror(i32 %10)
%12 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* %9, i8* %11)
br label %13
13: ; preds = %2, %7
%14 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %14
}