xunge/DecIR huggingface dataset:
void *key_create(int valeur) {
  int *key = (int *)malloc(sizeof(int));
  *key = valeur;
  return key;
}


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

x86 assembly (clang, -O2):
<key_create>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @key_create(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i8* @malloc(i64 4)
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32, i32* %2
%7 = load i32*, i32** %3
store i32 %6, i32* %7
%8 = load i32*, i32** %3
%9 = bitcast i32* %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @key_create(i32 %0) {
%2 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
%3 = bitcast i8* %2 to i32*
store i32 %0, i32* %3
ret i8* %2
}
int change_order_instructions(int *instructions, int *new_shellcode,
                              int num_inst) {}


x86 assembly (clang, -O0):
<change_order_instructions>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @change_order_instructions(i32* nocapture readnone %0, i32* nocapture readnone %1, i32 %2) {
ret i32 undef
}
/* Variables and functions */
int strlen(char *);
int sAdd(char *opt) {
  int l = strlen(opt) + 12;
  return l;
}


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

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

LLVM IR (-O0):
define i32 @sAdd(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 12
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @sAdd(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 12
ret i32 %3
}
void ft_tabstrdel(char **tab) {
  int i;
  i = 0;
  while (tab[i]) {
    free(tab[i]);
    i++;
  }
  free(tab);
}


x86 assembly (clang, -O0):
<ft_tabstrdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1155 <ft_tabstrdel+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_tabstrdel+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tabstrdel>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <ft_tabstrdel+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 <ft_tabstrdel+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ft_tabstrdel(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %2, %1 ]
tail call void @free(i8* %6)
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = bitcast i8** %0 to i8*
tail call void @free(i8* %12)
ret void
}
__attribute((always_)) float glm_smooth(float t) {
  return t * t * (3.0f - 2.0f * t);
}


x86 assembly (clang, -O0):
<glm_smooth>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
addss  %xmm2,%xmm2
movss  0xedc(%rip),%xmm1
subss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glm_smooth>:
movaps %xmm0,%xmm2
mulss  %xmm0,%xmm2
addss  %xmm0,%xmm0
movss  0xeed(%rip),%xmm1
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @glm_smooth(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = load float, float* %2
%7 = call float @llvm.fmuladd.f32(float -2.000000e+00, float %6, float 3.000000e+00)
%8 = fmul float %5, %7
ret float %8
}

LLVM IR (-O2):
define float @glm_smooth(float %0) {
%2 = fmul float %0, %0
%3 = tail call float @llvm.fmuladd.f32(float %0, float -2.000000e+00, float 3.000000e+00)
%4 = fmul float %2, %3
ret float %4
}
void set_bit(unsigned long *x, int n) {
  int set;
  unsigned long mask;
  set = (n >> 5);
  mask = (1UL << (n & 31));
  x[set] |= mask;
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x5,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
or     (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x5,%eax
and    $0x1f,%cl
mov    $0x1,%edx
shl    %cl,%rdx
cltq
or     %rdx,(%rdi,%rax,8)
ret

LLVM IR (-O0):
define void @set_bit(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
store i64* %0, i64** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 5
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = and i32 %9, 31
%11 = zext i32 %10 to i64
%12 = shl i64 1, %11
store i64 %12, i64* %6
%13 = load i64, i64* %6
%14 = load i64*, i64** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i64, i64* %14, i64 %16
%18 = load i64, i64* %17
%19 = or i64 %18, %13
store i64 %19, i64* %17
ret void
}

LLVM IR (-O2):
define void @set_bit(i64* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 5
%4 = and i32 %1, 31
%5 = zext i32 %4 to i64
%6 = shl nuw nsw i64 1, %5
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i64, i64* %0, i64 %7
%9 = load i64, i64* %8
%10 = or i64 %9, %6
store i64 %10, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ findTop();
int /*<<< orphan*/ isEmpty();
int /*<<< orphan*/ pop();
int /*<<< orphan*/ push(int);
int /*<<< orphan*/ traverse();
int main() {
  isEmpty();
  push(2);
  push(46);
  traverse();
  pop();
  push(13);
  traverse();
  isEmpty();
  push(4);
  pop();
  traverse();
  push(29);
  findTop();
  traverse();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <isEmpty@plt>
mov    $0x2,%edi
call   1060 <push@plt>
mov    $0x2e,%edi
call   1060 <push@plt>
mov    $0x0,%al
call   1030 <traverse@plt>
mov    $0x0,%al
call   1040 <pop@plt>
mov    $0xd,%edi
call   1060 <push@plt>
mov    $0x0,%al
call   1030 <traverse@plt>
mov    $0x0,%al
call   1050 <isEmpty@plt>
mov    $0x4,%edi
call   1060 <push@plt>
mov    $0x0,%al
call   1040 <pop@plt>
mov    $0x0,%al
call   1030 <traverse@plt>
mov    $0x1d,%edi
call   1060 <push@plt>
mov    $0x0,%al
call   1070 <findTop@plt>
mov    $0x0,%al
call   1030 <traverse@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <isEmpty@plt>
mov    $0x2,%edi
call   1060 <push@plt>
mov    $0x2e,%edi
call   1060 <push@plt>
xor    %eax,%eax
call   1030 <traverse@plt>
xor    %eax,%eax
call   1040 <pop@plt>
mov    $0xd,%edi
call   1060 <push@plt>
xor    %eax,%eax
call   1030 <traverse@plt>
xor    %eax,%eax
call   1050 <isEmpty@plt>
mov    $0x4,%edi
call   1060 <push@plt>
xor    %eax,%eax
call   1040 <pop@plt>
xor    %eax,%eax
call   1030 <traverse@plt>
mov    $0x1d,%edi
call   1060 <push@plt>
xor    %eax,%eax
call   1070 <findTop@plt>
xor    %eax,%eax
call   1030 <traverse@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @isEmpty()
%3 = call i32 @push(i32 2)
%4 = call i32 @push(i32 46)
%5 = call i32 (...) @traverse()
%6 = call i32 (...) @pop()
%7 = call i32 @push(i32 13)
%8 = call i32 (...) @traverse()
%9 = call i32 (...) @isEmpty()
%10 = call i32 @push(i32 4)
%11 = call i32 (...) @pop()
%12 = call i32 (...) @traverse()
%13 = call i32 @push(i32 29)
%14 = call i32 (...) @findTop()
%15 = call i32 (...) @traverse()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @isEmpty()
%2 = tail call i32 @push(i32 2)
%3 = tail call i32 @push(i32 46)
%4 = tail call i32 (...) @traverse()
%5 = tail call i32 (...) @pop()
%6 = tail call i32 @push(i32 13)
%7 = tail call i32 (...) @traverse()
%8 = tail call i32 (...) @isEmpty()
%9 = tail call i32 @push(i32 4)
%10 = tail call i32 (...) @pop()
%11 = tail call i32 (...) @traverse()
%12 = tail call i32 @push(i32 29)
%13 = tail call i32 (...) @findTop()
%14 = tail call i32 (...) @traverse()
ret i32 0
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void *btlza_malloc(int sz) {
  void *ptr;
  ptr = malloc(sz);
  memset(ptr, 0, sz);
  return (ptr);
}


x86 assembly (clang, -O0):
<btlza_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btlza_malloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @btlza_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %2
%8 = call i32 @memset(i8* %6, i32 0, i32 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @btlza_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i32 %0)
ret i8* %2
}
unsigned ncwrs1(int _k) { return _k ? 2 : 1; }


x86 assembly (clang, -O0):
<ncwrs1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x1,%eax
mov    $0x2,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncwrs1>:
cmp    $0x1,%edi
mov    $0x2,%eax
sbb    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @ncwrs1(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1, i32 2
ret i32 %3
}
void foo680() {}


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

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

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

LLVM IR (-O2):
define void @foo680() {
ret void
}
/* Variables and functions */
unsigned int end_name_hash(unsigned long);
unsigned long partial_name_hash(int /*<<< orphan*/, unsigned long);
__attribute__((always_)) unsigned int full_name_hash(const unsigned char *name,
                                                     unsigned int len) {
  unsigned long hash = 0;
  while (len--)
    hash = partial_name_hash(*name++, hash);
  return end_name_hash(hash);
}


x86 assembly (clang, -O0):
<full_name_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     116f <full_name_hash+0x4f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%edi
mov    -0x18(%rbp),%rsi
call   1040 <partial_name_hash@plt>
mov    %rax,-0x18(%rbp)
jmp    1137 <full_name_hash+0x17>
mov    -0x18(%rbp),%rdi
call   1030 <end_name_hash@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<full_name_hash>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1158 <full_name_hash+0x38>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%r14,%rbx,1),%edi
mov    %rax,%rsi
call   1040 <partial_name_hash@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1140 <full_name_hash+0x20>
jmp    115a <full_name_hash+0x3a>
xor    %eax,%eax
mov    %rax,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <end_name_hash@plt>

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

LLVM IR (-O2):
define i32 @full_name_hash(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %12, %4 ], [ 0, %2 ]
%6 = phi i32 [ %8, %4 ], [ %1, %2 ]
%7 = phi i8* [ %9, %4 ], [ %0, %2 ]
%8 = add i32 %6, -1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = zext i8 %10 to i32
%12 = tail call i64 @partial_name_hash(i32 %11, i64 %5)
%13 = icmp eq i32 %8, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %2
%15 = phi i64 [ 0, %2 ], [ %12, %4 ]
%16 = tail call i32 @end_name_hash(i64 %15)
ret i32 %16
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ EXIT_FAILURE;
int clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void getTime(struct timespec *tp) {
  if (clock_gettime(CLOCK_MONOTONIC, tp) == -1) {
    perror("FATAL: clock_gettime error");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0xffffffff,%eax
jne    1171 <getTime+0x41>
lea    0xea2(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
push   %rax
mov    %rdi,%rsi
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1030 <clock_gettime@plt>
cmp    $0xffffffff,%eax
je     1149 <getTime+0x19>
pop    %rax
ret
lea    0xeb0(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
@.str = [27 x i8] c"FATAL: clock_gettime error\00"
@EXIT_FAILURE = global i32 0
define void @getTime(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = call i32 @clock_gettime(i32 %3, %struct.timespec* %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
@.str = [27 x i8] c"FATAL: clock_gettime error\00"
@EXIT_FAILURE = global i32 0
define void @getTime(%struct.timespec* %0) {
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = tail call i32 @clock_gettime(i32 %2, %struct.timespec* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
void *Cyc_Core_identity(void *x) { return x; }


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

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

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

LLVM IR (-O2):
define i8* @Cyc_Core_identity(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int roamGetStatsThreshold(int, char **, int);
int roamGetRssiStatsThreshold(int argc, char *argv[]) {
  return roamGetStatsThreshold(argc, argv, 1);
}


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

x86 assembly (clang, -O2):
<roamGetRssiStatsThreshold>:
mov    $0x1,%edx
jmp    1030 <roamGetStatsThreshold@plt>

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

LLVM IR (-O2):
define i32 @roamGetRssiStatsThreshold(i32 %0, i8** %1) {
%3 = tail call i32 @roamGetStatsThreshold(i32 %0, i8** %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__2__IO__makeOutput();
void LedsP__Led0__makeOutput(void) {
  HplAtm128GeneralIOPinP__2__IO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @LedsP__Led0__makeOutput() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__2__IO__makeOutput()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int parrayi(int a[], int length) {
  int i = 0;
  for (i = 0; i < length; ++i) {
    printf("\n%d*%d\n", i, a[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<parrayi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <parrayi+0x51>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <parrayi+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parrayi>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <parrayi+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <parrayi+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\0A%d*%d\0A\00"
define i32 @parrayi(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"\0A%d*%d\0A\00"
define i32 @parrayi(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int *malloc(int);
void test(int *p) {
  p = malloc(sizeof(int) * 9);
  return;
}


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

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

LLVM IR (-O0):
define void @test(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32* @malloc(i32 36)
store i32* %3, i32** %2
ret void
}

LLVM IR (-O2):
define void @test(i32* nocapture readnone %0) {
%2 = tail call i32* @malloc(i32 36)
ret void
}
double calculate_mean(double sum, int number) {
  double value = -1.0;
  if (number != 0) {
    value = sum / number;
  }
  return value;
}


x86 assembly (clang, -O0):
<calculate_mean>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1136 <calculate_mean+0x36>
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_mean>:
test   %edi,%edi
je     110d <calculate_mean+0xd>
cvtsi2sd %edi,%xmm1
divsd  %xmm1,%xmm0
ret
movsd  0xeeb(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calculate_mean(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
store double -1.000000e+00, double* %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load double, double* %3
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = fdiv double %9, %11
store double %12, double* %5
br label %13
13: ; preds = %8, %2
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @calculate_mean(double %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = sitofp i32 %1 to double
%6 = fdiv double %0, %5
br label %7
7: ; preds = %4, %2
%8 = phi double [ %6, %4 ], [ -1.000000e+00, %2 ]
ret double %8
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello World!");
  return (EXIT_SUCCESS);
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
int lucky_nums(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Lucky numbers: %u\n", lucky_nums(1000000));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Lucky numbers: %u\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @lucky_nums(i32 1000000)
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Lucky numbers: %u\0A\00"
define i32 @main() {
%1 = tail call i32 @lucky_nums(i32 1000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(
      stderr,
      "usage: uCheader [options] <image filename>\n"
      "\n"
      "       Display the image header of a uCimage file and check its MD5.\n"
      "\n");
  fprintf(stderr, "Options:\n"
                  "\t-f <filename>\tinput image filename\n"
                  "\t-s\tRead image file from stdin\n"
                  "\t-h\tthis help information\n"
                  "\t-d\tprint debugging message\n"
                  "\t-q\tdo it quietly, no output to the screen\n\n");
  exit(1);
}


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    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xf2a(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [115 x i8] c"usage: uCheader [options] <image filename>\0A\0A Display the image header of a uCimage file and check its MD5.\0A\0A\00"
@.str.1 = [175 x i8] c"Options:\0A\09-f <filename>\09input image filename\0A\09-s\09Read image file from stdin\0A\09-h\09this help information\0A\09-d\09print debugging message\0A\09-q\09do it quietly, no output to the screen\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [115 x i8] c"usage: uCheader [options] <image filename>\0A\0A Display the image header of a uCimage file and check its MD5.\0A\0A\00"
@.str.1 = [175 x i8] c"Options:\0A\09-f <filename>\09input image filename\0A\09-s\09Read image file from stdin\0A\09-h\09this help information\0A\09-d\09print debugging message\0A\09-q\09do it quietly, no output to the screen\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblock_unref() {
  printf("NOT IMPLEMENTED:"
         "pa_memblock_unref"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_memblock_unref\0A\00"
define i32 @pa_memblock_unref() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_memblock_unref\00"
define i32 @pa_memblock_unref() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void system_rmb() {}


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

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

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

LLVM IR (-O2):
define void @system_rmb() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void fnShowUsage(char *pname, char *msg) {
  printf("%s:\n", msg);
  printf("USAGE:\n");
  printf("\t%s [dest_addr]\n", pname);
}


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

x86 assembly (clang, -O2):
<fnShowUsage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s:\0A\00"
@.str.1 = [8 x i8] c"USAGE:\0A\00"
@.str.2 = [17 x i8] c"\09%s [dest_addr]\0A\00"
define void @fnShowUsage(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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s:\0A\00"
@.str.2 = [17 x i8] c"\09%s [dest_addr]\0A\00"
@str = [7 x i8] c"USAGE:\00"
define void @fnShowUsage(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
void putc(char c) {
  while (!(*((volatile unsigned int *)((0x03010000 + (0x2f8 << 2)) + 0x14)) &
           0x20))
    barrier();
  *((volatile unsigned int *)((0x03010000 + (0x2f8 << 2)))) = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3010bf4,%eax
mov    (%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113d <putc+0x2d>
jmp    1149 <putc+0x39>
mov    $0x0,%al
call   1030 <barrier@plt>
jmp    111e <putc+0xe>
movsbl -0x1(%rbp),%ecx
mov    $0x3010be0,%eax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
push   %rbx
mov    %edi,%ebx
testl  $0x20,0x3010bf4
jne    1134 <putc+0x24>
xor    %eax,%eax
call   1030 <barrier@plt>
testl  $0x20,0x3010bf4
je     1120 <putc+0x10>
movsbl %bl,%eax
mov    %eax,0x3010be0
pop    %rbx
ret

LLVM IR (-O0):
define void @putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i32, i32* inttoptr (i64 50400244 to i32*)
%5 = and i32 %4, 32
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = call i32 (...) @barrier()
br label %3
10: ; preds = %3
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
store volatile i32 %12, i32* inttoptr (i64 50400224 to i32*)
ret void
}

LLVM IR (-O2):
define void @putc(i8 signext %0) {
%2 = load volatile i32, i32* inttoptr (i64 50400244 to i32*)
%3 = and i32 %2, 32
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = tail call i32 (...) @barrier()
%7 = load volatile i32, i32* inttoptr (i64 50400244 to i32*)
%8 = and i32 %7, 32
%9 = icmp eq i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %1
%11 = sext i8 %0 to i32
store volatile i32 %11, i32* inttoptr (i64 50400224 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fit_cornu_half(int /*<<< orphan*/, int, double *, double *,
                                  int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double, double);
void test_cornu(void) {
  double t0, t1;
  fit_cornu_half(0, 1, &t0, &t1, 0, 0);
  printf("%g %g\n", t0, t1);
}


x86 assembly (clang, -O0):
<test_cornu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %r9d,%r9d
mov    $0x1,%esi
lea    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rcx
mov    %r9d,%edi
mov    %r9d,%r8d
call   1040 <fit_cornu_half@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cornu>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
xor    %edi,%edi
mov    $0x1,%esi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1040 <fit_cornu_half@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%g %g\0A\00"
define void @test_cornu() {
%1 = alloca double
%2 = alloca double
%3 = call i32 @fit_cornu_half(i32 0, i32 1, double* %1, double* %2, i32 0, i32 0)
%4 = load double, double* %1
%5 = load double, double* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %4, double %5)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%g %g\0A\00"
define void @test_cornu() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @fit_cornu_half(i32 0, i32 1, double* %1, double* %2, i32 0, i32 0)
%6 = load double, double* %1
%7 = load double, double* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %6, double %7)
ret void
}
/* Type definitions */
struct MEMMAN {
  int dummy;
};

/* Variables and functions */
unsigned int memman_alloc(struct MEMMAN *, unsigned int);
unsigned int memman_alloc_4k(struct MEMMAN *man, unsigned int size) {
  unsigned int a;
  size = (size + 0xfff) & 0xfffff000;
  a = memman_alloc(man, size);
  return a;
}


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

x86 assembly (clang, -O2):
<memman_alloc_4k>:
add    $0xfff,%esi
and    $0xfffff000,%esi
jmp    1030 <memman_alloc@plt>

LLVM IR (-O0):
%struct.MEMMAN = type { i32 }
define i32 @memman_alloc_4k(%struct.MEMMAN* %0, i32 %1) {
%3 = alloca %struct.MEMMAN*
%4 = alloca i32
%5 = alloca i32
store %struct.MEMMAN* %0, %struct.MEMMAN** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add i32 %6, 4095
%8 = and i32 %7, -4096
store i32 %8, i32* %4
%9 = load %struct.MEMMAN*, %struct.MEMMAN** %3
%10 = load i32, i32* %4
%11 = call i32 @memman_alloc(%struct.MEMMAN* %9, i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
%struct.MEMMAN = type { i32 }
define i32 @memman_alloc_4k(%struct.MEMMAN* %0, i32 %1) {
%3 = add i32 %1, 4095
%4 = and i32 %3, -4096
%5 = tail call i32 @memman_alloc(%struct.MEMMAN* %0, i32 %4)
ret i32 %5
}
void hostapd_ubus_add_iface(struct hostapd_iface *iface) {}


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

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

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

LLVM IR (-O2):
%struct.hostapd_iface = type opaque
define void @hostapd_ubus_add_iface(%struct.hostapd_iface* nocapture %0) {
ret void
}
void stopTone() { return; }


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

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

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

LLVM IR (-O2):
define void @stopTone() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cs_base64_encode(unsigned char const *, int, char *);
void ns_base64_encode(const unsigned char *src, int src_len, char *dst) {
  cs_base64_encode(src, src_len, dst);
}


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

x86 assembly (clang, -O2):
<ns_base64_encode>:
jmp    1030 <cs_base64_encode@plt>

LLVM IR (-O0):
define void @ns_base64_encode(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @cs_base64_encode(i8* %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @ns_base64_encode(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @cs_base64_encode(i8* %0, i32 %1, i8* %2)
ret void
}
void willusgui_sbitmap_proc(void *handle, int message, int wparam,
                            void *lparam) {}


x86 assembly (clang, -O0):
<willusgui_sbitmap_proc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @willusgui_sbitmap_proc(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
define void @willusgui_sbitmap_proc(i8* nocapture %0, i32 %1, i32 %2, i8* nocapture %3) {
ret void
}
/* Type definitions */
struct stack {
  int dummy;
};

/* Variables and functions */
scalar_t__ isEmpty(struct stack *);
int pop(struct stack *);
int /*<<< orphan*/ push(struct stack *, int);
void insertAtbottom(struct stack *S, int data) {
  int temp;
  if (isEmpty(S)) {
    push(S, data);
    return;
  } else {
    temp = pop(S);
    insertAtbottom(S, data);
    push(S, temp);
  }
}


x86 assembly (clang, -O0):
<insertAtbottom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <isEmpty@plt>
cmp    $0x0,%rax
je     1173 <insertAtbottom+0x33>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1060 <push@plt>
jmp    1197 <insertAtbottom+0x57>
mov    -0x8(%rbp),%rdi
call   1030 <pop@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <insertAtbottom@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1060 <push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insertAtbottom>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <isEmpty@plt>
test   %rax,%rax
jne    116b <insertAtbottom+0x2b>
mov    %rbx,%rdi
call   1030 <pop@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <insertAtbottom@plt>
mov    %r14d,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <push@plt>

LLVM IR (-O0):
%struct.stack = type { i32 }
define void @insertAtbottom(%struct.stack* %0, i32 %1) {
%3 = alloca %struct.stack*
%4 = alloca i32
%5 = alloca i32
store %struct.stack* %0, %struct.stack** %3
store i32 %1, i32* %4
%6 = load %struct.stack*, %struct.stack** %3
%7 = call i64 @isEmpty(%struct.stack* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load %struct.stack*, %struct.stack** %3
%11 = load i32, i32* %4
%12 = call i32 @push(%struct.stack* %10, i32 %11)
br label %21
13: ; preds = %2
%14 = load %struct.stack*, %struct.stack** %3
%15 = call i32 @pop(%struct.stack* %14)
store i32 %15, i32* %5
%16 = load %struct.stack*, %struct.stack** %3
%17 = load i32, i32* %4
%18 = load %struct.stack*, %struct.stack** %3
%19 = load i32, i32* %5
%20 = call i32 @push(%struct.stack* %18, i32 %19)
br label %21
21: ; preds = %9, %13
ret void
}

LLVM IR (-O2):
%struct.stack = type { i32 }
define void @insertAtbottom(%struct.stack* %0, i32 %1) {
%3 = tail call i64 @isEmpty(%struct.stack* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2, %8
%6 = phi i32 [ %9, %8 ], [ %1, %2 ]
%7 = tail call i32 @push(%struct.stack* %0, i32 %6)
ret void
8: ; preds = %2
%9 = tail call i32 @pop(%struct.stack* %0)
tail call void @insertAtbottom(%struct.stack* %0, i32 %1)
br label %5
}
int fitsBits(int x, int n) {
  int shift, tmp;
  shift = 33 + ~n;
  tmp = (x << shift) >> shift;
  return !(x ^ tmp);
}


x86 assembly (clang, -O0):
<fitsBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x21,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x10(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitsBits>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%edx
shl    %cl,%edx
sar    %cl,%edx
xor    %eax,%eax
cmp    %edi,%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @fitsBits(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = xor i32 %7, -1
%9 = add nsw i32 33, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = shl i32 %10, %11
%13 = load i32, i32* %5
%14 = ashr i32 %12, %13
store i32 %14, i32* %6
%15 = load i32, i32* %3
%16 = load i32, i32* %6
%17 = xor i32 %15, %16
%18 = icmp ne i32 %17, 0
%19 = xor i1 %18, true
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @fitsBits(i32 %0, i32 %1) {
%3 = sub i32 32, %1
%4 = shl i32 %0, %3
%5 = ashr i32 %4, %3
%6 = icmp eq i32 %5, %0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t bitswap32(uint32_t x) {
  asm("bswap %0" : "=a"(x) : "0"(x));
  return x;
}


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

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

LLVM IR (-O0):
define i8* @bitswap32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "bswap $0", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @bitswap32(i8* readnone %0) {
%2 = tail call i8* asm "bswap $0", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
struct exynos_drm_display *exynos_dpi_probe(struct device *dev) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.exynos_drm_display = type opaque
%struct.device = type opaque
define %struct.exynos_drm_display* @exynos_dpi_probe(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret %struct.exynos_drm_display* null
}

LLVM IR (-O2):
%struct.exynos_drm_display = type opaque
%struct.device = type opaque
define noalias %struct.exynos_drm_display* @exynos_dpi_probe(%struct.device* nocapture readnone %0) {
ret %struct.exynos_drm_display* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float *a = NULL, *b = NULL, c = 5;
  a = &c;
  if (a != NULL) {
    b = a;
    printf("Numero : %f ", *b);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116b <main+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Numero : %f \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float 5.000000e+00)
ret i32 0
}