#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*/ get_storage_path(char *);
int snprintf(char *, int, char *, char *, char const *);
int /*<<< orphan*/ unlink(char *);
void remove_persistent_storage(const char *tag) {
  char buf[1024];
  char path[1024];
  get_storage_path(buf);
  if (snprintf(path, 1024, "%s_%s", buf, tag) >= 1024)
    path[1024 - 1] = '\0';
  unlink(path);
}


x86 assembly (clang, -O0):
<remove_persistent_storage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
call   1040 <get_storage_path@plt>
lea    -0x810(%rbp),%rdi
lea    -0x410(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    $0x400,%esi
lea    0xe97(%rip),%rdx
call   1050 <snprintf@plt>
cmp    $0x400,%eax
jl     1180 <remove_persistent_storage+0x50>
movb   $0x0,-0x411(%rbp)
lea    -0x810(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_persistent_storage>:
push   %r14
push   %rbx
sub    $0x808,%rsp
mov    %rdi,%rbx
lea    0x400(%rsp),%r14
mov    %r14,%rdi
call   1040 <get_storage_path@plt>
lea    0xeac(%rip),%rdx
mov    %rsp,%rdi
mov    $0x400,%esi
mov    %r14,%rcx
mov    %rbx,%r8
call   1050 <snprintf@plt>
cmp    $0x400,%eax
jl     1176 <remove_persistent_storage+0x46>
movb   $0x0,0x3ff(%rsp)
mov    %rsp,%rdi
call   1030 <unlink@plt>
add    $0x808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s_%s\00"
define void @remove_persistent_storage(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
store i8* %0, i8** %2
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = call i32 @get_storage_path(i8* %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%9 = load i8*, i8** %2
%10 = call i32 @snprintf(i8* %7, i32 1024, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = icmp sge i32 %10, 1024
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 1023
store i8 0, i8* %13
br label %14
14: ; preds = %12, %1
%15 = getelementptr inbounds [1024 x i8], [1024 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"
define void @remove_persistent_storage(i8* %0) {
%2 = alloca [1024 x i8]
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = call i32 @get_storage_path(i8* %4)
%7 = call i32 @snprintf(i8* %5, i32 1024, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %0)
%8 = icmp sgt i32 %7, 1023
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 1023
store i8 0, i8* %10
br label %11
11: ; preds = %9, %1
%12 = call i32 @unlink(i8* %5)
ret void
}