#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 */
char *get_work_dir();
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char const *);
int /*<<< orphan*/ unlink(char *);
void rm_workfile(const char *filename) {
  char file_path[4096];
  char summ_path[4096];
  snprintf(file_path, 4096, "%s/%s", get_work_dir(), filename);
  snprintf(summ_path, 4096, "%s/%s-summary", get_work_dir(), filename);
  unlink(file_path);
  unlink(summ_path);
}


x86 assembly (clang, -O0):
<rm_workfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2020,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x1010(%rbp),%rax
mov    %rax,-0x2020(%rbp)
mov    $0x0,%al
call   1050 <get_work_dir@plt>
mov    -0x2020(%rbp),%rdi
mov    %rax,%rcx
mov    -0x8(%rbp),%r8
mov    $0x1000,%esi
lea    0xe92(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x2010(%rbp),%rax
mov    %rax,-0x2018(%rbp)
mov    $0x0,%al
call   1050 <get_work_dir@plt>
mov    -0x2018(%rbp),%rdi
mov    %rax,%rcx
mov    -0x8(%rbp),%r8
mov    $0x1000,%esi
lea    0xe64(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x1010(%rbp),%rdi
call   1030 <unlink@plt>
lea    -0x2010(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x2020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rm_workfile>:
push   %r15
push   %r14
push   %rbx
sub    $0x2000,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <get_work_dir@plt>
lea    0xeb3(%rip),%rdx
lea    0x1000(%rsp),%r14
mov    %r14,%rdi
mov    $0x1000,%esi
mov    %rax,%rcx
mov    %rbx,%r8
call   1040 <snprintf@plt>
xor    %eax,%eax
call   1050 <get_work_dir@plt>
lea    0xe90(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x1000,%esi
mov    %rax,%rcx
mov    %rbx,%r8
call   1040 <snprintf@plt>
mov    %r14,%rdi
call   1030 <unlink@plt>
mov    %r15,%rdi
call   1030 <unlink@plt>
add    $0x2000,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [14 x i8] c"%s/%s-summary\00"
define void @rm_workfile(i8* %0) {
%2 = alloca i8*
%3 = alloca [4096 x i8]
%4 = alloca [4096 x i8]
store i8* %0, i8** %2
%5 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%6 = call i8* (...) @get_work_dir()
%7 = load i8*, i8** %2
%8 = call i32 @snprintf(i8* %5, i32 4096, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%10 = call i8* (...) @get_work_dir()
%11 = load i8*, i8** %2
%12 = call i32 @snprintf(i8* %9, i32 4096, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %10, i8* %11)
%13 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%14 = call i32 @unlink(i8* %13)
%15 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%16 = call i32 @unlink(i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [14 x i8] c"%s/%s-summary\00"
define void @rm_workfile(i8* %0) {
%2 = alloca [4096 x i8]
%3 = alloca [4096 x i8]
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%6 = tail call i8* (...) @get_work_dir()
%7 = call i32 @snprintf(i8* %4, i32 4096, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %0)
%8 = call i8* (...) @get_work_dir()
%9 = call i32 @snprintf(i8* %5, i32 4096, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %0)
%10 = call i32 @unlink(i8* %4)
%11 = call i32 @unlink(i8* %5)
ret void
}