xunge/DecIR huggingface dataset:
int clk_disable_after(void *privdata, int failed) {
  printk("[%s] :%s   failed:%d\n", __func__, privdata, failed);
  return 0;
}


x86 assembly (clang, -O0):
<clk_disable_after>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xed3(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1030 <printk@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clk_disable_after>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xef2(%rip),%rsi
xor    %eax,%eax
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"[%s] :%s failed:%d\0A\00"
@__func__.clk_disable_after = [18 x i8] c"clk_disable_after\00"
define i32 @clk_disable_after(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.clk_disable_after, i64 0, i64 0), i8* %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"[%s] :%s failed:%d\0A\00"
@__func__.clk_disable_after = [18 x i8] c"clk_disable_after\00"
define i32 @clk_disable_after(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.clk_disable_after, i64 0, i64 0), i8* %0, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PerfxMain_IterationWithTimeout(int /*<<< orphan*/);
void PerfxMain_Iteration(void) { PerfxMain_IterationWithTimeout(0); }


x86 assembly (clang, -O0):
<PerfxMain_Iteration>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <PerfxMain_IterationWithTimeout@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @PerfxMain_Iteration() {
%1 = call i32 @PerfxMain_IterationWithTimeout(i32 0)
ret void
}

LLVM IR (-O2):
define void @PerfxMain_Iteration() {
%1 = tail call i32 @PerfxMain_IterationWithTimeout(i32 0)
ret void
}
/* Type definitions */
struct aho_trie {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ aho_clean_trie_node(struct aho_trie *);
void aho_destroy_trie(struct aho_trie *restrict t) { aho_clean_trie_node(t); }


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

x86 assembly (clang, -O2):
<aho_destroy_trie>:
jmp    1030 <aho_clean_trie_node@plt>

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

LLVM IR (-O2):
%struct.aho_trie = type { i32 }
define void @aho_destroy_trie(%struct.aho_trie* noalias %0) {
%2 = tail call i32 @aho_clean_trie_node(%struct.aho_trie* %0)
ret void
}
f(int x) {
  { int x = 3; }
}


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

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int execve(const char *name, char *const argv[], char *const envp[]) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<execve>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<execve>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @execve(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ zmsleep(long);
void zsleep(long delay) { zmsleep(delay * 1000); }


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

x86 assembly (clang, -O2):
<zsleep>:
imul   $0x3e8,%rdi,%rdi
jmp    1030 <zmsleep@plt>

LLVM IR (-O0):
define void @zsleep(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 1000
%5 = call i32 @zmsleep(i64 %4)
ret void
}

LLVM IR (-O2):
define void @zsleep(i64 %0) {
%2 = mul nsw i64 %0, 1000
%3 = tail call i32 @zmsleep(i64 %2)
ret void
}
/* Variables and functions */
int foo(char *, int, char *, int);
void bar(signed char *w, signed char *x, int i, int *result) {
  *result = foo(w, 16, x, i);
}


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

x86 assembly (clang, -O2):
<bar>:
push   %rbx
mov    %rcx,%rbx
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x10,%esi
call   1030 <foo@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @bar(i8* %0, i8* %1, i32 %2, i32* nocapture writeonly %3) {
%5 = tail call i32 @foo(i8* %0, i32 16, i8* %1, i32 %2)
store i32 %5, i32* %3
ret void
}
void printchar(char **str, int c) {
  extern void U0putch(int c);
  if (str) {
    **str = c;
    ++(*str);
  } else
    (void)U0putch(c);
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <printchar+0x3b>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1153 <printchar+0x43>
mov    -0xc(%rbp),%edi
call   1030 <U0putch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
test   %rdi,%rdi
je     1120 <printchar+0x10>
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret
mov    %esi,%edi
jmp    1030 <U0putch@plt>

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

LLVM IR (-O2):
define void @printchar(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = trunc i32 %1 to i8
%6 = load i8*, i8** %0
store i8 %5, i8* %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
br label %10
9: ; preds = %2
tail call void @U0putch(i32 %1)
br label %10
10: ; preds = %9, %4
ret void
}
/* Variables and functions */
int ancil_recv_fds_with_buffer_from(int, int *, unsigned int, void *,
                                    int /*<<< orphan*/ *, int /*<<< orphan*/);
int ancil_recv_fds_with_buffer(int sock, int *fds, unsigned n_fds,
                               void *buffer) {
  return ancil_recv_fds_with_buffer_from(sock, fds, n_fds, buffer, NULL, 0);
}


x86 assembly (clang, -O0):
<ancil_recv_fds_with_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <ancil_recv_fds_with_buffer_from@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ancil_recv_fds_with_buffer>:
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <ancil_recv_fds_with_buffer_from@plt>

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

LLVM IR (-O2):
define i32 @ancil_recv_fds_with_buffer(i32 %0, i32* %1, i32 %2, i8* %3) {
%5 = tail call i32 @ancil_recv_fds_with_buffer_from(i32 %0, i32* %1, i32 %2, i8* %3, i32* null, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int test_return_in_catch_f();
void test_return_in_catch() { assert(test_return_in_catch_f() == 1); }


x86 assembly (clang, -O0):
<test_return_in_catch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_return_in_catch_f@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_return_in_catch>:
push   %rax
xor    %eax,%eax
call   1040 <test_return_in_catch_f@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @test_return_in_catch() {
%1 = call i32 (...) @test_return_in_catch_f()
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
ret void
}

LLVM IR (-O2):
define void @test_return_in_catch() {
%1 = tail call i32 (...) @test_return_in_catch_f()
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
/* Variables and functions */
int rb(int /*<<< orphan*/);
int getmarker(void) {
  int c;
  c = rb(0);
  if (c == -1)
    return -1;
  if (c != 0xff)
    return -1;
  c = rb(0);
  return c;
}


x86 assembly (clang, -O0):
<getmarker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <rb@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1138 <getmarker+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <getmarker+0x51>
cmpl   $0xff,-0x8(%rbp)
je     1151 <getmarker+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <getmarker+0x51>
xor    %edi,%edi
call   1030 <rb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmarker>:
push   %rax
xor    %edi,%edi
call   1030 <rb@plt>
cmp    $0xff,%eax
jne    1127 <getmarker+0x17>
xor    %edi,%edi
pop    %rax
jmp    1030 <rb@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getmarker() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @rb(i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %14
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 255
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 -1, i32* %1
br label %14
11: ; preds = %7
%12 = call i32 @rb(i32 0)
store i32 %12, i32* %2
%13 = load i32, i32* %2
store i32 %13, i32* %1
br label %14
14: ; preds = %11, %10, %6
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @getmarker() {
%1 = tail call i32 @rb(i32 0)
%2 = icmp eq i32 %1, 255
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @rb(i32 0)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ -1, %0 ]
ret i32 %6
}
/* Variables and functions */
int backup_sync_msg(int, int, int, void *);
int Backup_read(int id, void *addr) { return backup_sync_msg(3, 2, id, addr); }


x86 assembly (clang, -O0):
<Backup_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    $0x3,%edi
mov    $0x2,%esi
call   1030 <backup_sync_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Backup_read>:
mov    %rsi,%rcx
mov    %edi,%edx
mov    $0x3,%edi
mov    $0x2,%esi
jmp    1030 <backup_sync_msg@plt>

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

LLVM IR (-O2):
define i32 @Backup_read(i32 %0, i8* %1) {
%3 = tail call i32 @backup_sync_msg(i32 3, i32 2, i32 %0, i8* %1)
ret i32 %3
}
void get_message() {}


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

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

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

LLVM IR (-O2):
define void @get_message() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int fred(int p) {
  printf("yo %d\n", p);
  return 42;
}


x86 assembly (clang, -O0):
<fred>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2a,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fred>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2a,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"yo %d\0A\00"
define i32 @fred(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 42
}

LLVM IR (-O2):
@.str = [7 x i8] c"yo %d\0A\00"
define i32 @fred(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 42
}
/* Type definitions */
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int Cyc_slurp_rec(struct Cyc_Lexing_lexbuf *, int);
int Cyc_slurp(struct Cyc_Lexing_lexbuf *lexbuf) {
  int _T0;
  _T0 = Cyc_slurp_rec(lexbuf, 5);
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_slurp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
call   1030 <Cyc_slurp_rec@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_slurp>:
mov    $0x5,%esi
jmp    1030 <Cyc_slurp_rec@plt>

LLVM IR (-O0):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_slurp(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca i32
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call i32 @Cyc_slurp_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 5)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_slurp(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_slurp_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 5)
ret i32 %2
}
int calculaVelocidade(int holesForSec, float defDelay) {
  float pi = 3.14;
  float radius = 5.75;
  int holes = 608;
  int speed = (2 * pi * (radius / holes) * (holesForSec / (defDelay / 1000)));
  return speed;
}


x86 assembly (clang, -O0):
<calculaVelocidade>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  0xef8(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xee7(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x260,-0x14(%rbp)
movss  0xecf(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
cvtsi2ssl -0x14(%rbp),%xmm2
divss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
movss  0xea2(%rip),%xmm3
divss  %xmm3,%xmm2
divss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculaVelocidade>:
cvtsi2ss %edi,%xmm1
divss  0xef4(%rip),%xmm0
divss  %xmm0,%xmm1
mulss  0xeec(%rip),%xmm1
cvttss2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @calculaVelocidade(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store float %1, float* %4
store float 0x40091EB860000000, float* %5
store float 5.750000e+00, float* %6
store i32 608, i32* %7
%9 = load float, float* %5
%10 = fmul float 2.000000e+00, %9
%11 = load float, float* %6
%12 = load i32, i32* %7
%13 = sitofp i32 %12 to float
%14 = fdiv float %11, %13
%15 = fmul float %10, %14
%16 = load i32, i32* %3
%17 = sitofp i32 %16 to float
%18 = load float, float* %4
%19 = fdiv float %18, 1.000000e+03
%20 = fdiv float %17, %19
%21 = fmul float %15, %20
%22 = fptosi float %21 to i32
store i32 %22, i32* %8
%23 = load i32, i32* %8
ret i32 %23
}

LLVM IR (-O2):
define i32 @calculaVelocidade(i32 %0, float %1) {
%3 = sitofp i32 %0 to float
%4 = fdiv float %1, 1.000000e+03
%5 = fdiv float %3, %4
%6 = fmul float %5, 0x3FAE688E60000000
%7 = fptosi float %6 to i32
ret i32 %7
}
void lll_prof_exit_ull_high(void) {}


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

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

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

LLVM IR (-O2):
define void @lll_prof_exit_ull_high() {
ret void
}
/* Variables and functions */
int anetTcpGenericConnect(char *, char const *, int, char const *, int);
int anetTcpNonBlockBindConnect(char *err, const char *addr, int port,
                               const char *source_addr) {
  return anetTcpGenericConnect(err, addr, port, source_addr, 1);
}


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

x86 assembly (clang, -O2):
<anetTcpNonBlockBindConnect>:
mov    $0x1,%r8d
jmp    1030 <anetTcpGenericConnect@plt>

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

LLVM IR (-O2):
define i32 @anetTcpNonBlockBindConnect(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @anetTcpGenericConnect(i8* %0, i8* %1, i32 %2, i8* %3, i32 1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ error_sys_report(char const *);
int /*<<< orphan*/ exit(int);
void error_sys_exit(const char *msg) {
  error_sys_report(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<error_sys_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <error_sys_report@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_sys_exit>:
push   %rax
call   1030 <error_sys_report@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @error_sys_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error_sys_report(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @error_sys_exit(i8* %0) {
%2 = tail call i32 @error_sys_report(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int hea_test_u64_bit(int /*<<< orphan*/ const, int);
int hea_cq_aer_length_align_err_check(const __u64 *aer) {
  return hea_test_u64_bit(*aer, 35);
}


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

x86 assembly (clang, -O2):
<hea_cq_aer_length_align_err_check>:
mov    (%rdi),%edi
mov    $0x23,%esi
jmp    1030 <hea_test_u64_bit@plt>

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

LLVM IR (-O2):
define i32 @hea_cq_aer_length_align_err_check(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @hea_test_u64_bit(i32 %2, i32 35)
ret i32 %3
}
/* Type definitions */
struct extent_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ btrfs_clear_lock_blocking_rw(struct extent_buffer *, int);
void btrfs_clear_lock_blocking(struct extent_buffer *eb) {
  btrfs_clear_lock_blocking_rw(eb, 3);
}


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

x86 assembly (clang, -O2):
<btrfs_clear_lock_blocking>:
mov    $0x3,%esi
jmp    1030 <btrfs_clear_lock_blocking_rw@plt>

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

LLVM IR (-O2):
%struct.extent_buffer = type { i32 }
define void @btrfs_clear_lock_blocking(%struct.extent_buffer* %0) {
%2 = tail call i32 @btrfs_clear_lock_blocking_rw(%struct.extent_buffer* %0, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int *);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ merge_sort(int *, int, int *);
void sort(int a[], int n) {
  int *temp = malloc(n * sizeof(int));
  assert(temp);
  merge_sort(a, n, temp);
  free(temp);
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1060 <merge_sort@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x0(,%r15,4),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <assert@plt>
mov    %r14,%rdi
mov    %r15d,%esi
mov    %rbx,%rdx
call   1060 <merge_sort@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @sort(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 = sext i32 %6 to i64
%8 = mul i64 %7, 4
%9 = trunc i64 %8 to i32
%10 = call i32* @malloc(i32 %9)
store i32* %10, i32** %5
%11 = load i32*, i32** %5
%12 = call i32 @assert(i32* %11)
%13 = load i32*, i32** %3
%14 = load i32, i32* %4
%15 = load i32*, i32** %5
%16 = call i32 @merge_sort(i32* %13, i32 %14, i32* %15)
%17 = load i32*, i32** %5
%18 = call i32 @free(i32* %17)
ret void
}

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i32* @malloc(i32 %3)
%5 = tail call i32 @assert(i32* %4)
%6 = tail call i32 @merge_sort(i32* %0, i32 %1, i32* %4)
%7 = tail call i32 @free(i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
void print_help(const char *progname) {
  printf("Query OpenGL resource (vidmem and GPU-mapped sysmem) usage\n\n"
         "Usage: %s -p pid\n"
         "       %s -h\n\n"
         "  -h: print this help message\n"
         "  -p <pid>: select process to query\n",
         progname, progname);
}


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

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

LLVM IR (-O0):
@.str = [158 x i8] c"Query OpenGL resource (vidmem and GPU-mapped sysmem) usage\0A\0AUsage: %s -p pid\0A %s -h\0A\0A -h: print this help message\0A -p <pid>: select process to query\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [158 x i8] c"Query OpenGL resource (vidmem and GPU-mapped sysmem) usage\0A\0AUsage: %s -p pid\0A %s -h\0A\0A -h: print this help message\0A -p <pid>: select process to query\0A\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
double fabs(double x) {
  __asm__ __volatile__("fldl %0;"
                       "fabs;"
                       "fstpl %0"
                       : "+m"(x));
  return x;
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
fldl   -0x8(%rbp)
fabs
fstpl  -0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
fabs
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double %3
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ aes_enc_dec(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int);
void AES_128_DEC(unsigned const char *key, unsigned const char *msg,
                 unsigned char *cipher) {
  unsigned char key_copy[16];
  memcpy(cipher, msg, 16);
  memcpy(key_copy, key, 16);
  aes_enc_dec(cipher, key_copy, 1);
}


x86 assembly (clang, -O0):
<AES_128_DEC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x1,%edx
call   1040 <aes_enc_dec@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AES_128_DEC>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rdi,%r14
mov    %rdx,%rdi
mov    $0x10,%edx
call   1030 <memcpy@plt>
mov    %rsp,%r15
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x1,%edx
call   1040 <aes_enc_dec@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @AES_128_DEC(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [16 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = load i8*, i8** %5
%10 = call i32 @memcpy(i8* %8, i8* %9, i32 16)
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%12 = load i8*, i8** %4
%13 = call i32 @memcpy(i8* %11, i8* %12, i32 16)
%14 = load i8*, i8** %6
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%16 = call i32 @aes_enc_dec(i8* %14, i8* %15, i32 1)
ret void
}

LLVM IR (-O2):
define void @AES_128_DEC(i8* %0, i8* %1, i8* %2) {
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = tail call i32 @memcpy(i8* %2, i8* %1, i32 16)
%7 = call i32 @memcpy(i8* %5, i8* %0, i32 16)
%8 = call i32 @aes_enc_dec(i8* %2, i8* %5, i32 1)
ret void
}
char nma_int_to_hex(char code) {
  static char hex[] = "0123456789abcdef";
  return hex[code & 15];
}


x86 assembly (clang, -O0):
<nma_int_to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0x2f15(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nma_int_to_hex>:
and    $0xf,%edi
lea    0xef6(%rip),%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
@nma_int_to_hex.hex = internal global [17 x i8] c"0123456789abcdef\00"
define signext i8 @nma_int_to_hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 15
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [17 x i8], [17 x i8]* @nma_int_to_hex.hex, i64 0, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
@nma_int_to_hex.hex = internal unnamed_addr constant [17 x i8] c"0123456789abcdef\00"
define signext i8 @nma_int_to_hex(i8 signext %0) {
%2 = and i8 %0, 15
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds [17 x i8], [17 x i8]* @nma_int_to_hex.hex, i64 0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
int test_imm_A1uint16_reg(unsigned short val) {
  return ((val) & (0xA1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A1uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xa1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_A1uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 161
%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_A1uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 161
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char name[128] = {0};
  printf("What is your name?");
  scanf("%s", name);
  printf("Hello, %s, nice to meet you!\n", name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x90(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x90(%rbp),%rsi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xea7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xe9d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"What is your name?\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [30 x i8] c"Hello, %s, nice to meet you!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
store i32 0, i32* %1
%3 = bitcast [128 x i8]* %2 to i8*
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"What is your name?\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [30 x i8] c"Hello, %s, nice to meet you!\0A\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TimerEnable(int, int);
void wave_interrupt_start(void) { TimerEnable(0x40031000, 0x000000ff); }


x86 assembly (clang, -O0):
<wave_interrupt_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40031000,%edi
mov    $0xff,%esi
call   1030 <TimerEnable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_interrupt_start>:
mov    $0x40031000,%edi
mov    $0xff,%esi
jmp    1030 <TimerEnable@plt>

LLVM IR (-O0):
define void @wave_interrupt_start() {
%1 = call i32 @TimerEnable(i32 1073942528, i32 255)
ret void
}

LLVM IR (-O2):
define void @wave_interrupt_start() {
%1 = tail call i32 @TimerEnable(i32 1073942528, i32 255)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ mbstate_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
size_t wcrtomb(char *, int /*<<< orphan*/, int /*<<< orphan*/ *);
size_t wcrtomb_l(char *str, wchar_t wc, mbstate_t *ps, locale_t loc) {
  return wcrtomb(str, wc, ps);
}


x86 assembly (clang, -O0):
<wcrtomb_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <wcrtomb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcrtomb_l>:
jmp    1030 <wcrtomb@plt>

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

LLVM IR (-O2):
define i64 @wcrtomb_l(i8* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i64 @wcrtomb(i8* %0, i32 %1, i32* %2)
ret i64 %5
}
int test_imm_A5int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xA5 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A5int64_midword_mem>:
testb  $0xa5,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A5int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 10813440
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
const char *pathcon_nm7_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  case 1:
    return "i1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<pathcon_nm7_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <pathcon_nm7_name_in+0x2b>
jmp    111a <pathcon_nm7_name_in+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <pathcon_nm7_name_in+0x3b>
jmp    114b <pathcon_nm7_name_in+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathcon_nm7_name_in+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathcon_nm7_name_in+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm7_name_in>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @pathcon_nm7_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @pathcon_nm7_name_in(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int led_get();
int /*<<< orphan*/ led_set(int);
void led_toggle(uint32_t led_id) {
  uint32_t v = led_get();
  v ^= 1 << (led_id << 4);
  led_set(v);
}


x86 assembly (clang, -O0):
<led_toggle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <led_get@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
shl    $0x4,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <led_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_toggle>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <led_get@plt>
shl    $0x4,%ebx
btc    %ebx,%eax
mov    %eax,%edi
pop    %rbx
jmp    1040 <led_set@plt>

LLVM IR (-O0):
define void @led_toggle(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @led_get()
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = shl i32 %5, 4
%7 = shl i32 1, %6
%8 = load i32, i32* %3
%9 = xor i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @led_set(i32 %10)
ret void
}

LLVM IR (-O2):
define void @led_toggle(i32 %0) {
%2 = tail call i32 (...) @led_get()
%3 = shl i32 %0, 4
%4 = shl nuw i32 1, %3
%5 = xor i32 %2, %4
%6 = tail call i32 @led_set(i32 %5)
ret void
}
int MAX(int a, int b) { return (a > b ? a : b); }


x86 assembly (clang, -O0):
<MAX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <MAX+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <MAX+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @MAX(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @MAX(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int handle_zng(int ret) {
  switch (ret) {
  case -1:
    return -1;
    break;
  case 0:
    return 0;
    break;
  default:
    return -2;
    break;
  }
  return -2;
}


x86 assembly (clang, -O0):
<handle_zng>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xffffffff,%eax
je     112b <handle_zng+0x2b>
jmp    111b <handle_zng+0x1b>
mov    -0xc(%rbp),%eax
test   %eax,%eax
je     1137 <handle_zng+0x37>
jmp    1143 <handle_zng+0x43>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <handle_zng+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    114a <handle_zng+0x4a>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_zng>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
add    %eax,%eax
add    $0xfffffffe,%eax
cmp    $0xffffffff,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @handle_zng(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 -1, label %5
i32 0, label %6
]
5: ; preds = %1
store i32 -1, i32* %2
br label %8
6: ; preds = %1
store i32 0, i32* %2
br label %8
7: ; preds = %1
store i32 -2, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @handle_zng(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 0, i32 -2
%4 = icmp eq i32 %0, -1
%5 = select i1 %4, i32 -1, i32 %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void dowhileloop(int i) {
  do {
    printf("%d\n", i);
    i++;
  } while (i < 5);
}


x86 assembly (clang, -O0):
<dowhileloop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jl     111b <dowhileloop+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dowhileloop>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
cmp    $0x5,%edi
mov    $0x4,%ebp
cmovge %edi,%ebp
add    $0x1,%ebp
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1130 <dowhileloop+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @dowhileloop(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 4)
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ %0, %1 ], [ %6, %3 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add i32 %4, 1
%7 = icmp eq i32 %4, %2
br i1 %7, label %8, label %3
8: ; preds = %3
ret void
}
/* Type definitions */
struct Constraint {
  int dummy;
};

/* Variables and functions */
int ConstrntLen(struct Constraint **List) {
  int i;
  int Size = 0;
  for (i = 0; List[i] != NULL; ++i)
    ++Size;
  return Size;
}


x86 assembly (clang, -O0):
<ConstrntLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1140 <ConstrntLen+0x40>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <ConstrntLen+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConstrntLen>:
cmpq   $0x0,(%rdi)
je     111d <ConstrntLen+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <ConstrntLen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.Constraint = type { i32 }
define i32 @ConstrntLen(%struct.Constraint** %0) {
%2 = alloca %struct.Constraint**
%3 = alloca i32
%4 = alloca i32
store %struct.Constraint** %0, %struct.Constraint*** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %15, %1
%6 = load %struct.Constraint**, %struct.Constraint*** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.Constraint*, %struct.Constraint** %6, i64 %8
%10 = load %struct.Constraint*, %struct.Constraint** %9
%11 = icmp ne %struct.Constraint* %10, null
br i1 %11, label %12, label %18
12: ; preds = %5
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
br label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
%struct.Constraint = type { i32 }
define i32 @ConstrntLen(%struct.Constraint** nocapture %0) {
%2 = load %struct.Constraint*, %struct.Constraint** %0
%3 = icmp eq %struct.Constraint* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds %struct.Constraint*, %struct.Constraint** %0, i64 %6
%8 = load %struct.Constraint*, %struct.Constraint** %7
%9 = icmp eq %struct.Constraint* %8, null
br i1 %9, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %6 to i32
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 0, %1 ], [ %11, %10 ]
ret i32 %13
}