xunge/DecIR huggingface dataset:
/* Variables and functions */
char *str_njoin(char const *, char const *, size_t, size_t);
size_t strlen(char const *);
char *str_join(char const *s1, char const *s2) {
  size_t len_s1 = strlen(s2);
  size_t len_s2 = strlen(s2);
  return str_njoin(s1, s2, len_s1, len_s2);
}


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

x86 assembly (clang, -O2):
<str_join>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <str_njoin@plt>

LLVM IR (-O0):
define i8* @str_join(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %6
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = call i8* @str_njoin(i8* %11, i8* %12, i64 %13, i64 %14)
ret i8* %15
}

LLVM IR (-O2):
define i8* @str_join(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i8* @str_njoin(i8* %0, i8* %1, i64 %3, i64 %3)
ret i8* %4
}
/* Variables and functions */
long jround_up(long a, long b) {
  a += b - 1L;
  return a - (a % b);
}


x86 assembly (clang, -O0):
<jround_up>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    -0x18(%rbp),%rax
sub    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jround_up>:
lea    (%rdi,%rsi,1),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     111e <jround_up+0x1e>
mov    %rcx,%rax
cqto
idiv   %rsi
jmp    1124 <jround_up+0x24>
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
sub    %rdx,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @jround_up(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = sub nsw i64 %5, 1
%7 = load i64, i64* %3
%8 = add nsw i64 %7, %6
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = srem i64 %10, %11
%13 = sub nsw i64 %9, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @jround_up(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = srem i64 %4, %1
%6 = sub nsw i64 %4, %5
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int shm_open(const char *name, int oflag, mode_t mode) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @shm_open(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
int operation2(int one, int two, int three, int four) {
  int result = two;
  result += (one * 10);
  result += (four * 100);
  result += (three * 1000);
  return result;
}


x86 assembly (clang, -O0):
<operation2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0xa,-0x4(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0x64,-0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0x3e8,-0xc(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<operation2>:
lea    (%rdi,%rdi,4),%eax
lea    (%rsi,%rax,2),%esi
imul   $0x64,%ecx,%ecx
imul   $0x3e8,%edx,%eax
add    %esi,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @operation2(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
store i32 %10, i32* %9
%11 = load i32, i32* %5
%12 = mul nsw i32 %11, 10
%13 = load i32, i32* %9
%14 = add nsw i32 %13, %12
store i32 %14, i32* %9
%15 = load i32, i32* %8
%16 = mul nsw i32 %15, 100
%17 = load i32, i32* %9
%18 = add nsw i32 %17, %16
store i32 %18, i32* %9
%19 = load i32, i32* %7
%20 = mul nsw i32 %19, 1000
%21 = load i32, i32* %9
%22 = add nsw i32 %21, %20
store i32 %22, i32* %9
%23 = load i32, i32* %9
ret i32 %23
}

LLVM IR (-O2):
define i32 @operation2(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %0, 10
%6 = add nsw i32 %5, %1
%7 = mul nsw i32 %3, 100
%8 = mul nsw i32 %2, 1000
%9 = add i32 %6, %8
%10 = add i32 %9, %7
ret i32 %10
}
double rosen(double x[]) {
  return (100 * ((x[1] - x[0] * x[0]) * (x[1] - x[0] * x[0])) +
          (1.0 - x[0]) * (1.0 - x[0]));
}


x86 assembly (clang, -O0):
<rosen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0xe80(%rip),%xmm1
subsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0xe70(%rip),%xmm2
subsd  (%rax),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe58(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rosen>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
movsd  0xeef(%rip),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm2,%xmm2
mulsd  0xedb(%rip),%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @rosen(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 1
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = fneg double %8
%13 = call double @llvm.fmuladd.f64(double %12, double %11, double %5)
%14 = load double*, double** %2
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 0
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 0
%22 = load double, double* %21
%23 = fneg double %19
%24 = call double @llvm.fmuladd.f64(double %23, double %22, double %16)
%25 = fmul double %13, %24
%26 = load double*, double** %2
%27 = getelementptr inbounds double, double* %26, i64 0
%28 = load double, double* %27
%29 = fsub double 1.000000e+00, %28
%30 = load double*, double** %2
%31 = getelementptr inbounds double, double* %30, i64 0
%32 = load double, double* %31
%33 = fsub double 1.000000e+00, %32
%34 = fmul double %29, %33
%35 = call double @llvm.fmuladd.f64(double 1.000000e+02, double %25, double %34)
ret double %35
}

LLVM IR (-O2):
define double @rosen(double* nocapture %0) {
%2 = getelementptr inbounds double, double* %0, i64 1
%3 = load double, double* %2
%4 = load double, double* %0
%5 = fneg double %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double %4, double %3)
%7 = fmul double %6, %6
%8 = fsub double 1.000000e+00, %4
%9 = fmul double %8, %8
%10 = tail call double @llvm.fmuladd.f64(double %7, double 1.000000e+02, double %9)
ret double %10
}
/* Variables and functions */
size_t fmt_char(char *out, char c) {
  if (out) {
    *out = c;
  }
  return 1;
}


x86 assembly (clang, -O0):
<fmt_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1122 <fmt_char+0x22>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_char>:
test   %rdi,%rdi
je     1108 <fmt_char+0x8>
mov    %sil,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i64 @fmt_char(i8* writeonly %0, i8 signext %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %5, label %4
4: ; preds = %2
store i8 %1, i8* %0
br label %5
5: ; preds = %4, %2
ret i64 1
}
/* Variables and functions */
int indirect_func();
int indirect_call() { return indirect_func(); }


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

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

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

LLVM IR (-O2):
define i32 @indirect_call() {
%1 = tail call i32 (...) @indirect_func()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int ns_name_skip(int /*<<< orphan*/ const **, int /*<<< orphan*/ const *);
int dn_skipname(const u_char *ptr, const u_char *eom) {
  const u_char *saveptr = ptr;
  if (ns_name_skip(&ptr, eom) == -1) {
    return -1;
  }
  return ptr - saveptr;
}


x86 assembly (clang, -O0):
<dn_skipname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x10(%rbp),%rdi
call   1030 <ns_name_skip@plt>
cmp    $0xffffffff,%eax
jne    114a <dn_skipname+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <dn_skipname+0x4c>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dn_skipname>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rdi,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <ns_name_skip@plt>
mov    0x8(%rsp),%rcx
sub    %rbx,%rcx
shr    $0x2,%rcx
cmp    $0xffffffff,%eax
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @dn_skipname(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
%7 = load i32*, i32** %4
store i32* %7, i32** %6
%8 = load i32*, i32** %5
%9 = call i32 @ns_name_skip(i32** %4, i32* %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %20
12: ; preds = %2
%13 = load i32*, i32** %4
%14 = load i32*, i32** %6
%15 = ptrtoint i32* %13 to i64
%16 = ptrtoint i32* %14 to i64
%17 = sub i64 %15, %16
%18 = sdiv exact i64 %17, 4
%19 = trunc i64 %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %12, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @dn_skipname(i32* %0, i32* %1) {
%3 = alloca i32*
store i32* %0, i32** %3
%4 = call i32 @ns_name_skip(i32** %3, i32* %1)
%5 = icmp eq i32 %4, -1
%6 = load i32*, i32** %3
%7 = ptrtoint i32* %6 to i64
%8 = ptrtoint i32* %0 to i64
%9 = sub i64 %7, %8
%10 = lshr exact i64 %9, 2
%11 = trunc i64 %10 to i32
%12 = select i1 %5, i32 -1, i32 %11
ret i32 %12
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_int64_t(int64_t const k1, int64_t const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_LESS_int64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_LESS_int64_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_LESS_int64_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_int64_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void lisys_free(void *mem) { free(mem); }


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

x86 assembly (clang, -O2):
<lisys_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @lisys_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int foo() {
  int b = 100 + 100;
  return b;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0xc8,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 200
}
/* Variables and functions */
scalar_t__ constant_time_lt(unsigned int, unsigned int);
unsigned char constant_time_lt_8(unsigned int a, unsigned int b) {
  return (unsigned char)(constant_time_lt(a, b));
}


x86 assembly (clang, -O0):
<constant_time_lt_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <constant_time_lt@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<constant_time_lt_8>:
push   %rax
call   1030 <constant_time_lt@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @constant_time_lt_8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i64 @constant_time_lt(i32 %5, i32 %6)
%8 = trunc i64 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @constant_time_lt_8(i32 %0, i32 %1) {
%3 = tail call i64 @constant_time_lt(i32 %0, i32 %1)
%4 = trunc i64 %3 to i8
ret i8 %4
}
/* Variables and functions */
char *getlogin();
char *getLogin() { return getlogin(); }


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

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

LLVM IR (-O0):
define i8* @getLogin() {
%1 = call i8* (...) @getlogin()
ret i8* %1
}

LLVM IR (-O2):
define i8* @getLogin() {
%1 = tail call i8* (...) @getlogin()
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void *, size_t);
void rtc_hal_write(uint8_t address, void *data_in, size_t num_bytes) {
  uint8_t buffer[10];
  buffer[0] = address;
  memcpy(&buffer[1], data_in, num_bytes);
}


x86 assembly (clang, -O0):
<rtc_hal_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x40(%rbp)
lea    -0x40(%rbp),%rdi
add    $0x4,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtc_hal_write>:
sub    $0x28,%rsp
mov    %edi,(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <memcpy@plt>
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define void @rtc_hal_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca [10 x i32]
%5 = bitcast [10 x i32]* %4 to i8*
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
store i32 %0, i32* %6
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 1
%8 = call i32 @memcpy(i32* %7, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
scalar_t__ log(float);
void fvec_log(float *v, long n) {
  long i;
  for (i = 0; i < n; i++) {
    v[i] = (float)log(v[i]);
  }
}


x86 assembly (clang, -O0):
<fvec_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    116b <fvec_log+0x5b>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1030 <log@plt>
cvtsi2ss %rax,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <fvec_log+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fvec_log>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
jle    1152 <fvec_log+0x42>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  (%r15,%rbx,4),%xmm0
call   1030 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <fvec_log+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @fvec_log(float* %0, i64 %1) {
%3 = alloca float*
%4 = alloca i64
%5 = alloca i64
store float* %0, float** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %20, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = load float*, float** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds float, float* %11, i64 %12
%14 = load float, float* %13
%15 = call i64 @log(float %14)
%16 = sitofp i64 %15 to float
%17 = load float*, float** %3
%18 = load i64, i64* %5
%19 = getelementptr inbounds float, float* %17, i64 %18
store float %16, float* %19
br label %20
20: ; preds = %10
%21 = load i64, i64* %5
%22 = add nsw i64 %21, 1
store i64 %22, i64* %5
br label %6
23: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @fvec_log(float* nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds float, float* %0, i64 %5
%7 = load float, float* %6
%8 = tail call i64 @log(float %7)
%9 = sitofp i64 %8 to float
store float %9, float* %6
%10 = add nuw nsw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_flags() {
  printf("Flags:\n");
  printf("\t-f\tRead from file [file_path]\n");
  printf("\t-u\tRead directly from stdin \n");
}


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

x86 assembly (clang, -O2):
<print_flags>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Flags:\0A\00"
@.str.1 = [32 x i8] c"\09-f\09Read from file [file_path]\0A\00"
@.str.2 = [31 x i8] c"\09-u\09Read directly from stdin \0A\00"
define void @print_flags() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Flags:\00"
@str.3 = [31 x i8] c"\09-f\09Read from file [file_path]\00"
@str.4 = [30 x i8] c"\09-u\09Read directly from stdin \00"
define void @print_flags() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *_throw_fn(void *, char *, int /*<<< orphan*/);
void *throw(void *e) { return _throw_fn(e, "?", 0); }


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

x86 assembly (clang, -O2):
<throw>:
lea    0xee9(%rip),%rsi
xor    %edx,%edx
jmp    1030 <_throw_fn@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"?\00"
define i8* @throw(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @_throw_fn(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
ret i8* %4
}

LLVM IR (-O2):
@.str = [2 x i8] c"?\00"
define i8* @throw(i8* %0) {
%2 = tail call i8* @_throw_fn(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ getbits(unsigned char const *, int, int);
double getbitu(unsigned char const *, int, int);
double getbits_33(const unsigned char *buff, int pos) {
  return (double)getbits(buff, pos, 32) * 2.0 + getbitu(buff, pos + 32, 1);
}


x86 assembly (clang, -O0):
<getbits_33>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x20,%edx
call   1030 <getbits@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x20,%esi
mov    $0x1,%edx
call   1040 <getbitu@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbits_33>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    $0x20,%edx
call   1030 <getbits@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,(%rsp)
add    $0x20,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
call   1040 <getbitu@plt>
movsd  (%rsp),%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @getbits_33(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i64 @getbits(i8* %5, i32 %6, i32 32)
%8 = sitofp i64 %7 to double
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 32
%12 = call double @getbitu(i8* %9, i32 %11, i32 1)
%13 = call double @llvm.fmuladd.f64(double %8, double 2.000000e+00, double %12)
ret double %13
}

LLVM IR (-O2):
define double @getbits_33(i8* %0, i32 %1) {
%3 = tail call i64 @getbits(i8* %0, i32 %1, i32 32)
%4 = sitofp i64 %3 to double
%5 = add nsw i32 %1, 32
%6 = tail call double @getbitu(i8* %0, i32 %5, i32 1)
%7 = tail call double @llvm.fmuladd.f64(double %4, double 2.000000e+00, double %6)
ret double %7
}
signed int signedint_ignoring_unsignedint(signed int x, unsigned int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @signedint_ignoring_unsignedint(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int ebbrt_newlib_fstat(int, struct stat *);
int fstat(int file, struct stat *st) { return ebbrt_newlib_fstat(file, st); }


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

x86 assembly (clang, -O2):
<fstat>:
jmp    1030 <ebbrt_newlib_fstat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 @ebbrt_newlib_fstat(i32 %5, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = tail call i32 @ebbrt_newlib_fstat(i32 %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int ENOSYS;
int sysfs_modify_policy_max(unsigned int cpu, unsigned long max_freq) {
  return -ENOSYS;
}


x86 assembly (clang, -O0):
<sysfs_modify_policy_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ed4(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysfs_modify_policy_max>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @sysfs_modify_policy_max(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* @ENOSYS
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @sysfs_modify_policy_max(i32 %0, i64 %1) {
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Hello world from Moaath!\n");
  printf("I learned that 2+2+%d\n", 4);
  printf("The grade I am working for is %c\n", 'C');
  printf("The temperature outside is barely %f\n", 32.000000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x43,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
movsd  0xe9e(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf3f(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x43,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
movsd  0xe9e(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Hello world from Moaath!\0A\00"
@.str.1 = [23 x i8] c"I learned that 2+2+%d\0A\00"
@.str.2 = [34 x i8] c"The grade I am working for is %c\0A\00"
@.str.3 = [38 x i8] c"The temperature outside is barely %f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 4)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 67)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double 3.200000e+01)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"I learned that 2+2+%d\0A\00"
@.str.2 = [34 x i8] c"The grade I am working for is %c\0A\00"
@.str.3 = [38 x i8] c"The temperature outside is barely %f\0A\00"
@str = [25 x i8] c"Hello world from Moaath!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 67)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double 3.200000e+01)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PrintErrorCode();
int /*<<< orphan*/ dxl_write_word(int, int, int);
int setMoveSpeed(int Id, int rpm) {
  rpm = rpm / 0.114;
  dxl_write_word(Id, 32, rpm);
  PrintErrorCode();
  return rpm;
}


x86 assembly (clang, -O0):
<setMoveSpeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec5(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x20,%esi
call   1040 <dxl_write_word@plt>
mov    $0x0,%al
call   1030 <PrintErrorCode@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setMoveSpeed>:
push   %rbx
cvtsi2sd %esi,%xmm0
divsd  0xed3(%rip),%xmm0
cvttsd2si %xmm0,%ebx
mov    $0x20,%esi
mov    %ebx,%edx
call   1040 <dxl_write_word@plt>
xor    %eax,%eax
call   1030 <PrintErrorCode@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @setMoveSpeed(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.140000e-01
%8 = fptosi double %7 to i32
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @dxl_write_word(i32 %9, i32 32, i32 %10)
%12 = call i32 (...) @PrintErrorCode()
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
define i32 @setMoveSpeed(i32 %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fdiv double %3, 1.140000e-01
%5 = fptosi double %4 to i32
%6 = tail call i32 @dxl_write_word(i32 %0, i32 32, i32 %5)
%7 = tail call i32 (...) @PrintErrorCode()
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ yyparse();
int main() {
  printf("Enter an arithmetic expression : ");
  yyparse();
  printf("\nEntered expression is valid.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"Enter an arithmetic expression : \00"
@.str.1 = [31 x i8] c"\0AEntered expression is valid.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @yyparse()
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Enter an arithmetic expression : \00"
@str = [30 x i8] c"\0AEntered expression is valid.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @yyparse()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Tracking_UI_lightPressed();
void UI_UI_lightPressed() { Tracking_UI_lightPressed(); }


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

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

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

LLVM IR (-O2):
define void @UI_UI_lightPressed() {
%1 = tail call i32 (...) @Tracking_UI_lightPressed()
ret void
}
void EC_POINT_dbl(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_POINT_dbl() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x02() {
  Assert_real((isgraph(2) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              15, ("isgraph should be 0 for 0x02"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x02>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xf,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x02>:
push   %rax
mov    $0x2,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xf,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x02\00"
define void @t_isgraph_0x02() {
%1 = call i64 @isgraph(i32 2)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 15, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x02\00"
define void @t_isgraph_0x02() {
%1 = tail call i64 @isgraph(i32 2)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 15, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdblquote(int);
int isnotdblquote(int c) { return !isdblquote(c); }


x86 assembly (clang, -O0):
<isnotdblquote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isdblquote@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnotdblquote>:
push   %rax
call   1030 <isdblquote@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isnotdblquote(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isdblquote(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isnotdblquote(i32 %0) {
%2 = tail call i32 @isdblquote(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
long atoi(char *);
int /*<<< orphan*/ wo_self_assignement();
int main(int argc, char *argv[]) {
  long i, n;
  n = atoi(argv[1]);
  for (i = 0; i < n; i++)
    wo_self_assignement();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    1175 <main+0x55>
mov    $0x0,%al
call   1030 <wo_self_assignement@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114f <main+0x2f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
test   %rax,%rax
jle    114d <main+0x2d>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <wo_self_assignement@plt>
add    $0xffffffffffffffff,%rbx
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @atoi(i8* %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2, %7
%8 = phi i64 [ %10, %7 ], [ 0, %2 ]
%9 = tail call i32 (...) @wo_self_assignement()
%10 = add nuw nsw i64 %8, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret i32 0
}
int wps_validate_m3(const struct wpabuf *tlvs) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.wpabuf = type opaque
define i32 @wps_validate_m3(%struct.wpabuf* nocapture readnone %0) {
ret i32 0
}
void mytempo(tempo) long tempo;
{
  prtime();
  printf("Tempo %ld\n", tempo);
}


x86 assembly (clang, -O0):
<mytempo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <prtime@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):
<mytempo>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <prtime@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Tempo %ld\0A\00"
define void @mytempo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @prtime()
%4 = load i64, i64* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %4)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Tempo %ld\0A\00"
define void @mytempo(i64 %0) {
%2 = tail call i32 (...) @prtime()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
int getANX(unsigned char channel) { return channel; }


x86 assembly (clang, -O0):
<getANX>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getANX(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @getANX(i8 zeroext %0) {
%2 = zext i8 %0 to i32
ret i32 %2
}
void freestr(s) char *s;
{}


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

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

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

LLVM IR (-O2):
define void @freestr(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int shmdt(void const *);
int g_shmdt(const void *shmaddr) { return shmdt(shmaddr); }


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

x86 assembly (clang, -O2):
<g_shmdt>:
jmp    1030 <shmdt@plt>

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

LLVM IR (-O2):
define i32 @g_shmdt(i8* %0) {
%2 = tail call i32 @shmdt(i8* %0)
ret i32 %2
}
int bgbrasw_log2f8(int val) {
  int i, j, k;
  i = val << 8;
  j = 0;
  while (i >= 512) {
    i = i >> 1;
    j++;
  }
  k = (j << 8) | (i & 255);
  return (k);
}


x86 assembly (clang, -O0):
<bgbrasw_log2f8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x200,-0x8(%rbp)
jl     113b <bgbrasw_log2f8+0x3b>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <bgbrasw_log2f8+0x17>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bgbrasw_log2f8>:
shl    $0x8,%edi
xor    %ecx,%ecx
cmp    $0x200,%edi
jl     1134 <bgbrasw_log2f8+0x34>
xor    %ecx,%ecx
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
shr    %eax
add    $0x100,%ecx
cmp    $0x3ff,%edi
mov    %eax,%edi
ja     1120 <bgbrasw_log2f8+0x20>
jmp    1136 <bgbrasw_log2f8+0x36>
mov    %edi,%eax
movzbl %al,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @bgbrasw_log2f8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = shl i32 %6, 8
store i32 %7, i32* %3
store i32 0, i32* %4
br label %8
8: ; preds = %11, %1
%9 = load i32, i32* %3
%10 = icmp sge i32 %9, 512
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i32, i32* %3
%13 = ashr i32 %12, 1
store i32 %13, i32* %3
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %8
16: ; preds = %8
%17 = load i32, i32* %4
%18 = shl i32 %17, 8
%19 = load i32, i32* %3
%20 = and i32 %19, 255
%21 = or i32 %18, %20
store i32 %21, i32* %5
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @bgbrasw_log2f8(i32 %0) {
%2 = shl i32 %0, 8
%3 = icmp sgt i32 %2, 511
br i1 %3, label %4, label %12
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %2, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = lshr i32 %5, 1
%8 = add nuw nsw i32 %6, 1
%9 = icmp ugt i32 %5, 1023
br i1 %9, label %4, label %10
10: ; preds = %4
%11 = shl i32 %8, 8
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 0, %1 ], [ %11, %10 ]
%14 = phi i32 [ %2, %1 ], [ %7, %10 ]
%15 = and i32 %14, 255
%16 = or i32 %15, %13
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char const *, int /*<<< orphan*/);
int is_file_exist(const char *file_path) {
  if (NULL == file_path) {
    return -1;
  }
  if (access(file_path, F_OK) == 0) {
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<is_file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1134 <is_file_exist+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <is_file_exist+0x53>
mov    -0x10(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%rax
jne    115c <is_file_exist+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1163 <is_file_exist+0x53>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_file_exist>:
test   %rdi,%rdi
je     112e <is_file_exist+0x1e>
push   %rax
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
neg    %rax
sbb    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @is_file_exist(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i32, i32* @F_OK
%5 = tail call i64 @access(i8* %0, i32 %4)
%6 = icmp ne i64 %5, 0
%7 = sext i1 %6 to i32
br label %8
8: ; preds = %3, %1
%9 = phi i32 [ -1, %1 ], [ %7, %3 ]
ret i32 %9
}
void AONRTCDisable(void) {
  (*((volatile unsigned long
          *)(((unsigned long)(0x40092000 + 0x00000000) & 0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x40092000 + 0x00000000) & 0x000FFFFF) << 5) |
             ((0) << 2)))) = 0;
}


x86 assembly (clang, -O0):
<AONRTCDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43240000,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AONRTCDisable>:
movq   $0x0,0x43240000
ret

LLVM IR (-O0):
define void @AONRTCDisable() {
store volatile i64 0, i64* inttoptr (i64 1126432768 to i64*)
ret void
}

LLVM IR (-O2):
define void @AONRTCDisable() {
store volatile i64 0, i64* inttoptr (i64 1126432768 to i64*)
ret void
}