xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_14() {
  Assert_real((isqrt(14) == 3),
              "/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/stdlib/isqrt.c",
              75, ("Integer square root of 14 should be 3"));
}


x86 assembly (clang, -O0):
<t_sqrt_14>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe,%edi
call   1030 <isqrt@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x4b,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_14>:
push   %rax
mov    $0xe,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x4b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 14 should be 3\00"
define void @t_sqrt_14() {
%1 = call i32 @isqrt(i32 14)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 75, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 14 should be 3\00"
define void @t_sqrt_14() {
%1 = tail call i32 @isqrt(i32 14)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 75, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_9Eint32_reg(int val) { return ((val) & (0x9E << 0)) ? -20 : -40; }


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

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

LLVM IR (-O0):
define i32 @test_imm_9Eint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 158
%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_9Eint32_reg(i32 %0) {
%2 = and i32 %0, 158
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double exp(int);
float raw_tanh_derivative(float x) {
  float y = (2.0 / (1.0 + exp(-2 * x))) - 1.0;
  return 1.0 - y * y;
}


x86 assembly (clang, -O0):
<raw_tanh_derivative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xeeb(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <exp@plt>
movsd  0xec5(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xec1(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xead(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe8a(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_tanh_derivative>:
push   %rax
mulss  0xee7(%rip),%xmm0
cvttss2si %xmm0,%edi
call   1030 <exp@plt>
addsd  0xede(%rip),%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xeda(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
mulss  %xmm1,%xmm1
movss  0xeb6(%rip),%xmm0
subss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @raw_tanh_derivative(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fmul float -2.000000e+00, %4
%6 = fptosi float %5 to i32
%7 = call double @exp(i32 %6)
%8 = fadd double 1.000000e+00, %7
%9 = fdiv double 2.000000e+00, %8
%10 = fsub double %9, 1.000000e+00
%11 = fptrunc double %10 to float
store float %11, float* %3
%12 = load float, float* %3
%13 = load float, float* %3
%14 = fmul float %12, %13
%15 = fpext float %14 to double
%16 = fsub double 1.000000e+00, %15
%17 = fptrunc double %16 to float
ret float %17
}

LLVM IR (-O2):
define float @raw_tanh_derivative(float %0) {
%2 = fmul float %0, -2.000000e+00
%3 = fptosi float %2 to i32
%4 = tail call double @exp(i32 %3)
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double 2.000000e+00, %5
%7 = fadd double %6, -1.000000e+00
%8 = fptrunc double %7 to float
%9 = fmul float %8, %8
%10 = fsub float 1.000000e+00, %9
ret float %10
}
void clear_all(int keys[8]) {
  int i;
  for (i = 0; i < 8; i++) {
    keys[i] = 0;
  }
}


x86 assembly (clang, -O0):
<clear_all>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1136 <clear_all+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clear_all+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_all>:
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @clear_all(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store i32 0, i32* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @clear_all(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
void add_history(char *line) {}


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

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

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

LLVM IR (-O2):
define void @add_history(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MagnetometerHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void MagnetometerUpdated() { UAVObjUpdated(MagnetometerHandle()); }


x86 assembly (clang, -O0):
<MagnetometerUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <MagnetometerHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MagnetometerUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <MagnetometerHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @MagnetometerUpdated() {
%1 = call i32 (...) @MagnetometerHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @MagnetometerUpdated() {
%1 = tail call i32 (...) @MagnetometerHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
void ve_unregister_nfs_hooks(struct ve_struct *ve) {}


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

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

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

LLVM IR (-O2):
%struct.ve_struct = type opaque
define void @ve_unregister_nfs_hooks(%struct.ve_struct* nocapture %0) {
ret void
}
/* Type definitions */
struct sched_param {
  int dummy;
};
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_setschedparam(pthread_t a, int b, const struct sched_param *c) {
  assert(0);
}


x86 assembly (clang, -O0):
<pthread_setschedparam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sched_param = type { i32 }
define i32 @pthread_setschedparam(i32 %0, i32 %1, %struct.sched_param* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.sched_param*
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.sched_param* %2, %struct.sched_param** %7
%8 = call i32 @assert(i32 0)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
define i32 @pthread_setschedparam(i32 %0, i32 %1, %struct.sched_param* nocapture readnone %2) {
%4 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ runProducerConsumer(int, char **);
int main(int argc, char **argv) { runProducerConsumer(argc, argv); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @runProducerConsumer(i32 %0, i8** %1)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t h265hvcc_get_profile_idc(const uint8_t *p) { return p[1] & 0x1f; }


x86 assembly (clang, -O0):
<h265hvcc_get_profile_idc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_get_profile_idc>:
mov    0x4(%rdi),%eax
and    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @h265hvcc_get_profile_idc(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = and i32 %3, 31
ret i32 %4
}
/* Variables and functions */
scalar_t__ isalnum(char);
bool meaningful_char(char c) { return isalnum(c) || (c & 0x80); }


x86 assembly (clang, -O0):
<meaningful_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    114b <meaningful_char+0x3b>
movsbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<meaningful_char>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
test   %bl,%bl
sets   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @meaningful_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = and i32 %8, 128
%10 = icmp ne i32 %9, 0
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @meaningful_char(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp slt i8 %0, 0
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
double foo(double x, double y) {
  volatile int i = 0;
  return i == 0 ? x : y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x0,%eax
jne    1130 <foo+0x30>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    113a <foo+0x3a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x0,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
je     1112 <foo+0x12>
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @foo(double %0, double %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
%5 = load volatile i32, i32* %3
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, double %0, double %1
ret double %7
}
/* Type definitions */
struct oscap_stringlist {
  int dummy;
};
struct oscap_string_iterator {
  int dummy;
};
struct oscap_list {
  int dummy;
};

/* Variables and functions */
struct oscap_string_iterator *oscap_iterator_new(struct oscap_list *);
struct oscap_string_iterator *
oscap_stringlist_get_strings(const struct oscap_stringlist *list) {
  return oscap_iterator_new((struct oscap_list *)list);
}


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

x86 assembly (clang, -O2):
<oscap_stringlist_get_strings>:
jmp    1030 <oscap_iterator_new@plt>

LLVM IR (-O0):
%struct.oscap_string_iterator = type { i32 }
%struct.oscap_stringlist = type { i32 }
%struct.oscap_list = type { i32 }
define %struct.oscap_string_iterator* @oscap_stringlist_get_strings(%struct.oscap_stringlist* %0) {
%2 = alloca %struct.oscap_stringlist*
store %struct.oscap_stringlist* %0, %struct.oscap_stringlist** %2
%3 = load %struct.oscap_stringlist*, %struct.oscap_stringlist** %2
%4 = bitcast %struct.oscap_stringlist* %3 to %struct.oscap_list*
%5 = call %struct.oscap_string_iterator* @oscap_iterator_new(%struct.oscap_list* %4)
ret %struct.oscap_string_iterator* %5
}

LLVM IR (-O2):
%struct.oscap_string_iterator = type { i32 }
%struct.oscap_stringlist = type { i32 }
%struct.oscap_list = type { i32 }
define %struct.oscap_string_iterator* @oscap_stringlist_get_strings(%struct.oscap_stringlist* %0) {
%2 = bitcast %struct.oscap_stringlist* %0 to %struct.oscap_list*
%3 = tail call %struct.oscap_string_iterator* @oscap_iterator_new(%struct.oscap_list* %2)
ret %struct.oscap_string_iterator* %3
}
char *ctime(clock)
long *clock;
{ return asctime(localtime(clock)); }


x86 assembly (clang, -O0):
<ctime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <localtime@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <asctime@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctime>:
push   %rax
xor    %eax,%eax
call   1030 <localtime@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <asctime@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @ctime(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = call i32 (i64*, ...) bitcast (i32 (...)* @localtime to i32 (i64*, ...)*)(i64* %3)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @asctime to i32 (i32, ...)*)(i32 %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @ctime(i64* %0) {
%2 = tail call i32 (i64*, ...) bitcast (i32 (...)* @localtime to i32 (i64*, ...)*)(i64* %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @asctime to i32 (i32, ...)*)(i32 %2)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ SendWeaponPref2();
void DirectionChar2_OnChange(void) { SendWeaponPref2(); }


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

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

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

LLVM IR (-O2):
define void @DirectionChar2_OnChange() {
%1 = tail call i32 (...) @SendWeaponPref2()
ret void
}
/* Variables and functions */
int task_flag_asserted(int, int);
int task_thread_asserted(int id) { return task_flag_asserted(id, (1 << 3)); }


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

x86 assembly (clang, -O2):
<task_thread_asserted>:
mov    $0x8,%esi
jmp    1030 <task_flag_asserted@plt>

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

LLVM IR (-O2):
define i32 @task_thread_asserted(i32 %0) {
%2 = tail call i32 @task_flag_asserted(i32 %0, i32 8)
ret i32 %2
}
double dmin(double a, double b) {
  if (a > b)
    return b;
  else
    return a;
}


x86 assembly (clang, -O0):
<dmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112d <dmin+0x2d>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <dmin+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmin>:
minsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dmin(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %5
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @dmin(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ readl(void *);
uint32_t read_clkgr1(void) { return readl((void *)0xb0000000 + (0x28)); }


x86 assembly (clang, -O0):
<read_clkgr1>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000000,%edi
add    $0x28,%rdi
call   1030 <readl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_clkgr1>:
mov    $0xb0000028,%edi
jmp    1030 <readl@plt>

LLVM IR (-O0):
define i32 @read_clkgr1() {
%1 = call i32 @readl(i8* getelementptr (i8, i8* inttoptr (i64 2952790016 to i8*), i64 40))
ret i32 %1
}

LLVM IR (-O2):
define i32 @read_clkgr1() {
%1 = tail call i32 @readl(i8* inttoptr (i64 2952790056 to i8*))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ NP();
int /*<<< orphan*/ V();
int VP() {
  V();
  NP();
}


x86 assembly (clang, -O0):
<VP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <V@plt>
mov    $0x0,%al
call   1030 <NP@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @VP() {
%1 = alloca i32
%2 = call i32 (...) @V()
%3 = call i32 (...) @NP()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @VP() {
%1 = tail call i32 (...) @V()
%2 = tail call i32 (...) @NP()
ret i32 undef
}
/* Variables and functions */
void *malloc(size_t);
void *ldv_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<ldv_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @ldv_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set_value(int, unsigned int);
void out() {
  static unsigned char state = 0;
  gpio_set_value(139, (unsigned int)(state++ & 1));
}


x86 assembly (clang, -O0):
<out>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0f(%rip),%al
mov    %al,%cl
add    $0x1,%cl
mov    %cl,0x2f04(%rip)
movzbl %al,%esi
and    $0x1,%esi
mov    $0x8b,%edi
call   1030 <gpio_set_value@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<out>:
movzbl 0x2f12(%rip),%esi
lea    0x1(%rsi),%eax
mov    %al,0x2f09(%rip)
and    $0x1,%esi
mov    $0x8b,%edi
jmp    1030 <gpio_set_value@plt>

LLVM IR (-O0):
@out.state = internal global i8 0
define void @out() {
%1 = load i8, i8* @out.state
%2 = add i8 %1, 1
store i8 %2, i8* @out.state
%3 = zext i8 %1 to i32
%4 = and i32 %3, 1
%5 = call i32 @gpio_set_value(i32 139, i32 %4)
ret void
}

LLVM IR (-O2):
@out.state = internal unnamed_addr global i8 0
define void @out() {
%1 = load i8, i8* @out.state
%2 = add i8 %1, 1
store i8 %2, i8* @out.state
%3 = and i8 %1, 1
%4 = zext i8 %3 to i32
%5 = tail call i32 @gpio_set_value(i32 139, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void errorOutOfMemory() {
  fprintf(stderr, "Error: out of memory.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<errorOutOfMemory>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errorOutOfMemory>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Error: out of memory.\0A\00"
define void @errorOutOfMemory() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Error: out of memory.\0A\00"
define void @errorOutOfMemory() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ system(char *);
int hackedfunction() {
  printf("Way to go!!!!");
  fflush(stdout);
  system("/bin/sh");
  return 0;
}


x86 assembly (clang, -O0):
<hackedfunction>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xeb9(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hackedfunction>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xebc(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Way to go!!!!\00"
@stdout = global i32 0
@.str.1 = [8 x i8] c"/bin/sh\00"
define i32 @hackedfunction() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
%4 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Way to go!!!!\00"
@stdout = global i32 0
@.str.1 = [8 x i8] c"/bin/sh\00"
define i32 @hackedfunction() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ handle_LWP(int /*<<< orphan*/);
int gen_LWP() {
  handle_LWP(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @gen_LWP() {
%1 = call i32 @handle_LWP(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_LWP() {
%1 = tail call i32 @handle_LWP(i32 0)
ret i32 0
}
int my_nint(double d) {
  if (d >= 0.0)
    return ((int)(d + 0.4999));
  return ((int)(d - 0.4999));
}


x86 assembly (clang, -O0):
<my_nint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1134 <my_nint+0x34>
movsd  0xedd(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    114c <my_nint+0x4c>
movsd  -0x10(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_nint>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setb   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @my_nint(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = fadd double %7, 4.999000e-01
%9 = fptosi double %8 to i32
store i32 %9, i32* %2
br label %14
10: ; preds = %1
%11 = load double, double* %3
%12 = fsub double %11, 4.999000e-01
%13 = fptosi double %12 to i32
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @my_nint(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = select i1 %2, double -4.999000e-01, double 4.999000e-01
%4 = fadd double %3, %0
%5 = fptosi double %4 to i32
ret i32 %5
}
int d_ge_rc1(double a1) { return (((a1) >= (100))); }


x86 assembly (clang, -O0):
<d_ge_rc1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ge_rc1>:
xor    %eax,%eax
ucomisd 0xef6(%rip),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @d_ge_rc1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 1.000000e+02
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @d_ge_rc1(double %0) {
%2 = fcmp oge double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct pollfd {
  int events;
  int /*<<< orphan*/ fd;
};

/* Variables and functions */
int POLLIN;
int POLLPRI;
int /*<<< orphan*/ STDIN_FILENO;
scalar_t__ poll(struct pollfd *, int, int /*<<< orphan*/);
int term_poll(void) {
  struct pollfd pfd;
  pfd.fd = STDIN_FILENO;
  pfd.events = POLLIN | POLLPRI;
  if (poll(&pfd, 1, 0) > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<term_poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    0x2ebc(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <poll@plt>
cmp    $0x0,%rax
jle    115f <term_poll+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1166 <term_poll+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_poll>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    0x2ebb(%rip),%rax
mov    0x2ec4(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    %ecx,(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <poll@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pollfd = type { i32, i32 }
@STDIN_FILENO = global i32 0
@POLLIN = global i32 0
@POLLPRI = global i32 0
define i32 @term_poll() {
%1 = alloca i32
%2 = alloca %struct.pollfd
%3 = load i32, i32* @STDIN_FILENO
%4 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %2, i32 0, i32 1
store i32 %3, i32* %4
%5 = load i32, i32* @POLLIN
%6 = load i32, i32* @POLLPRI
%7 = or i32 %5, %6
%8 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %2, i32 0, i32 0
store i32 %7, i32* %8
%9 = call i64 @poll(%struct.pollfd* %2, i32 1, i32 0)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %0
store i32 1, i32* %1
br label %13
12: ; preds = %0
store i32 0, i32* %1
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
%struct.pollfd = type { i32, i32 }
@STDIN_FILENO = global i32 0
@POLLIN = global i32 0
@POLLPRI = global i32 0
define i32 @term_poll() {
%1 = alloca %struct.pollfd
%2 = bitcast %struct.pollfd* %1 to i8*
%3 = load i32, i32* @STDIN_FILENO
%4 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %1, i64 0, i32 1
store i32 %3, i32* %4
%5 = load i32, i32* @POLLIN
%6 = load i32, i32* @POLLPRI
%7 = or i32 %6, %5
%8 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %1, i64 0, i32 0
store i32 %7, i32* %8
%9 = call i64 @poll(%struct.pollfd* %1, i32 1, i32 0)
%10 = icmp sgt i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
float lerp(float y0, float y1, float d) { return y0 * (1 - d) + y1 * d; }


x86 assembly (clang, -O0):
<lerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xee0(%rip),%xmm2
subss  -0xc(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp>:
movss  0xef8(%rip),%xmm3
subss  %xmm2,%xmm3
mulss  %xmm2,%xmm1
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @lerp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = fsub float 1.000000e+00, %8
%10 = load float, float* %5
%11 = load float, float* %6
%12 = fmul float %10, %11
%13 = call float @llvm.fmuladd.f32(float %7, float %9, float %12)
ret float %13
}

LLVM IR (-O2):
define float @lerp(float %0, float %1, float %2) {
%4 = fsub float 1.000000e+00, %2
%5 = fmul float %1, %2
%6 = tail call float @llvm.fmuladd.f32(float %0, float %4, float %5)
ret float %6
}
void I422ToRGB24Row_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @I422ToRGB24Row_Any_SSSE3() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void ushort_put(unsigned short number, FILE *stream) {
  if (number > (unsigned short)9) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
    ushort_put(number / (unsigned short)10, stream);
#pragma GCC diagnostic pop
  }
  fputc('0' + (char)(number % (unsigned short)10), stream);
}


x86 assembly (clang, -O0):
<ushort_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x9,%eax
jle    1158 <ushort_put+0x38>
movzwl -0x2(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rsi
movzwl %ax,%edi
call   1040 <ushort_put@plt>
movzwl -0x2(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ushort_put>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
movzwl %di,%ebp
cmp    $0xa,%di
jb     1140 <ushort_put+0x20>
imul   $0xcccd,%ebp,%edi
shr    $0x13,%edi
mov    %rbx,%rsi
call   1040 <ushort_put@plt>
imul   $0xcccd,%ebp,%eax
shr    $0x12,%eax
and    $0xfffffffe,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebp
or     $0x30,%bpl
movzbl %bpl,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @ushort_put(i16 zeroext %0, i32* %1) {
%3 = alloca i16
%4 = alloca i32*
store i16 %0, i16* %3
store i32* %1, i32** %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = icmp sgt i32 %6, 9
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = sdiv i32 %10, 10
%12 = trunc i32 %11 to i16
%13 = load i32*, i32** %4
br label %14
14: ; preds = %8, %2
%15 = load i16, i16* %3
%16 = zext i16 %15 to i32
%17 = srem i32 %16, 10
%18 = trunc i32 %17 to i8
%19 = sext i8 %18 to i32
%20 = add nsw i32 48, %19
%21 = trunc i32 %20 to i8
%22 = load i32*, i32** %4
%23 = call i32 @fputc(i8 signext %21, i32* %22)
ret void
}

LLVM IR (-O2):
define void @ushort_put(i16 zeroext %0, i32* nocapture %1) {
%3 = icmp ugt i16 %0, 9
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = udiv i16 %0, 10
tail call void @ushort_put(i16 zeroext %5, i32* %1)
br label %6
6: ; preds = %4, %2
%7 = urem i16 %0, 10
%8 = trunc i16 %7 to i8
%9 = or i8 %8, 48
%10 = tail call i32 @fputc(i8 signext %9, i32* %1)
ret void
}
int CompareElement(int a, int b) {
  if (a < b)
    return -1;
  if (a == b)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<CompareElement>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1122 <CompareElement+0x22>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <CompareElement+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    113a <CompareElement+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1141 <CompareElement+0x41>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CompareElement>:
xor    %ecx,%ecx
cmp    %esi,%edi
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @CompareElement(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = icmp ne i32 %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
void __dbgui_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @__dbgui_shutdown() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int detail;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
void set_XEnterWindowEvent_detail(void *_p, int _v) {
  ((XEnterWindowEvent *)_p)->detail = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEnterWindowEvent_detail>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEnterWindowEvent_detail>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XEnterWindowEvent_detail(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XEnterWindowEvent_detail(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int tracepoint_probe_register(char *, void *);
__attribute__((always_)) int
register_trace_module_free(void (*probe)(struct module *mod)) {
  return tracepoint_probe_register("module_free", (void *)probe);
}


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

x86 assembly (clang, -O2):
<register_trace_module_free>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <tracepoint_probe_register@plt>

LLVM IR (-O0):
%struct.module = type opaque
@.str = [12 x i8] c"module_free\00"
define i32 @register_trace_module_free(void (%struct.module*)* %0) {
%2 = alloca void (%struct.module*)*
store void (%struct.module*)* %0, void (%struct.module*)** %2
%3 = load void (%struct.module*)*, void (%struct.module*)** %2
%4 = bitcast void (%struct.module*)* %3 to i8*
%5 = call i32 @tracepoint_probe_register(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.module = type opaque
@.str = [12 x i8] c"module_free\00"
define i32 @register_trace_module_free(void (%struct.module*)* %0) {
%2 = bitcast void (%struct.module*)* %0 to i8*
%3 = tail call i32 @tracepoint_probe_register(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %3
}
/* Variables and functions */
scalar_t__ registerExit();
void flushAllRegisters(void) {
  while (registerExit())
    ;
}


x86 assembly (clang, -O0):
<flushAllRegisters>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <flushAllRegisters+0x9>
mov    $0x0,%al
call   1030 <registerExit@plt>
cmp    $0x0,%rax
je     112f <flushAllRegisters+0x1f>
jmp    1119 <flushAllRegisters+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flushAllRegisters>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <registerExit@plt>
test   %rax,%rax
jne    1120 <flushAllRegisters+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @flushAllRegisters() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @registerExit()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @flushAllRegisters() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @registerExit()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fabs(int /*<<< orphan*/);
int /*<<< orphan*/ luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
void math_abs(void) { lua_pushnumber(fabs(luaL_check_number(1))); }


x86 assembly (clang, -O0):
<math_abs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
mov    %eax,%edi
call   1050 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_abs>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_abs() {
%1 = call i32 @luaL_check_number(i32 1)
%2 = call i32 @fabs(i32 %1)
%3 = call i32 @lua_pushnumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @math_abs() {
%1 = tail call i32 @luaL_check_number(i32 1)
%2 = tail call i32 @fabs(i32 %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
void foo_1_1_1_1_1_1_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_1_1_1_1_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
void printVersionNumber(unsigned char *ver_num) {
  unsigned int majVer = ver_num[1] * 255 + ver_num[0];
  unsigned int minVer = ver_num[3] * 255 + ver_num[2];
  printf("Version: %u.%u\n", majVer, minVer);
}


x86 assembly (clang, -O0):
<printVersionNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
imul   $0xff,%eax,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
imul   $0xff,%eax,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printVersionNumber>:
movzbl 0x1(%rdi),%eax
mov    %eax,%ecx
shl    $0x8,%ecx
sub    %eax,%ecx
movzbl (%rdi),%esi
add    %ecx,%esi
movzbl 0x3(%rdi),%eax
mov    %eax,%ecx
shl    $0x8,%ecx
sub    %eax,%ecx
movzbl 0x2(%rdi),%edx
add    %ecx,%edx
lea    0xec8(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Version: %u.%u\0A\00"
define void @printVersionNumber(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = mul nsw i32 %8, 255
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = add nsw i32 %9, %13
store i32 %14, i32* %3
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 3
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = mul nsw i32 %18, 255
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 2
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = add nsw i32 %19, %23
store i32 %24, i32* %4
%25 = load i32, i32* %3
%26 = load i32, i32* %4
%27 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %26)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Version: %u.%u\0A\00"
define void @printVersionNumber(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = mul nuw nsw i32 %4, 255
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = add nuw nsw i32 %5, %7
%9 = getelementptr inbounds i8, i8* %0, i64 3
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = mul nuw nsw i32 %11, 255
%13 = getelementptr inbounds i8, i8* %0, i64 2
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = add nuw nsw i32 %12, %15
%17 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int fahrenheit = 27;
  int celsius = (fahrenheit - 32) / 1.8;
  printf("%iF = %iC\n", fahrenheit, celsius);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1b,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
cvtsi2sd %eax,%xmm0
movsd  0xec8(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb8(%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
mov    $0x1b,%esi
mov    $0xfffffffe,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%iF = %iC\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 27, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 32
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.800000e+00
%8 = fptosi double %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%iF = %iC\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 27, i32 -2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ df_disable();
int /*<<< orphan*/ sei();
void df_deselect() {
  df_disable();
  sei();
}


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

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

LLVM IR (-O0):
define void @df_deselect() {
%1 = call i32 (...) @df_disable()
%2 = call i32 (...) @sei()
ret void
}

LLVM IR (-O2):
define void @df_deselect() {
%1 = tail call i32 (...) @df_disable()
%2 = tail call i32 (...) @sei()
ret void
}
/* Type definitions */
struct mq_attr {
  int dummy;
};
typedef int /*<<< orphan*/ mqd_t;

/* Variables and functions */
int syscall(int, int /*<<< orphan*/, struct mq_attr const *, struct mq_attr *);
int mq_setattr(mqd_t mqd, const struct mq_attr *new, struct mq_attr *old) {
  return syscall(279, mqd, new, old);
}


x86 assembly (clang, -O0):
<mq_setattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x117,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mq_setattr>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x117,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.mq_attr = type { i32 }
define i32 @mq_setattr(i32 %0, %struct.mq_attr* %1, %struct.mq_attr* %2) {
%4 = alloca i32
%5 = alloca %struct.mq_attr*
%6 = alloca %struct.mq_attr*
store i32 %0, i32* %4
store %struct.mq_attr* %1, %struct.mq_attr** %5
store %struct.mq_attr* %2, %struct.mq_attr** %6
%7 = load i32, i32* %4
%8 = load %struct.mq_attr*, %struct.mq_attr** %5
%9 = load %struct.mq_attr*, %struct.mq_attr** %6
%10 = call i32 @syscall(i32 279, i32 %7, %struct.mq_attr* %8, %struct.mq_attr* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.mq_attr = type { i32 }
define i32 @mq_setattr(i32 %0, %struct.mq_attr* %1, %struct.mq_attr* %2) {
%4 = tail call i32 @syscall(i32 279, i32 %0, %struct.mq_attr* %1, %struct.mq_attr* %2)
ret i32 %4
}