xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isIsomorphic(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
void test(char *l, char *r) {
  if (isIsomorphic(l, r)) {
    printf("%s || %s\n", l, r);
  } else {
    printf("%s /| %s\n", l, r);
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <isIsomorphic@plt>
cmp    $0x0,%rax
je     1160 <test+0x40>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    1174 <test+0x54>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <isIsomorphic@plt>
test   %rax,%rax
lea    0xed1(%rip),%rax
lea    0xec0(%rip),%rdi
cmove  %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s || %s\0A\00"
@.str.1 = [10 x i8] c"%s /| %s\0A\00"
define void @test(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** %4
%7 = call i64 @isIsomorphic(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
br label %17
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %14, i8* %15)
br label %17
17: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s || %s\0A\00"
@.str.1 = [10 x i8] c"%s /| %s\0A\00"
define void @test(i8* %0, i8* %1) {
%3 = tail call i64 @isIsomorphic(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @printf(i8* %5, i8* %0, i8* %1)
ret void
}
int scan(const char *text, char c, int from) {
  while (text[from] && text[from] != c) {
    from++;
  }
  return from;
}


x86 assembly (clang, -O0):
<scan>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1143 <scan+0x43>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1153 <scan+0x53>
jmp    1161 <scan+0x61>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1111 <scan+0x11>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan>:
movslq %edx,%rcx
lea    -0x1(%rcx),%eax
add    %rcx,%rdi
nopl   0x0(%rax)
movzbl (%rdi),%ecx
add    $0x1,%eax
test   %cl,%cl
je     1123 <scan+0x23>
add    $0x1,%rdi
cmp    %sil,%cl
jne    1110 <scan+0x10>
ret

LLVM IR (-O0):
define i32 @scan(i8* %0, i8 signext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
br label %7
7: ; preds = %27, %3
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %25
15: ; preds = %7
%16 = load i8*, i8** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8, i8* %5
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %21, %23
br label %25
25: ; preds = %15, %7
%26 = phi i1 [ false, %7 ], [ %24, %15 ]
br i1 %26, label %27, label %30
27: ; preds = %25
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %7
30: ; preds = %25
%31 = load i32, i32* %6
ret i32 %31
}

LLVM IR (-O2):
define i32 @scan(i8* nocapture %0, i8 signext %1, i32 %2) {
%4 = sext i32 %2 to i64
br label %5
5: ; preds = %5, %3
%6 = phi i64 [ %12, %5 ], [ %4, %3 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
%10 = icmp eq i8 %8, %1
%11 = or i1 %9, %10
%12 = add i64 %6, 1
br i1 %11, label %13, label %5
13: ; preds = %5
%14 = trunc i64 %6 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ plcvm_get_s8(scalar_t__);
scalar_t__ plcvm_lpm_u8();
int plcvm_pop();
int /*<<< orphan*/ plcvm_push(int /*<<< orphan*/);
void cb_ldm_s1_cs8(void) {
  plcvm_push(plcvm_get_s8(plcvm_pop() * 4 + plcvm_lpm_u8()));
}


x86 assembly (clang, -O0):
<cb_ldm_s1_cs8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <plcvm_pop@plt>
shl    $0x2,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <plcvm_lpm_u8@plt>
mov    -0x8(%rbp),%rdi
add    %rax,%rdi
call   1050 <plcvm_get_s8@plt>
mov    %eax,%edi
call   1040 <plcvm_push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_ldm_s1_cs8>:
push   %rbx
xor    %eax,%eax
call   1030 <plcvm_pop@plt>
shl    $0x2,%eax
movslq %eax,%rbx
xor    %eax,%eax
call   1060 <plcvm_lpm_u8@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1050 <plcvm_get_s8@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <plcvm_push@plt>

LLVM IR (-O0):
define void @cb_ldm_s1_cs8() {
%1 = call i32 (...) @plcvm_pop()
%2 = mul nsw i32 %1, 4
%3 = sext i32 %2 to i64
%4 = call i64 (...) @plcvm_lpm_u8()
%5 = add nsw i64 %3, %4
%6 = call i32 @plcvm_get_s8(i64 %5)
%7 = call i32 @plcvm_push(i32 %6)
ret void
}

LLVM IR (-O2):
define void @cb_ldm_s1_cs8() {
%1 = tail call i32 (...) @plcvm_pop()
%2 = shl nsw i32 %1, 2
%3 = sext i32 %2 to i64
%4 = tail call i64 (...) @plcvm_lpm_u8()
%5 = add nsw i64 %4, %3
%6 = tail call i32 @plcvm_get_s8(i64 %5)
%7 = tail call i32 @plcvm_push(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ heap_sift_down(long *, int, int /*<<< orphan*/);
int /*<<< orphan*/ heapify(long *, int);
int /*<<< orphan*/ swap(long *, int /*<<< orphan*/, int);
void heap_sort(long *ary, int ary_len) {
  int heap_size = ary_len;
  heapify(ary, heap_size);
  while (heap_size > 0) {
    ;
    swap(ary, 0, --heap_size);
    heap_sift_down(ary, heap_size, 0);
  }
}


x86 assembly (clang, -O0):
<heap_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <heapify@plt>
cmpl   $0x0,-0x10(%rbp)
jle    1182 <heap_sort+0x52>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
add    $0xffffffff,%edx
mov    %edx,-0x10(%rbp)
xor    %esi,%esi
call   1050 <swap@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
xor    %edx,%edx
call   1040 <heap_sift_down@plt>
jmp    1151 <heap_sort+0x21>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_sort>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <heapify@plt>
test   %ebx,%ebx
jle    1173 <heap_sort+0x43>
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x2(%rbx),%ebp
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1050 <swap@plt>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %edx,%edx
call   1040 <heap_sift_down@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1150 <heap_sort+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @heap_sort(i64* %0, i32 %1) {
%3 = tail call i32 @heapify(i64* %0, i32 %1)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %11
5: ; preds = %2, %5
%6 = phi i32 [ %7, %5 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = tail call i32 @swap(i64* %0, i32 0, i32 %7)
%9 = tail call i32 @heap_sift_down(i64* %0, i32 %7, i32 0)
%10 = icmp ugt i32 %6, 1
br i1 %10, label %5, label %11
11: ; preds = %5, %2
ret void
}
void gtk_tree_view_get_bin_window() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_get_bin_window() {
ret void
}
/* Variables and functions */
scalar_t__ chdir(char const *);
int /*<<< orphan*/ fail(char *);
int /*<<< orphan*/ mkdir(char const *, int);
void new_dir(const char *n) {
  mkdir(n, 0777);
  if (chdir(n) < 0)
    fail("chdir");
}


x86 assembly (clang, -O0):
<new_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
mov    -0x8(%rbp),%rdi
call   1050 <chdir@plt>
cmp    $0x0,%rax
jge    1169 <new_dir+0x39>
lea    0xe9c(%rip),%rdi
call   1040 <fail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_dir>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
mov    %rbx,%rdi
call   1050 <chdir@plt>
test   %rax,%rax
js     114d <new_dir+0x1d>
pop    %rbx
ret
lea    0xeac(%rip),%rdi
pop    %rbx
jmp    1040 <fail@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"chdir\00"
define void @new_dir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @mkdir(i8* %3, i32 511)
%5 = load i8*, i8** %2
%6 = call i64 @chdir(i8* %5)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @fail(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"chdir\00"
define void @new_dir(i8* %0) {
%2 = tail call i32 @mkdir(i8* %0, i32 511)
%3 = tail call i64 @chdir(i8* %0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @fail(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
struct S_MULTI_ARRAY {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destructor_multiarray1_default(void *);
void destructor_multiarray1_default_const(struct S_MULTI_ARRAY const *const A) {
  destructor_multiarray1_default((void *)A);
}


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

x86 assembly (clang, -O2):
<destructor_multiarray1_default_const>:
jmp    1030 <destructor_multiarray1_default@plt>

LLVM IR (-O0):
%struct.S_MULTI_ARRAY = type { i32 }
define void @destructor_multiarray1_default_const(%struct.S_MULTI_ARRAY* %0) {
%2 = alloca %struct.S_MULTI_ARRAY*
store %struct.S_MULTI_ARRAY* %0, %struct.S_MULTI_ARRAY** %2
%3 = load %struct.S_MULTI_ARRAY*, %struct.S_MULTI_ARRAY** %2
%4 = bitcast %struct.S_MULTI_ARRAY* %3 to i8*
%5 = call i32 @destructor_multiarray1_default(i8* %4)
ret void
}

LLVM IR (-O2):
%struct.S_MULTI_ARRAY = type { i32 }
define void @destructor_multiarray1_default_const(%struct.S_MULTI_ARRAY* %0) {
%2 = bitcast %struct.S_MULTI_ARRAY* %0 to i8*
%3 = tail call i32 @destructor_multiarray1_default(i8* %2)
ret void
}
void kmsg_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @kmsg_cleanup() {
ret void
}
int main() {
  int *pa;
  int a = 2;
  pa = &a;
  return *pa;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fwrite(void const *, size_t, size_t, int /*<<< orphan*/ *);
size_t wrap_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) {
  return fwrite(ptr, size, nmemb, stream);
}


x86 assembly (clang, -O0):
<wrap_fwrite>:
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),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_fwrite>:
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
define i64 @wrap_fwrite(i8* nocapture %0, i64 %1, i64 %2, i32* nocapture %3) {
%5 = tail call i64 @fwrite(i8* %0, i64 %1, i64 %2, i32* %3)
ret i64 %5
}
/* Variables and functions */
int alarm(int);
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *);
int main() {
  int ret = alarm(5);
  pause();
  printf("Wake up\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
call   1040 <alarm@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <pause@plt>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <alarm@plt>
xor    %eax,%eax
call   1050 <pause@plt>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Wake up\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @alarm(i32 5)
store i32 %2, i32* %1
%3 = call i32 (...) @pause()
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"Wake up\00"
define i32 @main() {
%1 = tail call i32 @alarm(i32 5)
%2 = tail call i32 (...) @pause()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int bitmap_test(const uint32_t *bitmap, unsigned nr) {
  unsigned i = ((nr) / (32U));
  const uint32_t mask = (1U << ((nr) % 32U));
  return (bitmap[i] & mask) != 0;
}


x86 assembly (clang, -O0):
<bitmap_test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x5,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
and    -0x14(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_test>:
mov    %esi,%ecx
mov    %esi,%eax
shr    $0x5,%eax
mov    (%rdi,%rax,4),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bitmap_test(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = udiv i32 %7, 32
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = urem i32 %9, 32
%11 = shl i32 1, %10
store i32 %11, i32* %6
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = load i32, i32* %6
%18 = and i32 %16, %17
%19 = icmp ne i32 %18, 0
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @bitmap_test(i32* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 5
%4 = and i32 %1, 31
%5 = zext i32 %3 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = lshr i32 %7, %4
%9 = and i32 %8, 1
ret i32 %9
}
/* Variables and functions */
int strlen(char const *);
unsigned int get_text_width(const char *s) { return strlen(s) * 8; }


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

x86 assembly (clang, -O2):
<get_text_width>:
push   %rax
call   1030 <strlen@plt>
shl    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_text_width(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = mul nsw i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_text_width(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = shl nsw i32 %2, 3
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int f(int, int);
int main() {
  if (f(2, 31) != 1)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x1f,%esi
call   1040 <f@plt>
cmp    $0x1,%eax
je     115e <main+0x2e>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x1f,%esi
call   1040 <f@plt>
cmp    $0x1,%eax
jne    114c <main+0x1c>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 2, i32 31)
%3 = icmp ne i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 2, i32 31)
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct xmlnode {
  int dummy;
};

/* Variables and functions */
char *XmlGetAttribute(struct xmlnode *, char const *);
char *x_strdup(char const *);
char *XmlGetAttributeDup(struct xmlnode *n, const char *attr) {
  const char *a = XmlGetAttribute(n, attr);
  if (a) {
    return x_strdup(a);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<XmlGetAttributeDup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <XmlGetAttribute@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115e <XmlGetAttributeDup+0x3e>
mov    -0x20(%rbp),%rdi
call   1040 <x_strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    1166 <XmlGetAttributeDup+0x46>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XmlGetAttributeDup>:
push   %rax
call   1030 <XmlGetAttribute@plt>
test   %rax,%rax
je     1134 <XmlGetAttributeDup+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <x_strdup@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.xmlnode = type { i32 }
define i8* @XmlGetAttributeDup(%struct.xmlnode* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca %struct.xmlnode*
%5 = alloca i8*
%6 = alloca i8*
store %struct.xmlnode* %0, %struct.xmlnode** %4
store i8* %1, i8** %5
%7 = load %struct.xmlnode*, %struct.xmlnode** %4
%8 = load i8*, i8** %5
%9 = call i8* @XmlGetAttribute(%struct.xmlnode* %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = call i8* @x_strdup(i8* %13)
store i8* %14, i8** %3
br label %16
15: ; preds = %2
store i8* null, i8** %3
br label %16
16: ; preds = %15, %12
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
%struct.xmlnode = type { i32 }
define i8* @XmlGetAttributeDup(%struct.xmlnode* %0, i8* %1) {
%3 = tail call i8* @XmlGetAttribute(%struct.xmlnode* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @x_strdup(i8* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
/* Type definitions */
struct Node {
  int dummy;
};

/* Variables and functions */
int addAtPos(struct Node **, struct Node *, int /*<<< orphan*/);
int addFront(struct Node **start, struct Node *nw_node) {
  return addAtPos(start, nw_node, 0);
}


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

x86 assembly (clang, -O2):
<addFront>:
xor    %edx,%edx
jmp    1030 <addAtPos@plt>

LLVM IR (-O0):
%struct.Node = type { i32 }
define i32 @addFront(%struct.Node** %0, %struct.Node* %1) {
%3 = alloca %struct.Node**
%4 = alloca %struct.Node*
store %struct.Node** %0, %struct.Node*** %3
store %struct.Node* %1, %struct.Node** %4
%5 = load %struct.Node**, %struct.Node*** %3
%6 = load %struct.Node*, %struct.Node** %4
%7 = call i32 @addAtPos(%struct.Node** %5, %struct.Node* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.Node = type { i32 }
define i32 @addFront(%struct.Node** %0, %struct.Node* %1) {
%3 = tail call i32 @addAtPos(%struct.Node** %0, %struct.Node* %1, i32 0)
ret i32 %3
}
void init() {
  printf(__func__);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<init>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@__func__.init = [5 x i8] c"init\00"
@.str = [2 x i8] c"\0A\00"
define void @init() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.init, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.init = [5 x i8] c"init\00"
define void @init() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.init, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
void chkdiff2(void) {
  int i;
  i = 0;
}


x86 assembly (clang, -O0):
<chkdiff2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @chkdiff2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ randomByte();
int /*<<< orphan*/ sqlite3OsEnterMutex();
int /*<<< orphan*/ sqlite3OsLeaveMutex();
void sqlite3Randomness(int N, void *pBuf) {
  unsigned char *zBuf = pBuf;
  sqlite3OsEnterMutex();
  while (N--) {
    *(zBuf++) = randomByte();
  }
  sqlite3OsLeaveMutex();
}


x86 assembly (clang, -O0):
<sqlite3Randomness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <sqlite3OsEnterMutex@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1181 <sqlite3Randomness+0x51>
mov    $0x0,%al
call   1040 <randomByte@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    114e <sqlite3Randomness+0x1e>
mov    $0x0,%al
call   1050 <sqlite3OsLeaveMutex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3Randomness>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <sqlite3OsEnterMutex@plt>
test   %ebp,%ebp
je     1163 <sqlite3Randomness+0x33>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <randomByte@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1150 <sqlite3Randomness+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <sqlite3OsLeaveMutex@plt>

LLVM IR (-O0):
define void @sqlite3Randomness(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %5
%7 = call i32 (...) @sqlite3OsEnterMutex()
br label %8
8: ; preds = %12, %2
%9 = load i32, i32* %3
%10 = add nsw i32 %9, -1
store i32 %10, i32* %3
%11 = icmp ne i32 %9, 0
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = call i32 (...) @randomByte()
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %5
store i8 %14, i8* %15
br label %8
17: ; preds = %8
%18 = call i32 (...) @sqlite3OsLeaveMutex()
ret void
}

LLVM IR (-O2):
define void @sqlite3Randomness(i32 %0, i8* nocapture writeonly %1) {
%3 = tail call i32 (...) @sqlite3OsEnterMutex()
%4 = icmp eq i32 %0, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %11, %5 ], [ %1, %2 ]
%7 = phi i32 [ %8, %5 ], [ %0, %2 ]
%8 = add nsw i32 %7, -1
%9 = tail call i32 (...) @randomByte()
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %10, i8* %6
%12 = icmp eq i32 %8, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = tail call i32 (...) @sqlite3OsLeaveMutex()
ret void
}
/* Type definitions */
struct fb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fb_putPixel_32(struct fb *, int, int, int);
void fb_drawPixel_rgb8888(struct fb *self, int x, int y, int r, int g, int b) {
  fb_putPixel_32(self, x, y, (r << 16) | (g << 8) | (b << 0));
}


x86 assembly (clang, -O0):
<fb_drawPixel_rgb8888>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
shl    $0x10,%ecx
mov    -0x18(%rbp),%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x1c(%rbp),%eax
shl    $0x0,%eax
or     %eax,%ecx
call   1030 <fb_putPixel_32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_drawPixel_rgb8888>:
shl    $0x10,%ecx
shl    $0x8,%r8d
or     %r8d,%ecx
or     %r9d,%ecx
jmp    1030 <fb_putPixel_32@plt>

LLVM IR (-O0):
%struct.fb = type { i32 }
define void @fb_drawPixel_rgb8888(%struct.fb* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca %struct.fb*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store %struct.fb* %0, %struct.fb** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load %struct.fb*, %struct.fb** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = shl i32 %16, 16
%18 = load i32, i32* %11
%19 = shl i32 %18, 8
%20 = or i32 %17, %19
%21 = load i32, i32* %12
%22 = shl i32 %21, 0
%23 = or i32 %20, %22
%24 = call i32 @fb_putPixel_32(%struct.fb* %13, i32 %14, i32 %15, i32 %23)
ret void
}

LLVM IR (-O2):
%struct.fb = type { i32 }
define void @fb_drawPixel_rgb8888(%struct.fb* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = shl i32 %3, 16
%8 = shl i32 %4, 8
%9 = or i32 %8, %7
%10 = or i32 %9, %5
%11 = tail call i32 @fb_putPixel_32(%struct.fb* %0, i32 %1, i32 %2, i32 %10)
ret void
}
int test_imm_01uint8_reg(unsigned char val) {
  return ((val) & (0x01 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_01uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_01uint8_reg>:
test   $0x1,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_01uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_01uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 1
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 0; i < 128; i++)
    printf("%2c", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    1150 <main+0x40>
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x80,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%2c\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 128
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
unsigned long __builtin_arm_rsr64(char *);
unsigned long rsr64_1() { return __builtin_arm_rsr64("sysreg"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"sysreg\00"
define i64 @rsr64_1() {
%1 = call i64 @__builtin_arm_rsr64(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i64 %1
}

LLVM IR (-O2):
@.str = [7 x i8] c"sysreg\00"
define i64 @rsr64_1() {
%1 = tail call i64 @__builtin_arm_rsr64(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glTranslatef(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ glutSolidSphere(double, int, int);
void fog_renderSphere(GLfloat x, GLfloat y, GLfloat z) {
  glPushMatrix();
  glTranslatef(x, y, z);
  glutSolidSphere(0.4, 16, 16);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<fog_renderSphere>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1040 <glPushMatrix@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1060 <glTranslatef@plt>
movsd  0xe92(%rip),%xmm0
mov    $0x10,%esi
mov    %esi,%edi
call   1050 <glutSolidSphere@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fog_renderSphere>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <glPushMatrix@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1060 <glTranslatef@plt>
movsd  0xe9a(%rip),%xmm0
mov    $0x10,%edi
mov    $0x10,%esi
call   1050 <glutSolidSphere@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <glPopMatrix@plt>

LLVM IR (-O0):
define void @fog_renderSphere(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 (...) @glPushMatrix()
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @glTranslatef(i32 %8, i32 %9, i32 %10)
%12 = call i32 @glutSolidSphere(double 4.000000e-01, i32 16, i32 16)
%13 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @fog_renderSphere(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @glPushMatrix()
%5 = tail call i32 @glTranslatef(i32 %0, i32 %1, i32 %2)
%6 = tail call i32 @glutSolidSphere(double 4.000000e-01, i32 16, i32 16)
%7 = tail call i32 (...) @glPopMatrix()
ret void
}
/* Variables and functions */
int main(void) {
  double x = 1;
  int foo = 0;
  if (foo)
    x = 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsd  0xeed(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1136 <main+0x36>
movsd  0xecf(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
store i32 0, i32* %1
store double 1.000000e+00, double* %2
store i32 0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store double 1.000000e+00, double* %2
br label %7
7: ; preds = %6, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned int ecrt_version_magic(void) { return (((1) << 8) + (5)); }


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

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

LLVM IR (-O0):
define i32 @ecrt_version_magic() {
ret i32 261
}

LLVM IR (-O2):
define i32 @ecrt_version_magic() {
ret i32 261
}
unsigned keycode_windows_from_lparam(unsigned lparam) {
  return ((lparam >> 16) & 0x7f) | ((lparam & (1 << 24)) != 0 ? 0x80 : 0);
}


x86 assembly (clang, -O0):
<keycode_windows_from_lparam>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0x7f,%eax
mov    -0x4(%rbp),%esi
and    $0x1000000,%esi
xor    %ecx,%ecx
mov    $0x80,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<keycode_windows_from_lparam>:
mov    %edi,%eax
shr    $0x10,%eax
and    $0x7f,%eax
shr    $0x11,%edi
and    $0x80,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @keycode_windows_from_lparam(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = and i32 %4, 127
%6 = load i32, i32* %2
%7 = and i32 %6, 16777216
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 128, i32 0
%11 = or i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @keycode_windows_from_lparam(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 127
%4 = lshr i32 %0, 17
%5 = and i32 %4, 128
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ putc(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int nprint(char *c, int n) {
  while (n--)
    putc(*c++, stdout);
  return 0;
}


x86 assembly (clang, -O0):
<nprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1158 <nprint+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
call   1030 <putc@plt>
jmp    111f <nprint+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nprint>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1147 <nprint+0x37>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
mov    0x2eb5(%rip),%r12
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
mov    (%r12),%esi
call   1030 <putc@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <nprint+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @nprint(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = load i32, i32* @stdout
%15 = call i32 @putc(i32 %13, i32 %14)
br label %5
16: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @nprint(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = load i32, i32* @stdout
%12 = tail call i32 @putc(i32 %10, i32 %11)
%13 = icmp eq i32 %7, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %2
ret i32 0
}
char IsLeapYear(int year) {
  return (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0));
}


x86 assembly (clang, -O0):
<IsLeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1134 <IsLeapYear+0x34>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1148 <IsLeapYear+0x48>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsLeapYear>:
test   $0x3,%dil
jne    1129 <IsLeapYear+0x29>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%ecx
mov    %edi,%edx
mov    $0x1,%al
sub    %ecx,%edx
je     1129 <IsLeapYear+0x29>
ret
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
setb   %al
ret

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

LLVM IR (-O2):
define signext i8 @IsLeapYear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp ne i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i8
br label %11
11: ; preds = %1, %7
%12 = phi i8 [ %10, %7 ], [ 1, %1 ]
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ func_2(int, char *, unsigned long);
void func_1(int a, char *b, unsigned long c) { func_2(a, b, c); }


x86 assembly (clang, -O0):
<func_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <func_2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_1>:
jmp    1030 <func_2@plt>

LLVM IR (-O0):
define void @func_1(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 i32 @func_2(i32 %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @func_1(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @func_2(i32 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void emit_negc(int rs, int rt, int sr) { assert(0); }


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

x86 assembly (clang, -O2):
<emit_negc>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @emit_negc(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @emit_negc(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @assert(i32 0)
ret void
}
long long bit19() { return 0x0000000000080000LL; }


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

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

LLVM IR (-O0):
define i64 @bit19() {
ret i64 524288
}

LLVM IR (-O2):
define i64 @bit19() {
ret i64 524288
}
int test_imm_F1int64_lowword_reg(long long val) {
  return ((val) & (0xF1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F1int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xf1,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F1int64_lowword_reg>:
test   $0xf1,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F1int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 241
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_F1int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 241
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int findCreateFileMode(const char *zPath, int flags, mode_t *pMode) {
  int rc = 0;
  if (flags & 0x00000010) {
    *pMode = 0600;
    (zPath = 0);
  } else {
    *pMode = 0644;
  }
  return rc;
}


x86 assembly (clang, -O0):
<findCreateFileMode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     113c <findCreateFileMode+0x3c>
mov    -0x18(%rbp),%rax
movl   $0x180,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    1146 <findCreateFileMode+0x46>
mov    -0x18(%rbp),%rax
movl   $0x1a4,(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findCreateFileMode>:
test   $0x10,%sil
mov    $0x1a4,%eax
mov    $0x180,%ecx
cmove  %eax,%ecx
mov    %ecx,(%rdx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @findCreateFileMode(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
store i32 0, i32* %7
%8 = load i32, i32* %5
%9 = and i32 %8, 16
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32*, i32** %6
store i32 384, i32* %12
store i8* null, i8** %4
br label %15
13: ; preds = %3
%14 = load i32*, i32** %6
store i32 420, i32* %14
br label %15
15: ; preds = %13, %11
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @findCreateFileMode(i8* nocapture readnone %0, i32 %1, i32* nocapture writeonly %2) {
%4 = and i32 %1, 16
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 420, i32 384
store i32 %6, i32* %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ VirtualizeTimerC__0__TimerFrom__fired();
void AlarmToTimerC__0__Timer__fired(void) {
  VirtualizeTimerC__0__TimerFrom__fired();
}


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

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

LLVM IR (-O0):
define void @AlarmToTimerC__0__Timer__fired() {
%1 = call i32 (...) @VirtualizeTimerC__0__TimerFrom__fired()
ret void
}

LLVM IR (-O2):
define void @AlarmToTimerC__0__Timer__fired() {
%1 = tail call i32 (...) @VirtualizeTimerC__0__TimerFrom__fired()
ret void
}
/* Variables and functions */
int my_city_at(int, int, int);
int city_at(int r, int c) { return my_city_at(r, c, -1); }


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

x86 assembly (clang, -O2):
<city_at>:
mov    $0xffffffff,%edx
jmp    1030 <my_city_at@plt>

LLVM IR (-O0):
define i32 @city_at(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 @my_city_at(i32 %5, i32 %6, i32 -1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @city_at(i32 %0, i32 %1) {
%3 = tail call i32 @my_city_at(i32 %0, i32 %1, i32 -1)
ret i32 %3
}