#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 EXIT_SUCCESS;
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putenv(char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("Usage: sslack path_to_slack [arguments]\n");
    return EXIT_SUCCESS;
  }
  putenv("DYLD_FORCE_FLAT_NAMESPACE=1");
  putenv("DYLD_INSERT_LIBRARIES=libsslack.dylib");
  execvp(argv[1], &argv[1]);
  perror("sslack can't load process....");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    117d <main+0x3d>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11c2 <main+0x82>
lea    0xea5(%rip),%rdi
call   1040 <putenv@plt>
lea    0xeb5(%rip),%rdi
call   1040 <putenv@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1060 <execvp@plt>
lea    0xeba(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e23(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jg     115d <main+0x1d>
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret
mov    %rsi,%rbx
lea    0xe99(%rip),%rdi
call   1040 <putenv@plt>
lea    0xea9(%rip),%rdi
call   1040 <putenv@plt>
mov    0x8(%rbx),%rdi
add    $0x8,%rbx
mov    %rbx,%rsi
call   1060 <execvp@plt>
lea    0xeb3(%rip),%rdi
call   1050 <perror@plt>
jmp    1152 <main+0x12>

LLVM IR (-O0):
@.str = [41 x i8] c"Usage: sslack path_to_slack [arguments]\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.1 = [28 x i8] c"DYLD_FORCE_FLAT_NAMESPACE=1\00"
@.str.2 = [38 x i8] c"DYLD_INSERT_LIBRARIES=libsslack.dylib\00"
@.str.3 = [30 x i8] c"sslack can't load process....\00"
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 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_SUCCESS
store i32 %10, i32* %3
br label %22
11: ; preds = %2
%12 = call i32 @putenv(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @putenv(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = call i32 @execvp(i8* %16, i8** %18)
%20 = call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%21 = load i32, i32* @EXIT_SUCCESS
store i32 %21, i32* %3
br label %22
22: ; preds = %11, %8
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@.str.1 = [28 x i8] c"DYLD_FORCE_FLAT_NAMESPACE=1\00"
@.str.2 = [38 x i8] c"DYLD_INSERT_LIBRARIES=libsslack.dylib\00"
@.str.3 = [30 x i8] c"sslack can't load process....\00"
@str = [40 x i8] c"Usage: sslack path_to_slack [arguments]\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
br label %13
6: ; preds = %2
%7 = tail call i32 @putenv(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @putenv(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @execvp(i8* %10, i8** %9)
%12 = tail call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
br label %13
13: ; preds = %6, %4
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}