xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ error(int, int /*<<< orphan*/, int /*<<< orphan*/, char *);
void unused_destructor_warning(int lineno) {
  error(lineno, 0, 0, "unused %%destructor");
}


x86 assembly (clang, -O0):
<unused_destructor_warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %edx,%edx
lea    0xed9(%rip),%rcx
mov    %edx,%esi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unused_destructor_warning>:
lea    0xee9(%rip),%rcx
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <error@plt>

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

LLVM IR (-O2):
@.str = [20 x i8] c"unused %%destructor\00"
define void @unused_destructor_warning(i32 %0) {
%2 = tail call i32 @error(i32 %0, i32 0, i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int snprintf(char *, size_t, char *, char *);
__attribute__((weak)) int HonggfuzzNetDriverTempdir(char *str, size_t size) {
  return snprintf(str, size, "%s", "/tmp/HFND_TMP_DIR");
}


x86 assembly (clang, -O0):
<HonggfuzzNetDriverTempdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
lea    0xecd(%rip),%rcx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HonggfuzzNetDriverTempdir>:
lea    0xee9(%rip),%rdx
lea    0xee5(%rip),%rcx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [18 x i8] c"/tmp/HFND_TMP_DIR\00"
define weak i32 @HonggfuzzNetDriverTempdir(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @snprintf(i8* %5, i64 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [18 x i8] c"/tmp/HFND_TMP_DIR\00"
define weak i32 @HonggfuzzNetDriverTempdir(i8* %0, i64 %1) {
%3 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret i32 %3
}
/* Type definitions */
struct dm_ioctl {
  int /*<<< orphan*/ name;
};

/* Variables and functions */
int /*<<< orphan*/ DM_NAME_LEN;
int copy_string(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int copy_name(struct dm_ioctl *ctl, const char *name) {
  return copy_string(ctl->name, name, DM_NAME_LEN);
}


x86 assembly (clang, -O0):
<copy_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
call   1030 <copy_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_name>:
mov    (%rdi),%edi
mov    0x2ec7(%rip),%rax
mov    (%rax),%edx
jmp    1030 <copy_string@plt>

LLVM IR (-O0):
%struct.dm_ioctl = type { i32 }
@DM_NAME_LEN = global i32 0
define i32 @copy_name(%struct.dm_ioctl* %0, i8* %1) {
%3 = alloca %struct.dm_ioctl*
%4 = alloca i8*
store %struct.dm_ioctl* %0, %struct.dm_ioctl** %3
store i8* %1, i8** %4
%5 = load %struct.dm_ioctl*, %struct.dm_ioctl** %3
%6 = getelementptr inbounds %struct.dm_ioctl, %struct.dm_ioctl* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* @DM_NAME_LEN
%10 = call i32 @copy_string(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.dm_ioctl = type { i32 }
@DM_NAME_LEN = global i32 0
define i32 @copy_name(%struct.dm_ioctl* nocapture %0, i8* %1) {
%3 = getelementptr inbounds %struct.dm_ioctl, %struct.dm_ioctl* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = load i32, i32* @DM_NAME_LEN
%6 = tail call i32 @copy_string(i32 %4, i8* %1, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ perfTest();
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int /*<<< orphan*/ test4();
int test_main() {
  test1();
  test2();
  test3();
  test4();
  perfTest();
  return 0;
}


x86 assembly (clang, -O0):
<test_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test1@plt>
mov    $0x0,%al
call   1070 <test2@plt>
mov    $0x0,%al
call   1040 <test3@plt>
mov    $0x0,%al
call   1060 <test4@plt>
mov    $0x0,%al
call   1030 <perfTest@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_main>:
push   %rax
xor    %eax,%eax
call   1050 <test1@plt>
xor    %eax,%eax
call   1070 <test2@plt>
xor    %eax,%eax
call   1040 <test3@plt>
xor    %eax,%eax
call   1060 <test4@plt>
xor    %eax,%eax
call   1030 <perfTest@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_main() {
%1 = call i32 (...) @test1()
%2 = call i32 (...) @test2()
%3 = call i32 (...) @test3()
%4 = call i32 (...) @test4()
%5 = call i32 (...) @perfTest()
ret i32 0
}

LLVM IR (-O2):
define i32 @test_main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
%3 = tail call i32 (...) @test3()
%4 = tail call i32 (...) @test4()
%5 = tail call i32 (...) @perfTest()
ret i32 0
}
/* Type definitions */
typedef char wchar_t;

/* Variables and functions */
int plus(wchar_t c, wchar_t d) { return ((c == '|' && d == '-') || d == '_'); }


x86 assembly (clang, -O0):
<plus>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x7c,%eax
jne    112f <plus+0x2f>
movsbl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x3(%rbp)
je     113c <plus+0x3c>
movsbl -0x2(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<plus>:
xor    $0x7c,%dil
mov    %esi,%eax
xor    $0x2d,%al
or     %dil,%al
sete   %al
cmp    $0x5f,%sil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @plus(i8 signext %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 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 124
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 45
br i1 %11, label %16, label %12
12: ; preds = %8, %2
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 95
br label %16
16: ; preds = %12, %8
%17 = phi i1 [ true, %8 ], [ %15, %12 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @plus(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, 124
%4 = icmp eq i8 %1, 45
%5 = and i1 %3, %4
%6 = icmp eq i8 %1, 95
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
int test_imm_88int8_reg(signed char val) {
  return ((val) & (0x88 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_88int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x88,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_88int8_reg>:
test   $0x88,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_88int8_reg(i8 signext %0) {
%2 = and i8 %0, -120
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
int syscall(int, int, char const *, int /*<<< orphan*/);
int inotify_add_watch(int fd, const char *name, __u32 mask) {
  return syscall(254, fd, name, mask);
}


x86 assembly (clang, -O0):
<inotify_add_watch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0xfe,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inotify_add_watch>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0xfe,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @inotify_add_watch(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @syscall(i32 254, i32 %0, i8* %1, i32 %2)
ret i32 %4
}
void __attribute__((weak)) __gcov_flush(void) {}


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

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

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

LLVM IR (-O2):
define weak void @__gcov_flush() {
ret void
}
/* Variables and functions */
void bzero(void) {}


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

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

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

LLVM IR (-O2):
define void @bzero() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ make_manual(int /*<<< orphan*/);
void o_online_manual_() { make_manual(0); }


x86 assembly (clang, -O0):
<o_online_manual_>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <make_manual@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<o_online_manual_>:
xor    %edi,%edi
jmp    1030 <make_manual@plt>

LLVM IR (-O0):
define void @o_online_manual_() {
%1 = call i32 @make_manual(i32 0)
ret void
}

LLVM IR (-O2):
define void @o_online_manual_() {
%1 = tail call i32 @make_manual(i32 0)
ret void
}
/* Variables and functions */
int _syscall_(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
              int /*<<< orphan*/);
int main() {
  int r = _syscall_(0, 0, 0, 0);
  return (r == 1 ? 0 : 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <_syscall_@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <_syscall_@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @_syscall_(i32 0, i32 0, i32 0, i32 0)
%2 = icmp ne i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
int trie_upgrade_lock(struct _rwlock *rw) {
  int retval;
  int res;
  (void)rw;
  retval = 0;
  (void)res;
  return retval;
}


x86 assembly (clang, -O0):
<trie_upgrade_lock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct._rwlock = type opaque
define i32 @trie_upgrade_lock(%struct._rwlock* %0) {
%2 = alloca %struct._rwlock*
%3 = alloca i32
%4 = alloca i32
store %struct._rwlock* %0, %struct._rwlock** %2
%5 = load %struct._rwlock*, %struct._rwlock** %2
store i32 0, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
%struct._rwlock = type opaque
define i32 @trie_upgrade_lock(%struct._rwlock* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
double pow(double, double);
double f1(double x) {
  return (x * x / ((-1.0 + pow(x, 4.0)) * (-1.0 + pow(x, 4.0))));
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xeb7(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea9(%rip),%xmm1
call   1030 <pow@plt>
movsd  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x10(%rbp),%xmm0
movsd  0xe87(%rip),%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xed1(%rip),%xmm1
call   1030 <pow@plt>
addsd  0xecc(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
movsd  0xeb1(%rip),%xmm1
call   1030 <pow@plt>
addsd  0xeac(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @f1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = call double @pow(double %6, double 4.000000e+00)
%8 = fadd double -1.000000e+00, %7
%9 = load double, double* %2
%10 = call double @pow(double %9, double 4.000000e+00)
%11 = fadd double -1.000000e+00, %10
%12 = fmul double %8, %11
%13 = fdiv double %5, %12
ret double %13
}

LLVM IR (-O2):
define double @f1(double %0) {
%2 = fmul double %0, %0
%3 = tail call double @pow(double %0, double 4.000000e+00)
%4 = fadd double %3, -1.000000e+00
%5 = tail call double @pow(double %0, double 4.000000e+00)
%6 = fadd double %5, -1.000000e+00
%7 = fmul double %4, %6
%8 = fdiv double %2, %7
ret double %8
}
/* Variables and functions */
double sqrt(double);
double circuit_current(double power, double resistance) {
  double current = 0.0;
  current = sqrt(power / resistance);
  return current;
}


x86 assembly (clang, -O0):
<circuit_current>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circuit_current>:
divsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1123 <circuit_current+0x13>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @circuit_current(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 0.000000e+00, double* %5
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fdiv double %6, %7
%9 = call double @sqrt(double %8)
store double %9, double* %5
%10 = load double, double* %5
ret double %10
}

LLVM IR (-O2):
define double @circuit_current(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @sqrt(double %3)
ret double %4
}
/* Variables and functions */
float shmAdd(float *, long, double);
float shmInc(float *addr, long i) { return shmAdd(addr, i, 1.0); }


x86 assembly (clang, -O0):
<shmInc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  0xed0(%rip),%xmm0
call   1030 <shmAdd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmInc>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <shmAdd@plt>

LLVM IR (-O0):
define float @shmInc(float* %0, i64 %1) {
%3 = alloca float*
%4 = alloca i64
store float* %0, float** %3
store i64 %1, i64* %4
%5 = load float*, float** %3
%6 = load i64, i64* %4
%7 = call float @shmAdd(float* %5, i64 %6, double 1.000000e+00)
ret float %7
}

LLVM IR (-O2):
define float @shmInc(float* %0, i64 %1) {
%3 = tail call float @shmAdd(float* %0, i64 %1, double 1.000000e+00)
ret float %3
}
double jac_chain_nm7_sq(double x) { return x * x; }


x86 assembly (clang, -O0):
<jac_chain_nm7_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm7_sq>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @jac_chain_nm7_sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @jac_chain_nm7_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello world from IoT QA\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Hello world from IoT QA\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"Hello world from IoT QA\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int nanosleep(struct timespec *, int /*<<< orphan*/ *);
int ms_sleep(int ms) {
  struct timespec ts;
  ts.tv_sec = 0;
  ts.tv_nsec = (ms * 100000);
  return nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<ms_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
imul   $0x186a0,-0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms_sleep>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
imul   $0x186a0,%edi,%eax
mov    %eax,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i32 @ms_sleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %4
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 100000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %6, i32* %7
%8 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret i32 %8
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define i32 @ms_sleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = mul nsw i32 %0, 100000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %5, i32* %6
%7 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNC_8() {
  long int stat = 99;
  BNCIO(8);
  return (stat);
}


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

x86 assembly (clang, -O2):
<BNC_8>:
push   %rax
mov    $0x8,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNC_8() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 8)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNC_8() {
%1 = tail call i32 @BNCIO(i32 8)
ret i64 99
}
unsigned int cpuid_ebx(unsigned int fn) {
  unsigned int eax, ebx, ecx, edx;
  asm("cpuid" : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) : "0"(fn));
  return ebx;
}


x86 assembly (clang, -O0):
<cpuid_ebx>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,-0x10(%rbp)
mov    %ebx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_ebx>:
push   %rbx
mov    %edi,%eax
cpuid
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cpuid_ebx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %7)
%9 = extractvalue { i32, i32, i32, i32 } %8, 0
%10 = extractvalue { i32, i32, i32, i32 } %8, 1
%11 = extractvalue { i32, i32, i32, i32 } %8, 2
%12 = extractvalue { i32, i32, i32, i32 } %8, 3
store i32 %9, i32* %3
store i32 %10, i32* %4
store i32 %11, i32* %5
store i32 %12, i32* %6
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
define i32 @cpuid_ebx(i32 %0) {
%2 = tail call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = extractvalue { i32, i32, i32, i32 } %2, 1
ret i32 %3
}
unsigned int to_uns_int(__float128 a) { return (unsigned int)a; }


x86 assembly (clang, -O0):
<to_uns_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movaps %xmm0,-0x10(%rbp)
movaps -0x10(%rbp),%xmm0
call   1120 <__fixunstfsi>
add    $0x10,%rsp
pop    %rbp
ret
nopl   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<to_uns_int>:
push   %rax
call   1110 <__fixunstfsi>
pop    %rcx
ret
nopl   0x0(%rax,%rax,1)

LLVM IR (-O0):
define i32 @to_uns_int(fp128 %0) {
%2 = alloca fp128
store fp128 %0, fp128* %2
%3 = load fp128, fp128* %2
%4 = fptoui fp128 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @to_uns_int(fp128 %0) {
%2 = fptoui fp128 %0 to i32
ret i32 %2
}
/* Variables and functions */
int *RemoveFromList(int *, int);
int *RemoveListFromList(int *dest, int *source) {
  int i;
  for (i = 1; i <= source[0]; i++)
    dest = RemoveFromList(dest, source[i]);
  return dest;
}


x86 assembly (clang, -O0):
<RemoveListFromList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jg     115c <RemoveListFromList+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <RemoveFromList@plt>
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <RemoveListFromList+0x17>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RemoveListFromList>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rax
cmpl   $0x0,(%rsi)
jle    1149 <RemoveListFromList+0x39>
mov    %rsi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x4(%r14,%rbx,4),%esi
mov    %rax,%rdi
call   1030 <RemoveFromList@plt>
movslq (%r14),%rcx
add    $0x1,%rbx
cmp    %rcx,%rbx
jl     1130 <RemoveListFromList+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @RemoveListFromList(i32* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 1
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %11, %5 ], [ 1, %2 ]
%7 = phi i32* [ %10, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i32, i32* %1, i64 %6
%9 = load i32, i32* %8
%10 = tail call i32* @RemoveFromList(i32* %7, i32 %9)
%11 = add nuw nsw i64 %6, 1
%12 = load i32, i32* %1
%13 = sext i32 %12 to i64
%14 = icmp slt i64 %6, %13
br i1 %14, label %5, label %15
15: ; preds = %5, %2
%16 = phi i32* [ %0, %2 ], [ %10, %5 ]
ret i32* %16
}
/* Variables and functions */
int /*<<< orphan*/ dosomething(int *);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int *p = malloc(sizeof(int));
  dosomething(p);
  printf("%d", *p);
  free(p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <dosomething@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <dosomething@plt>
mov    (%rbx),%esi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 4)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @dosomething(i32* %3)
%5 = load i32*, i32** %1
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32*, i32** %1
%9 = call i32 @free(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32 @dosomething(i32* %1)
%3 = load i32, i32* %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @free(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xdc() {
  Assert_real((iscntrl(220) == 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_iscntrl.c",
              1105, ("iscntrl should be 0 for 0xdc"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xdc>:
push   %rax
mov    $0xdc,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x451,%edx
pop    %rax
jmp    1040 <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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xdc\00"
define void @t_iscntrl_0xdc() {
%1 = call i64 @iscntrl(i32 220)
%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 1105, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xdc\00"
define void @t_iscntrl_0xdc() {
%1 = tail call i64 @iscntrl(i32 220)
%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 1105, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double exp(double);
double expm1(double x) { return exp(x) - 1; }


x86 assembly (clang, -O0):
<expm1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  0xed1(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expm1>:
push   %rax
call   1030 <exp@plt>
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @expm1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @exp(double %3)
%5 = fsub double %4, 1.000000e+00
ret double %5
}

LLVM IR (-O2):
define double @expm1(double %0) {
%2 = tail call double @exp(double %0)
%3 = fadd double %2, -1.000000e+00
ret double %3
}
unsigned bitScan_fun_llong(long long x) {
  unsigned r = 0;
  long long s = (x & 0x8000000000000000ll);
  if (x == 0)
    return 63;
  while (((x <<= 1) & 0x8000000000000000ll) == s)
    ++r;
  return r;
}


x86 assembly (clang, -O0):
<bitScan_fun_llong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movabs $0x8000000000000000,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1138 <bitScan_fun_llong+0x38>
movl   $0x3f,-0x4(%rbp)
jmp    1174 <bitScan_fun_llong+0x74>
jmp    113d <bitScan_fun_llong+0x3d>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
movabs $0x8000000000000000,%rcx
and    %rcx,%rax
cmp    -0x20(%rbp),%rax
jne    116e <bitScan_fun_llong+0x6e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <bitScan_fun_llong+0x3d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitScan_fun_llong>:
test   %rdi,%rdi
je     111f <bitScan_fun_llong+0x1f>
mov    $0xffffffff,%eax
mov    %rdi,%rcx
nopl   (%rax)
add    %rcx,%rcx
add    $0x1,%eax
mov    %rcx,%rdx
xor    %rdi,%rdx
jns    1110 <bitScan_fun_llong+0x10>
ret
mov    $0x3f,%eax
ret

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

LLVM IR (-O2):
define i32 @bitScan_fun_llong(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = shl i64 %4, 1
%7 = xor i64 %6, %0
%8 = icmp sgt i64 %7, -1
%9 = add i32 %5, 1
br i1 %8, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ 63, %1 ], [ %5, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ milli_delay(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void test_b() {
  int i = 1;
  while (1) {
    printf("%x\n", i++);
    milli_delay(100);
  }
}


x86 assembly (clang, -O0):
<test_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1040 <milli_delay@plt>
jmp    112f <test_b+0xf>

x86 assembly (clang, -O2):
<test_b>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%esi
lea    0xed1(%rip),%rbx
nop
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1040 <milli_delay@plt>
mov    %ebp,%esi
jmp    1130 <test_b+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"%x\0A\00"
define void @test_b() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %0, %2
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%6 = call i32 @milli_delay(i32 100)
br label %2
}

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define void @test_b() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = tail call i32 @milli_delay(i32 100)
br label %1
}
/* Variables and functions */
int strcmp(char *, char *);
int vstrcmp(const void *v1, const void *v2) {
  return (strcmp(*(char **)v1, *(char **)v2));
}


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

x86 assembly (clang, -O2):
<vstrcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @vstrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
char multiply(char a, char b, char c) { return a * b * c; }


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
imul   %ecx,%eax
movsbl -0x3(%rbp),%ecx
imul   %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
mov    %esi,%eax
mul    %dil
mul    %dl
ret

LLVM IR (-O0):
define signext i8 @multiply(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = mul nsw i32 %8, %10
%12 = load i8, i8* %6
%13 = sext i8 %12 to i32
%14 = mul nsw i32 %11, %13
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @multiply(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = mul i8 %1, %0
%5 = mul i8 %4, %2
ret i8 %5
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void I2CSlaveIntClearEx(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000818))) = ui32IntFlags;
}


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

x86 assembly (clang, -O2):
<I2CSlaveIntClearEx>:
mov    %rsi,0x818(%rdi)
ret

LLVM IR (-O0):
define void @I2CSlaveIntClearEx(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 = load i64, i64* %3
%7 = add i64 %6, 2072
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CSlaveIntClearEx(i64 %0, i64 %1) {
%3 = add i64 %0, 2072
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int g_close_object(int);
int g_get_object_id(char *);
int g_close_object_byname(char *label) {
  int id;
  if ((id = g_get_object_id(label)) == -1)
    return -1;
  return g_close_object(id);
}


x86 assembly (clang, -O0):
<g_close_object_byname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <g_get_object_id@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    114d <g_close_object_byname+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <g_close_object_byname+0x38>
mov    -0x14(%rbp),%edi
call   1040 <g_close_object@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_close_object_byname>:
push   %rax
call   1030 <g_get_object_id@plt>
cmp    $0xffffffff,%eax
je     1133 <g_close_object_byname+0x13>
mov    %eax,%edi
pop    %rax
jmp    1040 <g_close_object@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @g_close_object_byname(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @g_get_object_id(i8* %5)
store i32 %6, i32* %4
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %12
9: ; preds = %1
%10 = load i32, i32* %4
%11 = call i32 @g_close_object(i32 %10)
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @g_close_object_byname(i8* %0) {
%2 = tail call i32 @g_get_object_id(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @g_close_object(i32 %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
float input_number_of_plugged_joysticks();
float f_number_of_joysticks() { return input_number_of_plugged_joysticks(); }


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

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

LLVM IR (-O0):
define float @f_number_of_joysticks() {
%1 = call float (...) @input_number_of_plugged_joysticks()
ret float %1
}

LLVM IR (-O2):
define float @f_number_of_joysticks() {
%1 = tail call float (...) @input_number_of_plugged_joysticks()
ret float %1
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int main(void) {
  fork();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fork()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fork()
ret i32 0
}
const char *osurandom_get_implementation(void) { return "CryptGenRandom"; }


x86 assembly (clang, -O0):
<osurandom_get_implementation>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<osurandom_get_implementation>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"CryptGenRandom\00"
define i8* @osurandom_get_implementation() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"CryptGenRandom\00"
define i8* @osurandom_get_implementation() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
void foo70() {}


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

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

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

LLVM IR (-O2):
define void @foo70() {
ret void
}
/* Variables and functions */
scalar_t__ pow_2(int);
void Set(char *code, int i) { code[i / 8] += pow_2(i % 8); }


x86 assembly (clang, -O0):
<Set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <pow_2@plt>
mov    %rax,%rsi
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movsbq (%rax,%rcx,1),%rdx
add    %rsi,%rdx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Set>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x7(%rsi),%ebp
test   %esi,%esi
cmovns %esi,%ebp
mov    %ebp,%eax
and    $0xfffffff8,%eax
sub    %eax,%esi
mov    %esi,%edi
call   1030 <pow_2@plt>
sar    $0x3,%ebp
movslq %ebp,%rcx
add    %al,(%rbx,%rcx,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @Set(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = srem i32 %5, 8
%7 = call i64 @pow_2(i32 %6)
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 8
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i64
%15 = add nsw i64 %14, %7
%16 = trunc i64 %15 to i8
store i8 %16, i8* %12
ret void
}

LLVM IR (-O2):
define void @Set(i8* nocapture %0, i32 %1) {
%3 = srem i32 %1, 8
%4 = tail call i64 @pow_2(i32 %3)
%5 = sdiv i32 %1, 8
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i64 %4 to i8
%10 = add i8 %8, %9
store i8 %10, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char **argv) {
  printf("The value of argc is %d\n", argc);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"The value of argc is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"The value of argc is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
void gtk_color_selection_set_has_palette() {}


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

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

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

LLVM IR (-O2):
define void @gtk_color_selection_set_has_palette() {
ret void
}
void batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv,
                                         struct sk_buff *skb) {}


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

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

LLVM IR (-O0):
%struct.batadv_priv = type opaque
%struct.sk_buff = type opaque
define void @batadv_nc_skb_store_sniffed_unicast(%struct.batadv_priv* %0, %struct.sk_buff* %1) {
%3 = alloca %struct.batadv_priv*
%4 = alloca %struct.sk_buff*
store %struct.batadv_priv* %0, %struct.batadv_priv** %3
store %struct.sk_buff* %1, %struct.sk_buff** %4
ret void
}

LLVM IR (-O2):
%struct.batadv_priv = type opaque
%struct.sk_buff = type opaque
define void @batadv_nc_skb_store_sniffed_unicast(%struct.batadv_priv* nocapture %0, %struct.sk_buff* nocapture %1) {
ret void
}
float test_ilogbf(float x) { return __builtin_ilogbf(x); }


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

x86 assembly (clang, -O2):
<test_ilogbf>:
push   %rax
call   1030 <ilogbf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @test_ilogbf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @ilogbf(float %3)
%5 = sitofp i32 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @test_ilogbf(float %0) {
%2 = tail call i32 @ilogbf(float %0)
%3 = sitofp i32 %2 to float
ret float %3
}
/* Variables and functions */
unsigned char vx86_NBSB_Read8(int, unsigned char);
unsigned char sb1_Read8(unsigned char offset) {
  return vx86_NBSB_Read8(3, offset);
}


x86 assembly (clang, -O0):
<sb1_Read8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3,%edi
movzbl -0x1(%rbp),%esi
call   1030 <vx86_NBSB_Read8@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sb1_Read8>:
mov    %edi,%esi
mov    $0x3,%edi
jmp    1030 <vx86_NBSB_Read8@plt>

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

LLVM IR (-O2):
define zeroext i8 @sb1_Read8(i8 zeroext %0) {
%2 = tail call zeroext i8 @vx86_NBSB_Read8(i32 3, i8 zeroext %0)
ret i8 %2
}
double Yn(double x, double y) { return ((-x * y + 2 * y - 2) / (y - 1 - x)); }


x86 assembly (clang, -O0):
<Yn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xed1(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xebc(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xea3(%rip),%xmm2
subsd  %xmm2,%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Yn>:
movapd %xmm1,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm1,%xmm3
subsd  %xmm3,%xmm2
addsd  0xee4(%rip),%xmm2
addsd  0xee4(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @Yn(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fneg double %5
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double 2.000000e+00, %8
%10 = call double @llvm.fmuladd.f64(double %6, double %7, double %9)
%11 = fsub double %10, 2.000000e+00
%12 = load double, double* %4
%13 = fsub double %12, 1.000000e+00
%14 = load double, double* %3
%15 = fsub double %13, %14
%16 = fdiv double %11, %15
ret double %16
}

LLVM IR (-O2):
define double @Yn(double %0, double %1) {
%3 = fneg double %0
%4 = fmul double %1, 2.000000e+00
%5 = tail call double @llvm.fmuladd.f64(double %3, double %1, double %4)
%6 = fadd double %5, -2.000000e+00
%7 = fadd double %1, -1.000000e+00
%8 = fsub double %7, %0
%9 = fdiv double %6, %8
ret double %9
}