xunge/DecIR huggingface dataset:
/* Variables and functions */
int O_APPEND;
int O_CREAT;
int O_WRONLY;
void *doOpen(char const *, int);
void *__PHYSFS_platformOpenAppend(const char *filename) {
  return (doOpen(filename, O_WRONLY | O_CREAT | O_APPEND));
}


x86 assembly (clang, -O0):
<__PHYSFS_platformOpenAppend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
or     (%rax),%esi
mov    0x2e8f(%rip),%rax
or     (%rax),%esi
call   1030 <doOpen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__PHYSFS_platformOpenAppend>:
mov    0x2eb9(%rip),%rax
mov    0x2eda(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e9f(%rip),%rax
or     (%rax),%esi
jmp    1030 <doOpen@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_APPEND = global i32 0
define i8* @__PHYSFS_platformOpenAppend(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_WRONLY
%5 = load i32, i32* @O_CREAT
%6 = or i32 %4, %5
%7 = load i32, i32* @O_APPEND
%8 = or i32 %6, %7
%9 = call i8* @doOpen(i8* %3, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_APPEND = global i32 0
define i8* @__PHYSFS_platformOpenAppend(i8* %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %2
%5 = load i32, i32* @O_APPEND
%6 = or i32 %4, %5
%7 = tail call i8* @doOpen(i8* %0, i32 %6)
ret i8* %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int pow2(uint32_t v) {
  int r = 0;
  while (v >>= 1) {
    r++;
  }
  return r;
}


x86 assembly (clang, -O0):
<pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <pow2+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <pow2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <pow2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <pow2+0x10>
ret

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

LLVM IR (-O2):
define i32 @pow2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
unsigned int ya_random();
unsigned int rnd(unsigned int x) { return (ya_random() % x); }


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <ya_random@plt>
xor    %edx,%edx
divl   -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <ya_random@plt>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rnd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @ya_random()
%4 = load i32, i32* %2
%5 = urem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @rnd(i32 %0) {
%2 = tail call i32 (...) @ya_random()
%3 = urem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
zadd() { ol("DAD D"); }


x86 assembly (clang, -O0):
<zadd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"DAD D\00"
define i32 @zadd() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"DAD D\00"
define i32 @zadd() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct _CategoryWatcherHandle {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _CategoryWatcherHandle *);
void CategoryWatcherHandle_free(struct _CategoryWatcherHandle *handle) {
  free(handle);
}


x86 assembly (clang, -O0):
<CategoryWatcherHandle_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):
<CategoryWatcherHandle_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct._CategoryWatcherHandle = type { i32 }
define void @CategoryWatcherHandle_free(%struct._CategoryWatcherHandle* nocapture %0) {
%2 = tail call i32 @free(%struct._CategoryWatcherHandle* %0)
ret void
}
struct conscell *bulist(form)
struct conscell *form;
{
  return (topcopy(form));
}


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

x86 assembly (clang, -O2):
<bulist>:
push   %rax
xor    %eax,%eax
call   1030 <topcopy@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.conscell = type opaque
define %struct.conscell* @bulist(%struct.conscell* %0) {
%2 = alloca %struct.conscell*
store %struct.conscell* %0, %struct.conscell** %2
%3 = load %struct.conscell*, %struct.conscell** %2
%4 = call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @topcopy to i32 (%struct.conscell*, ...)*)(%struct.conscell* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to %struct.conscell*
ret %struct.conscell* %6
}

LLVM IR (-O2):
%struct.conscell = type opaque
define %struct.conscell* @bulist(%struct.conscell* %0) {
%2 = tail call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @topcopy to i32 (%struct.conscell*, ...)*)(%struct.conscell* %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to %struct.conscell*
ret %struct.conscell* %4
}
/* Variables and functions */
int foo(int);
int main() { return (foo(6) - 74); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6,%edi
call   1030 <foo@plt>
add    $0xffffffb6,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 6)
%3 = sub nsw i32 %2, 74
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 6)
%2 = add nsw i32 %1, -74
ret i32 %2
}
void dummy(int foo) { return; }


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

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

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

LLVM IR (-O2):
define void @dummy(i32 %0) {
ret void
}
void swap(char *a, char *b) {
  int temp = *a;
  *a = *b;
  *b = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = load i8*, i8** %3
store i8 %10, i8* %11
%12 = load i32, i32* %5
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %4
store i8 %13, i8* %14
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void test_classIsComplete(void *classPointer, void *lastPointer) {
  assert(classPointer != NULL);
  assert(lastPointer != NULL);
  while (classPointer != lastPointer) {
    assert(*((void **)classPointer) != NULL);
    classPointer = (&classPointer)[1];
  }
}


x86 assembly (clang, -O0):
<test_classIsComplete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1174 <test_classIsComplete+0x64>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x0(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1144 <test_classIsComplete+0x34>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_classIsComplete>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
cmp    %r14,%rbx
je     1151 <test_classIsComplete+0x41>
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
cmpq   $0x0,(%rbx)
setne  %dil
call   1030 <assert@plt>
jmp    1140 <test_classIsComplete+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @test_classIsComplete(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 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
br label %13
13: ; preds = %17, %2
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = icmp ne i8* %14, %15
br i1 %16, label %17, label %26
17: ; preds = %13
%18 = load i8*, i8** %3
%19 = bitcast i8* %18 to i8**
%20 = load i8*, i8** %19
%21 = icmp ne i8* %20, null
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = getelementptr inbounds i8*, i8** %3, i64 1
%25 = load i8*, i8** %24
store i8* %25, i8** %3
br label %13
26: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @test_classIsComplete(i8* %0, i8* readnone %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i8* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = icmp eq i8* %0, %1
br i1 %9, label %17, label %10
10: ; preds = %2
%11 = bitcast i8* %0 to i8**
br label %12
12: ; preds = %12, %10
%13 = load i8*, i8** %11
%14 = icmp ne i8* %13, null
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
br label %12
17: ; preds = %2
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
int cow_str_rfind(const char *str, char c) {
  char *p = strrchr(str, c);
  return (p) ? (p - str) : -1;
}


x86 assembly (clang, -O0):
<cow_str_rfind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <cow_str_rfind+0x42>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1162 <cow_str_rfind+0x52>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1162 <cow_str_rfind+0x52>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cow_str_rfind>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strrchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cow_str_rfind(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %4
%8 = call i8* @strrchr(i8* %6, i8 signext %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = load i8*, i8** %3
%14 = ptrtoint i8* %12 to i64
%15 = ptrtoint i8* %13 to i64
%16 = sub i64 %14, %15
br label %18
17: ; preds = %2
br label %18
18: ; preds = %17, %11
%19 = phi i64 [ %16, %11 ], [ -1, %17 ]
%20 = trunc i64 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @cow_str_rfind(i8* %0, i8 signext %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
size_t strlen(char const *);
size_t ustrlen(const unsigned char *s) { return strlen((const char *)s); }


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

x86 assembly (clang, -O2):
<ustrlen>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i64 @ustrlen(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
ret i64 %2
}
/* Variables and functions */
int drand48();
void get_randoms(int *numbers, int upper) {
  int i;
  for (i = upper - 1; i > 0; i -= 1) {
    numbers[i] = i * drand48();
  }
}


x86 assembly (clang, -O0):
<get_randoms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    115e <get_randoms+0x4e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <drand48@plt>
mov    -0x14(%rbp),%edx
imul   %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <get_randoms+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_randoms>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     113f <get_randoms+0x2f>
mov    %rdi,%r14
mov    %esi,%ebx
nop
lea    -0x1(%rbx),%r15
xor    %eax,%eax
call   1030 <drand48@plt>
imul   %r15d,%eax
mov    %r15d,%ecx
mov    %eax,(%r14,%rcx,4)
cmp    $0x2,%rbx
mov    %r15,%rbx
ja     1120 <get_randoms+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @get_randoms(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
br label %8
8: ; preds = %19, %2
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i32, i32* %5
%13 = call i32 (...) @drand48()
%14 = mul nsw i32 %12, %13
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
store i32 %14, i32* %18
br label %19
19: ; preds = %11
%20 = load i32, i32* %5
%21 = sub nsw i32 %20, 1
store i32 %21, i32* %5
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @get_randoms(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = trunc i64 %8 to i32
%10 = tail call i32 (...) @drand48()
%11 = mul nsw i32 %10, %9
%12 = and i64 %8, 4294967295
%13 = getelementptr inbounds i32, i32* %0, i64 %12
store i32 %11, i32* %13
%14 = icmp ugt i64 %7, 2
br i1 %14, label %6, label %15
15: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int puts(const char *s) {
  int i = 0;
  abort();
  return i;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<puts>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @puts(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int *g(int *);
int *f2(int *x) {
  switch (*x) {
  case 1:
    return g(x);
  case 2:
    return g(x);
  }
  return g(x);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x1,%eax
je     1144 <f2+0x34>
jmp    1133 <f2+0x23>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     1156 <f2+0x46>
jmp    1168 <f2+0x58>
mov    -0x10(%rbp),%rdi
call   1030 <g@plt>
mov    %rax,-0x8(%rbp)
jmp    1175 <f2+0x65>
mov    -0x10(%rbp),%rdi
call   1030 <g@plt>
mov    %rax,-0x8(%rbp)
jmp    1175 <f2+0x65>
mov    -0x10(%rbp),%rdi
call   1030 <g@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
jmp    1030 <g@plt>

LLVM IR (-O0):
define i32* @f2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
switch i32 %5, label %12 [
i32 1, label %6
i32 2, label %9
]
6: ; preds = %1
%7 = load i32*, i32** %3
%8 = call i32* @g(i32* %7)
store i32* %8, i32** %2
br label %15
9: ; preds = %1
%10 = load i32*, i32** %3
%11 = call i32* @g(i32* %10)
store i32* %11, i32** %2
br label %15
12: ; preds = %1
%13 = load i32*, i32** %3
%14 = call i32* @g(i32* %13)
store i32* %14, i32** %2
br label %15
15: ; preds = %12, %9, %6
%16 = load i32*, i32** %2
ret i32* %16
}

LLVM IR (-O2):
define i32* @f2(i32* %0) {
%2 = tail call i32* @g(i32* %0)
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clearscreen() { printf("\033[2J"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
define void @clearscreen() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void eglMakeCurrent(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglMakeCurrent() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ erf(int /*<<< orphan*/);
float log10(int /*<<< orphan*/);
int /*<<< orphan*/ sqrt(float);
float log10_chi2_k1_cdf(float x) { return log10(erf(sqrt(x / 2))); }


x86 assembly (clang, -O0):
<log10_chi2_k1_cdf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeb6(%rip),%xmm1
divss  %xmm1,%xmm0
call   1040 <sqrt@plt>
mov    %eax,%edi
call   1050 <erf@plt>
mov    %eax,%edi
call   1030 <log10@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10_chi2_k1_cdf>:
push   %rax
mulss  0xec7(%rip),%xmm0
call   1040 <sqrt@plt>
mov    %eax,%edi
call   1050 <erf@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <log10@plt>

LLVM IR (-O0):
define float @log10_chi2_k1_cdf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float %3, 2.000000e+00
%5 = call i32 @sqrt(float %4)
%6 = call i32 @erf(i32 %5)
%7 = call float @log10(i32 %6)
ret float %7
}

LLVM IR (-O2):
define float @log10_chi2_k1_cdf(float %0) {
%2 = fmul float %0, 5.000000e-01
%3 = tail call i32 @sqrt(float %2)
%4 = tail call i32 @erf(i32 %3)
%5 = tail call float @log10(i32 %4)
ret float %5
}
void format_synerr(msg, arg) const char *msg, arg[];
{
  char errmsg[2048];
  (void)snprintf(errmsg, sizeof(errmsg), msg, arg);
  synerr(errmsg);
}


x86 assembly (clang, -O0):
<format_synerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x800,%esi
mov    $0x0,%al
call   1030 <snprintf@plt>
lea    -0x810(%rbp),%rdi
mov    $0x0,%al
call   1040 <synerr@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_synerr>:
push   %rbx
sub    $0x800,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    $0x800,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <snprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <synerr@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @format_synerr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [2048 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %6, i64 2048, i8* %7, i8* %8)
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @synerr to i32 (i8*, ...)*)(i8* %10)
ret void
}

LLVM IR (-O2):
define void @format_synerr(i8* nocapture %0, i8* %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %4, i64 2048, i8* %0, i8* %1)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @synerr to i32 (i8*, ...)*)(i8* %4)
ret void
}
void foo362(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo362(i32 %0) {
ret void
}
int main() {
  int x;
  while (1) {
    x = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
jmp    110b <main+0xb>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
store i32 0, i32* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void prompt() {
  printf("Hello, welcome to this shitty game of tic-tac-toe\n");
  printf("------------------------------------------------\n");
  printf("                1 - Start game\n");
  printf("                2 - Quit\n");
  printf("just gimme a number and let\'s get it on (oh yeahhhh...): ");
}


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

x86 assembly (clang, -O2):
<prompt>:
push   %rax
lea    0xf12(%rip),%rdi
call   1030 <puts@plt>
lea    0xf38(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf70(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"Hello, welcome to this shitty game of tic-tac-toe\0A\00"
@.str.1 = [50 x i8] c"------------------------------------------------\0A\00"
@.str.2 = [32 x i8] c" 1 - Start game\0A\00"
@.str.3 = [26 x i8] c" 2 - Quit\0A\00"
@.str.4 = [58 x i8] c"just gimme a number and let's get it on (oh yeahhhh...): \00"
define void @prompt() {
%1 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.4 = [58 x i8] c"just gimme a number and let's get it on (oh yeahhhh...): \00"
@str = [50 x i8] c"Hello, welcome to this shitty game of tic-tac-toe\00"
@str.5 = [49 x i8] c"------------------------------------------------\00"
@str.6 = [31 x i8] c" 1 - Start game\00"
@str.7 = [25 x i8] c" 2 - Quit\00"
define void @prompt() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int interrupt_chk__();
int fm68k_would_interrupt(void) { return interrupt_chk__(); }


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

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

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

LLVM IR (-O2):
define i32 @fm68k_would_interrupt() {
%1 = tail call i32 (...) @interrupt_chk__()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() { printf("  -m x    size of mmap in pages (default 1000)\n"); }


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

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

LLVM IR (-O0):
@.str = [48 x i8] c" -m x size of mmap in pages (default 1000)\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [47 x i8] c" -m x size of mmap in pages (default 1000)\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ acos(int /*<<< orphan*/);
float glmDegf(int /*<<< orphan*/);
int /*<<< orphan*/ glmDotProduct2f(float const *, float const *);
float glmComputeNormalizedVectorAngle2fDeg(const float v1[2],
                                           const float v2[2]) {
  return glmDegf(acos(glmDotProduct2f(v1, v2)));
}


x86 assembly (clang, -O0):
<glmComputeNormalizedVectorAngle2fDeg>:
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   1050 <glmDotProduct2f@plt>
mov    %eax,%edi
call   1030 <acos@plt>
mov    %eax,%edi
call   1040 <glmDegf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeNormalizedVectorAngle2fDeg>:
push   %rax
call   1050 <glmDotProduct2f@plt>
mov    %eax,%edi
call   1030 <acos@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <glmDegf@plt>

LLVM IR (-O0):
define float @glmComputeNormalizedVectorAngle2fDeg(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = call i32 @glmDotProduct2f(float* %5, float* %6)
%8 = call i32 @acos(i32 %7)
%9 = call float @glmDegf(i32 %8)
ret float %9
}

LLVM IR (-O2):
define float @glmComputeNormalizedVectorAngle2fDeg(float* %0, float* %1) {
%3 = tail call i32 @glmDotProduct2f(float* %0, float* %1)
%4 = tail call i32 @acos(i32 %3)
%5 = tail call float @glmDegf(i32 %4)
ret float %5
}
/* Variables and functions */
char *strchr(const char *s, int c) {
  char ch = c;
  for (;;) {
    if (*s == ch) {
      break;
    } else if (!*s) {
      return NULL;
    } else {
      s++;
    }
  }
  return (char *)s;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x15(%rbp),%ecx
cmp    %ecx,%eax
jne    1129 <strchr+0x29>
jmp    1159 <strchr+0x59>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1143 <strchr+0x43>
movq   $0x0,-0x8(%rbp)
jmp    1161 <strchr+0x61>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1154 <strchr+0x54>
jmp    1111 <strchr+0x11>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %8, %12, %2
%18 = phi i8* [ %0, %2 ], [ %13, %12 ], [ null, %8 ]
ret i8* %18
}
int f2(int a, unsigned b) {
  unsigned long long c;
  return __builtin_mul_overflow(a, b, &c);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
mov    -0x8(%rbp),%ecx
imul   %rcx
mov    %rax,%rcx
xor    %eax,%eax
and    $0x1,%dl
or     %dl,%al
mov    %rcx,-0x10(%rbp)
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
movslq %edi,%rcx
mov    %esi,%eax
imul   %rcx
mov    %rdx,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sext i32 %6 to i65
%9 = zext i32 %7 to i65
%10 = call { i65, i1 } @llvm.smul.with.overflow.i65(i65 %8, i65 %9)
%11 = extractvalue { i65, i1 } %10, 1
%12 = extractvalue { i65, i1 } %10, 0
%13 = trunc i65 %12 to i64
%14 = zext i64 %13 to i65
%15 = icmp ne i65 %12, %14
%16 = or i1 %11, %15
store i64 %13, i64* %5
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = sext i32 %0 to i65
%4 = zext i32 %1 to i65
%5 = mul nsw i65 %4, %3
%6 = lshr i65 %5, 64
%7 = trunc i65 %6 to i32
ret i32 %7
}
void gtk_button_pressed() {}


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

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

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

LLVM IR (-O2):
define void @gtk_button_pressed() {
ret void
}
void gtk_image_set_from_animation() {}


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

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

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

LLVM IR (-O2):
define void @gtk_image_set_from_animation() {
ret void
}
/* Variables and functions */
int sin(int);
int internal_sin_i(int value) { return sin(value); }


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

x86 assembly (clang, -O2):
<internal_sin_i>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define i32 @internal_sin_i(i32 %0) {
%2 = tail call i32 @sin(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("The NUMBER is %d\n", 2);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"The NUMBER is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"The NUMBER is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
void le_write16(void *addr, const unsigned value) {
  unsigned char *p = (unsigned char *)addr;
  p[0] = value;
  p[1] = value >> 8;
}


x86 assembly (clang, -O0):
<le_write16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_write16>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @le_write16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = lshr i32 %11, 8
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
ret void
}

LLVM IR (-O2):
define void @le_write16(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rst(int);
void opcode_cf() { rst(0x08); }


x86 assembly (clang, -O0):
<opcode_cf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <rst@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<opcode_cf>:
mov    $0x8,%edi
jmp    1030 <rst@plt>

LLVM IR (-O0):
define void @opcode_cf() {
%1 = call i32 @rst(i32 8)
ret void
}

LLVM IR (-O2):
define void @opcode_cf() {
%1 = tail call i32 @rst(i32 8)
ret void
}
void *clamp(void *ptr, void *llimit, void *rlimit) {
  if (__builtin_expect(!!(ptr < llimit), 0)) {
    return llimit;
  } else if (__builtin_expect(!!(ptr > rlimit), 0)) {
    return rlimit;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
setb   %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
cmp    $0x0,%rax
je     113d <clamp+0x3d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <clamp+0x77>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
seta   %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
cmp    $0x0,%rax
je     116a <clamp+0x6a>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <clamp+0x77>
jmp    116f <clamp+0x6f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %rsi,%rax
cmp    %rdx,%rdi
cmovbe %rdi,%rdx
cmp    %rsi,%rdi
jb     1112 <clamp+0x12>
mov    %rdx,%rax
ret

LLVM IR (-O0):
define i8* @clamp(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = icmp ult i8* %8, %9
%11 = xor i1 %10, true
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
%14 = sext i32 %13 to i64
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %3
%17 = load i8*, i8** %6
store i8* %17, i8** %4
br label %32
18: ; preds = %3
%19 = load i8*, i8** %5
%20 = load i8*, i8** %7
%21 = icmp ugt i8* %19, %20
%22 = xor i1 %21, true
%23 = xor i1 %22, true
%24 = zext i1 %23 to i32
%25 = sext i32 %24 to i64
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %18
%28 = load i8*, i8** %7
store i8* %28, i8** %4
br label %32
29: ; preds = %18
br label %30
30: ; preds = %29
%31 = load i8*, i8** %5
store i8* %31, i8** %4
br label %32
32: ; preds = %30, %27, %16
%33 = load i8*, i8** %4
ret i8* %33
}

LLVM IR (-O2):
define i8* @clamp(i8* readnone %0, i8* readnone %1, i8* readnone %2) {
%4 = icmp ult i8* %0, %1
%5 = icmp ugt i8* %0, %2
%6 = select i1 %5, i8* %2, i8* %0
%7 = select i1 %4, i8* %1, i8* %6
ret i8* %7
}
float ldexpf(float x, int n) { return __builtin_ldexpf(x, n); }


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

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

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

LLVM IR (-O2):
define float @ldexpf(float %0, i32 %1) {
br label %3
3: ; preds = %3, %2
br label %3
}
int Rand(n) {
  unsigned char x[2];
  RAND_pseudo_bytes(x, 2);
  return (x[0] + 2 * x[1]);
}


x86 assembly (clang, -O0):
<Rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x6(%rbp),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <RAND_pseudo_bytes@plt>
movzbl -0x6(%rbp),%eax
movzbl -0x5(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rand>:
push   %rax
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <RAND_pseudo_bytes@plt>
movzbl 0x6(%rsp),%eax
movzbl 0x7(%rsp),%ecx
lea    (%rax,%rcx,2),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Rand(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @RAND_pseudo_bytes to i32 (i8*, i32, ...)*)(i8* %4, i32 2)
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = mul nsw i32 2, %11
%13 = add nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @Rand(i32 %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @RAND_pseudo_bytes to i32 (i8*, i32, ...)*)(i8* %3, i32 2)
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl nuw nsw i32 %9, 1
%11 = add nuw nsw i32 %10, %6
ret i32 %11
}
int f5(int *i) { return ++(*i); }


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

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

LLVM IR (-O0):
define i32 @f5(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
store i32 %5, i32* %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @f5(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret i32 %3
}
int quesCount(char *pattern) {
  int i = 0;
  int count = 0;
  while (pattern[i] != '\0') {
    if (pattern[i] == '?' && pattern[i - 1] != '\\') {
      count++;
    }
    i++;
  }
  return count;
}


x86 assembly (clang, -O0):
<quesCount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1171 <quesCount+0x71>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3f,%eax
jne    1163 <quesCount+0x63>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
je     1163 <quesCount+0x63>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <quesCount+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quesCount>:
xor    %eax,%eax
jmp    111f <quesCount+0x1f>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %ecx,%ecx
cmpb   $0x5c,-0x1(%rdi)
setne  %cl
add    %ecx,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x3f,%cl
je     1110 <quesCount+0x10>
test   %cl,%cl
jne    111b <quesCount+0x1b>
ret

LLVM IR (-O0):
define i32 @quesCount(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %33, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %36
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 63
br i1 %20, label %21, label %33
21: ; preds = %13
%22 = load i8*, i8** %2
%23 = load i32, i32* %3
%24 = sub nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %22, i64 %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 92
br i1 %29, label %30, label %33
30: ; preds = %21
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %33
33: ; preds = %30, %21, %13
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %5
36: ; preds = %5
%37 = load i32, i32* %4
ret i32 %37
}

LLVM IR (-O2):
define i32 @quesCount(i8* nocapture %0) {
br label %2
2: ; preds = %14, %1
%3 = phi i64 [ %16, %14 ], [ 0, %1 ]
%4 = phi i32 [ %15, %14 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %14 [
i8 0, label %17
i8 63, label %7
]
7: ; preds = %2
%8 = add nsw i64 %3, -1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 92
%12 = zext i1 %11 to i32
%13 = add nsw i32 %4, %12
br label %14
14: ; preds = %7, %2
%15 = phi i32 [ %4, %2 ], [ %13, %7 ]
%16 = add nuw i64 %3, 1
br label %2
17: ; preds = %2
ret i32 %4
}