#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*/ SOS_Message(char *);
int TDB_AddEntry(char *, char *, char *, char *);
int /*<<< orphan*/ TDB_Load(char *);
int /*<<< orphan*/ TDB_Write(char *);
int main(int argc, char *argv[]) {
  TDB_Load("/tmp/textures.tdb");
  if (TDB_AddEntry("sim", "/bla/bla.arr", "/bla/bla2/bla3.tga", "bla test") ==
      (1))
    SOS_Message("entry exists\n");
  TDB_Write("/tmp/textures.tdb");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1060 <TDB_Load@plt>
lea    0xea9(%rip),%rdi
lea    0xea6(%rip),%rsi
lea    0xeac(%rip),%rdx
lea    0xeb8(%rip),%rcx
call   1040 <TDB_AddEntry@plt>
cmp    $0x1,%eax
jne    1198 <main+0x58>
lea    0xeac(%rip),%rdi
call   1030 <SOS_Message@plt>
lea    0xe61(%rip),%rdi
call   1050 <TDB_Write@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1060 <TDB_Load@plt>
lea    0xebe(%rip),%rdi
lea    0xebb(%rip),%rsi
lea    0xec1(%rip),%rdx
lea    0xecd(%rip),%rcx
call   1040 <TDB_AddEntry@plt>
cmp    $0x1,%eax
jne    117f <main+0x3f>
lea    0xec5(%rip),%rdi
call   1030 <SOS_Message@plt>
lea    0xe7a(%rip),%rdi
call   1050 <TDB_Write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/tmp/textures.tdb\00"
@.str.1 = [4 x i8] c"sim\00"
@.str.2 = [13 x i8] c"/bla/bla.arr\00"
@.str.3 = [19 x i8] c"/bla/bla2/bla3.tga\00"
@.str.4 = [9 x i8] c"bla test\00"
@.str.5 = [14 x i8] c"entry exists\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @TDB_Load(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @TDB_AddEntry(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @SOS_Message(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = call i32 @TDB_Write(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [18 x i8] c"/tmp/textures.tdb\00"
@.str.1 = [4 x i8] c"sim\00"
@.str.2 = [13 x i8] c"/bla/bla.arr\00"
@.str.3 = [19 x i8] c"/bla/bla2/bla3.tga\00"
@.str.4 = [9 x i8] c"bla test\00"
@.str.5 = [14 x i8] c"entry exists\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @TDB_Load(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @TDB_AddEntry(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @SOS_Message(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
%9 = tail call i32 @TDB_Write(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}