#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 *concat(char *, char *);
int /*<<< orphan*/ free(char *);
char *getenv(char *);
int /*<<< orphan*/ unlink(char *);
void destroy_storage() {
  char *home = getenv("HOME");
  char *exp_p = concat(home, "/.expense.trkr");
  char *inc_p = concat(home, "/.income.trkr");
  char *cat_p = concat(home, "/.category.trkr");
  unlink(exp_p);
  unlink(inc_p);
  unlink(cat_p);
  free(exp_p);
  free(inc_p);
  free(cat_p);
}


x86 assembly (clang, -O0):
<destroy_storage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1060 <concat@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1060 <concat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1060 <concat@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <unlink@plt>
mov    -0x18(%rbp),%rdi
call   1050 <unlink@plt>
mov    -0x20(%rbp),%rdi
call   1050 <unlink@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_storage>:
push   %r15
push   %r14
push   %rbx
lea    0xeb4(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
lea    0xeaa(%rip),%rsi
mov    %rax,%rdi
call   1060 <concat@plt>
mov    %rax,%r14
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
call   1060 <concat@plt>
mov    %rax,%r15
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1060 <concat@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1050 <unlink@plt>
mov    %r15,%rdi
call   1050 <unlink@plt>
mov    %rbx,%rdi
call   1050 <unlink@plt>
mov    %r14,%rdi
call   1040 <free@plt>
mov    %r15,%rdi
call   1040 <free@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <free@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [15 x i8] c"/.expense.trkr\00"
@.str.2 = [14 x i8] c"/.income.trkr\00"
@.str.3 = [16 x i8] c"/.category.trkr\00"
define void @destroy_storage() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i8* @concat(i8* %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %2
%8 = load i8*, i8** %1
%9 = call i8* @concat(i8* %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
store i8* %9, i8** %3
%10 = load i8*, i8** %1
%11 = call i8* @concat(i8* %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
store i8* %11, i8** %4
%12 = load i8*, i8** %2
%13 = call i32 @unlink(i8* %12)
%14 = load i8*, i8** %3
%15 = call i32 @unlink(i8* %14)
%16 = load i8*, i8** %4
%17 = call i32 @unlink(i8* %16)
%18 = load i8*, i8** %2
%19 = call i32 @free(i8* %18)
%20 = load i8*, i8** %3
%21 = call i32 @free(i8* %20)
%22 = load i8*, i8** %4
%23 = call i32 @free(i8* %22)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [15 x i8] c"/.expense.trkr\00"
@.str.2 = [14 x i8] c"/.income.trkr\00"
@.str.3 = [16 x i8] c"/.category.trkr\00"
define void @destroy_storage() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @concat(i8* %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i8* @concat(i8* %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i8* @concat(i8* %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @unlink(i8* %2)
%6 = tail call i32 @unlink(i8* %3)
%7 = tail call i32 @unlink(i8* %4)
%8 = tail call i32 @free(i8* %2)
%9 = tail call i32 @free(i8* %3)
%10 = tail call i32 @free(i8* %4)
ret void
}