#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*/ sprintf(char *, char *, char *);
scalar_t__ unlink(char *);
int HashTable_removeFiles(char *filename) {
  int success = 0;
  char meta_fn[1024];
  sprintf(meta_fn, "%s_meta", filename);
  success += unlink(meta_fn);
  char state_fn[1024];
  sprintf(state_fn, "%s_state", filename);
  success += unlink(state_fn);
  char array_fn[1024];
  sprintf(array_fn, "%s_array", filename);
  success += unlink(array_fn);
  return success;
}


x86 assembly (clang, -O0):
<HashTable_removeFiles>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeb8(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <unlink@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x810(%rbp),%rdi
call   1030 <unlink@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
lea    -0xc10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe69(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xc10(%rbp),%rdi
call   1030 <unlink@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xc10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashTable_removeFiles>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xc08,%rsp
mov    %rdi,%r12
lea    0xec8(%rip),%rsi
lea    0x800(%rsp),%r14
mov    %r14,%rdi
mov    %r12,%rdx
call   1040 <sprintf@plt>
mov    %r14,%rdi
call   1030 <unlink@plt>
mov    %rax,%r14
lea    0xeab(%rip),%rsi
lea    0x400(%rsp),%r15
mov    %r15,%rdi
mov    %r12,%rdx
call   1040 <sprintf@plt>
mov    %r15,%rdi
call   1030 <unlink@plt>
mov    %rax,%rbx
add    %r14d,%ebx
lea    0xe8c(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %r12,%rdx
call   1040 <sprintf@plt>
mov    %r14,%rdi
call   1030 <unlink@plt>
add    %ebx,%eax
add    $0xc08,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s_meta\00"
@.str.1 = [9 x i8] c"%s_state\00"
@.str.2 = [9 x i8] c"%s_array\00"
define i32 @HashTable_removeFiles(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [1024 x i8]
%5 = alloca [1024 x i8]
%6 = alloca [1024 x i8]
store i8* %0, i8** %2
store i32 0, i32* %3
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%8 = load i8*, i8** %2
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%11 = call i64 @unlink(i8* %10)
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = add nsw i64 %13, %11
%15 = trunc i64 %14 to i32
store i32 %15, i32* %3
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%17 = load i8*, i8** %2
%18 = call i32 @sprintf(i8* %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%20 = call i64 @unlink(i8* %19)
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = add nsw i64 %22, %20
%24 = trunc i64 %23 to i32
store i32 %24, i32* %3
%25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%26 = load i8*, i8** %2
%27 = call i32 @sprintf(i8* %25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %26)
%28 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%29 = call i64 @unlink(i8* %28)
%30 = load i32, i32* %3
%31 = sext i32 %30 to i64
%32 = add nsw i64 %31, %29
%33 = trunc i64 %32 to i32
store i32 %33, i32* %3
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s_meta\00"
@.str.1 = [9 x i8] c"%s_state\00"
@.str.2 = [9 x i8] c"%s_array\00"
define i32 @HashTable_removeFiles(i8* %0) {
%2 = alloca [1024 x i8]
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = call i64 @unlink(i8* %5)
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%9 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%10 = call i64 @unlink(i8* %8)
%11 = add i64 %10, %7
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%13 = call i32 @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%14 = call i64 @unlink(i8* %12)
%15 = add i64 %11, %14
%16 = trunc i64 %15 to i32
ret i32 %16
}