xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ trap_Cmd_RemoveCommand(char *);
void CG_ScreenShutdown(void) {
  trap_Cmd_RemoveCommand("gamemenu");
  trap_Cmd_RemoveCommand("sizeup");
  trap_Cmd_RemoveCommand("sizedown");
  trap_Cmd_RemoveCommand("help_hud");
}


x86 assembly (clang, -O0):
<CG_ScreenShutdown>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <trap_Cmd_RemoveCommand@plt>
lea    0xee2(%rip),%rdi
call   1030 <trap_Cmd_RemoveCommand@plt>
lea    0xedd(%rip),%rdi
call   1030 <trap_Cmd_RemoveCommand@plt>
lea    0xeda(%rip),%rdi
call   1030 <trap_Cmd_RemoveCommand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_ScreenShutdown>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <trap_Cmd_RemoveCommand@plt>
lea    0xee5(%rip),%rdi
call   1030 <trap_Cmd_RemoveCommand@plt>
lea    0xee0(%rip),%rdi
call   1030 <trap_Cmd_RemoveCommand@plt>
lea    0xedd(%rip),%rdi
pop    %rax
jmp    1030 <trap_Cmd_RemoveCommand@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"gamemenu\00"
@.str.1 = [7 x i8] c"sizeup\00"
@.str.2 = [9 x i8] c"sizedown\00"
@.str.3 = [9 x i8] c"help_hud\00"
define void @CG_ScreenShutdown() {
%1 = call i32 @trap_Cmd_RemoveCommand(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @trap_Cmd_RemoveCommand(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @trap_Cmd_RemoveCommand(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @trap_Cmd_RemoveCommand(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"gamemenu\00"
@.str.1 = [7 x i8] c"sizeup\00"
@.str.2 = [9 x i8] c"sizedown\00"
@.str.3 = [9 x i8] c"help_hud\00"
define void @CG_ScreenShutdown() {
%1 = tail call i32 @trap_Cmd_RemoveCommand(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @trap_Cmd_RemoveCommand(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @trap_Cmd_RemoveCommand(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @trap_Cmd_RemoveCommand(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void task_consumer(int n, int buf[n]) {
  for (int i = 0; i < n; ++i)
    assert(buf[i] == i);
}


x86 assembly (clang, -O0):
<task_consumer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115b <task_consumer+0x4b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <task_consumer+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<task_consumer>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    114b <task_consumer+0x3b>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%eax
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
call   1030 <assert@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <task_consumer+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @task_consumer(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
store i32 0, i32* %5
br label %8
8: ; preds = %22, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %25
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32, i32* %5
%19 = icmp eq i32 %17, %18
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
br label %22
22: ; preds = %12
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %8
25: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @task_consumer(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %15, %7 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = zext i32 %10 to i64
%12 = icmp eq i64 %8, %11
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
%15 = add nuw nsw i64 %8, 1
%16 = icmp eq i64 %15, %5
br i1 %16, label %6, label %7
}
/* Type definitions */
struct BuffList {
  int dummy;
};
struct Buff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BuffList_Apply_Speed(struct BuffList *, int,
                                        int /*<<< orphan*/);
void ZhuiYingQuan_Buff_Stop(struct Buff *self, struct BuffList *list) {
  BuffList_Apply_Speed(list, -100, 0);
}


x86 assembly (clang, -O0):
<ZhuiYingQuan_Buff_Stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xffffff9c,%esi
xor    %edx,%edx
call   1030 <BuffList_Apply_Speed@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZhuiYingQuan_Buff_Stop>:
mov    %rsi,%rdi
mov    $0xffffff9c,%esi
xor    %edx,%edx
jmp    1030 <BuffList_Apply_Speed@plt>

LLVM IR (-O0):
%struct.Buff = type { i32 }
%struct.BuffList = type { i32 }
define void @ZhuiYingQuan_Buff_Stop(%struct.Buff* %0, %struct.BuffList* %1) {
%3 = alloca %struct.Buff*
%4 = alloca %struct.BuffList*
store %struct.Buff* %0, %struct.Buff** %3
store %struct.BuffList* %1, %struct.BuffList** %4
%5 = load %struct.BuffList*, %struct.BuffList** %4
%6 = call i32 @BuffList_Apply_Speed(%struct.BuffList* %5, i32 -100, i32 0)
ret void
}

LLVM IR (-O2):
%struct.Buff = type { i32 }
%struct.BuffList = type { i32 }
define void @ZhuiYingQuan_Buff_Stop(%struct.Buff* nocapture readnone %0, %struct.BuffList* %1) {
%3 = tail call i32 @BuffList_Apply_Speed(%struct.BuffList* %1, i32 -100, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  char *firstLine = "It was the best of times.\n";
  char *secondLine = "It was the worst of times.\n";
  printf(firstLine);
  printf(secondLine);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xee3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"It was the best of times.\0A\00"
@.str.1 = [28 x i8] c"It was the worst of times.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8** %7
%8 = load i8*, i8** %6
%9 = call i32 @printf(i8* %8)
%10 = load i8*, i8** %7
%11 = call i32 @printf(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"It was the best of times.\00"
@str.2 = [27 x i8] c"It was the worst of times.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char const *weak_l1();
const char *call_weak_l1(void) { return weak_l1() + 1; }


x86 assembly (clang, -O0):
<call_weak_l1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <weak_l1@plt>
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_weak_l1>:
push   %rax
xor    %eax,%eax
call   1030 <weak_l1@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @call_weak_l1() {
%1 = call i8* (...) @weak_l1()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}

LLVM IR (-O2):
define i8* @call_weak_l1() {
%1 = tail call i8* (...) @weak_l1()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}
int f(void) { return 5; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @f() {
ret i32 5
}

LLVM IR (-O2):
define i32 @f() {
ret i32 5
}
void reboot(void) {}


x86 assembly (clang, -O0):
<reboot>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reboot>:
ret

LLVM IR (-O0):
define void @reboot() {
ret void
}

LLVM IR (-O2):
define void @reboot() {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int trust;
};
typedef TYPE_1__ X509_TRUST;

/* Variables and functions */
int tr_cmp(const X509_TRUST *const *a, const X509_TRUST *const *b) {
  return (*a)->trust - (*b)->trust;
}


x86 assembly (clang, -O0):
<tr_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tr_cmp>:
mov    (%rdi),%rax
mov    (%rax),%eax
mov    (%rsi),%rcx
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32 }
define i32 @tr_cmp(%struct.TYPE_4__** %0, %struct.TYPE_4__** %1) {
%3 = alloca %struct.TYPE_4__**
%4 = alloca %struct.TYPE_4__**
store %struct.TYPE_4__** %0, %struct.TYPE_4__*** %3
store %struct.TYPE_4__** %1, %struct.TYPE_4__*** %4
%5 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %3
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %4
%10 = load %struct.TYPE_4__*, %struct.TYPE_4__** %9
%11 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32 }
define i32 @tr_cmp(%struct.TYPE_4__** nocapture %0, %struct.TYPE_4__** nocapture %1) {
%3 = load %struct.TYPE_4__*, %struct.TYPE_4__** %0
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %1
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = sub nsw i32 %5, %8
ret i32 %9
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ mode_string(int /*<<< orphan*/, char *);
void filemodestring(struct stat *statp, char *str) {
  mode_string(statp->st_mode, str);
}


x86 assembly (clang, -O0):
<filemodestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <mode_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filemodestring>:
mov    (%rdi),%edi
jmp    1030 <mode_string@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define void @filemodestring(%struct.stat* %0, i8* %1) {
%3 = alloca %struct.stat*
%4 = alloca i8*
store %struct.stat* %0, %struct.stat** %3
store i8* %1, i8** %4
%5 = load %struct.stat*, %struct.stat** %3
%6 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = call i32 @mode_string(i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define void @filemodestring(%struct.stat* nocapture %0, i8* %1) {
%3 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i32 @mode_string(i32 %4, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void printArray(double d[], int size) {
  for (int i = 0; i < size; i++)
    printf("%f\n", d[i]);
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define void @printArray(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @printArray(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Type definitions */
struct pt_regs {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_SETREGS;
scalar_t__ ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
                  struct pt_regs *);
int ptrace_setregs(pid_t pid, struct pt_regs *regs) {
  if (ptrace(PTRACE_SETREGS, pid, NULL, regs) < 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ptrace_setregs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edx
call   1030 <ptrace@plt>
cmp    $0x0,%rax
jge    114e <ptrace_setregs+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <ptrace_setregs+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrace_setregs>:
push   %rax
mov    %rsi,%rcx
mov    %edi,%esi
mov    0x2ecb(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
call   1030 <ptrace@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pt_regs = type { i32 }
@PTRACE_SETREGS = global i32 0
define i32 @ptrace_setregs(i32 %0, %struct.pt_regs* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.pt_regs*
store i32 %0, i32* %4
store %struct.pt_regs* %1, %struct.pt_regs** %5
%6 = load i32, i32* @PTRACE_SETREGS
%7 = load i32, i32* %4
%8 = load %struct.pt_regs*, %struct.pt_regs** %5
%9 = call i64 @ptrace(i32 %6, i32 %7, i32* null, %struct.pt_regs* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.pt_regs = type { i32 }
@PTRACE_SETREGS = global i32 0
define i32 @ptrace_setregs(i32 %0, %struct.pt_regs* %1) {
%3 = load i32, i32* @PTRACE_SETREGS
%4 = tail call i64 @ptrace(i32 %3, i32 %0, i32* null, %struct.pt_regs* %1)
%5 = ashr i64 %4, 63
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Type definitions */
struct imap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _getval(struct imap *, int);
int /*<<< orphan*/ _pushv(struct imap *, int, int /*<<< orphan*/);
void push(struct imap *ci, int arg) { _pushv(ci, arg, _getval(ci, arg)); }


x86 assembly (clang, -O0):
<push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <_getval@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    %eax,%edx
call   1030 <_pushv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<push>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <_getval@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_pushv@plt>

LLVM IR (-O0):
%struct.imap = type { i32 }
define void @push(%struct.imap* %0, i32 %1) {
%3 = alloca %struct.imap*
%4 = alloca i32
store %struct.imap* %0, %struct.imap** %3
store i32 %1, i32* %4
%5 = load %struct.imap*, %struct.imap** %3
%6 = load i32, i32* %4
%7 = load %struct.imap*, %struct.imap** %3
%8 = load i32, i32* %4
%9 = call i32 @_getval(%struct.imap* %7, i32 %8)
%10 = call i32 @_pushv(%struct.imap* %5, i32 %6, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.imap = type { i32 }
define void @push(%struct.imap* %0, i32 %1) {
%3 = tail call i32 @_getval(%struct.imap* %0, i32 %1)
%4 = tail call i32 @_pushv(%struct.imap* %0, i32 %1, i32 %3)
ret void
}
long add(long a, long b) {
  if (b < a)
    return add(b, a);
  if (a == 0)
    return b;
  return add(a - 1, b + 1);
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1144 <add+0x34>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <add@plt>
mov    %rax,-0x8(%rbp)
jmp    1175 <add+0x65>
cmpq   $0x0,-0x10(%rbp)
jne    115c <add+0x4c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <add+0x65>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
call   1030 <add@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
mov    %rsi,%rax
mov    %rdi,%rsi
mov    %rax,%rdi
cmp    %rsi,%rax
jl     1100 <add>
test   %rsi,%rsi
je     1123 <add+0x23>
add    $0xffffffffffffffff,%rsi
add    $0x1,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1100 <add>
ret

LLVM IR (-O0):
define i64 @add(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = load i64, i64* %4
%8 = icmp slt i64 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i64, i64* %5
%11 = load i64, i64* %4
%12 = call i64 @add(i64 %10, i64 %11)
store i64 %12, i64* %3
br label %24
13: ; preds = %2
%14 = load i64, i64* %4
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i64, i64* %5
store i64 %17, i64* %3
br label %24
18: ; preds = %13
%19 = load i64, i64* %4
%20 = sub nsw i64 %19, 1
%21 = load i64, i64* %5
%22 = add nsw i64 %21, 1
%23 = call i64 @add(i64 %20, i64 %22)
store i64 %23, i64* %3
br label %24
24: ; preds = %18, %16, %9
%25 = load i64, i64* %3
ret i64 %25
}

LLVM IR (-O2):
define i64 @add(i64 %0, i64 %1) {
br label %3
3: ; preds = %12, %2
%4 = phi i64 [ %0, %2 ], [ %13, %12 ]
%5 = phi i64 [ %1, %2 ], [ %14, %12 ]
%6 = icmp slt i64 %5, %4
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = icmp eq i64 %4, 0
br i1 %8, label %15, label %9
9: ; preds = %7
%10 = add nsw i64 %4, -1
%11 = add nsw i64 %5, 1
br label %12
12: ; preds = %9, %3
%13 = phi i64 [ %10, %9 ], [ %5, %3 ]
%14 = phi i64 [ %11, %9 ], [ %4, %3 ]
br label %3
15: ; preds = %7
ret i64 %5
}
/* Variables and functions */
int testLibAbs1();
int main() { return 0 + testLibAbs1(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <testLibAbs1@plt>
add    $0x0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
jmp    1030 <testLibAbs1@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @testLibAbs1()
%3 = add nsw i32 0, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testLibAbs1()
ret i32 %1
}
/* Variables and functions */
bool is_whitespace(char ch) { return (ch == ' ' || ch == '\r' || ch == '\n'); }


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_whitespace+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_whitespace+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
mov    $0x1,%eax
cmp    $0xd,%dil
je     1111 <is_whitespace+0x11>
cmp    $0x20,%dil
jne    1112 <is_whitespace+0x12>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_whitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 13
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "Usage: unlink"
                        " [<path> ...\n]");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: unlink [<path> ...\0A]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: unlink [<path> ...\0A]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int error(int, char *);
int /*<<< orphan*/ zaber_renumber();
int cmd_zrenumber(int argc, char *argv[]) {
  if (argc > 1)
    return error((-2), "No arguments for zrenumber!");
  zaber_renumber();
  return 0;
}


x86 assembly (clang, -O0):
<cmd_zrenumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1152 <cmd_zrenumber+0x32>
mov    $0xfffffffe,%edi
lea    0xebb(%rip),%rsi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
jmp    1160 <cmd_zrenumber+0x40>
mov    $0x0,%al
call   1040 <zaber_renumber@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_zrenumber>:
cmp    $0x2,%edi
jl     1136 <cmd_zrenumber+0x16>
lea    0xed4(%rip),%rsi
mov    $0xfffffffe,%edi
jmp    1030 <error@plt>
push   %rax
xor    %eax,%eax
call   1040 <zaber_renumber@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"No arguments for zrenumber!\00"
define i32 @cmd_zrenumber(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @error(i32 -2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 %9, i32* %3
br label %12
10: ; preds = %2
%11 = call i32 (...) @zaber_renumber()
store i32 0, i32* %3
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [28 x i8] c"No arguments for zrenumber!\00"
define i32 @cmd_zrenumber(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @error(i32 -2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %2
%7 = tail call i32 (...) @zaber_renumber()
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ 0, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void note(const char *s, const char *t) {
  fprintf(stderr, "tsort: %s%s\n", s, t);
}


x86 assembly (clang, -O0):
<note>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<note>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"tsort: %s%s\0A\00"
define void @note(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"tsort: %s%s\0A\00"
define void @note(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(void *, int, int, int /*<<< orphan*/ *);
int writeTo(FILE *id, void *ptr, int size) { return fwrite(ptr, 1, size, id); }


x86 assembly (clang, -O0):
<writeTo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeTo>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
define i32 @writeTo(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i32*, i32** %4
%10 = call i32 @fwrite(i8* %7, i32 1, i32 %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @writeTo(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @fwrite(i8* %1, i32 1, i32 %2, i32* %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void testGreater() { printf("%d > %d = %d\n", 10, 4, 10 > 4); }


x86 assembly (clang, -O0):
<testGreater>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testGreater>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d > %d = %d\0A\00"
define void @testGreater() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d > %d = %d\0A\00"
define void @testGreater() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_REQ_INFO;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_REQ_INFO_it;
X509_REQ_INFO *d2i_X509_REQ_INFO(X509_REQ_INFO **a, const unsigned char **in,
                                 long len) {
  return (X509_REQ_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                        &X509_REQ_INFO_it);
}


x86 assembly (clang, -O0):
<d2i_X509_REQ_INFO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2eb1(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_X509_REQ_INFO>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@X509_REQ_INFO_it = global i32 0
define i32* @d2i_X509_REQ_INFO(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @X509_REQ_INFO_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@X509_REQ_INFO_it = global i32 0
define i32* @d2i_X509_REQ_INFO(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @X509_REQ_INFO_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
float psi_to_bar(float value) { return value * 0.0689475729f; }


x86 assembly (clang, -O0):
<psi_to_bar>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<psi_to_bar>:
mulss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @psi_to_bar(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x3FB1A68C60000000
ret float %4
}

LLVM IR (-O2):
define float @psi_to_bar(float %0) {
%2 = fmul float %0, 0x3FB1A68C60000000
ret float %2
}
int do_048() { return 48; }


x86 assembly (clang, -O0):
<do_048>:
push   %rbp
mov    %rsp,%rbp
mov    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_048>:
mov    $0x30,%eax
ret

LLVM IR (-O0):
define i32 @do_048() {
ret i32 48
}

LLVM IR (-O2):
define i32 @do_048() {
ret i32 48
}
int psp_sound_change_video_format(int vertfreq) { return 0; }


x86 assembly (clang, -O0):
<psp_sound_change_video_format>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<psp_sound_change_video_format>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @psp_sound_change_video_format(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @psp_sound_change_video_format(i32 %0) {
ret i32 0
}
void local_mcu_Cpu_targetInit__I() {}


x86 assembly (clang, -O0):
<local_mcu_Cpu_targetInit__I>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_mcu_Cpu_targetInit__I>:
ret

LLVM IR (-O0):
define void @local_mcu_Cpu_targetInit__I() {
ret void
}

LLVM IR (-O2):
define void @local_mcu_Cpu_targetInit__I() {
ret void
}
int pldummy_next() { return 0; }


x86 assembly (clang, -O0):
<pldummy_next>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pldummy_next>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @pldummy_next() {
ret i32 0
}

LLVM IR (-O2):
define i32 @pldummy_next() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ sortCards(char *);
int main() {
  char deck[13];
  scanf("%s", deck);
  sortCards(deck);
  printf("%s\n", deck);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xd(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1040 <scanf@plt>
lea    -0xd(%rbp),%rdi
call   1050 <sortCards@plt>
lea    -0xd(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0x3(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <sortCards@plt>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%5 = call i32 @sortCards(i8* %4)
%6 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @sortCards(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *);
void vuln(char *string) {
  volatile int target;
  char buffer[64];
  target = 0;
  sprintf(buffer, string);
  if (target == 0xdeadbeef) {
    printf("you have hit the target correctly :)\n");
  }
}


x86 assembly (clang, -O0):
<vuln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <sprintf@plt>
mov    -0xc(%rbp),%eax
cmp    $0xdeadbeef,%eax
jne    115a <vuln+0x3a>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vuln>:
sub    $0x58,%rsp
mov    %rdi,%rsi
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdi
call   1040 <sprintf@plt>
mov    0xc(%rsp),%eax
cmp    $0xdeadbeef,%eax
jne    1154 <vuln+0x34>
lea    0xeb5(%rip),%rdi
add    $0x58,%rsp
jmp    1030 <puts@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"you have hit the target correctly :)\0A\00"
define void @vuln(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [64 x i8]
store i8* %0, i8** %2
store volatile i32 0, i32* %3
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @sprintf(i8* %5, i8* %6)
%8 = load volatile i32, i32* %3
%9 = icmp eq i32 %8, -559038737
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"you have hit the target correctly :)\00"
define void @vuln(i8* nocapture %0) {
%2 = alloca i32
%3 = alloca [64 x i8]
%4 = bitcast i32* %2 to i8*
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
store volatile i32 0, i32* %2
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) %0)
%7 = load volatile i32, i32* %2
%8 = icmp eq i32 %7, -559038737
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret void
}
/* Variables and functions */
int Scheme_EndTransaction();
int WSQ_EndTransaction() { return Scheme_EndTransaction(); }


x86 assembly (clang, -O0):
<WSQ_EndTransaction>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Scheme_EndTransaction@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WSQ_EndTransaction>:
xor    %eax,%eax
jmp    1030 <Scheme_EndTransaction@plt>

LLVM IR (-O0):
define i32 @WSQ_EndTransaction() {
%1 = call i32 (...) @Scheme_EndTransaction()
ret i32 %1
}

LLVM IR (-O2):
define i32 @WSQ_EndTransaction() {
%1 = tail call i32 (...) @Scheme_EndTransaction()
ret i32 %1
}
/* Variables and functions */
int PAPI_add_events(int, int *, int);
void papif_add_events__(int *EventSet, int *Events, int *number, int *check) {
  *check = PAPI_add_events(*EventSet, Events, *number);
}


x86 assembly (clang, -O0):
<papif_add_events__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <PAPI_add_events@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_add_events__>:
push   %rbx
mov    %rcx,%rbx
mov    (%rdi),%edi
mov    (%rdx),%edx
call   1030 <PAPI_add_events@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_add_events__(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %12
%14 = call i32 @PAPI_add_events(i32 %10, i32* %11, i32 %13)
%15 = load i32*, i32** %8
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @papif_add_events__(i32* nocapture %0, i32* %1, i32* nocapture %2, i32* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %2
%7 = tail call i32 @PAPI_add_events(i32 %5, i32* %1, i32 %6)
store i32 %7, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main(void) {
  int i = 10, j = 20;
  printf("before swap: i = %d, j = %d\n", i, j);
  swap(&i, &j);
  printf("after swap: i = %d, j = %d\n", i, j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
movl   $0x14,(%rsp)
lea    0xec9(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"before swap: i = %d, j = %d\0A\00"
@.str.1 = [28 x i8] c"after swap: i = %d, j = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = call i32 @swap(i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"before swap: i = %d, j = %d\0A\00"
@.str.1 = [28 x i8] c"after swap: i = %d, j = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 20, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 10, i32 20)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ kore_module_load(char *, char *);
int /*<<< orphan*/ kore_split_string(char *, char *, char **, int);
int configure_load(char *options) {
  char *argv[3];
  kore_split_string(options, " ", argv, 3);
  if (argv[0] == NULL)
    return (0);
  kore_module_load(argv[0], argv[1]);
  return (1);
}


x86 assembly (clang, -O0):
<configure_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    0xec5(%rip),%rsi
mov    $0x3,%ecx
call   1040 <kore_split_string@plt>
cmpq   $0x0,-0x30(%rbp)
jne    115c <configure_load+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1170 <configure_load+0x50>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <kore_module_load@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configure_load>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rsi
mov    %rsp,%rdx
mov    $0x3,%ecx
call   1040 <kore_split_string@plt>
mov    (%rsp),%rdi
test   %rdi,%rdi
je     1155 <configure_load+0x35>
mov    0x8(%rsp),%rsi
call   1030 <kore_module_load@plt>
mov    $0x1,%eax
add    $0x18,%rsp
ret
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define i32 @configure_load(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [3 x i8*]
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
%7 = call i32 @kore_split_string(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %6, i32 3)
%8 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %2
br label %18
12: ; preds = %1
%13 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
%14 = load i8*, i8** %13
%15 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @kore_module_load(i8* %14, i8* %16)
store i32 1, i32* %2
br label %18
18: ; preds = %12, %11
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i32 @configure_load(i8* %0) {
%2 = alloca [3 x i8*]
%3 = bitcast [3 x i8*]* %2 to i8*
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 0
%5 = call i32 @kore_split_string(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %4, i32 3)
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @kore_module_load(i8* %6, i8* %10)
br label %12
12: ; preds = %1, %8
%13 = phi i32 [ 1, %8 ], [ 0, %1 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *calloc(size_t, size_t);
void *xcalloc(size_t nmemb, size_t size) {
  void *ptr;
  ptr = calloc(nmemb, size);
  if (!ptr)
    abort();
  return ptr;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <xcalloc+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rax
call   1040 <calloc@plt>
test   %rax,%rax
je     112d <xcalloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void sigcatcher(int sig) {
  fprintf(stderr, "osmgeobase"
                  ": "
                  "Output has been terminated."
                  "\n");
  exit(1);
}


x86 assembly (clang, -O0):
<sigcatcher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigcatcher>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"osmgeobase: Output has been terminated.\0A\00"
define void @sigcatcher(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"osmgeobase: Output has been terminated.\0A\00"
define void @sigcatcher(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ DirectIndexedXE1(int);
int /*<<< orphan*/ STY8(int /*<<< orphan*/);
void Op94E1(void) { STY8(DirectIndexedXE1(2)); }


x86 assembly (clang, -O0):
<Op94E1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <DirectIndexedXE1@plt>
mov    %eax,%edi
call   1040 <STY8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op94E1>:
push   %rax
mov    $0x2,%edi
call   1030 <DirectIndexedXE1@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <STY8@plt>

LLVM IR (-O0):
define void @Op94E1() {
%1 = call i32 @DirectIndexedXE1(i32 2)
%2 = call i32 @STY8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op94E1() {
%1 = tail call i32 @DirectIndexedXE1(i32 2)
%2 = tail call i32 @STY8(i32 %1)
ret void
}