xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void do_something_2() { printf("doing work 2\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"doing work 2\00"
define void @do_something_2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ scanf(char *, char *);
int main(void) {
  char name[100];
  while (scanf("%[^\n]\n", name) != EOF) {
    printf("Go, %s, go go\n", name);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     1164 <main+0x44>
lea    -0x70(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xece(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    0x2ea7(%rip),%r12
cmp    (%r12),%rax
je     117c <main+0x5c>
lea    0xeb9(%rip),%r14
mov    %rsp,%rbx
lea    0xea8(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%[^\0A]\0A\00"
@EOF = global i64 0
@.str.1 = [15 x i8] c"Go, %s, go go\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i64, i64* @EOF
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]\0A\00"
@EOF = global i64 0
@.str.1 = [15 x i8] c"Go, %s, go go\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %0, %6
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%8 = call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = load i64, i64* @EOF
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %6
11: ; preds = %6, %0
ret i32 0
}
int test_imm_14uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x14 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_14uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 20
%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_14uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1310720
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_DAuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xDA << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_DAuint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 218
%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_DAuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14286848
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_vc1();
int /*<<< orphan*/ take_struct_vc1(int /*<<< orphan*/);
void test_struct_vc1() { take_struct_vc1(return_struct_vc1()); }


x86 assembly (clang, -O0):
<test_struct_vc1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <return_struct_vc1@plt>
mov    %eax,%edi
call   1030 <take_struct_vc1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_vc1>:
push   %rax
xor    %eax,%eax
call   1040 <return_struct_vc1@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <take_struct_vc1@plt>

LLVM IR (-O0):
define void @test_struct_vc1() {
%1 = call i32 (...) @return_struct_vc1()
%2 = call i32 @take_struct_vc1(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_vc1() {
%1 = tail call i32 (...) @return_struct_vc1()
%2 = tail call i32 @take_struct_vc1(i32 %1)
ret void
}
void testbench_output_init(void) {}


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

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

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

LLVM IR (-O2):
define void @testbench_output_init() {
ret void
}
/* Variables and functions */
unsigned int lettura_intero();
int /*<<< orphan*/ puts(char *);
unsigned int controllo_input(void) {
  unsigned int numero_consentito;
  do {
    numero_consentito = lettura_intero();
    if (numero_consentito <= 3) {
      puts("Attenzione il valore inserito supera i limiti consentiti!\n"
           "Reinserire il valore: ");
    }
  } while (numero_consentito <= 3);
  return (numero_consentito);
}


x86 assembly (clang, -O0):
<controllo_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <lettura_intero@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
ja     1148 <controllo_input+0x28>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
jmp    114d <controllo_input+0x2d>
cmpl   $0x3,-0x4(%rbp)
jbe    1128 <controllo_input+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<controllo_input>:
push   %rbx
xor    %eax,%eax
call   1040 <lettura_intero@plt>
cmp    $0x3,%eax
ja     1154 <controllo_input+0x34>
lea    0xecc(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <lettura_intero@plt>
cmp    $0x4,%eax
jb     1140 <controllo_input+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [81 x i8] c"Attenzione il valore inserito supera i limiti consentiti!\0AReinserire il valore: \00"
define i32 @controllo_input() {
%1 = alloca i32
br label %2
2: ; preds = %9, %0
%3 = call i32 (...) @lettura_intero()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp ule i32 %4, 3
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 @puts(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
br label %9
9: ; preds = %8
%10 = load i32, i32* %1
%11 = icmp ule i32 %10, 3
br i1 %11, label %2, label %12
12: ; preds = %9
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [81 x i8] c"Attenzione il valore inserito supera i limiti consentiti!\0AReinserire il valore: \00"
define i32 @controllo_input() {
%1 = tail call i32 (...) @lettura_intero()
%2 = icmp ult i32 %1, 4
br i1 %2, label %3, label %7
3: ; preds = %0, %3
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @lettura_intero()
%6 = icmp ult i32 %5, 4
br i1 %6, label %3, label %7
7: ; preds = %3, %0
%8 = phi i32 [ %1, %0 ], [ %5, %3 ]
ret i32 %8
}
/* Variables and functions */
long long stub1();
long long testClosureVrLL(long long (*closure)(void)) {
  return closure != NULL ? (*closure)() : (long long)0;
}


x86 assembly (clang, -O0):
<testClosureVrLL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1123 <testClosureVrLL+0x23>
call   *-0x8(%rbp)
mov    %rax,-0x10(%rbp)
jmp    112e <testClosureVrLL+0x2e>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    112e <testClosureVrLL+0x2e>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureVrLL>:
test   %rdi,%rdi
je     1107 <testClosureVrLL+0x7>
jmp    *%rdi
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @testClosureVrLL(i64 ()* %0) {
%2 = icmp eq i64 ()* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 %0()
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
void CYCALLOCPROFILE_mark(const char *s) {}


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

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

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

LLVM IR (-O2):
define void @CYCALLOCPROFILE_mark(i8* nocapture %0) {
ret void
}
long _GETPMC2(pmctable, pmtname)
struct mctable *pmctable;
char *pmtname;
{
  register int i;
  i = GETPMC(pmctable, pmtname);
  if (i == -1) {
    __setsv1type(pmctable);
  }
  return (i);
}


x86 assembly (clang, -O0):
<_GETPMC2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <GETPMC@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1157 <_GETPMC2+0x37>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <__setsv1type@plt>
movslq -0x14(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_GETPMC2>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <GETPMC@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    113e <_GETPMC2+0x1e>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <__setsv1type@plt>
movslq %ebp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.mctable = type opaque
define i64 @_GETPMC2(%struct.mctable* %0, i8* %1) {
%3 = alloca %struct.mctable*
%4 = alloca i8*
%5 = alloca i32
store %struct.mctable* %0, %struct.mctable** %3
store i8* %1, i8** %4
%6 = load %struct.mctable*, %struct.mctable** %3
%7 = load i8*, i8** %4
%8 = call i32 (%struct.mctable*, i8*, ...) bitcast (i32 (...)* @GETPMC to i32 (%struct.mctable*, i8*, ...)*)(%struct.mctable* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load %struct.mctable*, %struct.mctable** %3
%13 = call i32 (%struct.mctable*, ...) bitcast (i32 (...)* @__setsv1type to i32 (%struct.mctable*, ...)*)(%struct.mctable* %12)
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
ret i64 %16
}

LLVM IR (-O2):
%struct.mctable = type opaque
define i64 @_GETPMC2(%struct.mctable* %0, i8* %1) {
%3 = tail call i32 (%struct.mctable*, i8*, ...) bitcast (i32 (...)* @GETPMC to i32 (%struct.mctable*, i8*, ...)*)(%struct.mctable* %0, i8* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (%struct.mctable*, ...) bitcast (i32 (...)* @__setsv1type to i32 (%struct.mctable*, ...)*)(%struct.mctable* %0)
br label %7
7: ; preds = %5, %2
%8 = sext i32 %3 to i64
ret i64 %8
}
int foo(int y) {
  volatile int a = y;
  volatile int *volatile b = &a;
  return *b;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,-0xc(%rsp)
lea    -0xc(%rsp),%rax
mov    %rax,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = bitcast i32* %2 to i8*
store volatile i32 %0, i32* %2
%5 = bitcast i32** %3 to i8*
store volatile i32* %2, i32** %3
%6 = load volatile i32*, i32** %3
%7 = load volatile i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_aligned(void *ptr) {
  if (ptr) {
    free(*((void **)ptr - 1));
  }
}


x86 assembly (clang, -O0):
<free_aligned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <free_aligned+0x24>
mov    -0x8(%rbp),%rax
mov    -0x8(%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_aligned>:
test   %rdi,%rdi
je     111e <free_aligned+0xe>
mov    -0x8(%rdi),%rdi
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @free_aligned(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -8
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @free(i8* %6)
br label %8
8: ; preds = %3, %1
ret void
}
int execute_setresgid32() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_setresgid32() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ IO_output_high(int);
void LEDS_off(int mask) {
  if (mask & (1 << 22))
    IO_output_high((22 | (1 << 8)));
  if (mask & (1 << 21))
    IO_output_high((21 | (1 << 8)));
  if (mask & (1 << 20))
    IO_output_high((20 | (1 << 8)));
}


x86 assembly (clang, -O0):
<LEDS_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x400000,%eax
cmp    $0x0,%eax
je     1136 <LEDS_off+0x26>
mov    $0x116,%edi
call   1030 <IO_output_high@plt>
mov    -0x4(%rbp),%eax
and    $0x200000,%eax
cmp    $0x0,%eax
je     1151 <LEDS_off+0x41>
mov    $0x115,%edi
call   1030 <IO_output_high@plt>
mov    -0x4(%rbp),%eax
and    $0x100000,%eax
cmp    $0x0,%eax
je     116c <LEDS_off+0x5c>
mov    $0x114,%edi
call   1030 <IO_output_high@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LEDS_off>:
push   %rbx
mov    %edi,%ebx
test   $0x400000,%edi
jne    112d <LEDS_off+0x1d>
test   $0x200000,%ebx
jne    113f <LEDS_off+0x2f>
test   $0x100000,%ebx
jne    1151 <LEDS_off+0x41>
pop    %rbx
ret
mov    $0x116,%edi
call   1030 <IO_output_high@plt>
test   $0x200000,%ebx
je     1123 <LEDS_off+0x13>
mov    $0x115,%edi
call   1030 <IO_output_high@plt>
test   $0x100000,%ebx
je     112b <LEDS_off+0x1b>
mov    $0x114,%edi
pop    %rbx
jmp    1030 <IO_output_high@plt>

LLVM IR (-O0):
define void @LEDS_off(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 4194304
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @IO_output_high(i32 278)
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
%10 = and i32 %9, 2097152
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @IO_output_high(i32 277)
br label %14
14: ; preds = %12, %8
%15 = load i32, i32* %2
%16 = and i32 %15, 1048576
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @IO_output_high(i32 276)
br label %20
20: ; preds = %18, %14
ret void
}

LLVM IR (-O2):
define void @LEDS_off(i32 %0) {
%2 = and i32 %0, 4194304
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @IO_output_high(i32 278)
br label %6
6: ; preds = %4, %1
%7 = and i32 %0, 2097152
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @IO_output_high(i32 277)
br label %11
11: ; preds = %9, %6
%12 = and i32 %0, 1048576
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i32 @IO_output_high(i32 276)
br label %16
16: ; preds = %14, %11
ret void
}
int main(void) {
  int arr[260];
  int n;
  n = 5;
  arr[0] = 0;
  while (n > 1) {
    arr[1] = 7;
    n--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x424(%rbp)
movl   $0x0,-0x420(%rbp)
cmpl   $0x1,-0x424(%rbp)
jle    1151 <main+0x51>
movl   $0x7,-0x41c(%rbp)
mov    -0x424(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x424(%rbp)
jmp    1126 <main+0x26>
xor    %eax,%eax
add    $0x3b0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [260 x i32]
%3 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %3
%4 = getelementptr inbounds [260 x i32], [260 x i32]* %2, i64 0, i64 0
store i32 0, i32* %4
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = getelementptr inbounds [260 x i32], [260 x i32]* %2, i64 0, i64 1
store i32 7, i32* %9
%10 = load i32, i32* %3
%11 = add nsw i32 %10, -1
store i32 %11, i32* %3
br label %5
12: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *);
void smarthealthycmd(const char *path, char *cmd) {
  sprintf(cmd, "disktool -H %s", path);
  return;
}


x86 assembly (clang, -O0):
<smarthealthycmd>:
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 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smarthealthycmd>:
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xee3(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"disktool -H %s\00"
define void @smarthealthycmd(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"disktool -H %s\00"
define void @smarthealthycmd(i8* %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nx_printf(char *, ...);
unsigned int __VpuReadReg(unsigned int address) {
  unsigned int value = (*((volatile unsigned int *)(address)));
  do {
    if (0) {
      nx_printf("[DRV|REG_ACC]");
      nx_printf("read( 0x%08x, 0x%08x )\n", address, value);
    }
  } while (0);
  return value;
}


x86 assembly (clang, -O0):
<__VpuReadReg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    1114 <__VpuReadReg+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__VpuReadReg>:
mov    %edi,%eax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @__VpuReadReg(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
store i32 %7, i32* %3
br label %8
8: ; preds = %1
br label %9
9: ; preds = %8
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @__VpuReadReg(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ set_mode(int);
int f_v(int mode, unsigned char **sec, float *data, unsigned int ndata,
        char *inv_out, void **local) {
  set_mode(1);
  return 0;
}


x86 assembly (clang, -O0):
<f_v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0x1,%edi
call   1030 <set_mode@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_v>:
push   %rax
mov    $0x1,%edi
call   1030 <set_mode@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @f_v(i32 %0, i8** nocapture readnone %1, float* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i8** nocapture readnone %5) {
%7 = tail call i32 @set_mode(i32 1)
ret i32 0
}
int b6b_yield(struct b6b_interp *interp) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.b6b_interp = type opaque
define i32 @b6b_yield(%struct.b6b_interp* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_reader(int /*<<< orphan*/);
int /*<<< orphan*/ writer(int /*<<< orphan*/);
int main() {
__CPROVER_ASYNC_1:
  writer(0);
__CPROVER_ASYNC_2:
  write_reader(0);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <writer@plt>
xor    %edi,%edi
call   1030 <write_reader@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @writer(i32 0)
%2 = tail call i32 @write_reader(i32 0)
ret i32 0
}
/* Variables and functions */
int *malloc(int);
int *foo(void) {
  int *i = malloc(sizeof *i);
  return i;
}


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

x86 assembly (clang, -O2):
<foo>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i32* @foo() {
%1 = tail call i32* @malloc(i32 4)
ret i32* %1
}
void *check_ptr_ATTRvoid(void *v) { return v; }


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

x86 assembly (clang, -O2):
<check_ptr_ATTRvoid>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @check_ptr_ATTRvoid(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\n\nHello! Do you want a Spring salad?\nHa Ha Ha.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"\0A\0AHello! Do you want a Spring salad?\0AHa Ha Ha.\0A\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [48 x i8] c"\0A\0AHello! Do you want a Spring salad?\0AHa Ha Ha.\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int errno;
int errsock(void) { return errno; }


x86 assembly (clang, -O0):
<errsock>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errsock>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @errsock() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @errsock() {
%1 = load i32, i32* @errno
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *get_date(char *strBuf) {
  time_t now = time(NULL);
  struct tm tm_now;
  localtime_r(&now, &tm_now);
  strftime(strBuf, sizeof("20140101"), "%Y%m%d", &tm_now);
  return strBuf;
}


x86 assembly (clang, -O0):
<get_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <localtime_r@plt>
mov    -0x8(%rbp),%rdi
mov    $0x9,%esi
lea    0xe9b(%rip),%rdx
lea    -0x10(%rbp),%rcx
call   1050 <strftime@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_date>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%r14
mov    %r14,%rsi
call   1030 <localtime_r@plt>
lea    0xea2(%rip),%rdx
mov    %rbx,%rdi
mov    $0x9,%esi
mov    %r14,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [7 x i8] c"%Y%m%d\00"
define i8* @get_date(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm
store i8* %0, i8** %2
%5 = call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call i32 @localtime_r(i32* %3, %struct.tm* %4)
%7 = load i8*, i8** %2
%8 = call i32 @strftime(i8* %7, i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [7 x i8] c"%Y%m%d\00"
define i8* @get_date(i8* returned %0) {
%2 = alloca i32
%3 = alloca %struct.tm
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %2
%6 = bitcast %struct.tm* %3 to i8*
%7 = call i32 @localtime_r(i32* %2, %struct.tm* %3)
%8 = call i32 @strftime(i8* %0, i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
ret i8* %0
}
/* Variables and functions */
int random();
void buzz(int n) {
  volatile int i;
  int m = random() & 0x0ffff;
  for (i = 0; i < m; i++)
    ;
}


x86 assembly (clang, -O0):
<buzz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <buzz+0x40>
jmp    1142 <buzz+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <buzz+0x21>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buzz>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
movzwl %ax,%eax
movl   $0x0,0x4(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x4(%rsp),%ecx
cmp    %eax,%ecx
jge    113f <buzz+0x2f>
addl   $0x1,0x4(%rsp)
jmp    1130 <buzz+0x20>
pop    %rax
ret

LLVM IR (-O0):
define void @buzz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 (...) @random()
%6 = and i32 %5, 65535
store i32 %6, i32* %4
store volatile i32 0, i32* %3
br label %7
7: ; preds = %12, %1
%8 = load volatile i32, i32* %3
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %7
br label %12
12: ; preds = %11
%13 = load volatile i32, i32* %3
%14 = add nsw i32 %13, 1
store volatile i32 %14, i32* %3
br label %7
15: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @buzz(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 (...) @random()
%5 = and i32 %4, 65535
store volatile i32 0, i32* %2
%6 = load volatile i32, i32* %2
%7 = icmp slt i32 %6, %5
br i1 %7, label %8, label %13
8: ; preds = %1, %8
%9 = load volatile i32, i32* %2
%10 = add nsw i32 %9, 1
store volatile i32 %10, i32* %2
%11 = load volatile i32, i32* %2
%12 = icmp slt i32 %11, %5
br i1 %12, label %8, label %13
13: ; preds = %8, %1
ret void
}
void free_float(float _val) { return; }


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

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

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

LLVM IR (-O2):
define void @free_float(float %0) {
ret void
}
int division(int numero1, int numero2) { return numero1 / numero2; }


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

x86 assembly (clang, -O2):
<division>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @division(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @division(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int nrf_802154_core_notify_buffer_free(int /*<<< orphan*/ *);
bool nrf_802154_request_buffer_free(uint8_t *p_data) {
  bool result;
  result = nrf_802154_core_notify_buffer_free(p_data);
  return result;
}


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

x86 assembly (clang, -O2):
<nrf_802154_request_buffer_free>:
jmp    1030 <nrf_802154_core_notify_buffer_free@plt>

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

LLVM IR (-O2):
define i32 @nrf_802154_request_buffer_free(i32* %0) {
%2 = tail call i32 @nrf_802154_core_notify_buffer_free(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ countup(long *, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, long *);
void inithowoften(long *howoften) {
  long loopcount;
  loopcount = 0;
  do {
    printf("How many trees per cycle?\n");
    scanf("%ld%*[^\n]", howoften);
    getchar();
    countup(&loopcount, 10);
  } while (*howoften <= 0);
}


x86 assembly (clang, -O0):
<inithowoften>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
lea    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1060 <countup@plt>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jle    1154 <inithowoften+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inithowoften>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
movq   $0x0,(%rsp)
lea    0xeb0(%rip),%r14
lea    0xe9f(%rip),%r15
mov    %rsp,%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %r12,%rdi
mov    $0xa,%esi
call   1060 <countup@plt>
cmpq   $0x0,(%rbx)
jle    1170 <inithowoften+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [27 x i8] c"How many trees per cycle?\0A\00"
@.str.1 = [10 x i8] c"%ld%*[^\0A]\00"
define void @inithowoften(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
store i64 0, i64* %3
br label %4
4: ; preds = %10, %1
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = load i64*, i64** %2
%7 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64* %6)
%8 = call i32 (...) @getchar()
%9 = call i32 @countup(i64* %3, i32 10)
br label %10
10: ; preds = %4
%11 = load i64*, i64** %2
%12 = load i64, i64* %11
%13 = icmp sle i64 %12, 0
br i1 %13, label %4, label %14
14: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"%ld%*[^\0A]\00"
@str = [26 x i8] c"How many trees per cycle?\00"
define void @inithowoften(i64* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
br label %4
4: ; preds = %4, %1
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64* %0)
%7 = call i32 (...) @getchar()
%8 = call i32 @countup(i64* %2, i32 10)
%9 = load i64, i64* %0
%10 = icmp slt i64 %9, 1
br i1 %10, label %4, label %11
11: ; preds = %4
ret void
}
/* Variables and functions */
int nrf_802154_pib_auto_ack_get();
bool nrf_802154_auto_ack_get(void) { return nrf_802154_pib_auto_ack_get(); }


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

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

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

LLVM IR (-O2):
define i32 @nrf_802154_auto_ack_get() {
%1 = tail call i32 (...) @nrf_802154_pib_auto_ack_get()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ socket;
int main(void) {
  printf("test_dlsym_mucked socket: %p\n", socket);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"test_dlsym_mucked socket: %p\0A\00"
@socket = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @socket
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"test_dlsym_mucked socket: %p\0A\00"
@socket = global i32 0
define i32 @main() {
%1 = load i32, i32* @socket
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
struct pcg_state_setseq_64 {
  int dummy;
};

/* Variables and functions */
int pcg_setseq_64_xsh_rs_32_random_r(struct pcg_state_setseq_64 *);
uint32_t pcg_setseq_64_xsh_rs_32_boundedrand_r(struct pcg_state_setseq_64 *rng,
                                               uint32_t bound) {
  uint32_t threshold = -bound % bound;
  for (;;) {
    uint32_t r = pcg_setseq_64_xsh_rs_32_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_setseq_64_xsh_rs_32_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_setseq_64_xsh_rs_32_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_setseq_64_xsh_rs_32_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_setseq_64_xsh_rs_32_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_setseq_64_xsh_rs_32_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_setseq_64_xsh_rs_32_random_r@plt>
test   %eax,%eax
js     1120 <pcg_setseq_64_xsh_rs_32_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_setseq_64 = type { i32 }
define i32 @pcg_setseq_64_xsh_rs_32_boundedrand_r(%struct.pcg_state_setseq_64* %0, i32 %1) {
%3 = alloca %struct.pcg_state_setseq_64*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_setseq_64* %0, %struct.pcg_state_setseq_64** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_setseq_64*, %struct.pcg_state_setseq_64** %3
%13 = call i32 @pcg_setseq_64_xsh_rs_32_random_r(%struct.pcg_state_setseq_64* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_setseq_64 = type { i32 }
define i32 @pcg_setseq_64_xsh_rs_32_boundedrand_r(%struct.pcg_state_setseq_64* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_setseq_64_xsh_rs_32_random_r(%struct.pcg_state_setseq_64* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void end_connection(int sock) { close(sock); }


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

x86 assembly (clang, -O2):
<end_connection>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @end_connection(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void ScaleRowDown34_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown34_Any_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ finish(int /*<<< orphan*/);
int Broker_stop(char *s) {
  finish(0);
  return 0;
}


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

x86 assembly (clang, -O2):
<Broker_stop>:
push   %rax
xor    %edi,%edi
call   1030 <finish@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Broker_stop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @finish(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @Broker_stop(i8* nocapture readnone %0) {
%2 = tail call i32 @finish(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LED_REG_SaveConfig();
void LED_REG_Sleep(void) { LED_REG_SaveConfig(); }


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

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

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

LLVM IR (-O2):
define void @LED_REG_Sleep() {
%1 = tail call i32 (...) @LED_REG_SaveConfig()
ret void
}
unsigned xrop3_50_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T | S;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_50_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_50_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
lea    (%rcx,%rdi,1),%edx
mov    %esi,%eax
shl    $0x8,%eax
or     %eax,%ecx
or     %esi,%eax
or     $0xff,%ecx
xor    %edx,%ecx
not    %eax
or     %edx,%eax
and    %ecx,%eax
not    %edi
and    %esi,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_50_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = load i32, i32* %8
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = or i32 %34, %38
%40 = load i32, i32* %7
%41 = load i32, i32* %6
%42 = xor i32 %41, -1
%43 = and i32 %40, %42
%44 = load i32, i32* %5
%45 = and i32 %43, %44
%46 = or i32 %39, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_50_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %6
%9 = or i32 %4, %7
%10 = or i32 %9, 255
%11 = xor i32 %10, %5
%12 = xor i32 %8, -1
%13 = or i32 %5, %12
%14 = and i32 %11, %13
%15 = xor i32 %3, -1
%16 = and i32 %15, %6
%17 = or i32 %14, %16
ret i32 %17
}
/* Variables and functions */
bool nrf52_errata_28(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_28() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
char *strdup(char const *);
char *x_strdup(const char *s) {
  char *p = strdup(s);
  if (p == NULL) {
    perror("failed to duplicate string");
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<x_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <x_strdup+0x3e>
lea    0xea5(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_strdup>:
push   %rax
call   1050 <strdup@plt>
test   %rax,%rax
je     113d <x_strdup+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"failed to duplicate string\00"
@EXIT_FAILURE = global i32 0
define i8* @x_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [27 x i8] c"failed to duplicate string\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @x_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i8* %2
}