xunge/DecIR huggingface dataset:
/* Variables and functions */
int func(int *);
int main() {
  int test[] = {7, 8, 9};
  int result = func(test);
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <func@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <func@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.test = [3 x i32] [i32 7, i32 8, i32 9]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%6 = call i32 @func(i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@__const.main.test = [3 x i32] [i32 7, i32 8, i32 9]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @func(i32* %3)
ret i32 %4
}
/* Variables and functions */
double atan(double);
double freq2bark(double freq) {
  if (freq < 0)
    freq = 0;
  freq = freq * 0.001;
  return 13.0 * atan(.76 * freq) + 3.5 * atan(freq * freq / (7.5 * 7.5));
}


x86 assembly (clang, -O0):
<freq2bark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1133 <freq2bark+0x23>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xee5(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xecb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <atan@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <atan@plt>
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
movsd  0xe81(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe6d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freq2bark>:
sub    $0x18,%rsp
xorpd  %xmm1,%xmm1
maxsd  %xmm0,%xmm1
mulsd  0xedc(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xed6(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <atan@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm0
divsd  0xebd(%rip),%xmm0
call   1030 <atan@plt>
mulsd  0xeb8(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0xeb2(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @freq2bark(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
store double 0.000000e+00, double* %2
br label %6
6: ; preds = %5, %1
%7 = load double, double* %2
%8 = fmul double %7, 1.000000e-03
store double %8, double* %2
%9 = load double, double* %2
%10 = fmul double 7.600000e-01, %9
%11 = call double @atan(double %10)
%12 = load double, double* %2
%13 = load double, double* %2
%14 = fmul double %12, %13
%15 = fdiv double %14, 5.625000e+01
%16 = call double @atan(double %15)
%17 = fmul double 3.500000e+00, %16
%18 = call double @llvm.fmuladd.f64(double 1.300000e+01, double %11, double %17)
ret double %18
}

LLVM IR (-O2):
define double @freq2bark(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = select i1 %2, double 0.000000e+00, double %0
%4 = fmul double %3, 1.000000e-03
%5 = fmul double %4, 7.600000e-01
%6 = tail call double @atan(double %5)
%7 = fmul double %4, %4
%8 = fdiv double %7, 5.625000e+01
%9 = tail call double @atan(double %8)
%10 = fmul double %9, 3.500000e+00
%11 = tail call double @llvm.fmuladd.f64(double %6, double 1.300000e+01, double %10)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ htsmsg_add_u32(void *, char const *, int);
void add_bool(void *opaque, void *parent, const char *name, int v) {
  htsmsg_add_u32(parent, name, v);
}


x86 assembly (clang, -O0):
<add_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <htsmsg_add_u32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_bool>:
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <htsmsg_add_u32@plt>

LLVM IR (-O0):
define void @add_bool(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @htsmsg_add_u32(i8* %9, i8* %10, i32 %11)
ret void
}

LLVM IR (-O2):
define void @add_bool(i8* nocapture readnone %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @htsmsg_add_u32(i8* %1, i8* %2, i32 %3)
ret void
}
void foo016(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo016(i32 %0) {
ret void
}
int test_imm_86int64_lowword_reg(long long val) {
  return ((val) & (0x86 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_86int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 134
%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_86int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 134
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double aa_horner3(double, int, int, int);
double aa_tf_cos_series2(double theta2) {
  return aa_horner3(theta2, 1., -1. / 2, 1. / 24);
}


x86 assembly (clang, -O0):
<aa_tf_cos_series2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <aa_horner3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_tf_cos_series2>:
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <aa_horner3@plt>

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

LLVM IR (-O2):
define double @aa_tf_cos_series2(double %0) {
%2 = tail call double @aa_horner3(double %0, i32 1, i32 0, i32 0)
ret double %2
}
int RIFSIGNALED(int status) { return (status & 0xff) != 0; }


x86 assembly (clang, -O0):
<RIFSIGNALED>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RIFSIGNALED>:
xor    %eax,%eax
test   %dil,%dil
setne  %al
ret

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

LLVM IR (-O2):
define i32 @RIFSIGNALED(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f1(int, int, int, int, int, int, int, int);
int /*<<< orphan*/ f2(int, int);
void f0() {
  f1(1, 2, 3, 4, 5, 6, 7, 8);
  f2(1, 2);
}


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movl   $0x7,(%rsp)
movl   $0x8,0x8(%rsp)
call   1040 <f1@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
push   $0x8
push   $0x7
call   1040 <f1@plt>
add    $0x10,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
pop    %rax
jmp    1030 <f2@plt>

LLVM IR (-O0):
define void @f0() {
%1 = call i32 @f1(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8)
%2 = call i32 @f2(i32 1, i32 2)
ret void
}

LLVM IR (-O2):
define void @f0() {
%1 = tail call i32 @f1(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8)
%2 = tail call i32 @f2(i32 1, i32 2)
ret void
}
void _Locale_ctype_destroy(void *__DUMMY_PAR) {}


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

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

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

LLVM IR (-O2):
define void @_Locale_ctype_destroy(i8* nocapture %0) {
ret void
}
void delock(s) char *s;
{
  char ln[30];
  sprintf(ln, "%s.%s", "/var/lock/LCK.", s);
  rmlock(ln);
}


x86 assembly (clang, -O0):
<delock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rcx
lea    0xec5(%rip),%rsi
lea    0xec4(%rip),%rdx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1030 <rmlock@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delock>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rcx
lea    0xed1(%rip),%rsi
lea    0xed0(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <rmlock@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s.%s\00"
@.str.1 = [15 x i8] c"/var/lock/LCK.\00"
define void @delock(i8* %0) {
%2 = alloca i8*
%3 = alloca [30 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @rmlock to i32 (i8*, ...)*)(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s.%s\00"
@.str.1 = [15 x i8] c"/var/lock/LCK.\00"
define void @delock(i8* %0) {
%2 = alloca [30 x i8]
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @rmlock to i32 (i8*, ...)*)(i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
scalar_t__ pthread_mutex_init(int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
void safe_mutex_init(pthread_mutex_t *mutex,
                     const pthread_mutexattr_t *mutexattr) {
  if (pthread_mutex_init(mutex, mutexattr) != 0) {
    perror("safe_mutex_init: Failed to init mutex");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<safe_mutex_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <pthread_mutex_init@plt>
cmp    $0x0,%rax
je     1171 <safe_mutex_init+0x41>
lea    0xea2(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_mutex_init>:
push   %rax
call   1050 <pthread_mutex_init@plt>
test   %rax,%rax
jne    113d <safe_mutex_init+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"safe_mutex_init: Failed to init mutex\00"
@EXIT_FAILURE = global i32 0
define void @safe_mutex_init(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i64 @pthread_mutex_init(i32* %5, i32* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"safe_mutex_init: Failed to init mutex\00"
@EXIT_FAILURE = global i32 0
define void @safe_mutex_init(i32* %0, i32* %1) {
%3 = tail call i64 @pthread_mutex_init(i32* %0, i32* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
int int_mul(int a, int b) { return a * b; }


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

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

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

LLVM IR (-O2):
define i32 @int_mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t rshift(uint8_t op1, uint8_t op2) { return op1 >> op2; }


x86 assembly (clang, -O0):
<rshift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rshift>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @rshift(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}
int hash_string(const char *str) {
  int i, h = 0;
  for (i = 0; str[i]; i++) {
    h = h * 31 + str[i];
  }
  return h;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     114b <hash_string+0x4b>
imul   $0x1f,-0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <hash_string+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash_string+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_string+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = mul nsw i32 %7, 31
%9 = sext i8 %6 to i32
%10 = add nsw i32 %8, %9
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *string_itoa(int i) {
  static char s[16];
  if (!i)
    *s = '\0';
  else
    sprintf(s, "%d", i);
  return s;
}


x86 assembly (clang, -O0):
<string_itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1131 <string_itoa+0x21>
movb   $0x0,0x2f14(%rip)
jmp    1147 <string_itoa+0x37>
mov    -0x4(%rbp),%edx
lea    0x2f05(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ef2(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_itoa>:
push   %rax
test   %edi,%edi
je     112c <string_itoa+0x1c>
mov    %edi,%edx
lea    0x2f22(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1133 <string_itoa+0x23>
movb   $0x0,0x2f0d(%rip)
lea    0x2f06(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@string_itoa.s = internal global [16 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @string_itoa(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
store i8 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @string_itoa.s, i64 0, i64 0)
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @sprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @string_itoa.s, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %5
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @string_itoa.s, i64 0, i64 0)
}

LLVM IR (-O2):
@string_itoa.s = internal global [16 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @string_itoa(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1
store i8 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @string_itoa.s, i64 0, i64 0)
br label %6
4: ; preds = %1
%5 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @string_itoa.s, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %3
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @string_itoa.s, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ isdecr(int);
int /*<<< orphan*/ isincr(int);
int isbouncy(int num) { return !isincr(num) && !isdecr(num); }


x86 assembly (clang, -O0):
<isbouncy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isincr@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1156 <isbouncy+0x36>
mov    -0x4(%rbp),%edi
call   1040 <isdecr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isbouncy>:
push   %rbx
mov    %edi,%ebx
call   1030 <isincr@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1132 <isbouncy+0x12>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <isdecr@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isbouncy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isincr(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @isdecr(i32 %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @isbouncy(i32 %0) {
%2 = tail call i32 @isincr(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @isdecr(i32 %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
char *procprt_SUID_e(struct tstat *curstat, int avgval, int nsecs) {
  return "-       ";
}


x86 assembly (clang, -O0):
<procprt_SUID_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [9 x i8] c"- \00"
define i8* @procprt_SUID_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [9 x i8] c"- \00"
define i8* @procprt_SUID_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xdf() {
  Assert_real((isalpha(223) == 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_isalpha.c",
              1120, ("isalpha should be 0 for 0xdf"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xdf>:
push   %rax
mov    $0xdf,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x460,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xdf\00"
define void @t_isalpha_0xdf() {
%1 = call i64 @isalpha(i32 223)
%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 1120, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xdf\00"
define void @t_isalpha_0xdf() {
%1 = tail call i64 @isalpha(i32 223)
%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 1120, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float ftgetr4(entry, kw)
char *entry;
struct Keyword *kw;
{
  char temp[30];
  if (ftgetc(entry, kw, temp, 30))
    return ((float)atof(temp));
  else
    return ((float)0.0);
}


x86 assembly (clang, -O0):
<ftgetr4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x1e,%ecx
mov    $0x0,%al
call   1040 <ftgetc@plt>
cmp    $0x0,%eax
je     116a <ftgetr4+0x4a>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1030 <atof@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1172 <ftgetr4+0x52>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftgetr4>:
sub    $0x28,%rsp
mov    %rsp,%rdx
mov    $0x1e,%ecx
xor    %eax,%eax
call   1040 <ftgetc@plt>
test   %eax,%eax
je     114a <ftgetr4+0x2a>
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <atof@plt>
cvtsi2ss %eax,%xmm0
add    $0x28,%rsp
ret
xorps  %xmm0,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.Keyword = type opaque
define float @ftgetr4(i8* %0, %struct.Keyword* %1) {
%3 = alloca float
%4 = alloca i8*
%5 = alloca %struct.Keyword*
%6 = alloca [30 x i8]
store i8* %0, i8** %4
store %struct.Keyword* %1, %struct.Keyword** %5
%7 = load i8*, i8** %4
%8 = load %struct.Keyword*, %struct.Keyword** %5
%9 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%10 = call i32 (i8*, %struct.Keyword*, i8*, i32, ...) bitcast (i32 (...)* @ftgetc to i32 (i8*, %struct.Keyword*, i8*, i32, ...)*)(i8* %7, %struct.Keyword* %8, i8* %9, i32 30)
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @atof to i32 (i8*, ...)*)(i8* %13)
%15 = sitofp i32 %14 to float
store float %15, float* %3
br label %17
16: ; preds = %2
store float 0.000000e+00, float* %3
br label %17
17: ; preds = %16, %12
%18 = load float, float* %3
ret float %18
}

LLVM IR (-O2):
%struct.Keyword = type opaque
define float @ftgetr4(i8* %0, %struct.Keyword* %1) {
%3 = alloca [30 x i8]
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, %struct.Keyword*, i8*, i32, ...) bitcast (i32 (...)* @ftgetc to i32 (i8*, %struct.Keyword*, i8*, i32, ...)*)(i8* %0, %struct.Keyword* %1, i8* %4, i32 30)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @atof to i32 (i8*, ...)*)(i8* %4)
%9 = sitofp i32 %8 to float
br label %10
10: ; preds = %2, %7
%11 = phi float [ %9, %7 ], [ 0.000000e+00, %2 ]
ret float %11
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t u32_min(uint32_t x, uint32_t y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<u32_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <u32_min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <u32_min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u32_min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @u32_min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
__attribute__((visibility("default"))) void tls_clobber(void) {}


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

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

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

LLVM IR (-O2):
define void @tls_clobber() {
ret void
}
void FromFileStep(double *data, unsigned long buf_len, unsigned char ch,
                  unsigned char type) {}


x86 assembly (clang, -O0):
<FromFileStep>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @FromFileStep(double* nocapture %0, i64 %1, i8 zeroext %2, i8 zeroext %3) {
ret void
}
void cleancache(char *cache, int cache_size) {
  int i;
  for (i = 0; i < cache_size; i++)
    cache[i] = '\0';
}


x86 assembly (clang, -O0):
<cleancache>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <cleancache+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <cleancache+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleancache>:
test   %esi,%esi
jle    1122 <cleancache+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @cleancache(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
void schedule_timeout(signed long timeout) {
  switch (timeout) {
  case ((long)(~0UL >> 1)):
    break;
  }
}


x86 assembly (clang, -O0):
<schedule_timeout>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
sub    %rcx,%rax
jne    1129 <schedule_timeout+0x29>
jmp    1124 <schedule_timeout+0x24>
jmp    1129 <schedule_timeout+0x29>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @schedule_timeout(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
switch i64 %3, label %5 [
i64 9223372036854775807, label %4
]
4: ; preds = %1
br label %5
5: ; preds = %1, %4
ret void
}

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

/* Type definitions */
struct TYPE_2__ {
  int class;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
void set_XWindowAttributes_class(void *_p, int _v) {
  ((XWindowAttributes *)_p)->class = (int)_v;
}


x86 assembly (clang, -O0):
<set_XWindowAttributes_class>:
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_XWindowAttributes_class>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XWindowAttributes_class(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_XWindowAttributes_class(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
bool isPowerOfThree4(int n) { return n > 0 && 1162261467 % n == 0; }


x86 assembly (clang, -O0):
<isPowerOfThree4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1128 <isPowerOfThree4+0x28>
mov    $0x4546b3db,%eax
cltd
idivl  -0x4(%rbp)
cmp    $0x0,%edx
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOfThree4>:
test   %edi,%edi
jle    1115 <isPowerOfThree4+0x15>
mov    $0x4546b3db,%eax
xor    %edx,%edx
div    %edi
xor    %eax,%eax
test   %edx,%edx
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPowerOfThree4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = srem i32 1162261467, %6
%8 = icmp eq i32 %7, 0
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @isPowerOfThree4(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = urem i32 1162261467, %0
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
long setBit_fun_long(long x, unsigned i) { return x | 1 << i; }


x86 assembly (clang, -O0):
<setBit_fun_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBit_fun_long>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @setBit_fun_long(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = sext i32 %7 to i64
%9 = or i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @setBit_fun_long(i64 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = sext i32 %3 to i64
%5 = or i64 %4, %0
ret i64 %5
}
__attribute__((always_)) void pci_restore_iov_state(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_restore_iov_state(%struct.pci_dev* nocapture %0) {
ret void
}
int callee(x)
int x;
{
  int y = x * x;
  return (y - 2);
}


x86 assembly (clang, -O0):
<callee>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<callee>:
imul   %edi,%edi
lea    -0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @callee(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = add nsw i32 %2, -2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void square() {
  printf("___________\n");
  printf("|          |\n");
  printf("|          |\n");
  printf("|          |\n");
  printf("|          |\n");
  printf("|__________|\n");
}


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

x86 assembly (clang, -O2):
<square>:
push   %rbx
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xece(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"___________\0A\00"
@.str.1 = [14 x i8] c"| |\0A\00"
@.str.2 = [14 x i8] c"|__________|\0A\00"
define void @square() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"___________\00"
@str.6 = [13 x i8] c"| |\00"
@str.7 = [13 x i8] c"|__________|\00"
define void @square() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.6, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.6, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.7, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rtas_vend_errlog_scn {
  int dummy;
};
struct rtas_event {
  int dummy;
};

/* Variables and functions */
scalar_t__ get_re_scn(struct rtas_event *, int);
struct rtas_vend_errlog_scn *rtas_get_vend_errlog_scn(struct rtas_event *re) {
  return (struct rtas_vend_errlog_scn *)get_re_scn(re, 10);
}


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

x86 assembly (clang, -O2):
<rtas_get_vend_errlog_scn>:
mov    $0xa,%esi
jmp    1030 <get_re_scn@plt>

LLVM IR (-O0):
%struct.rtas_vend_errlog_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_vend_errlog_scn* @rtas_get_vend_errlog_scn(%struct.rtas_event* %0) {
%2 = alloca %struct.rtas_event*
store %struct.rtas_event* %0, %struct.rtas_event** %2
%3 = load %struct.rtas_event*, %struct.rtas_event** %2
%4 = call i64 @get_re_scn(%struct.rtas_event* %3, i32 10)
%5 = inttoptr i64 %4 to %struct.rtas_vend_errlog_scn*
ret %struct.rtas_vend_errlog_scn* %5
}

LLVM IR (-O2):
%struct.rtas_vend_errlog_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_vend_errlog_scn* @rtas_get_vend_errlog_scn(%struct.rtas_event* %0) {
%2 = tail call i64 @get_re_scn(%struct.rtas_event* %0, i32 10)
%3 = inttoptr i64 %2 to %struct.rtas_vend_errlog_scn*
ret %struct.rtas_vend_errlog_scn* %3
}
/* Variables and functions */
double pow(double, double);
double i1(double x) { return pow(x + 1, 1.0 / 3); }


x86 assembly (clang, -O0):
<i1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i1>:
addsd  0xee8(%rip),%xmm0
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @i1(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = tail call double @pow(double %2, double 0x3FD5555555555555)
ret double %3
}
int test_imm_15uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x15 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_15uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1376256
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void INT_Excep_RIIC2_TEI2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RIIC2_TEI2() {
ret void
}
int test_imm_DCuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xDC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DCuint64_highword_reg>:
movabs $0xdc00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DCuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 944892805120
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double sin_func(x)
double x;
{ return -1.0 - (7.0 / 60.0) * x * x - (31.0 / 2520.0) * x * x * x * x; }


x86 assembly (clang, -O0):
<sin_func>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeff(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xeb6(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin_func>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
movsd  0xef0(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @sin_func(double %0) {
%2 = fmul double %0, 0xBFBDDDDDDDDDDDDE
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double -1.000000e+00)
%4 = fmul double %0, 0xBF89319319319319
%5 = fmul double %4, %0
%6 = fmul double %5, %0
%7 = tail call double @llvm.fmuladd.f64(double %6, double %0, double %3)
ret double %7
}
void rtl_memset(void *mem, char ch, int len) {
  int i;
  char *p = (char *)mem;
  for (i = 0; i < len; i++) {
    *p = ch;
    p++;
  }
}


x86 assembly (clang, -O0):
<rtl_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    114f <rtl_memset+0x4f>
mov    -0x9(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1120 <rtl_memset+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl_memset>:
test   %edx,%edx
jle    1124 <rtl_memset+0x14>
push   %rax
mov    %edx,%edx
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @rtl_memset(i8* %0, i8 signext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
store i8* %9, i8** %8
store i32 0, i32* %7
br label %10
10: ; preds = %19, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = load i8, i8* %5
%16 = load i8*, i8** %8
store i8 %15, i8* %16
%17 = load i8*, i8** %8
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %8
br label %19
19: ; preds = %14
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
store i32 %21, i32* %7
br label %10
22: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @rtl_memset(i8* nocapture writeonly %0, i8 signext %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret void
}