xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  char string[30] = "How_are_you";
  char *p = &string[0], *p2 = string + 8;
  printf("%s,%s\n", p, p2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed9(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xed3(%rip),%ax
mov    %ax,-0x4(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xef3(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x8(%rsp),%rdx
lea    0xee7(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.string = [30 x i8] c"How_are_you\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [7 x i8] c"%s,%s\0A\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = alloca i8*
%3 = alloca i8*
%4 = bitcast [30 x i8]* %1 to i8*
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
store i8* %5, i8** %2
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds i8, i8* %6, i64 8
store i8* %7, i8** %3
%8 = load i8*, i8** %2
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.string = [30 x i8] c"How_are_you\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [7 x i8] c"%s,%s\0A\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 8
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float cena;
  printf("Vnesete ja cenata na proizvodot: ");
  scanf("%f", &cena);
  printf("Vkupnata cena na proizvodot e %.2f\n", cena * 1.18);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea2(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xec4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeae(%rip),%xmm0
lea    0xed4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Vnesete ja cenata na proizvodot: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [36 x i8] c"Vkupnata cena na proizvodot e %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 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), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fmul double %6, 1.180000e+00
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Vnesete ja cenata na proizvodot: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [36 x i8] c"Vkupnata cena na proizvodot e %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 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), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fmul double %6, 1.180000e+00
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
void ADC_SAR_Seq_1_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @ADC_SAR_Seq_1_SaveConfig() {
ret void
}
char *genend(char *end) {
  end[0] = '#';
  end[1] = 'e';
  end[2] = 'n';
  end[3] = 'd';
  end[3] = '\0';
}


x86 assembly (clang, -O0):
<genend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x23,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x65,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x6e,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0x64,0x3(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x3(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<genend>:
movl   $0x6e6523,(%rdi)
ret

LLVM IR (-O0):
define i8* @genend(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
store i8 35, i8* %5
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8 101, i8* %7
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 2
store i8 110, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 3
store i8 100, i8* %11
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 3
store i8 0, i8* %13
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @genend(i8* nocapture writeonly %0) {
store i8 35, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 101, i8* %2
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 110, i8* %3
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 0, i8* %4
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ Msp430UsartShareP__0__RawI2CInterrupts__fired();
void HplMsp430Usart0P__I2CInterrupts__fired(void) {
  Msp430UsartShareP__0__RawI2CInterrupts__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplMsp430Usart0P__I2CInterrupts__fired() {
%1 = tail call i32 (...) @Msp430UsartShareP__0__RawI2CInterrupts__fired()
ret void
}
/* Variables and functions */
int gettid();
int /*<<< orphan*/ printf(char *, unsigned int, int);
void *thread2_func(void *arg) {
  printf("thread 2 (arg=%d tid=%d) entered.\n", (unsigned)arg, gettid());
  return 1;
}


x86 assembly (clang, -O0):
<thread2_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <gettid@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread2_func>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <gettid@plt>
lea    0xece(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"thread 2 (arg=%d tid=%d) entered.\0A\00"
define i8* @thread2_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = call i32 (...) @gettid()
%6 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
@.str = [35 x i8] c"thread 2 (arg=%d tid=%d) entered.\0A\00"
define i8* @thread2_func(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 (...) @gettid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ jumpnrun_show_message(char *);
void jumpnrun_show_game_over(void) {
  char msg[] = "GAME OVER";
  jumpnrun_show_message(msg);
}


x86 assembly (clang, -O0):
<jumpnrun_show_game_over>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xa(%rbp)
mov    0xede(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0xa(%rbp),%rdi
call   1030 <jumpnrun_show_message@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jumpnrun_show_game_over>:
sub    $0x18,%rsp
movabs $0x45564f20454d4147,%rax
4f 56 45
mov    %rax,0x8(%rsp)
movw   $0x52,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <jumpnrun_show_message@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.jumpnrun_show_game_over.msg = [10 x i8] c"GAME OVER\00"
define void @jumpnrun_show_game_over() {
%1 = alloca [10 x i8]
%2 = bitcast [10 x i8]* %1 to i8*
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 @jumpnrun_show_message(i8* %3)
ret void
}

LLVM IR (-O2):
@__const.jumpnrun_show_game_over.msg = [10 x i8] c"GAME OVER\00"
define void @jumpnrun_show_game_over() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @jumpnrun_show_message(i8* %2)
ret void
}
void vadd(const float *src1, const float *src2, float *dst) {
  dst[0] = src1[0] + src2[0];
  dst[1] = src1[1] + src2[1];
  dst[2] = src1[2] + src2[2];
}


x86 assembly (clang, -O0):
<vadd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vadd>:
movss  (%rdi),%xmm0
addss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
movss  0x4(%rdi),%xmm0
addss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdx)
movss  0x8(%rdi),%xmm0
addss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @vadd(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fadd float %9, %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fadd float %18, %21
%23 = load float*, float** %6
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %4
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %5
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fadd float %27, %30
%32 = load float*, float** %6
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @vadd(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fadd float %4, %5
store float %6, float* %2
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %2, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 2
%16 = load float, float* %15
%17 = fadd float %14, %16
%18 = getelementptr inbounds float, float* %2, i64 2
store float %17, float* %18
ret void
}
int ld_gt_mr2(long double *a1, long double a2) { return !(((*a1) > (a2))); }


x86 assembly (clang, -O0):
<ld_gt_mr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_gt_mr2>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setbe  %al
ret

LLVM IR (-O0):
define i32 @ld_gt_mr2(x86_fp80* %0, x86_fp80 %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80, x86_fp80* %4
%8 = fcmp ogt x86_fp80 %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ld_gt_mr2(x86_fp80* nocapture %0, x86_fp80 %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = fcmp ule x86_fp80 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
void __attribute__((__no__)) test(double d1, float f1) {}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test(double %0, float %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_plot() { exit(1); }


x86 assembly (clang, -O0):
<caml_gr_plot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_gr_plot>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_gr_plot() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_plot() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int _fread_u16(uint16_t *u16, FILE *fp) { return fread(u16, 1, 2, fp); }


x86 assembly (clang, -O0):
<_fread_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fread_u16>:
mov    %rsi,%rcx
mov    $0x1,%esi
mov    $0x2,%edx
jmp    1030 <fread@plt>

LLVM IR (-O0):
define i32 @_fread_u16(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 i32 @fread(i32* %5, i32 1, i32 2, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @_fread_u16(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fread(i32* %0, i32 1, i32 2, i32* %1)
ret i32 %3
}
/* Variables and functions */
int get_eflags();
int /*<<< orphan*/ set_eflags(int);
extern int compare_and_swap_is_available(void) {
  int oldflags = get_eflags();
  int changed;
  set_eflags(oldflags ^ 0x40000);
  changed = (get_eflags() ^ oldflags) & 0x40000;
  set_eflags(oldflags);
  return changed != 0;
}


x86 assembly (clang, -O0):
<compare_and_swap_is_available>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_eflags@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    $0x40000,%edi
call   1030 <set_eflags@plt>
mov    $0x0,%al
call   1040 <get_eflags@plt>
xor    -0x4(%rbp),%eax
and    $0x40000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <set_eflags@plt>
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_and_swap_is_available>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <get_eflags@plt>
mov    %eax,%ebx
mov    %eax,%edi
xor    $0x40000,%edi
call   1030 <set_eflags@plt>
xor    %eax,%eax
call   1040 <get_eflags@plt>
mov    %eax,%ebp
xor    %ebx,%ebp
mov    %ebx,%edi
call   1030 <set_eflags@plt>
shr    $0x12,%ebp
and    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @compare_and_swap_is_available() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @get_eflags()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = xor i32 %4, 262144
%6 = call i32 @set_eflags(i32 %5)
%7 = call i32 (...) @get_eflags()
%8 = load i32, i32* %1
%9 = xor i32 %7, %8
%10 = and i32 %9, 262144
store i32 %10, i32* %2
%11 = load i32, i32* %1
%12 = call i32 @set_eflags(i32 %11)
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare_and_swap_is_available() {
%1 = tail call i32 (...) @get_eflags()
%2 = xor i32 %1, 262144
%3 = tail call i32 @set_eflags(i32 %2)
%4 = tail call i32 (...) @get_eflags()
%5 = xor i32 %4, %1
%6 = tail call i32 @set_eflags(i32 %1)
%7 = lshr i32 %5, 18
%8 = and i32 %7, 1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void errline(char *s) {
  fprintf(stderr, s);
  fprintf(stderr, "\n");
  return;
}


x86 assembly (clang, -O0):
<errline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errline>:
push   %rbx
mov    %rdi,%rsi
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed5(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @errline(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @errline(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
off_t nq_get_file_length(char *path) {
  struct stat st_buf;
  if (stat(path, &st_buf) < 0) {
    do {
    } while (0);
    return (off_t)-1;
  }
  return st_buf.st_size;
}


x86 assembly (clang, -O0):
<nq_get_file_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    1149 <nq_get_file_length+0x39>
jmp    1138 <nq_get_file_length+0x28>
jmp    113d <nq_get_file_length+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <nq_get_file_length+0x3f>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nq_get_file_length>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     1129 <nq_get_file_length+0x19>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @nq_get_file_length(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
br label %9
9: ; preds = %8
br label %10
10: ; preds = %9
store i32 -1, i32* %2
br label %14
11: ; preds = %1
%12 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%13 = load i32, i32* %12
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @nq_get_file_length(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
float asinf(float);
float futrts_asin32(float x) { return asinf(x); }


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

x86 assembly (clang, -O2):
<futrts_asin32>:
jmp    1030 <asinf@plt>

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

LLVM IR (-O2):
define float @futrts_asin32(float %0) {
%2 = tail call float @asinf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x76() {
  Assert_real((isalnum(118)),
              "/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_isalnum.c",
              595, ("isalnum should be 1 for v"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x76>:
push   %rbp
mov    %rsp,%rbp
mov    $0x76,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x253,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x76>:
push   %rax
mov    $0x76,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x253,%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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for v\00"
define void @t_isalnum_0x76() {
%1 = call i32 @isalnum(i32 118)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 595, i8* getelementptr inbounds ([26 x i8], [26 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for v\00"
define void @t_isalnum_0x76() {
%1 = tail call i32 @isalnum(i32 118)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 595, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void vscan_init(void) {}


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

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

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

LLVM IR (-O2):
define void @vscan_init() {
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
pid_t _fork() {
  assert(0);
  return -1;
}


x86 assembly (clang, -O0):
<_fork>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_fork() {
%1 = tail call i32 @assert(i32 0)
ret i32 -1
}
int valid_char(char test) {
  return ((test >= '0' && test <= '9') || (test >= 'a' || test <= 'f') ||
          (test >= 'A' && test <= 'F') || test == 'x' || test == 'X');
}


x86 assembly (clang, -O0):
<valid_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <valid_char+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    118b <valid_char+0x8b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x61,%ecx
mov    %al,-0x2(%rbp)
jge    118b <valid_char+0x8b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    118b <valid_char+0x8b>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     116c <valid_char+0x6c>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x46,%ecx
mov    %al,-0x2(%rbp)
jle    118b <valid_char+0x8b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x78,%ecx
mov    %al,-0x2(%rbp)
je     118b <valid_char+0x8b>
movsbl -0x1(%rbp),%eax
cmp    $0x58,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @valid_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %34, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %34, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 102
br i1 %17, label %34, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 65
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 70
br i1 %25, label %34, label %26
26: ; preds = %22, %18
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 120
br i1 %29, label %34, label %30
30: ; preds = %26
%31 = load i8, i8* %2
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 88
br label %34
34: ; preds = %30, %26, %22, %14, %10, %6
%35 = phi i1 [ true, %26 ], [ true, %22 ], [ true, %14 ], [ true, %10 ], [ true, %6 ], [ %33, %30 ]
%36 = zext i1 %35 to i32
ret i32 %36
}

LLVM IR (-O2):
define i32 @valid_char(i8 signext %0) {
ret i32 1
}
int test_imm_23uint16_mem(unsigned short *val) {
  return ((*val) & (-0x23 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_23uint16_mem>:
movzwl (%rdi),%eax
test   $0xffdd,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_23uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -35
%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_23uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -35
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ppuSetNameTblHorizontal();
int /*<<< orphan*/ ppuSetNameTblVertical();
void m156setParamsC014(uint16_t addr, uint8_t val) {
  (void)addr;
  if (val & 1)
    ppuSetNameTblHorizontal();
  else
    ppuSetNameTblVertical();
}


x86 assembly (clang, -O0):
<m156setParamsC014>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1149 <m156setParamsC014+0x29>
mov    $0x0,%al
call   1030 <ppuSetNameTblHorizontal@plt>
jmp    1150 <m156setParamsC014+0x30>
mov    $0x0,%al
call   1040 <ppuSetNameTblVertical@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m156setParamsC014>:
xor    %eax,%eax
test   $0x1,%sil
jne    112d <m156setParamsC014+0xd>
jmp    1040 <ppuSetNameTblVertical@plt>
jmp    1030 <ppuSetNameTblHorizontal@plt>

LLVM IR (-O0):
define void @m156setParamsC014(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 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @ppuSetNameTblHorizontal()
br label %13
11: ; preds = %2
%12 = call i32 (...) @ppuSetNameTblVertical()
br label %13
13: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
define void @m156setParamsC014(i32 %0, i32 %1) {
%3 = and i32 %1, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @ppuSetNameTblHorizontal()
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @ppuSetNameTblVertical()
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mission2(int, int /*<<< orphan*/);
int /*<<< orphan*/ moveDist(int, int);
int /*<<< orphan*/ rotate(int);
void mission7() {
  rotate(55);
  moveDist(40, 15);
  mission2(-45, 0);
}


x86 assembly (clang, -O0):
<mission7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x37,%edi
call   1050 <rotate@plt>
mov    $0x28,%edi
mov    $0xf,%esi
call   1030 <moveDist@plt>
mov    $0xffffffd3,%edi
xor    %esi,%esi
call   1040 <mission2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mission7>:
push   %rax
mov    $0x37,%edi
call   1050 <rotate@plt>
mov    $0x28,%edi
mov    $0xf,%esi
call   1030 <moveDist@plt>
mov    $0xffffffd3,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <mission2@plt>

LLVM IR (-O0):
define void @mission7() {
%1 = call i32 @rotate(i32 55)
%2 = call i32 @moveDist(i32 40, i32 15)
%3 = call i32 @mission2(i32 -45, i32 0)
ret void
}

LLVM IR (-O2):
define void @mission7() {
%1 = tail call i32 @rotate(i32 55)
%2 = tail call i32 @moveDist(i32 40, i32 15)
%3 = tail call i32 @mission2(i32 -45, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ gluPerspective(double, double, double, double);
void handleResize(int w, int h) {
  glViewport(0, 0, w, h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(45.0, (double)w / (double)h, 1.0, 200.0);
}


x86 assembly (clang, -O0):
<handleResize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1060 <glViewport@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
cvtsi2sdl -0x4(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe78(%rip),%xmm0
movsd  0xe78(%rip),%xmm2
movsd  0xe78(%rip),%xmm3
call   1040 <gluPerspective@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleResize>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1060 <glViewport@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
cvtsi2sd %ebp,%xmm1
cvtsi2sd %ebx,%xmm0
divsd  %xmm0,%xmm1
movsd  0xe83(%rip),%xmm0
movsd  0xe83(%rip),%xmm2
movsd  0xe83(%rip),%xmm3
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <gluPerspective@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @handleResize(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 i32 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = load i32, i32* @GL_PROJECTION
%9 = call i32 @glMatrixMode(i32 %8)
%10 = call i32 (...) @glLoadIdentity()
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to double
%13 = load i32, i32* %4
%14 = sitofp i32 %13 to double
%15 = fdiv double %12, %14
%16 = call i32 @gluPerspective(double 4.500000e+01, double %15, double 1.000000e+00, double 2.000000e+02)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @handleResize(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
%7 = sitofp i32 %0 to double
%8 = sitofp i32 %1 to double
%9 = fdiv double %7, %8
%10 = tail call i32 @gluPerspective(double 4.500000e+01, double %9, double 1.000000e+00, double 2.000000e+02)
ret void
}
double calcEccentricityEarthOrbit(const double t) {
  return 0.016708634 - t * (0.000042037 + 0.0000001267 * t);
}


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

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

LLVM IR (-O0):
define double @calcEccentricityEarthOrbit(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double 1.267000e-07, double %4, double 4.203700e-05)
%6 = fneg double %3
%7 = call double @llvm.fmuladd.f64(double %6, double %5, double 0x3F911C11725D0380)
ret double %7
}

LLVM IR (-O2):
define double @calcEccentricityEarthOrbit(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 1.267000e-07, double 4.203700e-05)
%3 = fneg double %0
%4 = tail call double @llvm.fmuladd.f64(double %3, double %2, double 0x3F911C11725D0380)
ret double %4
}
extern void *sbrk(unsigned int offset_) {
  return ({
    unsigned int _v;
    __asm__ volatile("mov %1, %%ebx \n"
                     "mov %2, %%eax \n"
                     "int $0x80\n"
                     "mov %%eax, %0 \n"
                     : "=a"(_v)
                     : "b"(offset_), "i"(3)
                     :);
    _v;
  });
}


x86 assembly (clang, -O0):
<sbrk>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%ebx
mov    %ebx,%ebx
mov    $0x3,%eax
int    $0x80
mov    %eax,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbrk>:
push   %rbx
mov    %edi,%ebx
mov    %ebx,%ebx
mov    $0x3,%eax
int    $0x80
mov    %eax,%eax
mov    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @sbrk(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 asm sideeffect "mov $1, %ebx \0Amov $2, %eax \0Aint $$0x80\0Amov %eax, $0 \0A", "={ax},{bx},i,~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 3)
store i32 %6, i32* %3
%7 = load i32, i32* %3
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @sbrk(i32 %0) {
%2 = tail call i32 asm sideeffect "mov $1, %ebx \0Amov $2, %eax \0Aint $$0x80\0Amov %eax, $0 \0A", "={ax},{bx},i,~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 3)
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int numa_get_interleave_node(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @numa_get_interleave_node() {
ret i32 0
}
int isupper(int c) { return ('A' <= c && c <= 'Z') ? c : 0; }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x41,%eax
cmp    -0x4(%rbp),%eax
jg     112a <isupper+0x2a>
cmpl   $0x5a,-0x4(%rbp)
jg     112a <isupper+0x2a>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <isupper+0x34>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <isupper+0x34>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
lea    -0x41(%rdi),%ecx
xor    %eax,%eax
cmp    $0x1a,%ecx
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = select i1 %3, i32 %0, i32 0
ret i32 %4
}
int rundung(double input) {
  int cast = (int)input;
  if (input - cast >= 0.5) {
    return cast + 1;
  } else {
    return cast;
  }
}


x86 assembly (clang, -O0):
<rundung>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xed9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     113f <rundung+0x3f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <rundung+0x45>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rundung>:
cvttsd2si %xmm0,%eax
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
ucomisd 0xee8(%rip),%xmm0
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @rundung(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
%5 = load double, double* %3
%6 = fptosi double %5 to i32
store i32 %6, i32* %4
%7 = load double, double* %3
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fsub double %7, %9
%11 = fcmp oge double %10, 5.000000e-01
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %17
15: ; preds = %1
%16 = load i32, i32* %4
store i32 %16, i32* %2
br label %17
17: ; preds = %15, %12
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @rundung(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fsub double %0, %3
%5 = fcmp oge double %4, 5.000000e-01
%6 = zext i1 %5 to i32
%7 = add nsw i32 %6, %2
ret i32 %7
}
int find_head(int total[]) {
  int j;
  for (j = 200 - 1; total[j] == 0; j--)
    ;
  return j + 1;
}


x86 assembly (clang, -O0):
<find_head>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xc7,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1134 <find_head+0x34>
jmp    1126 <find_head+0x26>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <find_head+0xf>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_head>:
mov    $0xc7,%eax
cs nopw 0x0(%rax,%rax,1)
nop
cmpl   $0x0,(%rdi,%rax,4)
lea    -0x1(%rax),%rax
je     1110 <find_head+0x10>
add    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @find_head(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 199, %1 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
%7 = add i64 %3, -1
br i1 %6, label %2, label %8
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = add nsw i32 %9, 1
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hfp_subevent_ag_indicator_status_changed_get_indicator_status(
    const uint8_t *event) {
  return event[4];
}


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

x86 assembly (clang, -O2):
<hfp_subevent_ag_indicator_status_changed_get_indicator_status>:
mov    0x10(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @hfp_subevent_ag_indicator_status_changed_get_indicator_status(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sdb_print_devices();
int cmd_sdb(const char *args[]) {
  sdb_print_devices();
  return 0;
}


x86 assembly (clang, -O0):
<cmd_sdb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <sdb_print_devices@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cmd_sdb(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 (...) @sdb_print_devices()
ret i32 0
}

LLVM IR (-O2):
define i32 @cmd_sdb(i8** nocapture readnone %0) {
%2 = tail call i32 (...) @sdb_print_devices()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void start_updowncounting(int delay_value) {
  printf("/* DIY : Student has to implement this */\n");
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"/* DIY : Student has to implement this */\0A\00"
define void @start_updowncounting(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c"/* DIY : Student has to implement this */\00"
define void @start_updowncounting(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int fun1();
int main(void) { return fun1(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fun1()
ret i32 %1
}
int test_satMul3(int x) {
  if ((x + x + x) / 3 != x)
    return x < 0 ? 0x80000000 : 0x7FFFFFFF;
  else
    return 3 * x;
}


x86 assembly (clang, -O0):
<test_satMul3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    -0x8(%rbp),%eax
je     113c <test_satMul3+0x3c>
mov    -0x8(%rbp),%edx
mov    $0x7fffffff,%eax
mov    $0x80000000,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1143 <test_satMul3+0x43>
imul   $0x3,-0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_satMul3>:
lea    (%rdi,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @test_satMul3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %8, 3
%10 = load i32, i32* %3
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 -2147483648, i32 2147483647
store i32 %16, i32* %2
br label %20
17: ; preds = %1
%18 = load i32, i32* %3
%19 = mul nsw i32 3, %18
store i32 %19, i32* %2
br label %20
20: ; preds = %17, %12
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @test_satMul3(i32 %0) {
%2 = mul nsw i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ key(unsigned char, int /*<<< orphan*/, int /*<<< orphan*/);
void menu(int selection) {
  if (selection == 666) {
    exit(0);
  }
  key((unsigned char)selection, 0, 0);
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x29a,-0x4(%rbp)
jne    113f <menu+0x1f>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
movzbl %al,%edi
mov    %edx,%esi
call   1030 <key@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu>:
cmp    $0x29a,%edi
je     1135 <menu+0x15>
movzbl %dil,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <key@plt>
push   %rax
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @menu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 666
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @exit(i32 0)
unreachable
7: ; preds = %1
%8 = load i32, i32* %2
%9 = trunc i32 %8 to i8
%10 = call i32 @key(i8 zeroext %9, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @menu(i32 %0) {
%2 = icmp eq i32 %0, 666
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %1
%6 = trunc i32 %0 to i8
%7 = tail call i32 @key(i8 zeroext %6, i32 0, i32 0)
ret void
}