#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*/ testFree(char *);
char *testMallocPrintf(char *, char const *);
int /*<<< orphan*/ unlink(char const *);
void testDeleteLsmdb(const char *zFile) {
  char *zLog = testMallocPrintf("%s-log", zFile);
  char *zShm = testMallocPrintf("%s-shm", zFile);
  unlink(zFile);
  unlink(zLog);
  unlink(zShm);
  testFree(zLog);
  testFree(zShm);
}


x86 assembly (clang, -O0):
<testDeleteLsmdb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <testMallocPrintf@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <testMallocPrintf@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x18(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x10(%rbp),%rdi
call   1050 <testFree@plt>
mov    -0x18(%rbp),%rdi
call   1050 <testFree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testDeleteLsmdb>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <testMallocPrintf@plt>
mov    %rax,%r14
lea    0xeb6(%rip),%rdi
mov    %rbx,%rsi
call   1040 <testMallocPrintf@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1030 <unlink@plt>
mov    %r14,%rdi
call   1030 <unlink@plt>
mov    %r15,%rdi
call   1030 <unlink@plt>
mov    %r14,%rdi
call   1050 <testFree@plt>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <testFree@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s-log\00"
@.str.1 = [7 x i8] c"%s-shm\00"
define void @testDeleteLsmdb(i8* %0) {
%2 = tail call i8* @testMallocPrintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i8* @testMallocPrintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @unlink(i8* %0)
%5 = tail call i32 @unlink(i8* %2)
%6 = tail call i32 @unlink(i8* %3)
%7 = tail call i32 @testFree(i8* %2)
%8 = tail call i32 @testFree(i8* %3)
ret void
}