xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: rmdir [-pv] directory ...\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"usage: rmdir [-pv] directory ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"usage: rmdir [-pv] directory ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void mouse_hold_at(int _x, int _y, int _button) {}


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

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

LLVM IR (-O0):
define void @mouse_hold_at(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @mouse_hold_at(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
char *easy_printf_helper(char const *, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ write_message(char *, char *);
void write_error_var_helper(const char *message, size_t size, va_list va) {
  char *msg = easy_printf_helper(message, size, va);
  write_message(msg, "[ERROR]");
  free(msg);
}


x86 assembly (clang, -O0):
<write_error_var_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <easy_printf_helper@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe9e(%rip),%rsi
call   1050 <write_message@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_error_var_helper>:
push   %rbx
call   1040 <easy_printf_helper@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rsi
mov    %rax,%rdi
call   1050 <write_message@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"[ERROR]\00"
define void @write_error_var_helper(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = load i32, i32* %6
%11 = call i8* @easy_printf_helper(i8* %8, i64 %9, i32 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = call i32 @write_message(i8* %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %7
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"[ERROR]\00"
define void @write_error_var_helper(i8* %0, i64 %1, i32 %2) {
%4 = tail call i8* @easy_printf_helper(i8* %0, i64 %1, i32 %2)
%5 = tail call i32 @write_message(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @free(i8* %4)
ret void
}
int test_imm_BAint8_mem(signed char *val) {
  return ((*val) & (-0xBA << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BAint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff46,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BAint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -186
%7 = icmp ne i32 %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_BAint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -186
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
void event_specific(package, s) char *package, *s;
{}


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

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

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

LLVM IR (-O2):
define void @event_specific(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_avg_xy_mmx(int, int, int /*<<< orphan*/ *,
                                 int /*<<< orphan*/ const *, int);
void MC_avg_xy_8_mmx(uint8_t *dest, const uint8_t *ref, int stride,
                     int height) {
  MC_avg_xy_mmx(8, height, dest, ref, stride);
}


x86 assembly (clang, -O0):
<MC_avg_xy_8_mmx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    $0x8,%edi
call   1030 <MC_avg_xy_mmx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_avg_xy_8_mmx>:
mov    %edx,%r8d
mov    %rsi,%rax
mov    %rdi,%rdx
mov    $0x8,%edi
mov    %ecx,%esi
mov    %rax,%rcx
jmp    1030 <MC_avg_xy_mmx@plt>

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

LLVM IR (-O2):
define void @MC_avg_xy_8_mmx(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_avg_xy_mmx(i32 8, i32 %3, i32* %0, i32* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Cmd_Argv(int);
int /*<<< orphan*/ LoadTheGame(int /*<<< orphan*/);
void Load_f(void) { LoadTheGame(Cmd_Argv(1)); }


x86 assembly (clang, -O0):
<Load_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <Cmd_Argv@plt>
mov    %eax,%edi
call   1030 <LoadTheGame@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Load_f>:
push   %rax
mov    $0x1,%edi
call   1040 <Cmd_Argv@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <LoadTheGame@plt>

LLVM IR (-O0):
define void @Load_f() {
%1 = call i32 @Cmd_Argv(i32 1)
%2 = call i32 @LoadTheGame(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Load_f() {
%1 = tail call i32 @Cmd_Argv(i32 1)
%2 = tail call i32 @LoadTheGame(i32 %1)
ret void
}
void foo717() {}


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

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

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

LLVM IR (-O2):
define void @foo717() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ _Exit(int);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void abort(void) {
  raise(SIGABRT);
  _Exit(1);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
mov    $0x1,%edi
call   1040 <_Exit@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
mov    $0x1,%edi
call   1040 <_Exit@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
define void @abort() {
%1 = load i32, i32* @SIGABRT
%2 = call i32 @raise(i32 %1)
%3 = call i32 @_Exit(i32 1)
unreachable
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define void @abort() {
%1 = load i32, i32* @SIGABRT
%2 = tail call i32 @raise(i32 %1)
%3 = tail call i32 @_Exit(i32 1)
unreachable
}
/* Variables and functions */
double SE_slope(double *, double *, int, double, double);
double qt(double, int);
double CI_slope(double *x, double *y, int n, double slope, double intercept,
                double prob) {
  return SE_slope(x, y, n, slope, intercept) * qt(prob, n - 2);
}


x86 assembly (clang, -O0):
<CI_slope>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <SE_slope@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x14(%rbp),%edi
sub    $0x2,%edi
call   1040 <qt@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CI_slope>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm2,0x8(%rsp)
mov    %edx,%ebx
call   1030 <SE_slope@plt>
movsd  %xmm0,(%rsp)
add    $0xfffffffe,%ebx
movsd  0x8(%rsp),%xmm0
mov    %ebx,%edi
call   1040 <qt@plt>
mulsd  (%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @CI_slope(double* %0, double* %1, i32 %2, double %3, double %4, double %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double* %0, double** %7
store double* %1, double** %8
store i32 %2, i32* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double*, double** %7
%14 = load double*, double** %8
%15 = load i32, i32* %9
%16 = load double, double* %10
%17 = load double, double* %11
%18 = call double @SE_slope(double* %13, double* %14, i32 %15, double %16, double %17)
%19 = load double, double* %12
%20 = load i32, i32* %9
%21 = sub nsw i32 %20, 2
%22 = call double @qt(double %19, i32 %21)
%23 = fmul double %18, %22
ret double %23
}

LLVM IR (-O2):
define double @CI_slope(double* %0, double* %1, i32 %2, double %3, double %4, double %5) {
%7 = tail call double @SE_slope(double* %0, double* %1, i32 %2, double %3, double %4)
%8 = add nsw i32 %2, -2
%9 = tail call double @qt(double %5, i32 %8)
%10 = fmul double %7, %9
ret double %10
}
int conditional(int x, int y, int z) {
  int ans = ((((!!x) << 31) >> 31) & y) + ((((!x) << 31) >> 31) & z);
  return ans;
}


x86 assembly (clang, -O0):
<conditional>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
shl    $0x1f,%eax
sar    $0x1f,%eax
and    -0x8(%rbp),%eax
cmpl   $0x0,-0x4(%rbp)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
shl    $0x1f,%ecx
sar    $0x1f,%ecx
and    -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<conditional>:
mov    %esi,%eax
test   %edi,%edi
cmove  %edx,%eax
ret

LLVM IR (-O0):
define i32 @conditional(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = shl i32 %12, 31
%14 = ashr i32 %13, 31
%15 = load i32, i32* %5
%16 = and i32 %14, %15
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 0
%19 = xor i1 %18, true
%20 = zext i1 %19 to i32
%21 = shl i32 %20, 31
%22 = ashr i32 %21, 31
%23 = load i32, i32* %6
%24 = and i32 %22, %23
%25 = add nsw i32 %16, %24
store i32 %25, i32* %7
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @conditional(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 %2, i32 %1
ret i32 %5
}
unsigned long gu2_get_max_supported_pixel_clock(void) { return 229500; }


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

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

LLVM IR (-O0):
define i64 @gu2_get_max_supported_pixel_clock() {
ret i64 229500
}

LLVM IR (-O2):
define i64 @gu2_get_max_supported_pixel_clock() {
ret i64 229500
}
long long int longlongint_ignoring_signedchar(long long int x, signed char y) {
  return x;
}


x86 assembly (clang, -O0):
<longlongint_ignoring_signedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<longlongint_ignoring_signedchar>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @longlongint_ignoring_signedchar(i64 %0, i8 signext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @longlongint_ignoring_signedchar(i64 returned %0, i8 signext %1) {
ret i64 %0
}
void addvv(double *result, const double *s1) {
  result[0] += s1[0];
  result[1] += s1[1];
  result[2] += s1[2];
}


x86 assembly (clang, -O0):
<addvv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<addvv>:
movsd  (%rsi),%xmm0
addsd  (%rdi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
addsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
addsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @addvv(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fadd double %10, %7
store double %11, double* %9
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fadd double %17, %14
store double %18, double* %16
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %3
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = fadd double %24, %21
store double %25, double* %23
ret void
}

LLVM IR (-O2):
define void @addvv(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = fadd double %3, %4
store double %5, double* %0
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = fadd double %7, %9
store double %10, double* %8
%11 = getelementptr inbounds double, double* %1, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = fadd double %12, %14
store double %15, double* %13
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ validate_fit(size_t, int);
size_t arena_size(size_t chunk_area, uint32_t m_cost) {
  assert(validate_fit(chunk_area, m_cost) == 0);
  return (size_t)chunk_area << (m_cost + 4);
}


x86 assembly (clang, -O0):
<arena_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <validate_fit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x4,%ecx
mov    %ecx,%ecx
shl    %cl,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arena_size>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1040 <validate_fit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
add    $0x4,%bl
mov    %ebx,%ecx
shl    %cl,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @arena_size(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 = call i64 @validate_fit(i64 %5, i32 %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i64, i64* %3
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 4
%14 = zext i32 %13 to i64
%15 = shl i64 %11, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @arena_size(i64 %0, i32 %1) {
%3 = tail call i64 @validate_fit(i64 %0, i32 %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = add nsw i32 %1, 4
%8 = zext i32 %7 to i64
%9 = shl i64 %0, %8
ret i64 %9
}
int wordsize(int n) {
  return (n % sizeof(unsigned int)) == 0 ? n / sizeof(int)
                                         : n / sizeof(int) + 1;
}


x86 assembly (clang, -O0):
<wordsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
and    $0x3,%rax
cmp    $0x0,%rax
jne    112a <wordsize+0x2a>
movslq -0x4(%rbp),%rax
shr    $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    113a <wordsize+0x3a>
movslq -0x4(%rbp),%rax
shr    $0x2,%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wordsize>:
movslq %edi,%rax
mov    %eax,%ecx
and    $0x3,%ecx
shr    $0x2,%rax
cmp    $0x1,%rcx
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @wordsize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = urem i64 %4, 4
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = udiv i64 %9, 4
br label %16
11: ; preds = %1
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = udiv i64 %13, 4
%15 = add i64 %14, 1
br label %16
16: ; preds = %11, %7
%17 = phi i64 [ %10, %7 ], [ %15, %11 ]
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @wordsize(i32 %0) {
%2 = sext i32 %0 to i64
%3 = and i64 %2, 3
%4 = icmp ne i64 %3, 0
%5 = lshr i64 %2, 2
%6 = zext i1 %4 to i64
%7 = add nuw nsw i64 %5, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ _IO(char, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
void hapara_timer_start() {
  int fd;
  fd = open("/dev/hapara_trace", O_RDWR);
  if (fd == -1)
    return;
  ioctl(fd, _IO('t', 8));
  close(fd);
}


x86 assembly (clang, -O0):
<hapara_timer_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
lea    0xea8(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    116f <hapara_timer_start+0x2f>
jmp    1196 <hapara_timer_start+0x56>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x74,%edi
mov    $0x8,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hapara_timer_start>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    0xeaf(%rip),%rdi
call   1060 <open@plt>
cmp    $0xffffffff,%eax
je     117d <hapara_timer_start+0x3d>
mov    %eax,%ebx
mov    $0x74,%edi
mov    $0x8,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <close@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/dev/hapara_trace\00"
@O_RDWR = global i32 0
define void @hapara_timer_start() {
%1 = alloca i32
%2 = load i32, i32* @O_RDWR
%3 = call i32 @open(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %0
br label %13
7: ; preds = %0
%8 = load i32, i32* %1
%9 = call i32 @_IO(i8 signext 116, i32 8)
%10 = call i32 @ioctl(i32 %8, i32 %9)
%11 = load i32, i32* %1
%12 = call i32 @close(i32 %11)
br label %13
13: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"/dev/hapara_trace\00"
@O_RDWR = global i32 0
define void @hapara_timer_start() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %2, -1
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = tail call i32 @_IO(i8 signext 116, i32 8)
%6 = tail call i32 @ioctl(i32 %2, i32 %5)
%7 = tail call i32 @close(i32 %2)
br label %8
8: ; preds = %0, %4
ret void
}
/* Variables and functions */
scalar_t__ main_parallel(int, int /*<<< orphan*/);
scalar_t__ main_serial(int, int /*<<< orphan*/);
int main(void) {
  if (main_serial(1, 0) != main_parallel(1, 0))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <main_serial@plt>
mov    %rax,-0x10(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <main_parallel@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     1167 <main+0x47>
movl   $0x1,-0x4(%rbp)
jmp    116e <main+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @main_serial(i32 1, i32 0)
%3 = call i64 @main_parallel(i32 1, i32 0)
%4 = icmp ne i64 %2, %3
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @main_serial(i32 1, i32 0)
%2 = tail call i64 @main_parallel(i32 1, i32 0)
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
ret i32 %4
}
void zlRotatez(signed long z) {}


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

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

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

LLVM IR (-O2):
define void @zlRotatez(i64 %0) {
ret void
}
void ILO_Trim_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @ILO_Trim_RestoreConfig() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *page_alloc(size_t page_size) { return malloc(page_size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @page_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
f(const int x) {
  int y = 0;
  y = x ? y : -y;
  { const int *p = &x; }
  return y;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1123 <f+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112b <f+0x2b>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 0
}
const char *separator(const char *separator) { return separator; }


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

x86 assembly (clang, -O2):
<separator>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @separator(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int __detect_PLATFORM_ENV_TOOLCHAIN_DETAIL() {
  printf("TT_ENV_TOOLCHAIN_GNU");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"TT_ENV_TOOLCHAIN_GNU\00"
define i32 @__detect_PLATFORM_ENV_TOOLCHAIN_DETAIL() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"TT_ENV_TOOLCHAIN_GNU\00"
define i32 @__detect_PLATFORM_ENV_TOOLCHAIN_DETAIL() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
int /*<<< orphan*/ my_memcpy(void *, void *, int);
void *my_realloc(void *ptr, int new_size, int old_size) {
  void *new_ptr;
  if (!(new_ptr = malloc(new_size)))
    return (ptr);
  my_memcpy(new_ptr, ptr, old_size);
  free(ptr);
  return (new_ptr);
}


x86 assembly (clang, -O0):
<my_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1165 <my_realloc+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1186 <my_realloc+0x56>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1050 <my_memcpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_realloc>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rdi,%rbp
mov    %esi,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1162 <my_realloc+0x32>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
call   1050 <my_memcpy@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rbp
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @my_realloc(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %6
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %8
%11 = icmp ne i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %3
%13 = load i8*, i8** %5
store i8* %13, i8** %4
br label %22
14: ; preds = %3
%15 = load i8*, i8** %8
%16 = load i8*, i8** %5
%17 = load i32, i32* %7
%18 = call i32 @my_memcpy(i8* %15, i8* %16, i32 %17)
%19 = load i8*, i8** %5
%20 = call i32 @free(i8* %19)
%21 = load i8*, i8** %8
store i8* %21, i8** %4
br label %22
22: ; preds = %14, %12
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
define i8* @my_realloc(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @malloc(i32 %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @my_memcpy(i8* %4, i8* %0, i32 %2)
%8 = tail call i32 @free(i8* %0)
br label %9
9: ; preds = %3, %6
%10 = phi i8* [ %4, %6 ], [ %0, %3 ]
ret i8* %10
}
/* Variables and functions */
int fac(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, f;
  printf("Enter a positive integer: ");
  scanf("%d", &n);
  f = fac(n);
  printf("Fac=%d", f);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <fac@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@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   1040 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <fac@plt>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Enter a positive integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"Fac=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%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* %1)
%5 = load i32, i32* %1
%6 = call i32 @fac(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Enter a positive integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"Fac=%d\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 @fac(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
void appendChar(char *s, char c) {
  int len = strlen(s);
  s[len] = c;
  s[len + 1] = '\0';
}


x86 assembly (clang, -O0):
<appendChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appendChar>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @appendChar(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %1, i8* %5
%6 = add nsw i32 %3, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
ret void
}
char *basic_strip(s)
char *s;
{
  return ((char *)strpbrk(
      s, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"));
}


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

x86 assembly (clang, -O2):
<basic_strip>:
lea    0xee9(%rip),%rsi
jmp    1030 <strpbrk@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\00"
define i8* @basic_strip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strpbrk(i8* %3, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [63 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\00"
define i8* @basic_strip(i8* %0) {
%2 = tail call i8* @strpbrk(i8* %0, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
unsigned long GetRGB92(unsigned char, unsigned char, unsigned char);
unsigned long getrgb(unsigned char r, unsigned char g, unsigned char b) {
  return GetRGB92(r, g, b);
}


x86 assembly (clang, -O0):
<getrgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x2(%rbp),%al
movzbl %cl,%edi
movzbl %al,%esi
movzbl -0x3(%rbp),%edx
call   1030 <GetRGB92@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrgb>:
jmp    1030 <GetRGB92@plt>

LLVM IR (-O0):
define i64 @getrgb(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = load i8, i8* %5
%9 = load i8, i8* %6
%10 = call i64 @GetRGB92(i8 zeroext %7, i8 zeroext %8, i8 zeroext %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @getrgb(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call i64 @GetRGB92(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2)
ret i64 %4
}
void printDevAttr(struct ibv_device_attr *attr) {
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
}


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

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

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

LLVM IR (-O2):
%struct.ibv_device_attr = type opaque
define void @printDevAttr(%struct.ibv_device_attr* nocapture %0) {
ret void
}
/* Variables and functions */
double pow(double, int);
double sin(double);
double g_function(double x) { return pow(x, 2) * sin(x); }


x86 assembly (clang, -O0):
<g_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_function>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @g_function(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, i32 2)
%5 = load double, double* %2
%6 = call double @sin(double %5)
%7 = fmul double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @g_function(double %0) {
%2 = tail call double @pow(double %0, i32 2)
%3 = tail call double @sin(double %0)
%4 = fmul double %2, %3
ret double %4
}
void foo283() {}


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

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

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

LLVM IR (-O2):
define void @foo283() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int summultiples(int);
int main() {
  printf("%d\n", summultiples(3) + summultiples(5) - summultiples(15));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
call   1030 <summultiples@plt>
mov    %eax,%ebx
mov    $0x5,%edi
call   1030 <summultiples@plt>
add    %eax,%ebx
mov    $0xf,%edi
call   1030 <summultiples@plt>
sub    %eax,%ebx
lea    0xeb4(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @summultiples(i32 3)
%3 = call i32 @summultiples(i32 5)
%4 = add nsw i32 %2, %3
%5 = call i32 @summultiples(i32 15)
%6 = sub nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @summultiples(i32 3)
%2 = tail call i32 @summultiples(i32 5)
%3 = add nsw i32 %2, %1
%4 = tail call i32 @summultiples(i32 15)
%5 = sub i32 %3, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
bool is_comment(char *line) { return line[0] == '#'; }


x86 assembly (clang, -O0):
<is_comment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_comment(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, 35
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_comment(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 35
%4 = zext i1 %3 to i32
ret i32 %4
}
void tester(void) {}


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

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

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

LLVM IR (-O2):
define void @tester() {
ret void
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
struct hostent *coroutine_gethostbyname(char const *);
int /*<<< orphan*/ coroutine_self();
struct hostent *g_sys_gethostbyname(char const *);
int /*<<< orphan*/ is_enable_sys_hook(int /*<<< orphan*/);
struct hostent *gethostbyname(const char *name) {
  if (!is_enable_sys_hook(coroutine_self())) {
    return g_sys_gethostbyname(name);
  }
  return coroutine_gethostbyname(name);
}


x86 assembly (clang, -O0):
<gethostbyname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <coroutine_self@plt>
mov    %eax,%edi
call   1060 <is_enable_sys_hook@plt>
cmp    $0x0,%eax
jne    1175 <gethostbyname+0x35>
mov    -0x10(%rbp),%rdi
call   1050 <g_sys_gethostbyname@plt>
mov    %rax,-0x8(%rbp)
jmp    1182 <gethostbyname+0x42>
mov    -0x10(%rbp),%rdi
call   1030 <coroutine_gethostbyname@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethostbyname>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <coroutine_self@plt>
mov    %eax,%edi
call   1060 <is_enable_sys_hook@plt>
mov    %rbx,%rdi
test   %eax,%eax
je     115f <gethostbyname+0x1f>
pop    %rbx
jmp    1030 <coroutine_gethostbyname@plt>
pop    %rbx
jmp    1050 <g_sys_gethostbyname@plt>

LLVM IR (-O0):
%struct.hostent = type { i32 }
define %struct.hostent* @gethostbyname(i8* %0) {
%2 = alloca %struct.hostent*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @coroutine_self()
%5 = call i32 @is_enable_sys_hook(i32 %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call %struct.hostent* @g_sys_gethostbyname(i8* %8)
store %struct.hostent* %9, %struct.hostent** %2
br label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call %struct.hostent* @coroutine_gethostbyname(i8* %11)
store %struct.hostent* %12, %struct.hostent** %2
br label %13
13: ; preds = %10, %7
%14 = load %struct.hostent*, %struct.hostent** %2
ret %struct.hostent* %14
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
define %struct.hostent* @gethostbyname(i8* %0) {
%2 = tail call i32 (...) @coroutine_self()
%3 = tail call i32 @is_enable_sys_hook(i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call %struct.hostent* @g_sys_gethostbyname(i8* %0)
br label %9
7: ; preds = %1
%8 = tail call %struct.hostent* @coroutine_gethostbyname(i8* %0)
br label %9
9: ; preds = %7, %5
%10 = phi %struct.hostent* [ %8, %7 ], [ %6, %5 ]
ret %struct.hostent* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char);
void funcion2() {
  int dato = 25;
  char num2 = 'z';
  printf("Funcion2, dato=%d, num2=%c\n", dato, num2);
  return;
}


x86 assembly (clang, -O0):
<funcion2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x19,-0x4(%rbp)
movb   $0x7a,-0x5(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed3(%rip),%rdi
movsbl -0x5(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcion2>:
lea    0xee9(%rip),%rdi
mov    $0x19,%esi
mov    $0x7a,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Funcion2, dato=%d, num2=%c\0A\00"
define void @funcion2() {
%1 = alloca i32
%2 = alloca i8
store i32 25, i32* %1
store i8 122, i8* %2
%3 = load i32, i32* %1
%4 = load i8, i8* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3, i8 signext %4)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Funcion2, dato=%d, num2=%c\0A\00"
define void @funcion2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 25, i8 signext 122)
ret void
}
void Counter_4_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @Counter_4_SaveConfig() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int ip_read16(const uint8_t *src) {
  return ((int)src[1]) | (((int)src[0]) << 8);
}


x86 assembly (clang, -O0):
<ip_read16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_read16>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ip_read16(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i64*, i64** %2
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ip_read16(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 1
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = load i64, i64* %0
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %4
ret i32 %8
}
int test_imm_72uint16_reg(unsigned short val) {
  return ((val) & (-0x72 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_72uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff8e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_72uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -114
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void I2CMasterBurstLengthSet(uint32_t ui32Base, uint8_t ui8Length) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000030))) = ui8Length;
}


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

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

LLVM IR (-O0):
define void @I2CMasterBurstLengthSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 48
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CMasterBurstLengthSet(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 48
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void multiplicar(int a, int b) { printf("La multiplicación es: %d", a * b); }


x86 assembly (clang, -O0):
<multiplicar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiplicar>:
imul   %edi,%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"La multiplicaci\C3\B3n es: %d\00"
define void @multiplicar(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
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"La multiplicaci\C3\B3n es: %d\00"
define void @multiplicar(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}