xunge/DecIR huggingface dataset:
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll24(struct __test_metadata *);
void wrapper_epoll24(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll24(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll24>:
jmp    1030 <epoll24@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll24(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll24(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll24(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll24(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgexit();
int /*<<< orphan*/ gentext();
void genexit(void) {
  gentext();
  cgexit();
}


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

x86 assembly (clang, -O2):
<genexit>:
push   %rax
xor    %eax,%eax
call   1040 <gentext@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <cgexit@plt>

LLVM IR (-O0):
define void @genexit() {
%1 = call i32 (...) @gentext()
%2 = call i32 (...) @cgexit()
ret void
}

LLVM IR (-O2):
define void @genexit() {
%1 = tail call i32 (...) @gentext()
%2 = tail call i32 (...) @cgexit()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int __infer_nondet_int();
int putc(int c, FILE *stream) {
  int rand;
  FILE tmp;
  tmp = *stream;
  rand = __infer_nondet_int();
  if (rand > 0)
    return c;
  else
    return EOF;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1147 <putc+0x37>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <putc+0x43>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
test   %eax,%eax
jg     1127 <putc+0x17>
mov    0x2ec3(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @putc(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = call i32 (...) @__infer_nondet_int()
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32, i32* %4
store i32 %14, i32* %3
br label %17
15: ; preds = %2
%16 = load i32, i32* @EOF
store i32 %16, i32* %3
br label %17
17: ; preds = %15, %13
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @putc(i32 %0, i32* nocapture readnone %1) {
%3 = tail call i32 (...) @__infer_nondet_int()
%4 = icmp sgt i32 %3, 0
%5 = load i32, i32* @EOF
%6 = select i1 %4, i32 %0, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ system(int /*<<< orphan*/);
int /*<<< orphan*/ taintme(char *);
void dangerouscall(char *s) { (void)system(taintme(s)); }


x86 assembly (clang, -O0):
<dangerouscall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <taintme@plt>
mov    %eax,%edi
call   1040 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @dangerouscall(i8* %0) {
%2 = tail call i32 @taintme(i8* %0)
%3 = tail call i32 @system(i32 %2)
ret void
}
find_solution(char *phone, char **b, int num_words) {}


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

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

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

LLVM IR (-O2):
define i32 @find_solution(i8* nocapture readnone %0, i8** nocapture readnone %1, i32 %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void FreeBlock(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @FreeBlock(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int aldl_timeout(int len) {
  int timeout = (len * 0.98) + (len * 0.35);
  if (timeout < 200 / 1000)
    timeout = 200 * 2 / 1000;
  return (timeout);
}


x86 assembly (clang, -O0):
<aldl_timeout>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xeef(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xedb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1145 <aldl_timeout+0x45>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aldl_timeout>:
cvtsi2sd %edi,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xef0(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @aldl_timeout(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to double
%8 = fmul double %7, 3.500000e-01
%9 = call double @llvm.fmuladd.f64(double %5, double 0x3FEF5C28F5C28F5C, double %8)
%10 = fptosi double %9 to i32
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 0, i32* %3
br label %14
14: ; preds = %13, %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @aldl_timeout(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 3.500000e-01
%4 = tail call double @llvm.fmuladd.f64(double %2, double 0x3FEF5C28F5C28F5C, double %3)
%5 = fptosi double %4 to i32
%6 = icmp sgt i32 %5, 0
%7 = select i1 %6, i32 %5, i32 0
ret i32 %7
}
/* Type definitions */
struct sched_param {
  int sched_priority;
};
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, int);
char *schedstring(int);
void print_sched(pid_t pid, int scheduler, struct sched_param *pri) {
  printf("PID [%5d] Scheduler [%21s] Priority [%2d]\n", (int)pid,
         schedstring(scheduler), pri->sched_priority);
  return;
}


x86 assembly (clang, -O0):
<print_sched>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <schedstring@plt>
mov    -0x1c(%rbp),%esi
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_sched>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
mov    %esi,%edi
call   1030 <schedstring@plt>
mov    (%rbx),%ecx
lea    0xec6(%rip),%rdi
mov    %r14d,%esi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
%struct.sched_param = type { i32 }
@.str = [43 x i8] c"PID [%5d] Scheduler [%21s] Priority [%2d]\0A\00"
define void @print_sched(i64 %0, i32 %1, %struct.sched_param* %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca %struct.sched_param*
store i64 %0, i64* %4
store i32 %1, i32* %5
store %struct.sched_param* %2, %struct.sched_param** %6
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = load i32, i32* %5
%10 = call i8* @schedstring(i32 %9)
%11 = load %struct.sched_param*, %struct.sched_param** %6
%12 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %10, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
@.str = [43 x i8] c"PID [%5d] Scheduler [%21s] Priority [%2d]\0A\00"
define void @print_sched(i64 %0, i32 %1, %struct.sched_param* nocapture %2) {
%4 = trunc i64 %0 to i32
%5 = tail call i8* @schedstring(i32 %1)
%6 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %5, i32 %7)
ret void
}
int KlelGetReleasePatch(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @KlelGetReleasePatch() {
ret i32 0
}
int max_ii(int a, int b) { return (b < a) ? a : b; }


x86 assembly (clang, -O0):
<max_ii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1121 <max_ii+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max_ii+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_ii>:
mov    %esi,%eax
cmp    %edi,%esi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max_ii(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max_ii(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ print_array(int *, int);
void slice_array(int arr[], int n, int start, int end) {
  print_array(arr + start, end - start);
}


x86 assembly (clang, -O0):
<slice_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x14(%rbp),%esi
sub    -0x10(%rbp),%esi
call   1030 <print_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slice_array>:
movslq %edx,%rax
lea    (%rdi,%rax,4),%rdi
sub    %eax,%ecx
mov    %ecx,%esi
jmp    1030 <print_array@plt>

LLVM IR (-O0):
define void @slice_array(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %7
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %8
%14 = load i32, i32* %7
%15 = sub nsw i32 %13, %14
%16 = call i32 @print_array(i32* %12, i32 %15)
ret void
}

LLVM IR (-O2):
define void @slice_array(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = sub nsw i32 %3, %2
%8 = tail call i32 @print_array(i32* %6, i32 %7)
ret void
}
void SSMR3GetGCUInt(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3GetGCUInt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo2() {
  printf("foo2 in main\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"foo2 in main\0A\00"
define void @foo2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"foo2 in main\00"
define void @foo2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_05uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x05 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_05uint64_lowword_mem>:
testb  $0x5,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_05uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 5
%6 = icmp ne i64 %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_05uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 5
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int raw_irqs_disabled_flags(unsigned long flags) { return !(flags & 1); }


x86 assembly (clang, -O0):
<raw_irqs_disabled_flags>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_irqs_disabled_flags>:
mov    %rdi,%rax
not    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @raw_irqs_disabled_flags(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 1
%4 = xor i32 %3, 1
ret i32 %4
}
void button_init() {
  *((volatile unsigned long *)0x7f008830) = 0b10 | (0b10 << 10);
}


x86 assembly (clang, -O0):
<button_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008830,%eax
movq   $0x802,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<button_init>:
movq   $0x802,0x7f008830
ret

LLVM IR (-O0):
define void @button_init() {
store volatile i64 2050, i64* inttoptr (i64 2130741296 to i64*)
ret void
}

LLVM IR (-O2):
define void @button_init() {
store volatile i64 2050, i64* inttoptr (i64 2130741296 to i64*)
ret void
}
void process_2() {
  int i;
  while (1) {
    printf_k("2");
    for (i = 0; i < 5000000; i++)
      asm("nop");
  }
}


x86 assembly (clang, -O0):
<process_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf_k@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x4c4b40,-0x4(%rbp)
jge    1149 <process_2+0x39>
nop
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112d <process_2+0x1d>
jmp    1118 <process_2+0x8>

x86 assembly (clang, -O2):
<process_2>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf_k@plt>
mov    $0x4c4b40,%eax
nop
nop
add    $0xffffffff,%eax
jne    1130 <process_2+0x20>
jmp    1120 <process_2+0x10>

LLVM IR (-O0):
@.str = [2 x i8] c"2\00"
define void @process_2() {
%1 = alloca i32
br label %2
2: ; preds = %0, %11
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @printf_k to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %4
4: ; preds = %8, %2
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 5000000
br i1 %6, label %7, label %11
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %4
11: ; preds = %4
br label %2
}

LLVM IR (-O2):
@.str = [2 x i8] c"2\00"
define void @process_2() {
br label %1
1: ; preds = %3, %0
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printf_k to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %5, %3 ]
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%5 = add nuw nsw i32 %4, 1
%6 = icmp eq i32 %5, 5000000
br i1 %6, label %1, label %3
}
/* Type definitions */
typedef char wint_t;

/* Variables and functions */
int isOctal(wint_t c) { return '0' <= c && c <= '7'; }


x86 assembly (clang, -O0):
<isOctal>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <isOctal+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x37,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOctal>:
and    $0xf8,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isOctal(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 55
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isOctal(i8 signext %0) {
%2 = and i8 %0, -8
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
void capturing2capturingNamed_capturingName_capturingNameEnd_rv_endCapturing() {
}


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

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

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

LLVM IR (-O2):
define void @capturing2capturingNamed_capturingName_capturingNameEnd_rv_endCapturing() {
ret void
}
void create_drive_direct(int r_speed, int l_speed) {}


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

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

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

LLVM IR (-O2):
define void @create_drive_direct(i32 %0, i32 %1) {
ret void
}
unsigned xrop3_152_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T | S;
  stk3 = ~stk3;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_152_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_152_0_0>:
shl    $0x8,%esi
lea    (%rsi,%rdi,1),%eax
shl    $0x8,%edi
not    %edi
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_152_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = xor i32 %26, -1
store i32 %27, i32* %10
%28 = load i32, i32* %5
%29 = load i32, i32* %10
%30 = or i32 %28, %29
store i32 %30, i32* %9
%31 = load i32, i32* %6
%32 = load i32, i32* %9
%33 = xor i32 %31, %32
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = xor i32 %34, -1
store i32 %35, i32* %8
%36 = load i32, i32* %8
ret i32 %36
}

LLVM IR (-O2):
define i32 @xrop3_152_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %3
%8 = xor i32 %4, -1
%9 = and i32 %7, %8
ret i32 %9
}
double SFMFeetToMeters(double feet) { return (feet / 3.280833); }


x86 assembly (clang, -O0):
<SFMFeetToMeters>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SFMFeetToMeters>:
divsd  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @SFMFeetToMeters(double %0) {
%2 = fdiv double %0, 0x400A3F255F3519BD
ret double %2
}
int HelpItem160(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem160() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_day(int);
int main(void) {
  print_day(2);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_day(i32 2)
ret i32 0
}
/* Type definitions */
struct WordCounts {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct WordCounts *);
void word_counts_free(struct WordCounts *wc) { free(wc); }


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

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

LLVM IR (-O0):
%struct.WordCounts = type { i32 }
define void @word_counts_free(%struct.WordCounts* %0) {
%2 = alloca %struct.WordCounts*
store %struct.WordCounts* %0, %struct.WordCounts** %2
%3 = load %struct.WordCounts*, %struct.WordCounts** %2
%4 = call i32 @free(%struct.WordCounts* %3)
ret void
}

LLVM IR (-O2):
%struct.WordCounts = type { i32 }
define void @word_counts_free(%struct.WordCounts* nocapture %0) {
%2 = tail call i32 @free(%struct.WordCounts* %0)
ret void
}
void eglCreateImageKHR(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglCreateImageKHR() {
ret void
}
void tegra_bpmp_mail_return_data(int ch, int code, void *data, int sz) {}


x86 assembly (clang, -O0):
<tegra_bpmp_mail_return_data>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @tegra_bpmp_mail_return_data(i32 %0, i32 %1, i8* nocapture %2, i32 %3) {
ret void
}
/* Variables and functions */
unsigned long long magic(int);
int /*<<< orphan*/ printf(char *, unsigned long long);
int main() {
  unsigned long long res = 0;
  res = magic(600851475143);
  printf("If you can trust me, the number "
         "you are looking for is %llu\n",
         res);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [61 x i8] c"If you can trust me, the number you are looking for is %llu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
%3 = call i64 @magic(i32 -443946297)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [61 x i8] c"If you can trust me, the number you are looking for is %llu\0A\00"
define i32 @main() {
%1 = tail call i64 @magic(i32 -443946297)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}
INSTR(SETT) {
  STORE_T_IMM_I32(1);
  NEXT_INSTR();
}


x86 assembly (clang, -O0):
<INSTR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <STORE_T_IMM_I32@plt>
mov    $0x0,%al
call   1040 <NEXT_INSTR@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INSTR>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <STORE_T_IMM_I32@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <NEXT_INSTR@plt>

LLVM IR (-O0):
define i32 @INSTR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, ...) bitcast (i32 (...)* @STORE_T_IMM_I32 to i32 (i32, ...)*)(i32 1)
%5 = call i32 (...) @NEXT_INSTR()
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @INSTR(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @STORE_T_IMM_I32 to i32 (i32, ...)*)(i32 1)
%3 = tail call i32 (...) @NEXT_INSTR()
ret i32 undef
}
int main(int argc, char **argv) {
  int *p;
  p = &argc;
  return *p;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 returned %0, i8** nocapture readnone %1) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printh(unsigned char *buf, int size) {
  for (int i = 0; i < size; i++) {
    printf("0x%02X ", *buf);
    buf++;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <printh+0x51>
mov    -0x8(%rbp),%rax
movzbl (%rax),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printh+0x16>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printh>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1158 <printh+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1140 <printh+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"0x%02X \00"
define void @printh(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %6, %2
%5 = tail call i32 @putchar(i32 10)
ret void
6: ; preds = %2, %6
%7 = phi i32 [ %13, %6 ], [ 0, %2 ]
%8 = phi i8* [ %12, %6 ], [ %0, %2 ]
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = add nuw nsw i32 %7, 1
%14 = icmp eq i32 %13, %1
br i1 %14, label %4, label %6
}
int fun263() { return 263; }


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

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

LLVM IR (-O0):
define i32 @fun263() {
ret i32 263
}

LLVM IR (-O2):
define i32 @fun263() {
ret i32 263
}
int test_imm_9Auint32_reg(unsigned int val) {
  return ((val) & (0x9A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Auint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x9a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_9Auint32_reg(i32 %0) {
%2 = and i32 %0, 154
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ get_pci_addr(int, int, int, int);
int /*<<< orphan*/ outl(int, int /*<<< orphan*/);
int /*<<< orphan*/ outw(int, int /*<<< orphan*/);
void pci_write_conf_word(uint8_t bus, uint8_t dev, uint8_t func, uint8_t offset,
                         uint16_t data) {
  uint32_t addr = get_pci_addr(bus, dev, func, offset);
  outl(0x0CF8, addr);
  if ((offset & 0x02) == 0)
    outw(0x0CFC, data);
  else
    outw(0x0CFE, data);
}


x86 assembly (clang, -O0):
<pci_write_conf_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1050 <get_pci_addr@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    $0xcf8,%edi
call   1030 <outl@plt>
mov    -0x10(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
jne    118a <pci_write_conf_word+0x5a>
mov    -0x14(%rbp),%esi
mov    $0xcfc,%edi
call   1040 <outw@plt>
jmp    1197 <pci_write_conf_word+0x67>
mov    -0x14(%rbp),%esi
mov    $0xcfe,%edi
call   1040 <outw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_write_conf_word>:
push   %rbp
push   %rbx
push   %rax
mov    %r8d,%ebx
mov    %ecx,%ebp
call   1050 <get_pci_addr@plt>
mov    $0xcf8,%edi
mov    %eax,%esi
call   1030 <outl@plt>
and    $0x2,%ebp
or     $0xcfc,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <outw@plt>

LLVM IR (-O0):
define void @pci_write_conf_word(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = call i32 @get_pci_addr(i32 %12, i32 %13, i32 %14, i32 %15)
store i32 %16, i32* %11
%17 = load i32, i32* %11
%18 = call i32 @outl(i32 3320, i32 %17)
%19 = load i32, i32* %9
%20 = and i32 %19, 2
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %5
%23 = load i32, i32* %10
%24 = call i32 @outw(i32 3324, i32 %23)
br label %28
25: ; preds = %5
%26 = load i32, i32* %10
%27 = call i32 @outw(i32 3326, i32 %26)
br label %28
28: ; preds = %25, %22
ret void
}

LLVM IR (-O2):
define void @pci_write_conf_word(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @get_pci_addr(i32 %0, i32 %1, i32 %2, i32 %3)
%7 = tail call i32 @outl(i32 3320, i32 %6)
%8 = and i32 %3, 2
%9 = or i32 %8, 3324
%10 = tail call i32 @outw(i32 %9, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_version(void) { printf("notify-desktop 0.2.0\n"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"notify-desktop 0.2.0\0A\00"
define void @show_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"notify-desktop 0.2.0\00"
define void @show_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int atoi(int /*<<< orphan*/);
int /*<<< orphan*/ pipe2string(char *);
int timlib_get_seed(void) {
  int seed;
  seed = atoi(pipe2string("now.sh hhmmss"));
  return seed;
}


x86 assembly (clang, -O0):
<timlib_get_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <pipe2string@plt>
mov    %eax,%edi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timlib_get_seed>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <pipe2string@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <atoi@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"now.sh hhmmss\00"
define i32 @timlib_get_seed() {
%1 = alloca i32
%2 = call i32 @pipe2string(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @atoi(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [14 x i8] c"now.sh hhmmss\00"
define i32 @timlib_get_seed() {
%1 = tail call i32 @pipe2string(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @atoi(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int16_t PQCLEAN_KYBER51290S_CLEAN_montgomery_reduce(int32_t a) {
  int32_t t;
  int16_t u;
  u = (int16_t)(a * (int64_t)62209);
  t = (int32_t)u * 3329;
  t = a - t;
  t >>= 16;
  return (int16_t)t;
}


x86 assembly (clang, -O0):
<PQCLEAN_KYBER51290S_CLEAN_montgomery_reduce>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xf301,-0x4(%rbp),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   $0xd01,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PQCLEAN_KYBER51290S_CLEAN_montgomery_reduce>:
imul   $0xf3a80000,%edi,%eax
sar    $0x10,%eax
cltq
ret

LLVM IR (-O0):
define i64 @PQCLEAN_KYBER51290S_CLEAN_montgomery_reduce(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 62209
%7 = sext i32 %6 to i64
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
%10 = mul nsw i32 %9, 3329
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = ashr i32 %14, 16
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
ret i64 %17
}

LLVM IR (-O2):
define i64 @PQCLEAN_KYBER51290S_CLEAN_montgomery_reduce(i32 %0) {
%2 = mul i32 %0, -207093760
%3 = ashr exact i32 %2, 16
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
size_t zmalloc_used_memory();
size_t zmalloc_get_rss(void) { return zmalloc_used_memory(); }


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

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

LLVM IR (-O0):
define i64 @zmalloc_get_rss() {
%1 = call i64 (...) @zmalloc_used_memory()
ret i64 %1
}

LLVM IR (-O2):
define i64 @zmalloc_get_rss() {
%1 = tail call i64 (...) @zmalloc_used_memory()
ret i64 %1
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SYS_futex;
int syscall(int /*<<< orphan*/, void *, int, int, struct timespec *, void *,
            int);
int sys_futex(void *uaddr, int op, int val1, struct timespec *timeout,
              void *uaddr2, int val3) {
  return syscall(SYS_futex, uaddr, op, val1, timeout, uaddr2, val3);
}


x86 assembly (clang, -O0):
<sys_futex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_futex>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebb(%rip),%rdi
mov    (%rdi),%edi
mov    %r9d,(%rsp)
mov    %rax,%r9
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
define i32 @sys_futex(i8* %0, i32 %1, i32 %2, %struct.timespec* %3, i8* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.timespec*
%11 = alloca i8*
%12 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store %struct.timespec* %3, %struct.timespec** %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load i32, i32* @SYS_futex
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load %struct.timespec*, %struct.timespec** %10
%18 = load i8*, i8** %11
%19 = load i32, i32* %12
%20 = call i32 @syscall(i32 %13, i8* %14, i32 %15, i32 %16, %struct.timespec* %17, i8* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
define i32 @sys_futex(i8* %0, i32 %1, i32 %2, %struct.timespec* %3, i8* %4, i32 %5) {
%7 = load i32, i32* @SYS_futex
%8 = tail call i32 @syscall(i32 %7, i8* %0, i32 %1, i32 %2, %struct.timespec* %3, i8* %4, i32 %5)
ret i32 %8
}
/* Variables and functions */
double funcAngCor_p0_2plus_12minus_14926_L3(double *, double *);
double sin(double);
double fitAngDist_p0_2plus_12minus_14926_L3(double *x, double *par) {
  double result;
  result =
      funcAngCor_p0_2plus_12minus_14926_L3(x, &par[0]) * sin(x[0] * 0.0174533);
  return result;
}


x86 assembly (clang, -O0):
<fitAngDist_p0_2plus_12minus_14926_L3>:
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   1040 <funcAngCor_p0_2plus_12minus_14926_L3@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeb2(%rip),%xmm0
mulsd  (%rax),%xmm0
call   1030 <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_p0_2plus_12minus_14926_L3>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <funcAngCor_p0_2plus_12minus_14926_L3@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
mulsd  0xec1(%rip),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @fitAngDist_p0_2plus_12minus_14926_L3(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_p0_2plus_12minus_14926_L3(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_p0_2plus_12minus_14926_L3(double* %0, double* %1) {
%3 = tail call double @funcAngCor_p0_2plus_12minus_14926_L3(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 */
int rand();
int rand_between(int min, int max) { return rand() % (max - min + 1) + min; }


x86 assembly (clang, -O0):
<rand_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_between>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @rand_between(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t swap_uint64(uint64_t val) {
  val = ((val << 8) & 0xFF00FF00FF00FF00ULL) |
        ((val >> 8) & 0x00FF00FF00FF00FFULL);
  val = ((val << 16) & 0xFFFF0000FFFF0000ULL) |
        ((val >> 16) & 0x0000FFFF0000FFFFULL);
  return (val << 32) | (val >> 32);
}


x86 assembly (clang, -O0):
<swap_uint64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
cltq
movabs $0xff00ff00ff00ff00,%rcx
and    %rcx,%rax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
movabs $0xff00ff00ff00ff,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
cltq
movabs $0xffff0000ffff0000,%rcx
and    %rcx,%rax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
movslq %ecx,%rcx
movabs $0xffff0000ffff,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swap_uint64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = sext i32 %4 to i64
%6 = and i64 %5, -71777214294589696
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = sext i32 %8 to i64
%10 = and i64 %9, 71777214294589695
%11 = or i64 %6, %10
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = shl i32 %13, 16
%15 = sext i32 %14 to i64
%16 = and i64 %15, -281470681808896
%17 = load i32, i32* %2
%18 = ashr i32 %17, 16
%19 = sext i32 %18 to i64
%20 = and i64 %19, 281470681808895
%21 = or i64 %16, %20
%22 = trunc i64 %21 to i32
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = shl i32 %23, 32
%25 = load i32, i32* %2
%26 = ashr i32 %25, 32
%27 = or i32 %24, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @swap_uint64(i32 %0) {
ret i32 poison
}