xunge/DecIR huggingface dataset:
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_standard_random_coefficient_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(96, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_standard_random_coefficient_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x60,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_standard_random_coefficient_system>:
mov    $0x60,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @celcon_standard_random_coefficient_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 96, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_standard_random_coefficient_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 96, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ test122_DynMemImpl_free__E(int);
int /*<<< orphan*/ test122_DynMemImpl_malloc__E(int);
int /*<<< orphan*/ test122_Module1_foo__E();
int /*<<< orphan*/ test122_SleepWakeImpl_sleep__E(int);
int /*<<< orphan*/ test122_TestProg_bar__I();
void test122_TestProg_pollen__run__E() {
  test122_Module1_foo__E();
  test122_SleepWakeImpl_sleep__E(7);
  test122_DynMemImpl_malloc__E(3);
  test122_DynMemImpl_free__E(3);
  test122_TestProg_bar__I();
}


x86 assembly (clang, -O0):
<test122_TestProg_pollen__run__E>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <test122_Module1_foo__E@plt>
mov    $0x7,%edi
call   1040 <test122_SleepWakeImpl_sleep__E@plt>
mov    $0x3,%edi
call   1030 <test122_DynMemImpl_malloc__E@plt>
mov    $0x3,%edi
call   1060 <test122_DynMemImpl_free__E@plt>
mov    $0x0,%al
call   1050 <test122_TestProg_bar__I@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test122_TestProg_pollen__run__E>:
push   %rax
xor    %eax,%eax
call   1070 <test122_Module1_foo__E@plt>
mov    $0x7,%edi
call   1040 <test122_SleepWakeImpl_sleep__E@plt>
mov    $0x3,%edi
call   1030 <test122_DynMemImpl_malloc__E@plt>
mov    $0x3,%edi
call   1060 <test122_DynMemImpl_free__E@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test122_TestProg_bar__I@plt>

LLVM IR (-O0):
define void @test122_TestProg_pollen__run__E() {
%1 = call i32 (...) @test122_Module1_foo__E()
%2 = call i32 @test122_SleepWakeImpl_sleep__E(i32 7)
%3 = call i32 @test122_DynMemImpl_malloc__E(i32 3)
%4 = call i32 @test122_DynMemImpl_free__E(i32 3)
%5 = call i32 (...) @test122_TestProg_bar__I()
ret void
}

LLVM IR (-O2):
define void @test122_TestProg_pollen__run__E() {
%1 = tail call i32 (...) @test122_Module1_foo__E()
%2 = tail call i32 @test122_SleepWakeImpl_sleep__E(i32 7)
%3 = tail call i32 @test122_DynMemImpl_malloc__E(i32 3)
%4 = tail call i32 @test122_DynMemImpl_free__E(i32 3)
%5 = tail call i32 (...) @test122_TestProg_bar__I()
ret void
}
int stop_memory_paging(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @stop_memory_paging() {
ret i32 0
}
struct task_group *autogroup_task_group(struct task_struct *p,
                                        struct task_group *tg) {
  return tg;
}


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

x86 assembly (clang, -O2):
<autogroup_task_group>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
%struct.task_struct = type opaque
%struct.task_group = type opaque
define %struct.task_group* @autogroup_task_group(%struct.task_struct* %0, %struct.task_group* %1) {
%3 = alloca %struct.task_struct*
%4 = alloca %struct.task_group*
store %struct.task_struct* %0, %struct.task_struct** %3
store %struct.task_group* %1, %struct.task_group** %4
%5 = load %struct.task_group*, %struct.task_group** %4
ret %struct.task_group* %5
}

LLVM IR (-O2):
%struct.task_struct = type opaque
%struct.task_group = type opaque
define %struct.task_group* @autogroup_task_group(%struct.task_struct* nocapture readnone %0, %struct.task_group* readnone returned %1) {
ret %struct.task_group* %1
}
__attribute__((__noreturn__)) void exit(int code) {
  while (1) {
  }
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <exit+0x7>

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

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

LLVM IR (-O2):
define void @exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
/* Variables and functions */
int strlen(char *);
unsigned hasher(char a[]) {
  int i;
  unsigned int hash = 71;
  for (i = 0; i < strlen(a); i++) {
    hash = ((hash * 33) + a[i]) % 256;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hasher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x47,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    116e <hasher+0x5e>
imul   $0x21,-0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <hasher+0x1a>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasher>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    $0x47,%ebp
test   %eax,%eax
jle    1154 <hasher+0x44>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebp,%eax
shl    $0x5,%eax
add    %ebp,%eax
movzbl (%r14,%rbx,1),%ecx
add    %eax,%ecx
movzbl %cl,%ebp
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1130 <hasher+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @hasher(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %17
4: ; preds = %1, %4
%5 = phi i64 [ %13, %4 ], [ 0, %1 ]
%6 = phi i32 [ %12, %4 ], [ 71, %1 ]
%7 = mul nuw nsw i32 %6, 33
%8 = getelementptr inbounds i8, i8* %0, i64 %5
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = and i32 %11, 255
%13 = add nuw nsw i64 %5, 1
%14 = tail call i32 @strlen(i8* %0)
%15 = sext i32 %14 to i64
%16 = icmp slt i64 %13, %15
br i1 %16, label %4, label %17
17: ; preds = %4, %1
%18 = phi i32 [ 71, %1 ], [ %12, %4 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: ./primes <increasing positive integers>\n");
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"usage: ./primes <increasing positive integers>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"usage: ./primes <increasing positive integers>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
char abs_char(char i) { return i >= 0 ? i : -i; }


x86 assembly (clang, -O0):
<abs_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jl     1123 <abs_char+0x23>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112e <abs_char+0x2e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_char>:
mov    %edi,%ecx
sar    $0x7,%cl
lea    (%rdi,%rcx,1),%eax
xor    %cl,%al
ret

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

LLVM IR (-O2):
define signext i8 @abs_char(i8 signext %0) {
%2 = tail call i8 @llvm.abs.i8(i8 %0, i1 false)
ret i8 %2
}
int has_slash(char *s) {
  while (*s) {
    if (s[0] == '/')
      return 1;
    s++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<has_slash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <has_slash+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1131 <has_slash+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1149 <has_slash+0x49>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <has_slash+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_slash>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <has_slash+0x11>
cmp    $0x2f,%al
je     1114 <has_slash+0x14>
add    $0x1,%rdi
jmp    1100 <has_slash>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @has_slash(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 47, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %9
}
void __terminal_task(void *p) { return; }


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

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

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

LLVM IR (-O2):
define void @__terminal_task(i8* nocapture %0) {
ret void
}
char *hash_plugin_summary(void) {
  return ("samsungpin \tSamsung Anrdoid PIN lock plugin");
}


x86 assembly (clang, -O0):
<hash_plugin_summary>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_summary>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [44 x i8] c"samsungpin \09Samsung Anrdoid PIN lock plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [44 x i8] c"samsungpin \09Samsung Anrdoid PIN lock plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
unsigned int __VERIFIER_nondet_uint() {
  srand(time(NULL));
  return (unsigned int)rand();
}


x86 assembly (clang, -O0):
<__VERIFIER_nondet_uint>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__VERIFIER_nondet_uint>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <rand@plt>

LLVM IR (-O0):
define i32 @__VERIFIER_nondet_uint() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
%3 = call i64 (...) @rand()
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @__VERIFIER_nondet_uint() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i64 (...) @rand()
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void mdelay(unsigned msec) { usleep(msec * 1000); }


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

x86 assembly (clang, -O2):
<mdelay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @mdelay(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, scalar_t__);
scalar_t__ strlen(char *);
char *strcpy(char *d, char *s) {
  memcpy(d, s, strlen(s) + 1);
  return d;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <memcpy@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %4)
ret i8* %0
}
long long fi4(long long j, signed short *b, int i) { return j + b[i]; }


x86 assembly (clang, -O0):
<fi4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movswq (%rcx,%rdx,2),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fi4>:
movslq %edx,%rax
movswq (%rsi,%rax,2),%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @fi4(i64 %0, i16* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i16*
%6 = alloca i32
store i64 %0, i64* %4
store i16* %1, i16** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i16*, i16** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i16, i16* %8, i64 %10
%12 = load i16, i16* %11
%13 = sext i16 %12 to i64
%14 = add nsw i64 %7, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @fi4(i64 %0, i16* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i16, i16* %1, i64 %4
%6 = load i16, i16* %5
%7 = sext i16 %6 to i64
%8 = add nsw i64 %7, %0
ret i64 %8
}
int prcmu_release_usb_wakeup_state(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @prcmu_release_usb_wakeup_state() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint32_t getTime(void) {
  static struct timeval T;
  gettimeofday(&T, NULL);
  return (T.tv_sec * 1000000) + T.tv_usec;
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f15(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x2f02(%rip),%eax
cltq
add    0x2f01(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
push   %rax
lea    0x2f18(%rip),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x2f0a(%rip),%rax
imul   $0xf4240,%rax,%rax
add    0x2f04(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
@getTime.T = internal global %struct.timeval zeroinitializer
define i64 @getTime() {
%1 = call i32 @gettimeofday(%struct.timeval* @getTime.T, i32* null)
%2 = load i32, i32* getelementptr inbounds (%struct.timeval, %struct.timeval* @getTime.T, i32 0, i32 0)
%3 = mul nsw i32 %2, 1000000
%4 = sext i32 %3 to i64
%5 = load i64, i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @getTime.T, i32 0, i32 1)
%6 = add nsw i64 %4, %5
ret i64 %6
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
@getTime.T = internal global %struct.timeval zeroinitializer
define i64 @getTime() {
%1 = tail call i32 @gettimeofday(%struct.timeval* @getTime.T, i32* null)
%2 = load i32, i32* getelementptr inbounds (%struct.timeval, %struct.timeval* @getTime.T, i64 0, i32 0)
%3 = mul nsw i32 %2, 1000000
%4 = sext i32 %3 to i64
%5 = load i64, i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @getTime.T, i64 0, i32 1)
%6 = add nsw i64 %5, %4
ret i64 %6
}
/* Type definitions */
struct cache_policy_item_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(struct cache_policy_item_ *);
void cache_queue_policy_destroy_item(struct cache_policy_item_ *item) {
  (void)0;
  assert(item != NULL);
  free(item);
  (void)0;
}


x86 assembly (clang, -O0):
<cache_queue_policy_destroy_item>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cache_queue_policy_destroy_item>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.cache_policy_item_ = type { i32 }
define void @cache_queue_policy_destroy_item(%struct.cache_policy_item_* %0) {
%2 = alloca %struct.cache_policy_item_*
store %struct.cache_policy_item_* %0, %struct.cache_policy_item_** %2
%3 = load %struct.cache_policy_item_*, %struct.cache_policy_item_** %2
%4 = icmp ne %struct.cache_policy_item_* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.cache_policy_item_*, %struct.cache_policy_item_** %2
%8 = call i32 @free(%struct.cache_policy_item_* %7)
ret void
}

LLVM IR (-O2):
%struct.cache_policy_item_ = type { i32 }
define void @cache_queue_policy_destroy_item(%struct.cache_policy_item_* %0) {
%2 = icmp ne %struct.cache_policy_item_* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @free(%struct.cache_policy_item_* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BlinkC__Leds__led1Toggle();
void BlinkC__Timer1__fired(void) { BlinkC__Leds__led1Toggle(); }


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

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

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

LLVM IR (-O2):
define void @BlinkC__Timer1__fired() {
%1 = tail call i32 (...) @BlinkC__Leds__led1Toggle()
ret void
}
/* Type definitions */
struct yaffs_dev {
  int dummy;
};

/* Variables and functions */
int yaffs_remount_common(struct yaffs_dev *, int /*<<< orphan*/, int, int);
int yaffs_remount_reldev(struct yaffs_dev *dev, int force, int read_only) {
  return yaffs_remount_common(dev, (0), force, read_only);
}


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

x86 assembly (clang, -O2):
<yaffs_remount_reldev>:
mov    %edx,%ecx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <yaffs_remount_common@plt>

LLVM IR (-O0):
%struct.yaffs_dev = type { i32 }
define i32 @yaffs_remount_reldev(%struct.yaffs_dev* %0, i32 %1, i32 %2) {
%4 = alloca %struct.yaffs_dev*
%5 = alloca i32
%6 = alloca i32
store %struct.yaffs_dev* %0, %struct.yaffs_dev** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.yaffs_dev*, %struct.yaffs_dev** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @yaffs_remount_common(%struct.yaffs_dev* %7, i32 0, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.yaffs_dev = type { i32 }
define i32 @yaffs_remount_reldev(%struct.yaffs_dev* %0, i32 %1, i32 %2) {
%4 = tail call i32 @yaffs_remount_common(%struct.yaffs_dev* %0, i32 0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ write(char *, char *, char *);
void function_atid(char *atid) {
  atid[strlen(atid) - 1] = '\0';
  write("ganttproject.gan", " task-id=\"%s\"", atid);
}


x86 assembly (clang, -O0):
<function_atid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdx
lea    0xea8(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_atid>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
lea    0xec9(%rip),%rdi
lea    0xed3(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [14 x i8] c" task-id=\22%s\22\00"
define void @function_atid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
store i8 0, i8* %8
%9 = load i8*, i8** %2
%10 = call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [14 x i8] c" task-id=\22%s\22\00"
define void @function_atid(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
%6 = tail call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct terminal_settings {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct terminal_settings *);
scalar_t__ getchar();
struct terminal_settings *init_term_io_settings(int);
int /*<<< orphan*/ reset_term_io_settings(struct terminal_settings *);
char getch_(int echo) {
  char ch;
  struct terminal_settings *ts;
  ts = init_term_io_settings(echo);
  ch = (char)getchar();
  reset_term_io_settings(ts);
  free(ts);
  return ch;
}


x86 assembly (clang, -O0):
<getch_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <init_term_io_settings@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <reset_term_io_settings@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movsbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch_>:
push   %r14
push   %rbx
push   %rax
call   1060 <init_term_io_settings@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <reset_term_io_settings@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.terminal_settings = type { i32 }
define signext i8 @getch_(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca %struct.terminal_settings*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call %struct.terminal_settings* @init_term_io_settings(i32 %5)
store %struct.terminal_settings* %6, %struct.terminal_settings** %4
%7 = call i64 (...) @getchar()
%8 = trunc i64 %7 to i8
store i8 %8, i8* %3
%9 = load %struct.terminal_settings*, %struct.terminal_settings** %4
%10 = call i32 @reset_term_io_settings(%struct.terminal_settings* %9)
%11 = load %struct.terminal_settings*, %struct.terminal_settings** %4
%12 = call i32 @free(%struct.terminal_settings* %11)
%13 = load i8, i8* %3
ret i8 %13
}

LLVM IR (-O2):
%struct.terminal_settings = type { i32 }
define signext i8 @getch_(i32 %0) {
%2 = tail call %struct.terminal_settings* @init_term_io_settings(i32 %0)
%3 = tail call i64 (...) @getchar()
%4 = trunc i64 %3 to i8
%5 = tail call i32 @reset_term_io_settings(%struct.terminal_settings* %2)
%6 = tail call i32 @free(%struct.terminal_settings* %2)
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ LOCK_UN;
int /*<<< orphan*/ flock(int, int /*<<< orphan*/);
void atsha_unlock(int lockfile) { flock(lockfile, LOCK_UN); }


x86 assembly (clang, -O0):
<atsha_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <flock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atsha_unlock>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <flock@plt>

LLVM IR (-O0):
@LOCK_UN = global i32 0
define void @atsha_unlock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @LOCK_UN
%5 = call i32 @flock(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@LOCK_UN = global i32 0
define void @atsha_unlock(i32 %0) {
%2 = load i32, i32* @LOCK_UN
%3 = tail call i32 @flock(i32 %0, i32 %2)
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void SSIDMADisable(uint32_t ui32Base, uint32_t ui32DMAFlags) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000024))) &= ~ui32DMAFlags;
}


x86 assembly (clang, -O0):
<SSIDMADisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x24(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIDMADisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,0x24(%rcx)
ret

LLVM IR (-O0):
define void @SSIDMADisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add i64 %7, 36
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @SSIDMADisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add i64 %7, 36
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}
void env_free(envp) char **envp;
{
  register char **p;
  for (p = envp; *p; p++)
    free(*p);
  free(envp);
}


x86 assembly (clang, -O0):
<env_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114f <env_free+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <env_free+0x14>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<env_free>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <env_free+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <env_free+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @env_free(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %8, %4 ], [ %2, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
tail call void @free(i8* %5)
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = bitcast i8** %0 to i8*
tail call void @free(i8* %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void printchar(char **str, int c) {
  if (str) {
    **str = c;
    ++(*str);
  } else {
    fputc(c, stdout);
  }
}


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    115c <printchar+0x4c>
mov    -0xc(%rbp),%edi
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
call   1030 <fputc@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    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@stdout = global i32 0
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 %19
15: ; preds = %2
%16 = load i32, i32* %4
%17 = load i32, i32* @stdout
%18 = call i32 @fputc(i32 %16, i32 %17)
br label %19
19: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
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 %12
9: ; preds = %2
%10 = load i32, i32* @stdout
%11 = tail call i32 @fputc(i32 %1, i32 %10)
br label %12
12: ; preds = %9, %4
ret void
}
void zero_tests() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @useless() {
ret i32 0
}
/* Variables and functions */
int check(int, int, int);
int even_div(int);
int main(int argc, char **argv) {
  int x = 0, done = 0;
  while (!done) {
    x++;
    if (even_div(x) == 1) {
      done = 1;
    }
  }
  return check(5, 232792560, x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115a <main+0x3a>
jmp    1180 <main+0x60>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <even_div@plt>
cmp    $0x1,%eax
jne    117b <main+0x5b>
movl   $0x1,-0x18(%rbp)
jmp    1144 <main+0x24>
mov    -0x14(%rbp),%edx
mov    $0x5,%edi
mov    $0xde021f0,%esi
call   1040 <check@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <even_div@plt>
cmp    $0x1,%eax
jne    1130 <main+0x10>
mov    $0x5,%edi
mov    $0xde021f0,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1040 <check@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %19, %2
%9 = load i32, i32* %7
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = call i32 @even_div(i32 %15)
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 1, i32* %7
br label %19
19: ; preds = %18, %12
br label %8
20: ; preds = %8
%21 = load i32, i32* %6
%22 = call i32 @check(i32 5, i32 232792560, i32 %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %5, %3 ]
%5 = add nuw nsw i32 %4, 1
%6 = tail call i32 @even_div(i32 %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @check(i32 5, i32 232792560, i32 %5)
ret i32 %9
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  char menuitem;
  int press;
  do {
    printf("1-exit\n>> ");
    press = getchar();
    menuitem = (press != EOF ? press : 0);
  } while (press != '1');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%eax
je     1162 <main+0x42>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    116c <main+0x4c>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    116c <main+0x4c>
mov    -0x10(%rbp),%eax
mov    %al,-0x5(%rbp)
cmpl   $0x31,-0xc(%rbp)
jne    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x31,%eax
jne    1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"1-exit\0A>> \00"
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %16, %0
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @getchar()
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = load i32, i32* %3
br label %13
12: ; preds = %4
br label %13
13: ; preds = %12, %10
%14 = phi i32 [ %11, %10 ], [ 0, %12 ]
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %16
16: ; preds = %13
%17 = load i32, i32* %3
%18 = icmp ne i32 %17, 49
br i1 %18, label %4, label %19
19: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"1-exit\0A>> \00"
@EOF = global i32 0
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @getchar()
%4 = icmp eq i32 %3, 49
br i1 %4, label %5, label %1
5: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void short_usage(char *name, FILE *f) {
  fprintf(f, "\nUsage: %s [OPTION]... [COMMAND]... IMAGE\n", name);
  fprintf(f, "Use '%s --help' to print long help describing all options\n",
          name);
}


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

x86 assembly (clang, -O2):
<short_usage>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <fprintf@plt>
lea    0xef8(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"\0AUsage: %s [OPTION]... [COMMAND]... IMAGE\0A\00"
@.str.1 = [59 x i8] c"Use '%s --help' to print long help describing all options\0A\00"
define void @short_usage(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %4
%9 = load i8*, i8** %3
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"\0AUsage: %s [OPTION]... [COMMAND]... IMAGE\0A\00"
@.str.1 = [59 x i8] c"Use '%s --help' to print long help describing all options\0A\00"
define void @short_usage(i8* %0, i32* nocapture %1) {
%3 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ createFPTree();
int /*<<< orphan*/ generateFrequentItemSets();
int /*<<< orphan*/ sortInputTransaction();
void FP_Tree_generate() {
  generateFrequentItemSets();
  sortInputTransaction();
  createFPTree();
}


x86 assembly (clang, -O0):
<FP_Tree_generate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <generateFrequentItemSets@plt>
mov    $0x0,%al
call   1030 <sortInputTransaction@plt>
mov    $0x0,%al
call   1050 <createFPTree@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FP_Tree_generate>:
push   %rax
xor    %eax,%eax
call   1040 <generateFrequentItemSets@plt>
xor    %eax,%eax
call   1030 <sortInputTransaction@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <createFPTree@plt>

LLVM IR (-O0):
define void @FP_Tree_generate() {
%1 = call i32 (...) @generateFrequentItemSets()
%2 = call i32 (...) @sortInputTransaction()
%3 = call i32 (...) @createFPTree()
ret void
}

LLVM IR (-O2):
define void @FP_Tree_generate() {
%1 = tail call i32 (...) @generateFrequentItemSets()
%2 = tail call i32 (...) @sortInputTransaction()
%3 = tail call i32 (...) @createFPTree()
ret void
}
int wps_validate_beacon(const struct wpabuf *wps_ie) { return 0; }


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

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

LLVM IR (-O0):
%struct.wpabuf = type opaque
define i32 @wps_validate_beacon(%struct.wpabuf* %0) {
%2 = alloca %struct.wpabuf*
store %struct.wpabuf* %0, %struct.wpabuf** %2
ret i32 0
}

LLVM IR (-O2):
%struct.wpabuf = type opaque
define i32 @wps_validate_beacon(%struct.wpabuf* nocapture readnone %0) {
ret i32 0
}
void do_irq(struct pt_regs *pt_regs) { return; }


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

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

LLVM IR (-O0):
%struct.pt_regs = type opaque
define void @do_irq(%struct.pt_regs* %0) {
%2 = alloca %struct.pt_regs*
store %struct.pt_regs* %0, %struct.pt_regs** %2
ret void
}

LLVM IR (-O2):
%struct.pt_regs = type opaque
define void @do_irq(%struct.pt_regs* nocapture %0) {
ret void
}
int isNum(char num[], int start, int end) {
  int i;
  for (i = start; i < end; i++) {
    if (num[i] >= '0' && num[i] <= '9')
      continue;
    else
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isNum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1169 <isNum+0x69>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     114f <isNum+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jg     114f <isNum+0x4f>
jmp    115b <isNum+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    1170 <isNum+0x70>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1114 <isNum+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNum>:
mov    $0x1,%eax
cmp    %edx,%esi
jge    1134 <isNum+0x34>
movslq %esi,%rcx
add    %rcx,%rdi
sub    %esi,%edx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rdi,%rsi,1),%ecx
add    $0xd0,%cl
cmp    $0xa,%cl
jae    1135 <isNum+0x35>
add    $0x1,%rsi
cmp    %esi,%edx
jne    1120 <isNum+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isNum(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = sext i32 %1 to i64
br label %10
7: ; preds = %10
%8 = trunc i64 %16 to i32
%9 = icmp eq i32 %8, %2
br i1 %9, label %17, label %10
10: ; preds = %5, %7
%11 = phi i64 [ %6, %5 ], [ %16, %7 ]
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = add i8 %13, -48
%15 = icmp ult i8 %14, 10
%16 = add nsw i64 %11, 1
br i1 %15, label %7, label %17
17: ; preds = %10, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %10 ]
ret i32 %18
}
int func2(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @func2() {
ret i32 0
}
const char *caveat_string(int caveat) {
  switch (caveat) {
  case 0:
  default:
    return "None";
  }
}


x86 assembly (clang, -O0):
<caveat_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
test   %eax,%eax
jne    111c <caveat_string+0x1c>
jmp    1117 <caveat_string+0x17>
jmp    111c <caveat_string+0x1c>
lea    0xedd(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<caveat_string>:
lea    0xef9(%rip),%rax
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"None\00"
define i8* @caveat_string(i32 %0) {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}