#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 */
typedef int /*<<< orphan*/ ldd_file;
typedef int /*<<< orphan*/ exe_file;

/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *);
void remove_exe_info_files() {
  char *workdir, *jobid, ldd_file[1024], exe_file[1024];
  char f1[] = "executable_file_info.txt";
  char f2[] = "executable_ldd_info.txt";
  workdir = getenv("TMPDIR");
  jobid = getenv("PBS_JOBID");
  snprintf(exe_file, sizeof(exe_file), "%s/%s_%s", workdir, jobid, f1);
  snprintf(ldd_file, sizeof(ldd_file), "%s/%s_%s", workdir, jobid, f2);
  remove(exe_file);
  remove(ldd_file);
}


x86 assembly (clang, -O0):
<remove_exe_info_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x850,%rsp
mov    0xebe(%rip),%rax
mov    %rax,-0x830(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0x828(%rbp)
mov    0xeb2(%rip),%rax
mov    %rax,-0x820(%rbp)
mov    0xead(%rip),%al
mov    %al,-0x818(%rbp)
mov    0xea8(%rip),%rax
mov    %rax,-0x850(%rbp)
mov    0xea2(%rip),%rax
mov    %rax,-0x848(%rbp)
mov    0xe9c(%rip),%rax
mov    %rax,-0x840(%rbp)
lea    0xe96(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
lea    0xe8d(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    -0x830(%rbp),%r9
mov    $0x400,%esi
lea    0xe6c(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    -0x850(%rbp),%r9
mov    $0x400,%esi
lea    0xe45(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x810(%rbp),%rdi
call   1040 <remove@plt>
lea    -0x410(%rbp),%rdi
call   1040 <remove@plt>
add    $0x850,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_exe_info_files>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x840,%rsp
movups 0xec2(%rip),%xmm0
movups %xmm0,0x29(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x7478742e6f666e,%rax
mov    %rax,0x10(%rsp)
lea    0xebf(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%r14
lea    0xeb7(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
lea    0xeb2(%rip),%r15
lea    0x40(%rsp),%r12
lea    0x20(%rsp),%r9
mov    %r12,%rdi
mov    $0x400,%esi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %rax,%r8
call   1050 <snprintf@plt>
lea    0x440(%rsp),%r13
mov    %rsp,%r9
mov    %r13,%rdi
mov    $0x400,%esi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %rbx,%r8
call   1050 <snprintf@plt>
mov    %r12,%rdi
call   1040 <remove@plt>
mov    %r13,%rdi
call   1040 <remove@plt>
add    $0x840,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.remove_exe_info_files.f1 = [25 x i8] c"executable_file_info.txt\00"
@__const.remove_exe_info_files.f2 = [24 x i8] c"executable_ldd_info.txt\00"
@.str = [7 x i8] c"TMPDIR\00"
@.str.1 = [10 x i8] c"PBS_JOBID\00"
@.str.2 = [9 x i8] c"%s/%s_%s\00"
define void @remove_exe_info_files() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = alloca [25 x i8]
%6 = alloca [24 x i8]
%7 = bitcast [25 x i8]* %5 to i8*
%8 = bitcast [24 x i8]* %6 to i8*
%9 = call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* %9, i8** %1
%10 = call i8* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
store i8* %10, i8** %2
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%12 = load i8*, i8** %1
%13 = load i8*, i8** %2
%14 = getelementptr inbounds [25 x i8], [25 x i8]* %5, i64 0, i64 0
%15 = call i32 @snprintf(i8* %11, i32 1024, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %12, i8* %13, i8* %14)
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%17 = load i8*, i8** %1
%18 = load i8*, i8** %2
%19 = getelementptr inbounds [24 x i8], [24 x i8]* %6, i64 0, i64 0
%20 = call i32 @snprintf(i8* %16, i32 1024, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %17, i8* %18, i8* %19)
%21 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%22 = call i32 @remove(i8* %21)
%23 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%24 = call i32 @remove(i8* %23)
ret void
}

LLVM IR (-O2):
@__const.remove_exe_info_files.f1 = [25 x i8] c"executable_file_info.txt\00"
@__const.remove_exe_info_files.f2 = [24 x i8] c"executable_ldd_info.txt\00"
@.str = [7 x i8] c"TMPDIR\00"
@.str.1 = [10 x i8] c"PBS_JOBID\00"
@.str.2 = [9 x i8] c"%s/%s_%s\00"
define void @remove_exe_info_files() {
%1 = alloca [1024 x i8]
%2 = alloca [1024 x i8]
%3 = alloca [25 x i8]
%4 = alloca [24 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [24 x i8], [24 x i8]* %4, i64 0, i64 0
%9 = tail call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = tail call i8* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @snprintf(i8* %6, i32 1024, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %9, i8* %10, i8* %7)
%12 = call i32 @snprintf(i8* %5, i32 1024, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %9, i8* %10, i8* %8)
%13 = call i32 @remove(i8* %6)
%14 = call i32 @remove(i8* %5)
ret void
}