int main(int argc, char *argv[]) {
  int monitorProcessPID = atoi(argv[1]);
  char procPIDPath[1026];
  sprintf(procPIDPath, "%s%d%s", "/proc/", monitorProcessPID, "/");
  printf("\n Processing PID=%d at Path=%s", monitorProcessPID, procPIDPath);
  int profile_ret = startProfile(monitorProcessPID, procPIDPath);
  return profile_ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x14(%rbp),%ecx
lea    0xe84(%rip),%rsi
lea    0xe84(%rip),%rdx
lea    0xe82(%rip),%r8
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    -0x14(%rbp),%esi
lea    -0x420(%rbp),%rdx
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0x420(%rbp),%rsi
mov    $0x0,%al
call   1040 <startProfile@plt>
mov    %eax,-0x424(%rbp)
mov    -0x424(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    0x8(%rsi),%rdi
xor    %eax,%eax
call   1050 <atoi@plt>
mov    %eax,%ebx
lea    0xea2(%rip),%rsi
lea    0xea2(%rip),%rdx
lea    0xea0(%rip),%r8
mov    %rsp,%r14
mov    %r14,%rdi
mov    %eax,%ecx
xor    %eax,%eax
call   1060 <sprintf@plt>
lea    0xe8c(%rip),%rdi
mov    %ebx,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <startProfile@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s%d%s\00"
@.str.1 = [7 x i8] c"/proc/\00"
@.str.2 = [2 x i8] c"/\00"
@.str.3 = [31 x i8] c"\0A Processing PID=%d at Path=%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [1026 x i8]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %11)
store i32 %12, i32* %6
%13 = getelementptr inbounds [1026 x i8], [1026 x i8]* %7, i64 0, i64 0
%14 = load i32, i32* %6
%15 = call i32 (i8*, i8*, ...) @sprintf(i8* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%16 = load i32, i32* %6
%17 = getelementptr inbounds [1026 x i8], [1026 x i8]* %7, i64 0, i64 0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %16, i8* %17)
%19 = load i32, i32* %6
%20 = getelementptr inbounds [1026 x i8], [1026 x i8]* %7, i64 0, i64 0
%21 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @startProfile to i32 (i32, i8*, ...)*)(i32 %19, i8* %20)
store i32 %21, i32* %8
%22 = load i32, i32* %8
ret i32 %22
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s%d%s\00"
@.str.1 = [7 x i8] c"/proc/\00"
@.str.2 = [2 x i8] c"/\00"
@.str.3 = [31 x i8] c"\0A Processing PID=%d at Path=%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1026 x i8]
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %5)
%7 = getelementptr inbounds [1026 x i8], [1026 x i8]* %3, i64 0, i64 0
%8 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %6, i8* %7)
%10 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @startProfile to i32 (i32, i8*, ...)*)(i32 %6, i8* %7)
ret i32 %10
}