xunge/DecIR huggingface dataset:
int main() {
  int arg = 0xA0000000;
  int out = 0;
  __asm__("movl %1, %%eax;" : "=a"(out) : "r"(arg));
  return arg == out;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa0000000,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xa0000000,%eax
mov    %eax,%eax
xor    %ecx,%ecx
cmp    $0xa0000000,%eax
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -1610612736, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 asm "movl $1, %eax;", "={ax},r,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm "movl $1, %eax;", "={ax},r,~{dirflag},~{fpsr},~{flags}"(i32 -1610612736)
%2 = icmp eq i32 %1, -1610612736
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ split_me(int);
int main() {
  split_me(1);
  split_me(2);
  split_me(3);
  split_me(4);
  split_me(5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <split_me@plt>
mov    $0x2,%edi
call   1030 <split_me@plt>
mov    $0x3,%edi
call   1030 <split_me@plt>
mov    $0x4,%edi
call   1030 <split_me@plt>
mov    $0x5,%edi
call   1030 <split_me@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <split_me@plt>
mov    $0x2,%edi
call   1030 <split_me@plt>
mov    $0x3,%edi
call   1030 <split_me@plt>
mov    $0x4,%edi
call   1030 <split_me@plt>
mov    $0x5,%edi
call   1030 <split_me@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @split_me(i32 1)
%2 = call i32 @split_me(i32 2)
%3 = call i32 @split_me(i32 3)
%4 = call i32 @split_me(i32 4)
%5 = call i32 @split_me(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @split_me(i32 1)
%2 = tail call i32 @split_me(i32 2)
%3 = tail call i32 @split_me(i32 3)
%4 = tail call i32 @split_me(i32 4)
%5 = tail call i32 @split_me(i32 5)
ret i32 0
}
/* Variables and functions */
int strnlen(const char *s, int maxlen) {
  const char *es = s;
  while (*es && maxlen) {
    es++;
    maxlen--;
  }
  return (es - s);
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1132 <strnlen+0x32>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1142 <strnlen+0x42>
jmp    115c <strnlen+0x5c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1113 <strnlen+0x13>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
cmpb   $0x0,(%rdi)
mov    %rdi,%rax
je     1134 <strnlen+0x34>
mov    %rdi,%rax
test   %esi,%esi
je     1134 <strnlen+0x34>
add    $0xffffffff,%esi
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0xffffffff,%esi
setb   %cl
cmpb   $0x0,0x1(%rax)
lea    0x1(%rax),%rax
je     1134 <strnlen+0x34>
test   %cl,%cl
jne    1120 <strnlen+0x20>
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @strnlen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %17, %2
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %12, %7
%16 = phi i1 [ false, %7 ], [ %14, %12 ]
br i1 %16, label %17, label %22
17: ; preds = %15
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %5
%20 = load i32, i32* %4
%21 = add nsw i32 %20, -1
store i32 %21, i32* %4
br label %7
22: ; preds = %15
%23 = load i8*, i8** %5
%24 = load i8*, i8** %3
%25 = ptrtoint i8* %23 to i64
%26 = ptrtoint i8* %24 to i64
%27 = sub i64 %25, %26
%28 = trunc i64 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @strnlen(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp ne i8 %3, 0
%5 = icmp ne i32 %1, 0
%6 = and i1 %4, %5
br i1 %6, label %7, label %16
7: ; preds = %2, %7
%8 = phi i8* [ %10, %7 ], [ %0, %2 ]
%9 = phi i32 [ %11, %7 ], [ %1, %2 ]
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = add nsw i32 %9, -1
%12 = load i8, i8* %10
%13 = icmp ne i8 %12, 0
%14 = icmp ne i32 %11, 0
%15 = select i1 %13, i1 %14, i1 false
br i1 %15, label %7, label %16
16: ; preds = %7, %2
%17 = phi i8* [ %0, %2 ], [ %10, %7 ]
%18 = ptrtoint i8* %17 to i64
%19 = ptrtoint i8* %0 to i64
%20 = sub i64 %18, %19
%21 = trunc i64 %20 to i32
ret i32 %21
}
/* Variables and functions */
scalar_t__ __syscall(int, char const *, int, int /*<<< orphan*/,
                     int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                     int /*<<< orphan*/, int /*<<< orphan*/);
int open(const char *path, int flags) {
  return (int)__syscall(1, (path), (flags), (0), (0), (0), (0), (0), (0));
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <__syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
sub    $0x8,%rsp
mov    $0x1,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
push   $0x0
call   1030 <__syscall@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @open(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 @__syscall(i32 1, i8* %5, i32 %6, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @open(i8* %0, i32 %1) {
%3 = tail call i64 @__syscall(i32 1, i8* %0, i32 %1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%4 = trunc i64 %3 to i32
ret i32 %4
}
int test_imm_9Auint16_mem(unsigned short *val) {
  return ((*val) & (-0x9A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Auint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff66,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Auint16_mem>:
movzwl (%rdi),%eax
test   $0xff66,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Auint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -154
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_9Auint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -154
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ useconds_t;

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int usleep(useconds_t usec) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<usleep>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @usleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define i32 @usleep(i32 %0) {
%2 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint8_t encodeFirstByte(uint32_t a) {
  uint32_t *p_a = &a;
  uint8_t *p_b = (uint8_t *)p_a;
  return *p_b;
}


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

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

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

LLVM IR (-O2):
define i32 @encodeFirstByte(i32 returned %0) {
ret i32 %0
}
unsigned char get_spd_byte(int slotnum, int offset) {
  unsigned char spd_byte;
  spd_byte = *(volatile unsigned char *)(0x8fffa000 + slotnum * 0x100 + offset);
  return spd_byte;
}


x86 assembly (clang, -O0):
<get_spd_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
add    $0x8fffa000,%eax
add    -0x8(%rbp),%eax
mov    %eax,%eax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_spd_byte>:
shl    $0x8,%edi
lea    (%rdi,%rsi,1),%eax
add    $0x8fffa000,%eax
mov    (%rax),%al
ret

LLVM IR (-O0):
define zeroext i8 @get_spd_byte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 256
%8 = add i32 -1879072768, %7
%9 = load i32, i32* %4
%10 = add i32 %8, %9
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
%13 = load volatile i8, i8* %12
store i8 %13, i8* %5
%14 = load i8, i8* %5
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @get_spd_byte(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 8
%4 = add i32 %3, -1879072768
%5 = add i32 %4, %1
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = load volatile i8, i8* %7
ret i8 %8
}
/* Variables and functions */
int write_block(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int trim_test(int value) {
  if (value > 100)
    value = 100;
  else if (value < -100)
    value = -100;
  value += 100;
  return write_block(30, value, 0, 0);
}


x86 assembly (clang, -O0):
<trim_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jle    1131 <trim_test+0x21>
movl   $0x64,-0x4(%rbp)
jmp    1147 <trim_test+0x37>
cmpl   $0xffffff9c,-0x4(%rbp)
jge    1142 <trim_test+0x32>
movl   $0xffffff9c,-0x4(%rbp)
jmp    1147 <trim_test+0x37>
mov    -0x4(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1e,%edi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <write_block@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_test>:
cmp    $0xffffff9d,%edi
mov    $0xffffff9c,%eax
cmovge %edi,%eax
add    $0x64,%eax
cmp    $0x65,%edi
mov    $0xc8,%esi
cmovl  %eax,%esi
mov    $0x1e,%edi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <write_block@plt>

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

LLVM IR (-O2):
define i32 @trim_test(i32 %0) {
%2 = icmp sgt i32 %0, 100
%3 = icmp sgt i32 %0, -100
%4 = select i1 %3, i32 %0, i32 -100
%5 = add i32 %4, 100
%6 = select i1 %2, i32 200, i32 %5
%7 = tail call i32 @write_block(i32 30, i32 %6, i32 0, i32 0)
ret i32 %7
}
int init_ext4_xattr(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init_ext4_xattr() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ definition();
void form(void) {
  ;
  definition();
  ;
}


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

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

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

LLVM IR (-O2):
define void @form() {
%1 = tail call i32 (...) @definition()
ret void
}
/* Variables and functions */
double funcAngCor_alpha0_0plus_0plus_12049_L0(double *, double *);
double sin(double);
double fitAngDist_alpha0_0plus_0plus_12049_L0(double *x, double *par) {
  double result;
  result = funcAngCor_alpha0_0plus_0plus_12049_L0(x, &par[0]) *
           sin(x[0] * 0.0174533);
  return result;
}


x86 assembly (clang, -O0):
<fitAngDist_alpha0_0plus_0plus_12049_L0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <funcAngCor_alpha0_0plus_0plus_12049_L0@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeb2(%rip),%xmm0
mulsd  (%rax),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitAngDist_alpha0_0plus_0plus_12049_L0>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <funcAngCor_alpha0_0plus_0plus_12049_L0@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
mulsd  0xec1(%rip),%xmm0
call   1040 <sin@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @fitAngDist_alpha0_0plus_0plus_12049_L0(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = call double @funcAngCor_alpha0_0plus_0plus_12049_L0(double* %6, double* %8)
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fmul double %12, 1.745330e-02
%14 = call double @sin(double %13)
%15 = fmul double %9, %14
store double %15, double* %5
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @fitAngDist_alpha0_0plus_0plus_12049_L0(double* %0, double* %1) {
%3 = tail call double @funcAngCor_alpha0_0plus_0plus_12049_L0(double* %0, double* %1)
%4 = load double, double* %0
%5 = fmul double %4, 1.745330e-02
%6 = tail call double @sin(double %5)
%7 = fmul double %3, %6
ret double %7
}
/* Variables and functions */
char *strerror_r(int, char *, size_t);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
void iio_strerror(int err, char *buf, size_t len) {
  char *str = strerror_r(err, buf, len);
  if (str != buf)
    strncpy(buf, str, len);
}


x86 assembly (clang, -O0):
<iio_strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <strerror_r@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1166 <iio_strerror+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iio_strerror>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <strerror_r@plt>
cmp    %rbx,%rax
je     1149 <iio_strerror+0x29>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @iio_strerror(i32 %0, i8* %1, i64 %2) {
%4 = tail call i8* @strerror_r(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i8* %4, %1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @strncpy(i8* %1, i8* %4, i64 %2)
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
void skip_space(char **str) {
  while (isspace(**str))
    (*str)++;
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1148 <skip_space+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    111c <skip_space+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
movsbl (%rax),%edi
nopw   0x0(%rax,%rax,1)
call   1030 <isspace@plt>
test   %rax,%rax
je     113a <skip_space+0x2a>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
jmp    1120 <skip_space+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @skip_space(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = tail call i64 @isspace(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1, %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
%9 = load i8, i8* %8
%10 = tail call i64 @isspace(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void move_right(void) {
  putchar(0x1b);
  putchar(0x5b);
  putchar(0x43);
}


x86 assembly (clang, -O0):
<move_right>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <putchar@plt>
mov    $0x5b,%edi
call   1030 <putchar@plt>
mov    $0x43,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_right>:
push   %rax
mov    $0x1b,%edi
call   1030 <putchar@plt>
mov    $0x5b,%edi
call   1030 <putchar@plt>
mov    $0x43,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @move_right() {
%1 = call i32 @putchar(i32 27)
%2 = call i32 @putchar(i32 91)
%3 = call i32 @putchar(i32 67)
ret void
}

LLVM IR (-O2):
define void @move_right() {
%1 = tail call i32 @putchar(i32 27)
%2 = tail call i32 @putchar(i32 91)
%3 = tail call i32 @putchar(i32 67)
ret void
}
extern double d1s1s2(double d1, float s1, float s2) { return d1 + s1 + s2; }


x86 assembly (clang, -O0):
<d1s1s2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<d1s1s2>:
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @d1s1s2(double %0, float %1, float %2) {
%4 = alloca double
%5 = alloca float
%6 = alloca float
store double %0, double* %4
store float %1, float* %5
store float %2, float* %6
%7 = load double, double* %4
%8 = load float, float* %5
%9 = fpext float %8 to double
%10 = fadd double %7, %9
%11 = load float, float* %6
%12 = fpext float %11 to double
%13 = fadd double %10, %12
ret double %13
}

LLVM IR (-O2):
define double @d1s1s2(double %0, float %1, float %2) {
%4 = fpext float %1 to double
%5 = fadd double %4, %0
%6 = fpext float %2 to double
%7 = fadd double %5, %6
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t bnep_event_channel_timeout_get_channel_state(const uint8_t *event) {
  return event[14];
}


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

x86 assembly (clang, -O2):
<bnep_event_channel_timeout_get_channel_state>:
mov    0x38(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @bnep_event_channel_timeout_get_channel_state(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 14
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @bnep_event_channel_timeout_get_channel_state(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 14
%3 = load i32, i32* %2
ret i32 %3
}
void foo456(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo456(i32 %0) {
ret void
}
void INT_SRE2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_SRE2() {
ret void
}
/* Variables and functions */
void *dlsym(void *, char const *);
void *os_dlsym(void *module, const char *func) { return dlsym(module, func); }


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

x86 assembly (clang, -O2):
<os_dlsym>:
jmp    1030 <dlsym@plt>

LLVM IR (-O0):
define i8* @os_dlsym(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 i8* @dlsym(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @os_dlsym(i8* %0, i8* %1) {
%3 = tail call i8* @dlsym(i8* %0, i8* %1)
ret i8* %3
}
void inter_mercenary_sql_final(void) { return; }


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

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

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

LLVM IR (-O2):
define void @inter_mercenary_sql_final() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_verbose(char *);
void print_failed_address() {
  print_verbose("Could not reach node by address\n");
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"Could not reach node by address\0A\00"
define void @print_failed_address() {
%1 = call i32 @print_verbose(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Could not reach node by address\0A\00"
define void @print_failed_address() {
%1 = tail call i32 @print_verbose(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned _str2id(const unsigned char *s) {
  unsigned h;
  for (h = 0; *s; s++)
    h = 131 * h + *s;
  return h;
}


x86 assembly (clang, -O0):
<_str2id>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <_str2id+0x40>
imul   $0x83,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <_str2id+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_str2id>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <_str2id+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0x83,%eax,%edx
movzbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <_str2id+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @_str2id(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 131
%9 = zext i8 %5 to i32
%10 = add i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
int do_smbus_read_byte(int, unsigned int, unsigned int);
int smbus_read_byte(unsigned device, unsigned address) {
  return do_smbus_read_byte(0x6000, device, address);
}


x86 assembly (clang, -O0):
<smbus_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x6000,%edi
call   1030 <do_smbus_read_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbus_read_byte>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x6000,%edi
jmp    1030 <do_smbus_read_byte@plt>

LLVM IR (-O0):
define i32 @smbus_read_byte(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 i32 @do_smbus_read_byte(i32 24576, i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @smbus_read_byte(i32 %0, i32 %1) {
%3 = tail call i32 @do_smbus_read_byte(i32 24576, i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ auto_static();
int main(void) {
  int i;
  for (i = 0; i < 5; ++i)
    auto_static();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1145 <main+0x35>
mov    $0x0,%al
call   1030 <auto_static@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 (...) @auto_static()
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @auto_static()
%2 = tail call i32 (...) @auto_static()
%3 = tail call i32 (...) @auto_static()
%4 = tail call i32 (...) @auto_static()
%5 = tail call i32 (...) @auto_static()
ret i32 0
}
/* Variables and functions */
void *__real_malloc(size_t);
int /*<<< orphan*/ printf(char *, size_t, void *);
void *__wrap_malloc(size_t size) {
  void *lptr = __real_malloc(size);
  printf("Malloc: %lu bytes @%p\n", size, lptr);
  return lptr;
}


x86 assembly (clang, -O0):
<__wrap_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__real_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <__real_malloc@plt>
mov    %rax,%rbx
lea    0xeca(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Malloc: %lu bytes @%p\0A\00"
define i8* @__wrap_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @__real_malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i64, i64* %2
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %6, i8* %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [23 x i8] c"Malloc: %lu bytes @%p\0A\00"
define i8* @__wrap_malloc(i64 %0) {
%2 = tail call i8* @__real_malloc(i64 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %0, i8* %2)
ret i8* %2
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
float Si7021TempRawToC(uint16_t raw) {
  return (175.72f * (float)raw) / 65536.0f - 46.85f;
}


x86 assembly (clang, -O0):
<Si7021TempRawToC>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm1
movss  0xef2(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  0xee2(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xed2(%rip),%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Si7021TempRawToC>:
cvtsi2ss %rdi,%xmm0
mulss  0xef3(%rip),%xmm0
mulss  0xeef(%rip),%xmm0
addss  0xeeb(%rip),%xmm0
ret

LLVM IR (-O0):
define float @Si7021TempRawToC(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to float
%5 = fmul float 0x4065F70A40000000, %4
%6 = fdiv float %5, 6.553600e+04
%7 = fsub float %6, 0x40476CCCC0000000
ret float %7
}

LLVM IR (-O2):
define float @Si7021TempRawToC(i64 %0) {
%2 = sitofp i64 %0 to float
%3 = fmul float %2, 0x4065F70A40000000
%4 = fmul float %3, 0x3EF0000000000000
%5 = fadd float %4, 0xC0476CCCC0000000
ret float %5
}
int sum_sqr_digits(int n) {
  int s = 0;
  int x;
  while (n != 0) {
    x = (n % 10);
    s += x * x;
    n /= 10;
  }
  return (s);
}


x86 assembly (clang, -O0):
<sum_sqr_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <sum_sqr_digits+0x46>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <sum_sqr_digits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_sqr_digits>:
xor    %eax,%eax
test   %edi,%edi
je     113e <sum_sqr_digits+0x3e>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
imul   %esi,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <sum_sqr_digits+0x10>
ret

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

LLVM IR (-O2):
define i32 @sum_sqr_digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = srem i32 %4, 10
%7 = mul nsw i32 %6, %6
%8 = add nuw nsw i32 %7, %5
%9 = sdiv i32 %4, 10
%10 = add i32 %4, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
/* Variables and functions */
float harmonic(long, double);
long pow(double, float);
long getZipfCountAtCDF(long n, double alpha, float cdf) {
  return pow(2.7182818284590452354, ((cdf * harmonic(n, alpha)) -
                                     0.57721566490153286060651209008240243)) -
         0.5;
}


x86 assembly (clang, -O0):
<getZipfCountAtCDF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
call   1030 <harmonic@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeaa(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm1
movsd  0xe92(%rip),%xmm0
call   1040 <pow@plt>
cvtsi2sd %rax,%xmm0
movsd  0xe78(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getZipfCountAtCDF>:
push   %rax
movss  %xmm1,0x4(%rsp)
call   1030 <harmonic@plt>
mulss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xec2(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movsd  0xebb(%rip),%xmm0
call   1040 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xeae(%rip),%xmm0
cvttsd2si %xmm0,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @getZipfCountAtCDF(i64 %0, double %1, float %2) {
%4 = alloca i64
%5 = alloca double
%6 = alloca float
store i64 %0, i64* %4
store double %1, double* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load i64, i64* %4
%9 = load double, double* %5
%10 = call float @harmonic(i64 %8, double %9)
%11 = fmul float %7, %10
%12 = fpext float %11 to double
%13 = fsub double %12, 0x3FE2788CFC6FB619
%14 = fptrunc double %13 to float
%15 = call i64 @pow(double 0x4005BF0A8B145769, float %14)
%16 = sitofp i64 %15 to double
%17 = fsub double %16, 5.000000e-01
%18 = fptosi double %17 to i64
ret i64 %18
}

LLVM IR (-O2):
define i64 @getZipfCountAtCDF(i64 %0, double %1, float %2) {
%4 = tail call float @harmonic(i64 %0, double %1)
%5 = fmul float %4, %2
%6 = fpext float %5 to double
%7 = fadd double %6, 0xBFE2788CFC6FB619
%8 = fptrunc double %7 to float
%9 = tail call i64 @pow(double 0x4005BF0A8B145769, float %8)
%10 = sitofp i64 %9 to double
%11 = fadd double %10, -5.000000e-01
%12 = fptosi double %11 to i64
ret i64 %12
}
void pdr2_(x, y) float *x, *y;
{ pdr(*x, *y, 0.0); }


x86 assembly (clang, -O0):
<pdr2_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    $0x3,%al
call   1030 <pdr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdr2_>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    $0x3,%al
jmp    1030 <pdr@plt>

LLVM IR (-O0):
define void @pdr2_(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = fpext float %6 to double
%8 = load float*, float** %4
%9 = load float, float* %8
%10 = fpext float %9 to double
%11 = call i32 (double, double, double, ...) bitcast (i32 (...)* @pdr to i32 (double, double, double, ...)*)(double %7, double %10, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
define void @pdr2_(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = fpext float %3 to double
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @pdr to i32 (double, double, double, ...)*)(double %4, double %6, double 0.000000e+00)
ret void
}
/* Variables and functions */
int TRUE;
int /*<<< orphan*/ curs_set(unsigned int);
int /*<<< orphan*/ ncurses_display_refresh();
void ncurses_display_hal_cursor_visibility(bool visible) {
  curs_set((visible == TRUE) ? 1U : 0U);
  ncurses_display_refresh();
}


x86 assembly (clang, -O0):
<ncurses_display_hal_cursor_visibility>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
mov    $0x1,%eax
cmp    %edx,%ecx
cmove  %eax,%edi
call   1040 <curs_set@plt>
mov    $0x0,%al
call   1030 <ncurses_display_refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncurses_display_hal_cursor_visibility>:
push   %rax
mov    0x2ec0(%rip),%rcx
xor    %eax,%eax
cmp    %edi,(%rcx)
sete   %al
mov    %eax,%edi
call   1040 <curs_set@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ncurses_display_refresh@plt>

LLVM IR (-O0):
@TRUE = global i32 0
define void @ncurses_display_hal_cursor_visibility(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @TRUE
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
%8 = call i32 @curs_set(i32 %7)
%9 = call i32 (...) @ncurses_display_refresh()
ret void
}

LLVM IR (-O2):
@TRUE = global i32 0
define void @ncurses_display_hal_cursor_visibility(i32 %0) {
%2 = load i32, i32* @TRUE
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i32
%5 = tail call i32 @curs_set(i32 %4)
%6 = tail call i32 (...) @ncurses_display_refresh()
ret void
}
void RTTcpSgWriteLVNB(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTcpSgWriteLVNB() {
ret void
}
double sqrt(double n) {
  double square, x, old;
  x = n;
  old = 0.0;
  while (old != x) {
    old = x;
    x = (x + n / x) * 0.5;
  }
  return x;
}


x86 assembly (clang, -O0):
<sqrt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1136 <sqrt+0x36>
jp     1136 <sqrt+0x36>
jmp    1169 <sqrt+0x69>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  0xea5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    111b <sqrt+0x1b>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    110c <sqrt+0xc>
jnp    1140 <sqrt+0x40>
movsd  0xeec(%rip),%xmm2
movapd %xmm0,%xmm3
nopl   0x0(%rax,%rax,1)
movapd %xmm0,%xmm1
divsd  %xmm3,%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm3
movapd %xmm1,%xmm3
jne    1120 <sqrt+0x20>
jp     1120 <sqrt+0x20>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sqrt(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
store double %6, double* %4
store double 0.000000e+00, double* %5
br label %7
7: ; preds = %11, %1
%8 = load double, double* %5
%9 = load double, double* %4
%10 = fcmp une double %8, %9
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load double, double* %4
store double %12, double* %5
%13 = load double, double* %4
%14 = load double, double* %2
%15 = load double, double* %4
%16 = fdiv double %14, %15
%17 = fadd double %13, %16
%18 = fmul double %17, 5.000000e-01
store double %18, double* %4
br label %7
19: ; preds = %7
%20 = load double, double* %4
ret double %20
}

LLVM IR (-O2):
define double @sqrt(double %0) {
%2 = fcmp une double %0, 0.000000e+00
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi double [ %7, %3 ], [ %0, %1 ]
%5 = fdiv double %0, %4
%6 = fadd double %4, %5
%7 = fmul double %6, 5.000000e-01
%8 = fcmp une double %4, %7
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi double [ %0, %1 ], [ %7, %3 ]
ret double %10
}
/* Variables and functions */
char getchar();
void clear_input_buff(void) {
  while (getchar() != '\n')
    ;
}


x86 assembly (clang, -O0):
<clear_input_buff>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <clear_input_buff+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <clear_input_buff+0x21>
jmp    1119 <clear_input_buff+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_input_buff>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <clear_input_buff+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @clear_input_buff() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @clear_input_buff() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getWakeLock(int);
void foo1() { getWakeLock(1); }


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <getWakeLock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo1>:
mov    $0x1,%edi
jmp    1030 <getWakeLock@plt>

LLVM IR (-O0):
define void @foo1() {
%1 = call i32 @getWakeLock(i32 1)
ret void
}

LLVM IR (-O2):
define void @foo1() {
%1 = tail call i32 @getWakeLock(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isxdigit(int);
void uninitvar_isxdigit(void) {
  int i;
  (void)isxdigit(i);
}


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

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

LLVM IR (-O0):
define void @uninitvar_isxdigit() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @isxdigit(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_isxdigit() {
ret void
}
int user_find(const char *uid) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @user_find(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int string_ncount(char const *, int /*<<< orphan*/, char const *,
                  int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int string_count(const char *src, const char *charlist) {
  return (string_ncount(src, strlen(src), charlist, strlen(charlist)));
}


x86 assembly (clang, -O0):
<string_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
call   1040 <string_ncount@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_count>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <string_ncount@plt>

LLVM IR (-O0):
define i32 @string_count(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** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @string_ncount(i8* %5, i32 %7, i8* %8, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @string_count(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @string_ncount(i8* %0, i32 %3, i8* %1, i32 %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_unpack_prim_8_be(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void ivory_serialize_unpack_int64_be(const uint8_t *src, uint32_t offs,
                                     int64_t *dst) {
  uint64_t tmp = ivory_serialize_unpack_prim_8_be(src + offs);
  memcpy(dst, &tmp, sizeof(*dst));
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_int64_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <ivory_serialize_unpack_prim_8_be@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_unpack_int64_be>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
call   1030 <ivory_serialize_unpack_prim_8_be@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ivory_serialize_unpack_int64_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = tail call i32 @ivory_serialize_unpack_prim_8_be(i32* %7)
store i32 %8, i32* %4
%9 = call i32 @memcpy(i32* %2, i32* %4, i32 4)
ret void
}