xunge/DecIR huggingface dataset:
int time_total_centiseconds(float t) { return (int)(t * 100.0f + 0.5f); }


x86 assembly (clang, -O0):
<time_total_centiseconds>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xee2(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_total_centiseconds>:
mulss  0xef8(%rip),%xmm0
addss  0xef4(%rip),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @time_total_centiseconds(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.fmuladd.f32(float %3, float 1.000000e+02, float 5.000000e-01)
%5 = fptosi float %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @time_total_centiseconds(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float 1.000000e+02, float 5.000000e-01)
%3 = fptosi float %2 to i32
ret i32 %3
}
/* Type definitions */
struct iavf_ring {
  int dummy;
};

/* Variables and functions */
int IAVF_DESC_UNUSED(struct iavf_ring *);
int __iavf_maybe_stop_tx(struct iavf_ring *, int);
scalar_t__ likely(int);
int iavf_maybe_stop_tx(struct iavf_ring *tx_ring, int size) {
  if (likely(IAVF_DESC_UNUSED(tx_ring) >= size))
    return 0;
  return __iavf_maybe_stop_tx(tx_ring, size);
}


x86 assembly (clang, -O0):
<iavf_maybe_stop_tx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <IAVF_DESC_UNUSED@plt>
cmp    -0x14(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <likely@plt>
cmp    $0x0,%rax
je     116e <iavf_maybe_stop_tx+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    117d <iavf_maybe_stop_tx+0x4d>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <__iavf_maybe_stop_tx@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iavf_maybe_stop_tx>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <IAVF_DESC_UNUSED@plt>
xor    %edi,%edi
cmp    %ebp,%eax
setge  %dil
call   1050 <likely@plt>
test   %rax,%rax
je     1158 <iavf_maybe_stop_tx+0x28>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__iavf_maybe_stop_tx@plt>

LLVM IR (-O0):
%struct.iavf_ring = type { i32 }
define i32 @iavf_maybe_stop_tx(%struct.iavf_ring* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.iavf_ring*
%5 = alloca i32
store %struct.iavf_ring* %0, %struct.iavf_ring** %4
store i32 %1, i32* %5
%6 = load %struct.iavf_ring*, %struct.iavf_ring** %4
%7 = call i32 @IAVF_DESC_UNUSED(%struct.iavf_ring* %6)
%8 = load i32, i32* %5
%9 = icmp sge i32 %7, %8
%10 = zext i1 %9 to i32
%11 = call i64 @likely(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 0, i32* %3
br label %18
14: ; preds = %2
%15 = load %struct.iavf_ring*, %struct.iavf_ring** %4
%16 = load i32, i32* %5
%17 = call i32 @__iavf_maybe_stop_tx(%struct.iavf_ring* %15, i32 %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %14, %13
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.iavf_ring = type { i32 }
define i32 @iavf_maybe_stop_tx(%struct.iavf_ring* %0, i32 %1) {
%3 = tail call i32 @IAVF_DESC_UNUSED(%struct.iavf_ring* %0)
%4 = icmp sge i32 %3, %1
%5 = zext i1 %4 to i32
%6 = tail call i64 @likely(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @__iavf_maybe_stop_tx(%struct.iavf_ring* %0, i32 %1)
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ %9, %8 ], [ 0, %2 ]
ret i32 %11
}
int global_func(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @global_func(i32 returned %0) {
ret i32 %0
}
int main() {
  int a = 0;
  int b = 1;
  __asm__ __volatile__("movl %1, %%eax;"
                       "movl %%eax, %0;"
                       : "=r"(b)
                       : "r"(a)
                       : "%eax");
  printf("b= %d\n", b);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"b= %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect "movl $1, %eax;movl %eax, $0;", "=r,r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"b= %d\0A\00"
define i32 @main() {
%1 = tail call i32 asm sideeffect "movl $1, %eax;movl %eax, $0;", "=r,r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 0)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void foo(void) {
  int k;
  extern int l;
  extern int m;
#pragma omp threadprivate(m)
#pragma omp parallel copyin(i)
  bar();
#pragma omp parallel copyin(j)
  bar();
#pragma omp parallel copyin(k)
  bar();
#pragma omp parallel copyin(l)
  bar();
#pragma omp parallel copyin(m)
  bar();
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
%2 = call i32 (...) @bar()
%3 = call i32 (...) @bar()
%4 = call i32 (...) @bar()
%5 = call i32 (...) @bar()
%6 = call i32 (...) @bar()
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 (...) @bar()
%3 = tail call i32 (...) @bar()
%4 = tail call i32 (...) @bar()
%5 = tail call i32 (...) @bar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prim(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ readmatrix(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  printf("Please specify the number of vertices in the graph: ");
  int sizeofmat;
  scanf("%d", &sizeofmat);
  readmatrix(sizeofmat);
  prim(sizeofmat);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <readmatrix@plt>
mov    0x4(%rsp),%edi
call   1030 <prim@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"Please specify the number of vertices in the graph: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @readmatrix(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @prim(i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [53 x i8] c"Please specify the number of vertices in the graph: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @readmatrix(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @prim(i32 %7)
ret i32 0
}
void mem_info() {}


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

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

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

LLVM IR (-O2):
define void @mem_info() {
ret void
}
/* Type definitions */
struct sshbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __UNCONST(char const *);
int sshbuf_put_string(struct sshbuf *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int sshbuf_put_cstring(struct sshbuf *buf, const char *v) {
  return sshbuf_put_string(buf, __UNCONST(v), v == NULL ? 0 : strlen(v));
}


x86 assembly (clang, -O0):
<sshbuf_put_cstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <__UNCONST@plt>
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1169 <sshbuf_put_cstring+0x39>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1175 <sshbuf_put_cstring+0x45>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
call   1030 <sshbuf_put_string@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sshbuf_put_cstring>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <__UNCONST@plt>
mov    %eax,%ebp
test   %rbx,%rbx
je     1155 <sshbuf_put_cstring+0x25>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
jmp    1157 <sshbuf_put_cstring+0x27>
xor    %edx,%edx
mov    %r14,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <sshbuf_put_string@plt>

LLVM IR (-O0):
%struct.sshbuf = type { i32 }
define i32 @sshbuf_put_cstring(%struct.sshbuf* %0, i8* %1) {
%3 = alloca %struct.sshbuf*
%4 = alloca i8*
store %struct.sshbuf* %0, %struct.sshbuf** %3
store i8* %1, i8** %4
%5 = load %struct.sshbuf*, %struct.sshbuf** %3
%6 = load i8*, i8** %4
%7 = call i32 @__UNCONST(i8* %6)
%8 = load i8*, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %2
br label %14
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i32 @strlen(i8* %12)
br label %14
14: ; preds = %11, %10
%15 = phi i32 [ 0, %10 ], [ %13, %11 ]
%16 = call i32 @sshbuf_put_string(%struct.sshbuf* %5, i32 %7, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.sshbuf = type { i32 }
define i32 @sshbuf_put_cstring(%struct.sshbuf* %0, i8* %1) {
%3 = tail call i32 @__UNCONST(i8* %1)
%4 = icmp eq i8* %1, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
%9 = tail call i32 @sshbuf_put_string(%struct.sshbuf* %0, i32 %3, i32 %8)
ret i32 %9
}
int test_unsignedlonglong() {
  int i;
  unsigned long long reds[2] = {4096, 4096};
#pragma acc parallel loop
  for (i = 0; i < 4096; i++) {
#pragma acc atomic
    reds[0]--;
#pragma acc atomic
    --reds[1];
  }
  for (i = 0; i < 2; i++) {
    if (reds[i] != 0) {
      return i + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_unsignedlonglong>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1000,-0x8(%rbp)
jge    1154 <test_unsignedlonglong+0x54>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1121 <test_unsignedlonglong+0x21>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1196 <test_unsignedlonglong+0x96>
movslq -0x8(%rbp),%rax
cmpq   $0x0,-0x20(%rbp,%rax,8)
je     1183 <test_unsignedlonglong+0x83>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    119d <test_unsignedlonglong+0x9d>
jmp    1188 <test_unsignedlonglong+0x88>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115b <test_unsignedlonglong+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_unsignedlonglong() {
ret i32 0
}
/* Variables and functions */
float cosf(float);
float dtMathCosf(float x) { return cosf(x); }


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

x86 assembly (clang, -O2):
<dtMathCosf>:
jmp    1030 <cosf@plt>

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

LLVM IR (-O2):
define float @dtMathCosf(float %0) {
%2 = tail call float @cosf(float %0)
ret float %2
}
int fibonacciRec(int num) {
  if (num <= 1)
    return 1;
  return fibonacciRec(num - 1) + fibonacciRec(num - 2);
}


x86 assembly (clang, -O0):
<fibonacciRec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1131 <fibonacciRec+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <fibonacciRec+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacciRec@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacciRec@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacciRec>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1145 <fibonacciRec+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fibonacciRec@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x3,%ebx
ja     1130 <fibonacciRec+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fibonacciRec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = call i32 @fibonacciRec(i32 %9)
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 2
%13 = call i32 @fibonacciRec(i32 %12)
%14 = add nsw i32 %10, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %7, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @fibonacciRec(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fibonacciRec(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
int val_seg_ulaw(int val) {
  int r = 0;
  val >>= 7;
  if (val & 0xf0) {
    val >>= 4;
    r += 4;
  }
  if (val & 0x0c) {
    val >>= 2;
    r += 2;
  }
  if (val & 0x02)
    r += 1;
  return r;
}


x86 assembly (clang, -O0):
<val_seg_ulaw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x7,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0,%eax
cmp    $0x0,%eax
je     113a <val_seg_ulaw+0x3a>
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xc,%eax
cmp    $0x0,%eax
je     115b <val_seg_ulaw+0x5b>
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1173 <val_seg_ulaw+0x73>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<val_seg_ulaw>:
xor    %edx,%edx
test   $0x7800,%edi
setne  %dl
lea    0x0(,%rdx,4),%ecx
add    $0x7,%cl
sar    %cl,%edi
lea    0x0(,%rdx,4),%ecx
mov    %edi,%eax
shr    $0x2,%eax
test   $0xc,%dil
lea    0x2(,%rdx,4),%edx
cmove  %edi,%eax
cmove  %ecx,%edx
shr    %eax
and    $0x1,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @val_seg_ulaw(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = ashr i32 %4, 7
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = and i32 %6, 240
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i32, i32* %2
%11 = ashr i32 %10, 4
store i32 %11, i32* %2
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 4
store i32 %13, i32* %3
br label %14
14: ; preds = %9, %1
%15 = load i32, i32* %2
%16 = and i32 %15, 12
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i32, i32* %2
%20 = ashr i32 %19, 2
store i32 %20, i32* %2
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 2
store i32 %22, i32* %3
br label %23
23: ; preds = %18, %14
%24 = load i32, i32* %2
%25 = and i32 %24, 2
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %30
30: ; preds = %27, %23
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @val_seg_ulaw(i32 %0) {
%2 = and i32 %0, 30720
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 7, i32 11
%5 = ashr i32 %0, %4
%6 = select i1 %3, i32 0, i32 4
%7 = and i32 %5, 12
%8 = icmp eq i32 %7, 0
%9 = lshr i32 %5, 2
%10 = or i32 %6, 2
%11 = select i1 %8, i32 %5, i32 %9
%12 = select i1 %8, i32 %6, i32 %10
%13 = lshr i32 %11, 1
%14 = and i32 %13, 1
%15 = or i32 %14, %12
ret i32 %15
}
unsigned My_random(unsigned seed) {
  unsigned long storage;
  storage = seed * 279470273;
  seed = storage % 4294967291U;
  return seed;
}


x86 assembly (clang, -O0):
<My_random>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x10a860c1,-0x4(%rbp),%eax
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xfffffffb,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<My_random>:
imul   $0x10a860c1,%edi,%ecx
mov    %ecx,%eax
sub    $0xfffffffb,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @My_random(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul i32 %4, 279470273
%6 = zext i32 %5 to i64
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = urem i64 %7, 4294967291
%9 = trunc i64 %8 to i32
store i32 %9, i32* %2
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @My_random(i32 %0) {
%2 = mul i32 %0, 279470273
%3 = icmp ult i32 %2, -5
%4 = add i32 %2, 5
%5 = select i1 %3, i32 %2, i32 %4
ret i32 %5
}
/* Type definitions */
struct StringTable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ makeStringFromInt(int);
int putString(struct StringTable *, int /*<<< orphan*/, void *);
int putInt(struct StringTable *st, int key, void *val) {
  return putString(st, makeStringFromInt(key), val);
}


x86 assembly (clang, -O0):
<putInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <makeStringFromInt@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
call   1040 <putString@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putInt>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <makeStringFromInt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <putString@plt>

LLVM IR (-O0):
%struct.StringTable = type { i32 }
define i32 @putInt(%struct.StringTable* %0, i32 %1, i8* %2) {
%4 = alloca %struct.StringTable*
%5 = alloca i32
%6 = alloca i8*
store %struct.StringTable* %0, %struct.StringTable** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.StringTable*, %struct.StringTable** %4
%8 = load i32, i32* %5
%9 = call i32 @makeStringFromInt(i32 %8)
%10 = load i8*, i8** %6
%11 = call i32 @putString(%struct.StringTable* %7, i32 %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.StringTable = type { i32 }
define i32 @putInt(%struct.StringTable* %0, i32 %1, i8* %2) {
%4 = tail call i32 @makeStringFromInt(i32 %1)
%5 = tail call i32 @putString(%struct.StringTable* %0, i32 %4, i8* %2)
ret i32 %5
}
/* Variables and functions */
int is_first_in_group_Logon(size_t __tag) {
  (void)__tag;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @is_first_in_group_Logon(i64 %0) {
ret i32 0
}
int any_int(void) { return 3; }


x86 assembly (clang, -O0):
<any_int>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any_int>:
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @any_int() {
ret i32 3
}

LLVM IR (-O2):
define i32 @any_int() {
ret i32 3
}
/* Variables and functions */
double nmea_degree2radian(int /*<<< orphan*/);
int /*<<< orphan*/ nmea_ndeg2degree(double);
double nmea_ndeg2radian(double val) {
  return nmea_degree2radian(nmea_ndeg2degree(val));
}


x86 assembly (clang, -O0):
<nmea_ndeg2radian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <nmea_ndeg2degree@plt>
mov    %eax,%edi
call   1030 <nmea_degree2radian@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmea_ndeg2radian>:
push   %rax
call   1040 <nmea_ndeg2degree@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <nmea_degree2radian@plt>

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

LLVM IR (-O2):
define double @nmea_ndeg2radian(double %0) {
%2 = tail call i32 @nmea_ndeg2degree(double %0)
%3 = tail call double @nmea_degree2radian(i32 %2)
ret double %3
}
int exact_square(int number) {
  int square = 1;
  while (square <= number / square) {
    if (number == square * square) {
      return 1;
    } else {
      square++;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     1154 <exact_square+0x54>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jne    1146 <exact_square+0x46>
movl   $0x1,-0x4(%rbp)
jmp    115b <exact_square+0x5b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <exact_square+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
test   %edi,%edi
jle    112a <exact_square+0x2a>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
lea    0x1(%rcx),%esi
mov    %esi,%eax
imul   %esi,%eax
cmp    %edi,%eax
je     112d <exact_square+0x2d>
add    $0x2,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
mov    %esi,%ecx
cmp    %eax,%esi
jl     1110 <exact_square+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @exact_square(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = sdiv i32 %7, %8
%10 = icmp sle i32 %6, %9
br i1 %10, label %11, label %22
11: ; preds = %5
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %4
%15 = mul nsw i32 %13, %14
%16 = icmp eq i32 %12, %15
br i1 %16, label %17, label %18
17: ; preds = %11
store i32 1, i32* %2
br label %23
18: ; preds = %11
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %21
21: ; preds = %18
br label %5
22: ; preds = %5
store i32 0, i32* %2
br label %23
23: ; preds = %22, %17
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %11, label %6
3: ; preds = %6
%4 = sdiv i32 %0, %10
%5 = icmp slt i32 %7, %4
br i1 %5, label %6, label %11
6: ; preds = %1, %3
%7 = phi i32 [ %10, %3 ], [ 1, %1 ]
%8 = mul nsw i32 %7, %7
%9 = icmp eq i32 %8, %0
%10 = add nuw nsw i32 %7, 1
br i1 %9, label %11, label %3
11: ; preds = %6, %3, %1
%12 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %6 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndLeave(const char *progname, int status) {
  FILE *stream = stderr;
  if (status == EXIT_SUCCESS) {
    stream = stdout;
  }
  fprintf(stream, "Usage: %s [-u user] command\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndLeave+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndLeave>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndLeave+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndLeave+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [29 x i8] c"Usage: %s [-u user] command\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32*, i32** @stderr
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stdout
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [29 x i8] c"Usage: %s [-u user] command\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int safer_strncpy(char *, size_t, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
bool safer_strcpy(char *dest, size_t destsz, const char *src) {
  return (src) ? safer_strncpy(dest, destsz, src, strlen(src)) : false;
}


x86 assembly (clang, -O0):
<safer_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117b <safer_strcpy+0x5b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    %eax,%ecx
call   1030 <safer_strncpy@plt>
mov    %eax,-0x1c(%rbp)
jmp    1185 <safer_strcpy+0x65>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1185 <safer_strcpy+0x65>
mov    -0x1c(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safer_strcpy>:
test   %rdx,%rdx
je     1150 <safer_strcpy+0x30>
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <safer_strncpy@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @safer_strcpy(i8* %0, i64 %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i32 @strlen(i8* %2)
%7 = tail call i32 @safer_strncpy(i8* %0, i64 %1, i8* %2, i32 %6)
br label %8
8: ; preds = %3, %5
%9 = phi i32 [ %7, %5 ], [ 0, %3 ]
ret i32 %9
}
int pthread_mutex_destroy() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutex_destroy() {
ret i32 0
}
/* Variables and functions */
int lirc_send_key_with_time(char const *, char const *, int /*<<< orphan*/);
int lirc_send_key(const char *remote, const char *key) {
  return lirc_send_key_with_time(remote, key, 0);
}


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

x86 assembly (clang, -O2):
<lirc_send_key>:
xor    %edx,%edx
jmp    1030 <lirc_send_key_with_time@plt>

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

LLVM IR (-O2):
define i32 @lirc_send_key(i8* %0, i8* %1) {
%3 = tail call i32 @lirc_send_key_with_time(i8* %0, i8* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 1;
  int j = 0;
  while ((i != 0) && i > 0) {
    j = i;
    i = i + 1;
  }
  printf("Max of int is %d\n", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1146 <main+0x36>
cmpl   $0x0,-0x8(%rbp)
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1156 <main+0x46>
jmp    116a <main+0x5a>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [18 x i8] c"Max of int is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
br label %10
10: ; preds = %7, %4
%11 = phi i1 [ false, %4 ], [ %9, %7 ]
br i1 %11, label %12, label %16
12: ; preds = %10
%13 = load i32, i32* %2
store i32 %13, i32* %3
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %4
16: ; preds = %10
%17 = load i32, i32* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
struct ref_context *get_refs(unsigned long long refs_id) {}


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

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

LLVM IR (-O0):
%struct.ref_context = type opaque
define %struct.ref_context* @get_refs(i64 %0) {
%2 = alloca %struct.ref_context*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load %struct.ref_context*, %struct.ref_context** %2
ret %struct.ref_context* %4
}

LLVM IR (-O2):
%struct.ref_context = type opaque
define noalias %struct.ref_context* @get_refs(i64 %0) {
ret %struct.ref_context* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void menu() {
  printf("Welcome to + or - !\n\n");
  printf("Please, take a seat and enjoy !\n\n");
  printf("1 - Play alone\n");
  printf("0 - Quit\n");
}


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

x86 assembly (clang, -O2):
<menu>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Welcome to + or - !\0A\0A\00"
@.str.1 = [34 x i8] c"Please, take a seat and enjoy !\0A\0A\00"
@.str.2 = [16 x i8] c"1 - Play alone\0A\00"
@.str.3 = [10 x i8] c"0 - Quit\0A\00"
define void @menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Welcome to + or - !\0A\00"
@str.4 = [33 x i8] c"Please, take a seat and enjoy !\0A\00"
@str.5 = [15 x i8] c"1 - Play alone\00"
@str.6 = [9 x i8] c"0 - Quit\00"
define void @menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t I2CMasterBurstCountGet(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x00000034))));
}


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

x86 assembly (clang, -O2):
<I2CMasterBurstCountGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0x34(%rax),%rax
ret

LLVM IR (-O0):
define i64 @I2CMasterBurstCountGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 52
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @I2CMasterBurstCountGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 52
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Type definitions */
struct ledaValue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void main() {
  printf("size pointer %d size int %d size real %d\n",
         sizeof(struct ledaValue *), sizeof(int), sizeof(double));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x8,%ecx
mov    $0x4,%edx
mov    %ecx,%esi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
mov    $0x4,%edx
mov    $0x8,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"size pointer %d size int %d size real %d\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 8, i32 4, i32 8)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"size pointer %d size int %d size real %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 8, i32 4, i32 8)
ret void
}
int memcg_cache_id(struct mem_cgroup *memcg) { return -1; }


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

x86 assembly (clang, -O2):
<memcg_cache_id>:
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
%struct.mem_cgroup = type opaque
define i32 @memcg_cache_id(%struct.mem_cgroup* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
scalar_t__ j1f(float);
int /*<<< orphan*/ link_failure_j1f();
void test_j1f(float f) {
  if (j1f(f) != j1f(f))
    link_failure_j1f();
}


x86 assembly (clang, -O0):
<test_j1f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <j1f@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <j1f@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_j1f+0x3c>
mov    $0x0,%al
call   1030 <link_failure_j1f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_j1f>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1040 <j1f@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1040 <j1f@plt>
cmp    %rax,%rbx
jne    1149 <test_j1f+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_j1f@plt>

LLVM IR (-O0):
define void @test_j1f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @j1f(float %3)
%5 = load float, float* %2
%6 = call i64 @j1f(float %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_j1f()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_j1f(float %0) {
%2 = tail call i64 @j1f(float %0)
%3 = tail call i64 @j1f(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_j1f()
br label %7
7: ; preds = %5, %1
ret void
}
void Seccomp_dropPermissions(struct Allocator *tempAlloc, struct Log *logger,
                             struct Except *eh) {}


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

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

LLVM IR (-O0):
%struct.Allocator = type opaque
%struct.Log = type opaque
%struct.Except = type opaque
define void @Seccomp_dropPermissions(%struct.Allocator* %0, %struct.Log* %1, %struct.Except* %2) {
%4 = alloca %struct.Allocator*
%5 = alloca %struct.Log*
%6 = alloca %struct.Except*
store %struct.Allocator* %0, %struct.Allocator** %4
store %struct.Log* %1, %struct.Log** %5
store %struct.Except* %2, %struct.Except** %6
ret void
}

LLVM IR (-O2):
%struct.Allocator = type opaque
%struct.Log = type opaque
%struct.Except = type opaque
define void @Seccomp_dropPermissions(%struct.Allocator* nocapture %0, %struct.Log* nocapture %1, %struct.Except* nocapture %2) {
ret void
}
/* Variables and functions */
unsigned int to_upper(unsigned int);
bool is_lower(unsigned int ch) {
  return (to_upper(ch) != ch) || (ch == 0x00DF);
}


x86 assembly (clang, -O0):
<is_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <to_upper@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jne    1140 <is_lower+0x30>
cmpl   $0xdf,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_lower>:
push   %rbx
mov    %edi,%ebx
call   1030 <to_upper@plt>
cmp    %ebx,%eax
setne  %al
cmp    $0xdf,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_lower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @to_upper(i32 %3)
%5 = load i32, i32* %2
%6 = icmp ne i32 %4, %5
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 223
br label %10
10: ; preds = %7, %1
%11 = phi i1 [ true, %1 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_lower(i32 %0) {
%2 = tail call i32 @to_upper(i32 %0)
%3 = icmp ne i32 %2, %0
%4 = icmp eq i32 %0, 223
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
char *strcat(char *dst, const char *src) {
  char *d = dst;
  while (*dst) {
    dst++;
  }
  while ((*dst++ = *src++)) {
  }
  return d;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1166 <strcat+0x66>
jmp    1137 <strcat+0x37>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
int isupper(int c) {
  if (c >= 'A' && c <= 'Z')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1127 <isupper+0x27>
cmpl   $0x5a,-0x8(%rbp)
jg     1127 <isupper+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <isupper+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int func4(void) { return (1); }


x86 assembly (clang, -O0):
<func4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @func4() {
ret i32 1
}

LLVM IR (-O2):
define i32 @func4() {
ret i32 1
}