xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int data[]) {
  int i;
  for (i = 0; i < 3; i++) {
    printf("%4d", data[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1154 <printArray+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printArray+0x13>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xed0(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%4d\00"
define void @printArray(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = tail call i32 @putchar(i32 10)
ret void
}
unsigned long rho_ruby_disable_gc() { return 0; }


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

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

LLVM IR (-O0):
define i64 @rho_ruby_disable_gc() {
ret i64 0
}

LLVM IR (-O2):
define i64 @rho_ruby_disable_gc() {
ret i64 0
}
int execute_restart_syscall() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_restart_syscall() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ blob_in_bounds(int, int);
int track_bbox_bottom(int, int);
int track_bbox_top(int, int);
int track_bbox_height(int ch, int i) {
  if (!blob_in_bounds(ch, i))
    return -1;
  return track_bbox_bottom(ch, i) - track_bbox_top(ch, i) + 1;
}


x86 assembly (clang, -O0):
<track_bbox_height>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <blob_in_bounds@plt>
cmp    $0x0,%eax
jne    115e <track_bbox_height+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1184 <track_bbox_height+0x54>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <track_bbox_bottom@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <track_bbox_top@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<track_bbox_height>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
call   1040 <blob_in_bounds@plt>
test   %eax,%eax
je     115f <track_bbox_height+0x2f>
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <track_bbox_bottom@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r14d,%esi
call   1050 <track_bbox_top@plt>
sub    %eax,%ebx
add    $0x1,%ebx
jmp    1164 <track_bbox_height+0x34>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @track_bbox_height(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 @blob_in_bounds(i32 %6, i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %2
store i32 -1, i32* %3
br label %20
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @track_bbox_bottom(i32 %12, i32 %13)
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call i32 @track_bbox_top(i32 %15, i32 %16)
%18 = sub nsw i32 %14, %17
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %20
20: ; preds = %11, %10
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @track_bbox_height(i32 %0, i32 %1) {
%3 = tail call i32 @blob_in_bounds(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 @track_bbox_bottom(i32 %0, i32 %1)
%7 = tail call i32 @track_bbox_top(i32 %0, i32 %1)
%8 = add i32 %6, 1
%9 = sub i32 %8, %7
br label %10
10: ; preds = %2, %5
%11 = phi i32 [ %9, %5 ], [ -1, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void status_header(void) {
  printf("   width  height  depth  colour  dpi  print(mm)  filename\n"
         "---------------------------------------------------------"
         "----------------------\n");
}


x86 assembly (clang, -O0):
<status_header>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<status_header>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [139 x i8] c" width height depth colour dpi print(mm) filename\0A-------------------------------------------------------------------------------\0A\00"
define void @status_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [138 x i8] c" width height depth colour dpi print(mm) filename\0A-------------------------------------------------------------------------------\00"
define void @status_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([138 x i8], [138 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int, int);
int main() { f(1, 2, 3); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 1, i32 2, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1, i32 2, i32 3)
ret i32 0
}
int f(int *i) { return *i + 1; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ pRender_PutDataWordPLUS(int, unsigned long, int,
                                           unsigned long, int *);
void Render_PutDataWordPLUSMaskWithPixels(int HorizontalCount,
                                          unsigned long GraphicsData, int Line,
                                          unsigned long Mask, int *pPixels) {
  pRender_PutDataWordPLUS(HorizontalCount, GraphicsData, Line, Mask, pPixels);
}


x86 assembly (clang, -O0):
<Render_PutDataWordPLUSMaskWithPixels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <pRender_PutDataWordPLUS@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Render_PutDataWordPLUSMaskWithPixels>:
jmp    1030 <pRender_PutDataWordPLUS@plt>

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

LLVM IR (-O2):
define void @Render_PutDataWordPLUSMaskWithPixels(i32 %0, i64 %1, i32 %2, i64 %3, i32* %4) {
%6 = tail call i32 @pRender_PutDataWordPLUS(i32 %0, i64 %1, i32 %2, i64 %3, i32* %4)
ret void
}
int main() {
  int i, n, ia, ib, ic;
  float fa, fb, fc;
  n = 1000000000;
  ia = ib = ic = 9;
  fa = fb = 9.0;
  for (i = 0; i < n; i++) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3b9aca00,-0xc(%rbp)
movl   $0x9,-0x18(%rbp)
movl   $0x9,-0x14(%rbp)
movl   $0x9,-0x10(%rbp)
movss  0xed1(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xec4(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <main+0x67>
jmp    1159 <main+0x59>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <main+0x48>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca float
store i32 0, i32* %1
store i32 1000000000, i32* %3
store i32 9, i32* %6
store i32 9, i32* %5
store i32 9, i32* %4
store float 9.000000e+00, float* %8
store float 9.000000e+00, float* %7
store i32 0, i32* %2
br label %10
10: ; preds = %15, %0
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %18
14: ; preds = %10
br label %15
15: ; preds = %14
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %10
18: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void port_disable(void) { asm volatile("cli" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @port_disable() {
tail call void asm sideeffect "cli", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int minimum(int a, int b, int c) {
  int min = a;
  if (b < min)
    min = b;
  if (c < min)
    min = c;
  return min;
}


x86 assembly (clang, -O0):
<minimum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1125 <minimum+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1137 <minimum+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimum>:
mov    %edi,%eax
cmp    %edi,%esi
cmovl  %esi,%eax
cmp    %edx,%eax
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @minimum(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
int sterlen(char *str) {}


x86 assembly (clang, -O0):
<sterlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sterlen(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @sterlen(i8* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ z_streamp;

/* Variables and functions */
int deflate(int /*<<< orphan*/, int);
__attribute__((__visibility__("default"))) int kz_deflate(z_streamp strm,
                                                          int flush) {
  return deflate(strm, flush);
}


x86 assembly (clang, -O0):
<kz_deflate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <deflate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kz_deflate>:
jmp    1030 <deflate@plt>

LLVM IR (-O0):
define i32 @kz_deflate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @deflate(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @kz_deflate(i32 %0, i32 %1) {
%3 = tail call i32 @deflate(i32 %0, i32 %1)
ret i32 %3
}
void SteamAPI_vr_IVRControlPanel_SetIPD(void *self, float fIPD) {
  xlogf("%s(self = %p, fIPD = %f)\n", __func__, self, fIPD);
}


x86 assembly (clang, -O0):
<SteamAPI_vr_IVRControlPanel_SetIPD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xecb(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_vr_IVRControlPanel_SetIPD>:
mov    %rdi,%rdx
cvtss2sd %xmm0,%xmm0
lea    0xee2(%rip),%rdi
lea    0xef5(%rip),%rsi
mov    $0x1,%al
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"%s(self = %p, fIPD = %f)\0A\00"
@__func__.SteamAPI_vr_IVRControlPanel_SetIPD = [35 x i8] c"SteamAPI_vr_IVRControlPanel_SetIPD\00"
define void @SteamAPI_vr_IVRControlPanel_SetIPD(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%5 = load i8*, i8** %3
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = call i32 (i8*, i8*, i8*, double, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, double, ...)*)(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__func__.SteamAPI_vr_IVRControlPanel_SetIPD, i64 0, i64 0), i8* %5, double %7)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"%s(self = %p, fIPD = %f)\0A\00"
@__func__.SteamAPI_vr_IVRControlPanel_SetIPD = [35 x i8] c"SteamAPI_vr_IVRControlPanel_SetIPD\00"
define void @SteamAPI_vr_IVRControlPanel_SetIPD(i8* %0, float %1) {
%3 = fpext float %1 to double
%4 = tail call i32 (i8*, i8*, i8*, double, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, double, ...)*)(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__func__.SteamAPI_vr_IVRControlPanel_SetIPD, i64 0, i64 0), i8* %0, double %3)
ret void
}
/* Type definitions */
struct _stor_fopen_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _stor_fopen_req *);
void stor_fopen_req_free(struct _stor_fopen_req *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<stor_fopen_req_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct._stor_fopen_req = type { i32 }
define void @stor_fopen_req_free(%struct._stor_fopen_req* %0) {
%2 = alloca %struct._stor_fopen_req*
store %struct._stor_fopen_req* %0, %struct._stor_fopen_req** %2
%3 = load %struct._stor_fopen_req*, %struct._stor_fopen_req** %2
%4 = call i32 @free(%struct._stor_fopen_req* %3)
ret void
}

LLVM IR (-O2):
%struct._stor_fopen_req = type { i32 }
define void @stor_fopen_req_free(%struct._stor_fopen_req* nocapture %0) {
%2 = tail call i32 @free(%struct._stor_fopen_req* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ write_to_log(char *);
void allocation_failed() {
  write_to_log("Error: allocation failed\n");
  exit(1);
}


x86 assembly (clang, -O0):
<allocation_failed>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <write_to_log@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<allocation_failed>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <write_to_log@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Error: allocation failed\0A\00"
define void @allocation_failed() {
%1 = call i32 @write_to_log(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"Error: allocation failed\0A\00"
define void @allocation_failed() {
%1 = tail call i32 @write_to_log(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int is_upcase(int a) {
  if (a >= 'A' && a <= 'Z')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_upcase>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1127 <is_upcase+0x27>
cmpl   $0x5a,-0x8(%rbp)
jg     1127 <is_upcase+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <is_upcase+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_upcase>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_upcase(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_upcase(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int cmp(const void *s, const void *t) { return *((char *)s) - *((char *)t); }


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

x86 assembly (clang, -O2):
<cmp>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
struct initrec *findentry(const char *name) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
%struct.initrec = type opaque
define %struct.initrec* @findentry(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret %struct.initrec* null
}

LLVM IR (-O2):
%struct.initrec = type opaque
define noalias %struct.initrec* @findentry(i8* nocapture readnone %0) {
ret %struct.initrec* null
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(char);
void main() {
  char b;
  b = 1 || 2 || 3 || 4;
  if (~!+b++)
    print("b ");
  printid(b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x1,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,%cl
add    $0x1,%cl
mov    %cl,-0x1(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
xor    $0xffffffff,%eax
cmp    $0x0,%eax
je     115f <main+0x3f>
lea    0xea6(%rip),%rdi
call   1030 <print@plt>
movsbl -0x1(%rbp),%edi
call   1040 <printid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <printid@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"b \02\00"
define void @main() {
%1 = alloca i8
store i8 1, i8* %1
%2 = load i8, i8* %1
%3 = add i8 %2, 1
store i8 %3, i8* %1
%4 = sext i8 %2 to i32
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = xor i32 %7, -1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %0
%13 = load i8, i8* %1
%14 = call i32 @printid(i8 signext %13)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"b \02\00"
define void @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(i8 signext 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int pendingcc(FILE *fp) { return -1; }


x86 assembly (clang, -O0):
<pendingcc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pendingcc(i32* nocapture readnone %0) {
ret i32 -1
}
int fun244() { return 244; }


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

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

LLVM IR (-O0):
define i32 @fun244() {
ret i32 244
}

LLVM IR (-O2):
define i32 @fun244() {
ret i32 244
}
int needWord(unsigned char type) {
  return ((type <= 0x17) && (type > 0x0f)) || (type == 0x1e) || (type == 0x1f);
}


x86 assembly (clang, -O0):
<needWord>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x17,%eax
jg     1129 <needWord+0x29>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xf,%ecx
mov    %al,-0x2(%rbp)
jg     1148 <needWord+0x48>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x1e,%ecx
mov    %al,-0x2(%rbp)
je     1148 <needWord+0x48>
movzbl -0x1(%rbp),%eax
cmp    $0x1f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<needWord>:
mov    %edi,%eax
and    $0xf8,%al
cmp    $0x10,%al
sete   %al
and    $0xfe,%dil
cmp    $0x1e,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @needWord(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sle i32 %4, 23
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sgt i32 %8, 15
br i1 %9, label %18, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 30
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 31
br label %18
18: ; preds = %14, %10, %6
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @needWord(i8 zeroext %0) {
%2 = and i8 %0, -8
%3 = icmp eq i8 %2, 16
%4 = and i8 %0, -2
%5 = icmp eq i8 %4, 30
%6 = or i1 %5, %3
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ encrypt(char *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int main() {
  char msg[80];
  while (fgets(msg, 80, stdin)) {
    encrypt(msg);
    printf("Encrypted message: %s\n", msg);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     117e <main+0x4e>
lea    -0x60(%rbp),%rdi
call   1040 <encrypt@plt>
lea    -0x60(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    0x2ea8(%rip),%r15
mov    (%r15),%edx
mov    %rsp,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
test   %rax,%rax
je     1188 <main+0x58>
mov    %rsp,%rbx
lea    0xea1(%rip),%r14
nop
mov    %rbx,%rdi
call   1040 <encrypt@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
test   %rax,%rax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [23 x i8] c"Encrypted message: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i64 @fgets(i8* %4, i32 80, i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%10 = call i32 @encrypt(i8* %9)
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [23 x i8] c"Encrypted message: %s\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i64 @fgets(i8* %2, i32 80, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = call i32 @encrypt(i8* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = load i32, i32* @stdin
%10 = call i64 @fgets(i8* %2, i32 80, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
OP(ed, a7) {}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
scalar_t__ parseInt(char *, int);
char *stringToInt(scalar_t__);
char *wum_add(char *a, char *b) {
  return stringToInt((parseInt(a, 10) + parseInt(b, 10)));
}


x86 assembly (clang, -O0):
<wum_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <parseInt@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <parseInt@plt>
mov    -0x18(%rbp),%rdi
add    %rax,%rdi
call   1040 <stringToInt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wum_add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    $0xa,%esi
call   1030 <parseInt@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0xa,%esi
call   1030 <parseInt@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <stringToInt@plt>

LLVM IR (-O0):
define i8* @wum_add(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i64 @parseInt(i8* %5, i32 10)
%7 = load i8*, i8** %4
%8 = call i64 @parseInt(i8* %7, i32 10)
%9 = add nsw i64 %6, %8
%10 = call i8* @stringToInt(i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @wum_add(i8* %0, i8* %1) {
%3 = tail call i64 @parseInt(i8* %0, i32 10)
%4 = tail call i64 @parseInt(i8* %1, i32 10)
%5 = add nsw i64 %4, %3
%6 = tail call i8* @stringToInt(i64 %5)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ writec(int /*<<< orphan*/);
void writel(const char *l) {
  while (*l)
    writec(*l++);
}


x86 assembly (clang, -O0):
<writel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <writel+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <writec@plt>
jmp    111c <writel+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writel>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <writel+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <writec@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <writel+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @writel(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @writec(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @writel(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @writec(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int getI16(unsigned char *buf) { return (buf[0] + (buf[1] << 8)); }


x86 assembly (clang, -O0):
<getI16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getI16>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @getI16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = add nsw i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @getI16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ file_short;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(char *, int, int, int /*<<< orphan*/ *);
int write_short(unsigned short s, FILE *file) {
  unsigned char file_short[2];
  file_short[0] = (s & (unsigned)0xff00) >> 8;
  file_short[1] = s & 0xff;
  if (fwrite((char *)file_short, (int)sizeof(file_short), 1, file) != 1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<write_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x6(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x6(%rbp),%eax
and    $0xff00,%eax
shr    $0x8,%eax
mov    %al,-0x12(%rbp)
movzwl -0x6(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x11(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
cmp    $0x1,%eax
je     116a <write_short+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1171 <write_short+0x61>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_short>:
push   %rax
mov    %rsi,%rcx
rol    $0x8,%di
mov    %di,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @write_short(i16 zeroext %0, i32* %1) {
%3 = alloca i32
%4 = alloca i16
%5 = alloca i32*
%6 = alloca [2 x i8]
store i16 %0, i16* %4
store i32* %1, i32** %5
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = and i32 %8, 65280
%10 = lshr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
store i8 %11, i8* %12
%13 = load i16, i16* %4
%14 = zext i16 %13 to i32
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 1
store i8 %16, i8* %17
%18 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%19 = load i32*, i32** %5
%20 = call i32 @fwrite(i8* %18, i32 2, i32 1, i32* %19)
%21 = icmp ne i32 %20, 1
br i1 %21, label %22, label %23
22: ; preds = %2
store i32 0, i32* %3
br label %24
23: ; preds = %2
store i32 1, i32* %3
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @write_short(i16 zeroext %0, i32* nocapture %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = lshr i16 %0, 8
%6 = trunc i16 %5 to i8
store i8 %6, i8* %4
%7 = trunc i16 %0 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @fwrite(i8* %4, i32 2, i32 1, i32* %1)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
ret i32 %11
}
void glRecti(int x1, int y1, int x2, int y2) { glRecti(x1, y1, x2, y2); }


x86 assembly (clang, -O0):
<glRecti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <glRecti@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glRecti>:
jmp    1100 <glRecti>

LLVM IR (-O0):
define void @glRecti(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* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
ret void
}

LLVM IR (-O2):
define void @glRecti(i32 %0, i32 %1, i32 %2, i32 %3) {
br label %5
5: ; preds = %5, %4
br label %5
}
int check(int *x) {
  if (!x)
    return 0;
  return 10;
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <check+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1126 <check+0x26>
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
xor    %ecx,%ecx
test   %rdi,%rdi
mov    $0xa,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @check(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 0, i32* %2
br label %8
7: ; preds = %1
store i32 10, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @check(i32* readnone %0) {
%2 = icmp eq i32* %0, null
%3 = select i1 %2, i32 0, i32 10
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *strjoin(char *, char *);
char *source_canonicalization(char *old_rootfs_mount_name, char *source,
                              char *cwd) {
  assert(source != NULL && source[0] == '/');
  return strjoin(old_rootfs_mount_name, source);
}


x86 assembly (clang, -O0):
<source_canonicalization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x19(%rbp)
je     1154 <source_canonicalization+0x34>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strjoin@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<source_canonicalization>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %rsi,%rsi
je     1138 <source_canonicalization+0x18>
cmpb   $0x2f,(%rbx)
sete   %dil
call   1040 <assert@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strjoin@plt>

LLVM IR (-O0):
define i8* @source_canonicalization(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 47
br label %15
15: ; preds = %9, %3
%16 = phi i1 [ false, %3 ], [ %14, %9 ]
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i8*, i8** %4
%20 = load i8*, i8** %5
%21 = call i8* @strjoin(i8* %19, i8* %20)
ret i8* %21
}

LLVM IR (-O2):
define i8* @source_canonicalization(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, 47
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %3
%10 = phi i32 [ 0, %3 ], [ %8, %5 ]
%11 = tail call i32 @assert(i32 %10)
%12 = tail call i8* @strjoin(i8* %0, i8* %1)
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ bar(char *);
int foo() {
  int i = 0;
  {
    char a[8000];
    bar(a);
    i += a[0];
  }
  {
    char a[8192];
    char b[32];
    bar(a);
    i += a[0];
    bar(b);
    i += a[0];
  }
  return i;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1f50(%rbp),%rdi
call   1030 <bar@plt>
movsbl -0x1f50(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
lea    -0x3f50(%rbp),%rdi
call   1030 <bar@plt>
movsbl -0x3f50(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
lea    -0x3f70(%rbp),%rdi
call   1030 <bar@plt>
movsbl -0x3f50(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3f70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
sub    $0x2028,%rsp
lea    0x20(%rsp),%rdi
call   1030 <bar@plt>
movsbl 0x20(%rsp),%ebx
lea    0x20(%rsp),%rdi
call   1030 <bar@plt>
movsbl 0x20(%rsp),%ebp
add    %ebx,%ebp
mov    %rsp,%rdi
call   1030 <bar@plt>
movsbl 0x20(%rsp),%eax
add    %ebp,%eax
add    $0x2028,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = alloca [8000 x i8]
%3 = alloca [8192 x i8]
%4 = alloca [32 x i8]
store i32 0, i32* %1
%5 = getelementptr inbounds [8000 x i8], [8000 x i8]* %2, i64 0, i64 0
%6 = call i32 @bar(i8* %5)
%7 = getelementptr inbounds [8000 x i8], [8000 x i8]* %2, i64 0, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i32, i32* %1
%11 = add nsw i32 %10, %9
store i32 %11, i32* %1
%12 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%13 = call i32 @bar(i8* %12)
%14 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = load i32, i32* %1
%18 = add nsw i32 %17, %16
store i32 %18, i32* %1
%19 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%20 = call i32 @bar(i8* %19)
%21 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = load i32, i32* %1
%25 = add nsw i32 %24, %23
store i32 %25, i32* %1
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
define i32 @foo() {
%1 = alloca [8000 x i8]
%2 = alloca [8192 x i8]
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [8000 x i8], [8000 x i8]* %1, i64 0, i64 0
%5 = call i32 @bar(i8* %4)
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%10 = call i32 @bar(i8* %8)
%11 = load i8, i8* %8
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, %7
%14 = call i32 @bar(i8* %9)
%15 = load i8, i8* %8
%16 = sext i8 %15 to i32
%17 = add nsw i32 %13, %16
ret i32 %17
}
void Delay(long count) {
  volatile int i, j = 0;
  volatile static int loop = 800000000 / 10000;
  for (; count > 0; count--)
    for (i = 0; i < loop; i++) {
      j++;
    }
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    115f <Delay+0x5f>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ef6(%rip),%ecx
cmp    %ecx,%eax
jge    1149 <Delay+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1121 <Delay+0x21>
jmp    114e <Delay+0x4e>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <Delay+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay>:
movl   $0x0,-0x4(%rsp)
test   %rdi,%rdi
jg     111d <Delay+0x1d>
ret
xchg   %ax,%ax
lea    -0x1(%rdi),%rax
cmp    $0x1,%rdi
mov    %rax,%rdi
jle    110d <Delay+0xd>
movl   $0x0,-0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
mov    -0x8(%rsp),%eax
cmp    0x2ee6(%rip),%eax
jge    1110 <Delay+0x10>
addl   $0x1,-0x4(%rsp)
addl   $0x1,-0x8(%rsp)
jmp    1130 <Delay+0x30>

LLVM IR (-O0):
@Delay.loop = internal global i32 80000
define void @Delay(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
store i64 %0, i64* %2
store volatile i32 0, i32* %4
br label %5
5: ; preds = %20, %1
%6 = load i64, i64* %2
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %5
store volatile i32 0, i32* %3
br label %9
9: ; preds = %16, %8
%10 = load volatile i32, i32* %3
%11 = load volatile i32, i32* @Delay.loop
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load volatile i32, i32* %4
%15 = add nsw i32 %14, 1
store volatile i32 %15, i32* %4
br label %16
16: ; preds = %13
%17 = load volatile i32, i32* %3
%18 = add nsw i32 %17, 1
store volatile i32 %18, i32* %3
br label %9
19: ; preds = %9
br label %20
20: ; preds = %19
%21 = load i64, i64* %2
%22 = add nsw i64 %21, -1
store i64 %22, i64* %2
br label %5
23: ; preds = %5
ret void
}

LLVM IR (-O2):
@Delay.loop = internal global i32 80000
define void @Delay(i64 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
%6 = icmp sgt i64 %0, 0
br i1 %6, label %7, label %23
7: ; preds = %1, %20
%8 = phi i64 [ %21, %20 ], [ %0, %1 ]
store volatile i32 0, i32* %2
%9 = load volatile i32, i32* %2
%10 = load volatile i32, i32* @Delay.loop
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %7, %12
%13 = load volatile i32, i32* %3
%14 = add nsw i32 %13, 1
store volatile i32 %14, i32* %3
%15 = load volatile i32, i32* %2
%16 = add nsw i32 %15, 1
store volatile i32 %16, i32* %2
%17 = load volatile i32, i32* %2
%18 = load volatile i32, i32* @Delay.loop
%19 = icmp slt i32 %17, %18
br i1 %19, label %12, label %20
20: ; preds = %12, %7
%21 = add nsw i64 %8, -1
%22 = icmp sgt i64 %8, 1
br i1 %22, label %7, label %23
23: ; preds = %20, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long);
void __default_disp_each(const void *_elm) {
  unsigned long long int value = (unsigned long long int)_elm;
  printf("%i ", value);
}


x86 assembly (clang, -O0):
<__default_disp_each>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__default_disp_each>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%i \00"
define void @__default_disp_each(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i \00"
define void @__default_disp_each(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %2)
ret void
}