xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void put_32bitLE(uint8_t *buf, uint32_t v) {
  for (unsigned int i = 0; i < 4; i++) {
    buf[i] = v & 0xFF;
    v >>= 8;
  }
}


x86 assembly (clang, -O0):
<put_32bitLE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jae    1146 <put_32bitLE+0x46>
mov    -0xc(%rbp),%edx
and    $0xff,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <put_32bitLE+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_32bitLE>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,(%rdi)
movzbl %ah,%ecx
mov    %ecx,0x4(%rdi)
mov    %esi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x8(%rdi)
shr    $0x18,%eax
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @put_32bitLE(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = icmp ult i32 %7, 4
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 %11, i32* %15
%16 = load i32, i32* %4
%17 = ashr i32 %16, 8
store i32 %17, i32* %4
br label %18
18: ; preds = %9
%19 = load i32, i32* %5
%20 = add i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @put_32bitLE(i32* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 255
store i32 %3, i32* %0
%4 = lshr i32 %1, 8
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %1, 16
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
%10 = lshr i32 %1, 24
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_blitzmax_comments() {
  test_parser_verify_parse(test_parser_sourcefile("blitzmax", "' comment"),
                           "blitzmax", "", "' comment", 0);
}


x86 assembly (clang, -O0):
<test_blitzmax_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xecb(%rip),%rdx
lea    0xebb(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_blitzmax_comments>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rbx
lea    0xed7(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xece(%rip),%rdx
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rcx
xor    %r8d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"blitzmax\00"
@.str.1 = [10 x i8] c"' comment\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_blitzmax_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"blitzmax\00"
@.str.1 = [10 x i8] c"' comment\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_blitzmax_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void UART4_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @UART4_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @UART4_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
call3c(fp, dp) float *fp;
double *dp;
{
  fp = 0;
  dp = 0;
}


x86 assembly (clang, -O0):
<call3c>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @call3c(float* nocapture readnone %0, double* nocapture readnone %1) {
ret i32 undef
}
int d_ne_cr2(double a1) { return !(((100) != (a1))); }


x86 assembly (clang, -O0):
<d_ne_cr2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ne_cr2>:
cmpeqsd 0xef7(%rip),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @d_ne_cr2(double %0) {
%2 = fcmp oeq double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
ISR(TIMER2_OVF_vect) {}


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

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

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

LLVM IR (-O2):
define i32 @ISR(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_RADIO_GIO1_PIN() { clear_io_bit(-1, 7); }


x86 assembly (clang, -O0):
<TOSH_CLR_RADIO_GIO1_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
mov    $0x7,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_RADIO_GIO1_PIN>:
mov    $0xffffffff,%edi
mov    $0x7,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_RADIO_GIO1_PIN() {
%1 = call i32 @clear_io_bit(i32 -1, i32 7)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_RADIO_GIO1_PIN() {
%1 = tail call i32 @clear_io_bit(i32 -1, i32 7)
ret void
}
int foo_1(void) { return 3 ^ 3; }


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

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

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

LLVM IR (-O2):
define i32 @foo_1() {
ret i32 0
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRE7_set(void) { return U_WMRCORENONE_set("U_WMRE7"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRE7\00"
define i8* @U_WMRE7_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRE7\00"
define i8* @U_WMRE7_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int GCD(int, int);
int /*<<< orphan*/ printf(char *, int);
void main() { printf("%d\n", GCD(2, 4)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x4,%esi
call   1040 <GCD@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x4,%esi
call   1040 <GCD@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @GCD(i32 2, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void INI_Rename_set_ctx() { ; }


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

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

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

LLVM IR (-O2):
define void @INI_Rename_set_ctx() {
ret void
}
/* Variables and functions */
double __ocml_mul_rtn_f64(double, double);
double __dmul_ru(double x, double y) { return __ocml_mul_rtn_f64(x, y); }


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

x86 assembly (clang, -O2):
<__dmul_ru>:
jmp    1030 <__ocml_mul_rtn_f64@plt>

LLVM IR (-O0):
define double @__dmul_ru(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @__ocml_mul_rtn_f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @__dmul_ru(double %0, double %1) {
%3 = tail call double @__ocml_mul_rtn_f64(double %0, double %1)
ret double %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int padcon_get_standard_closest_pole(double *cre, double *cim) {
  int fail;
  int precision = 0;
  int *b;
  double nbr[2];
  fail = _ada_use_c2phc4c(866, &precision, b, nbr, 0);
  *cre = nbr[0];
  *cim = nbr[1];
  return fail;
}


x86 assembly (clang, -O0):
<padcon_get_standard_closest_pole>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x20(%rbp),%rdx
lea    -0x30(%rbp),%rcx
mov    $0x362,%edi
lea    -0x18(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padcon_get_standard_closest_pole>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rcx
mov    $0x362,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @padcon_get_standard_closest_pole(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca [2 x double]
store double* %0, double** %3
store double* %1, double** %4
store i32 0, i32* %6
%9 = load i32*, i32** %7
%10 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%11 = call i32 @_ada_use_c2phc4c(i32 866, i32* %6, i32* %9, double* %10, i32 0)
store i32 %11, i32* %5
%12 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%13 = load double, double* %12
%14 = load double*, double** %3
store double %13, double* %14
%15 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 1
%16 = load double, double* %15
%17 = load double*, double** %4
store double %16, double* %17
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @padcon_get_standard_closest_pole(double* nocapture writeonly %0, double* nocapture writeonly %1) {
%3 = alloca i32
%4 = alloca [2 x double]
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = bitcast [2 x double]* %4 to i8*
%7 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%8 = call i32 @_ada_use_c2phc4c(i32 866, i32* %3, i32* undef, double* %7, i32 0)
%9 = load double, double* %7
store double %9, double* %0
%10 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 1
%11 = load double, double* %10
store double %11, double* %1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ pthread_testcancel();
void thread_self_test_exit() { pthread_testcancel(); }


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

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

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

LLVM IR (-O2):
define void @thread_self_test_exit() {
%1 = tail call i32 (...) @pthread_testcancel()
ret void
}
void _asm_generic1parm_retd_end(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_set1_pd(int);
int /*<<< orphan*/ _mm_storeh_pd(double *, int /*<<< orphan*/);
double f() {
  __m128d x = _mm_set1_pd(0.);
  double r = 42;
  _mm_storeh_pd(&r, x);
  return r;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <_mm_set1_pd@plt>
mov    %eax,-0x4(%rbp)
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    -0x10(%rbp),%rdi
call   1040 <_mm_storeh_pd@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
xor    %edi,%edi
call   1030 <_mm_set1_pd@plt>
movabs $0x4045000000000000,%rcx
mov    %rcx,(%rsp)
mov    %rsp,%rdi
mov    %eax,%esi
call   1040 <_mm_storeh_pd@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f() {
%1 = alloca i32
%2 = alloca double
%3 = call i32 @_mm_set1_pd(i32 0)
store i32 %3, i32* %1
store double 4.200000e+01, double* %2
%4 = load i32, i32* %1
%5 = call i32 @_mm_storeh_pd(double* %2, i32 %4)
%6 = load double, double* %2
ret double %6
}

LLVM IR (-O2):
define double @f() {
%1 = alloca double
%2 = tail call i32 @_mm_set1_pd(i32 0)
%3 = bitcast double* %1 to i8*
store double 4.200000e+01, double* %1
%4 = call i32 @_mm_storeh_pd(double* %1, i32 %2)
%5 = load double, double* %1
ret double %5
}
int test_imm_A5int64_lowword_reg(long long val) {
  return ((val) & (0xA5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A5int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 165
%5 = icmp ne i64 %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_A5int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 165
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void increment_no_dither(void) { return; }


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

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

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

LLVM IR (-O2):
define void @increment_no_dither() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pthread_create() {
  printf("You are about to die! attempt to use pthreads in something not "
         "linked\n with them\n");
}


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

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

LLVM IR (-O0):
@.str = [82 x i8] c"You are about to die! attempt to use pthreads in something not linked\0A with them\0A\00"
define void @pthread_create() {
%1 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [81 x i8] c"You are about to die! attempt to use pthreads in something not linked\0A with them\00"
define void @pthread_create() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str, i64 0, i64 0))
ret void
}
int get_up_available(int ypos, int xpos, int size, int width) {
  int up_available = ypos > 0;
  return up_available;
}


x86 assembly (clang, -O0):
<get_up_available>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_up_available>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @get_up_available(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 0
%12 = zext i1 %11 to i32
store i32 %12, i32* %9
%13 = load i32, i32* %9
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_up_available(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %0, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char a_encipher(char);
char a_decipher(char text) { return a_encipher(text); }


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

x86 assembly (clang, -O2):
<a_decipher>:
jmp    1030 <a_encipher@plt>

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

LLVM IR (-O2):
define signext i8 @a_decipher(i8 signext %0) {
%2 = tail call signext i8 @a_encipher(i8 signext %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ hanoi(int, char, char, char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int m;
  printf("Input the number of disks:");
  scanf("%d", &m);
  printf("The steps to moving %3d disks:\n", m);
  hanoi(m, 'A', 'B', 'C');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1050 <hanoi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1050 <hanoi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Input the number of disks:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"The steps to moving %3d disks:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @hanoi(i32 %7, i8 signext 65, i8 signext 66, i8 signext 67)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Input the number of disks:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"The steps to moving %3d disks:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @hanoi(i32 %7, i8 signext 65, i8 signext 66, i8 signext 67)
ret i32 0
}
/* Variables and functions */
double ceil(double);
double floor(double);
double round0(double x) { return (x > 0) ? floor(x) : ceil(x); }


x86 assembly (clang, -O0):
<round0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1153 <round0+0x33>
movsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1162 <round0+0x42>
movsd  -0x8(%rbp),%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round0>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112f <round0+0xf>
jmp    1040 <floor@plt>
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define double @round0(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = call double @llvm.floor.f64(double %6)
br label %11
8: ; preds = %1
%9 = load double, double* %2
%10 = call double @llvm.ceil.f64(double %9)
br label %11
11: ; preds = %8, %5
%12 = phi double [ %7, %5 ], [ %10, %8 ]
ret double %12
}

LLVM IR (-O2):
define double @round0(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @llvm.floor.f64(double %0)
br label %7
5: ; preds = %1
%6 = tail call double @llvm.ceil.f64(double %0)
br label %7
7: ; preds = %5, %3
%8 = phi double [ %4, %3 ], [ %6, %5 ]
ret double %8
}
/* Variables and functions */
int hxd2i(int);
int atoi_h_pp(char **pp) {
  int c, r = 0;
  for (; (c = **pp) & 80; ++*pp)
    r = 16 * r + hxd2i(c);
  return r;
}


x86 assembly (clang, -O0):
<atoi_h_pp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
and    $0x50,%eax
cmp    $0x0,%eax
je     116a <atoi_h_pp+0x5a>
mov    -0x10(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <hxd2i@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1123 <atoi_h_pp+0x13>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi_h_pp>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rax
movsbl (%rax),%edi
xor    %ebp,%ebp
test   $0x50,%dil
je     114e <atoi_h_pp+0x3e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
shl    $0x4,%ebp
call   1030 <hxd2i@plt>
add    %eax,%ebp
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
test   $0x50,%dil
jne    1130 <atoi_h_pp+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @atoi_h_pp(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 80
%6 = icmp eq i32 %5, 0
br i1 %6, label %19, label %7
7: ; preds = %1, %7
%8 = phi i32 [ %16, %7 ], [ %4, %1 ]
%9 = phi i32 [ %12, %7 ], [ 0, %1 ]
%10 = shl nsw i32 %9, 4
%11 = tail call i32 @hxd2i(i32 %8)
%12 = add nsw i32 %11, %10
%13 = load i8*, i8** %0
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8* %14, i8** %0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = and i32 %16, 80
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %7
19: ; preds = %7, %1
%20 = phi i32 [ 0, %1 ], [ %12, %7 ]
ret i32 %20
}
void *test_anti_range_62(unsigned char n) {
  extern void *alloc_anti_range_62(unsigned char)
      __attribute__((alloc_size(1)));
  if (0 <= n && n <= 0)
    n = 0 - 1;
  return alloc_anti_range_62(n);
}


x86 assembly (clang, -O0):
<test_anti_range_62>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     113d <test_anti_range_62+0x2d>
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jg     113d <test_anti_range_62+0x2d>
movb   $0xff,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <alloc_anti_range_62@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_62>:
cmp    $0x1,%edi
sbb    %eax,%eax
or     %dil,%al
movzbl %al,%edi
jmp    1030 <alloc_anti_range_62@plt>

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

LLVM IR (-O2):
define i8* @test_anti_range_62(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i8 -1, i8 %0
%4 = tail call i8* @alloc_anti_range_62(i8 zeroext %3)
ret i8* %4
}
unsigned long generate_random_number(void) {
  static unsigned long rand_seed = 22222;
  rand_seed = (rand_seed * 196314165) + 907633515;
  return rand_seed;
}


x86 assembly (clang, -O0):
<generate_random_number>:
push   %rbp
mov    %rsp,%rbp
imul   $0xbb38435,0x2f11(%rip),%rax
35 84 b3 0b
add    $0x3619636b,%rax
mov    %rax,0x2f04(%rip)
mov    0x2efd(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_random_number>:
imul   $0xbb38435,0x2f15(%rip),%rax
35 84 b3 0b
add    $0x3619636b,%rax
mov    %rax,0x2f08(%rip)
ret

LLVM IR (-O0):
@generate_random_number.rand_seed = internal global i64 22222
define i64 @generate_random_number() {
%1 = load i64, i64* @generate_random_number.rand_seed
%2 = mul i64 %1, 196314165
%3 = add i64 %2, 907633515
store i64 %3, i64* @generate_random_number.rand_seed
%4 = load i64, i64* @generate_random_number.rand_seed
ret i64 %4
}

LLVM IR (-O2):
@generate_random_number.rand_seed = internal unnamed_addr global i64 22222
define i64 @generate_random_number() {
%1 = load i64, i64* @generate_random_number.rand_seed
%2 = mul i64 %1, 196314165
%3 = add i64 %2, 907633515
store i64 %3, i64* @generate_random_number.rand_seed
ret i64 %3
}
spiegel(n) int n;
{
  int i, j, k, l;
  i = 1;
  j = 128;
  l = 0;
  for (k = 0; k < 8; k++) {
    if ((i & n) > 0)
      l |= j;
    i <<= 1;
    j >>= 1;
  }
  return (l);
}


x86 assembly (clang, -O0):
<spiegel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x80,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    1165 <spiegel+0x65>
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
cmp    $0x0,%eax
jle    1145 <spiegel+0x45>
mov    -0xc(%rbp),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1123 <spiegel+0x23>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spiegel>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %al,%dil
mov    %edi,%eax
and    $0x55,%al
add    %al,%al
shr    %dil
and    $0x55,%dil
or     %al,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @spiegel(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 128, i32* %4
store i32 0, i32* %6
store i32 0, i32* %5
br label %7
7: ; preds = %24, %1
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 8
br i1 %9, label %10, label %27
10: ; preds = %7
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = and i32 %11, %12
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %10
%16 = load i32, i32* %4
%17 = load i32, i32* %6
%18 = or i32 %17, %16
store i32 %18, i32* %6
br label %19
19: ; preds = %15, %10
%20 = load i32, i32* %3
%21 = shl i32 %20, 1
store i32 %21, i32* %3
%22 = load i32, i32* %4
%23 = ashr i32 %22, 1
store i32 %23, i32* %4
br label %24
24: ; preds = %19
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %7
27: ; preds = %7
%28 = load i32, i32* %6
ret i32 %28
}

LLVM IR (-O2):
define i32 @spiegel(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = call i8 @llvm.bitreverse.i8(i8 %2)
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int f(float);
int main(void) {
  float a;
  return f(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(float undef)
ret i32 %1
}
/* Type definitions */
struct aom_read_bit_buffer {
  int dummy;
};

/* Variables and functions */
scalar_t__ aom_rb_read_literal(struct aom_read_bit_buffer *, int);
int aom_rb_read_inv_signed_literal(struct aom_read_bit_buffer *rb, int bits) {
  const int nbits = sizeof(unsigned) * 8 - bits - 1;
  const unsigned value = (unsigned)aom_rb_read_literal(rb, bits + 1) << nbits;
  return ((int)value) >> nbits;
}


x86 assembly (clang, -O0):
<aom_rb_read_inv_signed_literal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x20,%eax
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
call   1030 <aom_rb_read_literal@plt>
mov    -0x10(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    %cl,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aom_rb_read_inv_signed_literal>:
push   %rbx
mov    %esi,%ebx
lea    0x1(%rbx),%esi
call   1030 <aom_rb_read_literal@plt>
mov    $0x1f,%cl
sub    %bl,%cl
shl    %cl,%eax
sar    %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.aom_read_bit_buffer = type { i32 }
define i32 @aom_rb_read_inv_signed_literal(%struct.aom_read_bit_buffer* %0, i32 %1) {
%3 = alloca %struct.aom_read_bit_buffer*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.aom_read_bit_buffer* %0, %struct.aom_read_bit_buffer** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = sub i64 32, %8
%10 = sub i64 %9, 1
%11 = trunc i64 %10 to i32
store i32 %11, i32* %5
%12 = load %struct.aom_read_bit_buffer*, %struct.aom_read_bit_buffer** %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
%15 = call i64 @aom_rb_read_literal(%struct.aom_read_bit_buffer* %12, i32 %14)
%16 = trunc i64 %15 to i32
%17 = load i32, i32* %5
%18 = shl i32 %16, %17
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = load i32, i32* %5
%21 = ashr i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
%struct.aom_read_bit_buffer = type { i32 }
define i32 @aom_rb_read_inv_signed_literal(%struct.aom_read_bit_buffer* %0, i32 %1) {
%3 = sub i32 31, %1
%4 = add nsw i32 %1, 1
%5 = tail call i64 @aom_rb_read_literal(%struct.aom_read_bit_buffer* %0, i32 %4)
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, %3
%8 = ashr i32 %7, %3
ret i32 %8
}
int ithread_cleanup_thread(void) {
  int ret = 0;
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @ithread_cleanup_thread() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ absolute();
int /*<<< orphan*/ rol16addr(int /*<<< orphan*/);
void rolAbs16(void) { rol16addr(absolute()); }


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

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

LLVM IR (-O0):
define void @rolAbs16() {
%1 = call i32 (...) @absolute()
%2 = call i32 @rol16addr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @rolAbs16() {
%1 = tail call i32 (...) @absolute()
%2 = tail call i32 @rol16addr(i32 %1)
ret void
}
char *RCSid() {
  return RCSid("$Id: set.c,v 1.354.2.6 2013/09/11 23:38:37 sfeam Exp $");
}


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

x86 assembly (clang, -O2):
<RCSid>:
jmp    1100 <RCSid>

LLVM IR (-O0):
@.str = [55 x i8] c"$Id: set.c,v 1.354.2.6 2013/09/11 23:38:37 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t f16i(int16_t x) { return x ^ 1; }


x86 assembly (clang, -O0):
<f16i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f16i>:
mov    %edi,%eax
xor    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @f16i(i32 %0) {
%2 = xor i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ __syscall(int);
uid_t getuid(void) { return __syscall(24); }


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

x86 assembly (clang, -O2):
<getuid>:
mov    $0x18,%edi
jmp    1030 <__syscall@plt>

LLVM IR (-O0):
define i32 @getuid() {
%1 = call i32 @__syscall(i32 24)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getuid() {
%1 = tail call i32 @__syscall(i32 24)
ret i32 %1
}
void rop3_85_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = ~*D;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_85_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_85_1_0>:
xor    (%rdi),%sil
not    %sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_85_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = xor i32 %10, -1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %7
%13 = load i8, i8* %7
%14 = zext i8 %13 to i32
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = and i32 %14, %17
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8, i8* %5
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = or i32 %18, %24
%26 = trunc i32 %25 to i8
%27 = load i8*, i8** %4
store i8 %26, i8* %27
ret void
}

LLVM IR (-O2):
define void @rop3_85_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = xor i8 %5, -1
store i8 %6, i8* %0
ret void
}
int init_ext3_xattr(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init_ext3_xattr() {
ret i32 0
}
int isAbsolute(const char *path) { return (path[0] == '/') ? 1 : 0; }


x86 assembly (clang, -O0):
<isAbsolute>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x2f,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAbsolute>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @isAbsolute(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 47
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
ret i32 %9
}

LLVM IR (-O2):
define i32 @isAbsolute(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
uint32_t f_scalar_3(int32_t x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @f_scalar_3(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
double asin(double);
double Double_asin(double x) { return asin(x); }


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

x86 assembly (clang, -O2):
<Double_asin>:
jmp    1030 <asin@plt>

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

LLVM IR (-O2):
define double @Double_asin(double %0) {
%2 = tail call double @asin(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glGetMinmaxParameterfv_size(int /*<<< orphan*/);
GLint __glGetMinmaxParameteriv_size(GLenum pname) {
  return __glGetMinmaxParameterfv_size(pname);
}


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

x86 assembly (clang, -O2):
<__glGetMinmaxParameteriv_size>:
jmp    1030 <__glGetMinmaxParameterfv_size@plt>

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

LLVM IR (-O2):
define i32 @__glGetMinmaxParameteriv_size(i32 %0) {
%2 = tail call i32 @__glGetMinmaxParameterfv_size(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xa1() {
  Assert_real((isspace(161) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              810, ("isspace should be 0 for 0xa1"));
}


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

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

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

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


x86 assembly (clang, -O0):
<set_priority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <setpriority@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_priority>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
jmp    1030 <setpriority@plt>

LLVM IR (-O0):
@PRIO_PROCESS = global i32 0
define i32 @set_priority(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @PRIO_PROCESS
%4 = load i32, i32* %2
%5 = call i32 @setpriority(i32 %3, i32 0, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@PRIO_PROCESS = global i32 0
define i32 @set_priority(i32 %0) {
%2 = load i32, i32* @PRIO_PROCESS
%3 = tail call i32 @setpriority(i32 %2, i32 0, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ can_rx(int /*<<< orphan*/);
void CAN1_RX0_IRQHandler() { can_rx(0); }


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

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

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

LLVM IR (-O2):
define void @CAN1_RX0_IRQHandler() {
%1 = tail call i32 @can_rx(i32 0)
ret void
}
/* Variables and functions */
double floor(double);
double Rs(double x) {
  double R0 = 1.0;
  double H0 = 0.2;
  return (1.2 + (floor((x - R0) / H0) - .5) * H0);
}


x86 assembly (clang, -O0):
<Rs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xede(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
call   1030 <floor@plt>
movsd  0xeb5(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe98(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rs>:
push   %rax
addsd  0xee7(%rip),%xmm0
divsd  0xee7(%rip),%xmm0
call   1030 <floor@plt>
addsd  0xee2(%rip),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0xeda(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Rs(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 1.000000e+00, double* %3
store double 2.000000e-01, double* %4
%5 = load double, double* %2
%6 = load double, double* %3
%7 = fsub double %5, %6
%8 = load double, double* %4
%9 = fdiv double %7, %8
%10 = call double @llvm.floor.f64(double %9)
%11 = fsub double %10, 5.000000e-01
%12 = load double, double* %4
%13 = call double @llvm.fmuladd.f64(double %11, double %12, double 1.200000e+00)
ret double %13
}

LLVM IR (-O2):
define double @Rs(double %0) {
%2 = fadd double %0, -1.000000e+00
%3 = fdiv double %2, 2.000000e-01
%4 = tail call double @llvm.floor.f64(double %3)
%5 = fadd double %4, -5.000000e-01
%6 = tail call double @llvm.fmuladd.f64(double %5, double 2.000000e-01, double 1.200000e+00)
ret double %6
}