xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ init_global_stats();
int /*<<< orphan*/ print_stats();
int main(int argc, char *argv[]) {
  init_global_stats();
  print_stats();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init_global_stats()
%4 = tail call i32 (...) @print_stats()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned char, unsigned int);
int smbus_wait(unsigned int);
int smbus_write(unsigned smbus_io_base, unsigned char byte) {
  outb(byte, smbus_io_base + 0x00);
  return smbus_wait(smbus_io_base);
}


x86 assembly (clang, -O0):
<smbus_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    -0x4(%rbp),%esi
add    $0x0,%esi
movzbl %al,%edi
call   1030 <outb@plt>
mov    -0x4(%rbp),%edi
call   1040 <smbus_wait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbus_write>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
mov    %ebx,%esi
call   1030 <outb@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <smbus_wait@plt>

LLVM IR (-O0):
define i32 @smbus_write(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 0
%8 = call i32 @outb(i8 zeroext %5, i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @smbus_wait(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @smbus_write(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @outb(i8 zeroext %1, i32 %0)
%4 = tail call i32 @smbus_wait(i32 %0)
ret i32 %4
}
void foo6d() {}


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

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

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

LLVM IR (-O2):
define void @foo6d() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ o_sinc(double);
double pow(int /*<<< orphan*/, double);
double F_Bspl(double t, double n) { return pow(o_sinc(t / 2.), n + 1.); }


x86 assembly (clang, -O0):
<F_Bspl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <o_sinc@plt>
mov    %eax,%edi
movsd  0xeae(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F_Bspl>:
push   %rax
movsd  %xmm1,(%rsp)
mulsd  0xed2(%rip),%xmm0
call   1040 <o_sinc@plt>
movsd  (%rsp),%xmm0
addsd  0xec8(%rip),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @F_Bspl(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fdiv double %5, 2.000000e+00
%7 = call i32 @o_sinc(double %6)
%8 = load double, double* %4
%9 = fadd double %8, 1.000000e+00
%10 = call double @pow(i32 %7, double %9)
ret double %10
}

LLVM IR (-O2):
define double @F_Bspl(double %0, double %1) {
%3 = fmul double %0, 5.000000e-01
%4 = tail call i32 @o_sinc(double %3)
%5 = fadd double %1, 1.000000e+00
%6 = tail call double @pow(i32 %4, double %5)
ret double %6
}
int check_palindrom(long number) {
  int new_number = 0, old_number = number;
  while (number) {
    new_number *= 10;
    new_number += number % 10;
    number /= 10;
  }
  return old_number == new_number ? 1 : 0;
}


x86 assembly (clang, -O0):
<check_palindrom>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1157 <check_palindrom+0x57>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
movslq -0xc(%rbp),%rax
add    %rdx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    1116 <check_palindrom+0x16>
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_palindrom>:
xor    %ecx,%ecx
test   %rdi,%rdi
je     1153 <check_palindrom+0x53>
movabs $0x6666666666666667,%r8
66 66 66
mov    %rdi,%rsi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rcx,%rcx,4),%r9d
mov    %rsi,%rax
imul   %r8
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
lea    (%rdx,%rdx,1),%eax
lea    (%rax,%rax,4),%eax
mov    %esi,%ecx
sub    %eax,%ecx
lea    (%rcx,%r9,2),%ecx
add    $0x9,%rsi
cmp    $0x12,%rsi
mov    %rdx,%rsi
ja     1120 <check_palindrom+0x20>
xor    %eax,%eax
cmp    %edi,%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @check_palindrom(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %10, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = mul nsw i32 %5, 10
%7 = srem i64 %4, 10
%8 = trunc i64 %7 to i32
%9 = add i32 %6, %8
%10 = sdiv i64 %4, 10
%11 = add i64 %4, 9
%12 = icmp ult i64 %11, 19
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %9, %3 ]
%15 = trunc i64 %0 to i32
%16 = icmp eq i32 %14, %15
%17 = zext i1 %16 to i32
ret i32 %17
}
unsigned int tune5(unsigned int t) {
  return (t * 5 & t >> 7) | (t * 3 & t >> 10);
}


x86 assembly (clang, -O0):
<tune5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x5,-0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x7,%ecx
and    %ecx,%eax
imul   $0x3,-0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
shr    $0xa,%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tune5>:
lea    (%rdi,%rdi,4),%eax
mov    %edi,%ecx
shr    $0x7,%ecx
and    %eax,%ecx
lea    (%rdi,%rdi,2),%eax
shr    $0xa,%edi
and    %edi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @tune5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 5
%5 = load i32, i32* %2
%6 = lshr i32 %5, 7
%7 = and i32 %4, %6
%8 = load i32, i32* %2
%9 = mul i32 %8, 3
%10 = load i32, i32* %2
%11 = lshr i32 %10, 10
%12 = and i32 %9, %11
%13 = or i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @tune5(i32 %0) {
%2 = mul i32 %0, 5
%3 = lshr i32 %0, 7
%4 = and i32 %2, %3
%5 = mul i32 %0, 3
%6 = lshr i32 %0, 10
%7 = and i32 %5, %6
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
scalar_t__ es_primo(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int pedir_numero();
int /*<<< orphan*/ stdout;
int main() {
  int num;
  num = pedir_numero();
  if (es_primo(num)) {
    fprintf(stdout, "El numero %d es primo\n", num);
  } else {
    fprintf(stdout, "El numero %d es compuesto\n", num);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <pedir_numero@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <es_primo@plt>
cmp    $0x0,%rax
je     1178 <main+0x48>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xe92(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1190 <main+0x60>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xe8c(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <pedir_numero@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <es_primo@plt>
test   %rax,%rax
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rax
lea    0xea5(%rip),%rsi
cmove  %rax,%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [23 x i8] c"El numero %d es primo\0A\00"
@.str.1 = [27 x i8] c"El numero %d es compuesto\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @pedir_numero()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @es_primo(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* @stdout
%9 = load i32, i32* %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %15
11: ; preds = %0
%12 = load i32, i32* @stdout
%13 = load i32, i32* %2
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %11, %7
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [23 x i8] c"El numero %d es primo\0A\00"
@.str.1 = [27 x i8] c"El numero %d es compuesto\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @pedir_numero()
%2 = tail call i64 @es_primo(i32 %1)
%3 = icmp eq i64 %2, 0
%4 = load i32, i32* @stdout
%5 = select i1 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @fprintf(i32 %4, i8* %5, i32 %1)
ret i32 0
}
void CClinkern_flipper_free_world() {}


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

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

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

LLVM IR (-O2):
define void @CClinkern_flipper_free_world() {
ret void
}
IsDigid(c) unsigned short c;
{ return '0' <= c && c <= '9'; }


x86 assembly (clang, -O0):
<IsDigid>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x3(%rbp)
jg     112e <IsDigid+0x2e>
movzwl -0x2(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsDigid>:
movzwl %di,%ecx
add    $0xffffffd0,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @IsDigid(i32 %0) {
%2 = alloca i16
%3 = trunc i32 %0 to i16
store i16 %3, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = icmp sle i32 48, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i16, i16* %2
%9 = zext i16 %8 to i32
%10 = icmp sle i32 %9, 57
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ false, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @IsDigid(i32 %0) {
%2 = and i32 %0, 65535
%3 = add nsw i32 %2, -48
%4 = icmp ult i32 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int __bswapsi2(int);
int /*<<< orphan*/ printf(char *, int, int, int);
int test__bswapsi2(uint32_t a, uint32_t expected) {
  uint32_t actual = __bswapsi2(a);
  if (actual != expected)
    printf("error in test__bswapsi2(0x%0X) = 0x%0X, expected 0x%0X\n", a,
           actual, expected);
  return actual != expected;
}


x86 assembly (clang, -O0):
<test__bswapsi2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1160 <__bswapsi2>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     114a <test__bswapsi2+0x3a>
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret
xchg   %ax,%ax

x86 assembly (clang, -O2):
<test__bswapsi2>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%r14d
call   1150 <__bswapsi2>
mov    %eax,%ebp
cmp    %ebx,%eax
je     1137 <test__bswapsi2+0x27>
lea    0xed5(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
cmp    %ebx,%ebp
setne  %al
pop    %rbx
pop    %r14
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)

LLVM IR (-O0):
@.str = [56 x i8] c"error in test__bswapsi2(0x%0X) = 0x%0X, expected 0x%0X\0A\00"
define i32 @test__bswapsi2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @__bswapsi2(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %14)
br label %16
16: ; preds = %11, %2
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = icmp ne i32 %17, %18
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
@.str = [56 x i8] c"error in test__bswapsi2(0x%0X) = 0x%0X, expected 0x%0X\0A\00"
define i32 @test__bswapsi2(i32 %0, i32 %1) {
%3 = tail call i32 @__bswapsi2(i32 %0)
%4 = icmp ne i32 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %3, i32 %1)
br label %7
7: ; preds = %5, %2
%8 = zext i1 %4 to i32
ret i32 %8
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR4F_set(void) { return U_WMRCORENONE_set("U_WMRSTARTPAGE"); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"U_WMRSTARTPAGE\00"
define i8* @U_WMR4F_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ Z80_WR_MEM(int, int);
void MemoryWrite(int Address, int Data, int NumberOfBytes) {
  int i;
  int WriteData;
  WriteData = Data;
  for (i = 0; i < NumberOfBytes; i++) {
    Z80_WR_MEM(Address + i, WriteData);
    WriteData >>= 8;
  }
}


x86 assembly (clang, -O0):
<MemoryWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <MemoryWrite+0x4f>
mov    -0x4(%rbp),%edi
add    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <Z80_WR_MEM@plt>
mov    -0x14(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112e <MemoryWrite+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MemoryWrite>:
push   %rbp
push   %r14
push   %rbx
test   %edx,%edx
jle    1135 <MemoryWrite+0x25>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
nop
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <Z80_WR_MEM@plt>
sar    $0x8,%ebp
add    $0x1,%ebx
add    $0xffffffff,%r14d
jne    1120 <MemoryWrite+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @MemoryWrite(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %13
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ %1, %3 ]
%7 = phi i32 [ %11, %5 ], [ 0, %3 ]
%8 = add nsw i32 %7, %0
%9 = tail call i32 @Z80_WR_MEM(i32 %8, i32 %6)
%10 = ashr i32 %6, 8
%11 = add nuw nsw i32 %7, 1
%12 = icmp eq i32 %11, %2
br i1 %12, label %13, label %5
13: ; preds = %5, %3
ret void
}
int test_imm_06uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x06 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_06uint64_highword_mem>:
testb  $0x6,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_06uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 25769803776
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int round_up(int x, int n) { return ((x + n - 1) / n) * n; }


x86 assembly (clang, -O0):
<round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x8(%rbp)
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_up>:
lea    (%rdi,%rsi,1),%ecx
add    $0xffffffff,%ecx
mov    %ecx,%eax
cltd
idiv   %esi
sub    %edx,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @round_up(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 = add nsw i32 %5, %6
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = sdiv i32 %8, %9
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @round_up(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = srem i32 %4, %1
%6 = sub i32 %4, %5
ret i32 %6
}
/* Variables and functions */
float blendDarken(float, float);
float blendLighten(float, float);
float blendPinLight(float base, float blend) {
  return (blend < 0.5f) ? blendDarken(base, (2.0f * blend))
                        : blendLighten(base, (2.0f * (blend - 0.5f)));
}


x86 assembly (clang, -O0):
<blendPinLight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xec6(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1165 <blendPinLight+0x45>
movss  -0x4(%rbp),%xmm0
movss  0xeb3(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
call   1030 <blendDarken@plt>
movss  %xmm0,-0xc(%rbp)
jmp    1191 <blendPinLight+0x71>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  0xe89(%rip),%xmm1
subss  %xmm1,%xmm2
movss  0xe81(%rip),%xmm1
mulss  %xmm2,%xmm1
call   1040 <blendLighten@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blendPinLight>:
movss  0xed8(%rip),%xmm2
ucomiss %xmm1,%xmm2
jbe    1136 <blendPinLight+0x16>
addss  %xmm1,%xmm1
jmp    1030 <blendDarken@plt>
addss  0xec6(%rip),%xmm1
addss  %xmm1,%xmm1
jmp    1040 <blendLighten@plt>

LLVM IR (-O0):
define float @blendPinLight(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fcmp olt float %5, 5.000000e-01
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load float, float* %3
%9 = load float, float* %4
%10 = fmul float 2.000000e+00, %9
%11 = call float @blendDarken(float %8, float %10)
br label %18
12: ; preds = %2
%13 = load float, float* %3
%14 = load float, float* %4
%15 = fsub float %14, 5.000000e-01
%16 = fmul float 2.000000e+00, %15
%17 = call float @blendLighten(float %13, float %16)
br label %18
18: ; preds = %12, %7
%19 = phi float [ %11, %7 ], [ %17, %12 ]
ret float %19
}

LLVM IR (-O2):
define float @blendPinLight(float %0, float %1) {
%3 = fcmp olt float %1, 5.000000e-01
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = fmul float %1, 2.000000e+00
%6 = tail call float @blendDarken(float %0, float %5)
br label %11
7: ; preds = %2
%8 = fadd float %1, -5.000000e-01
%9 = fmul float %8, 2.000000e+00
%10 = tail call float @blendLighten(float %0, float %9)
br label %11
11: ; preds = %7, %4
%12 = phi float [ %6, %4 ], [ %10, %7 ]
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ elg_error_msg(char *, char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void elg_error_impl(const char *f, int l) {
  elg_error_msg("[%s:%d]: %s", f, l, strerror(errno));
}


x86 assembly (clang, -O0):
<elg_error_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xea5(%rip),%rdi
call   1030 <elg_error_msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elg_error_impl>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <elg_error_msg@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"[%s:%d]: %s\00"
@errno = global i32 0
define void @elg_error_impl(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = load i32, i32* @errno
%8 = call i32 @strerror(i32 %7)
%9 = call i32 @elg_error_msg(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"[%s:%d]: %s\00"
@errno = global i32 0
define void @elg_error_impl(i8* %0, i32 %1) {
%3 = load i32, i32* @errno
%4 = tail call i32 @strerror(i32 %3)
%5 = tail call i32 @elg_error_msg(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %4)
ret void
}
void gtk_text_tag_table_add() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_tag_table_add() {
ret void
}
void nop() { 123; }


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

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

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

LLVM IR (-O2):
define void @nop() {
ret void
}
int d_bge_rm2(double a1, double *a2) {
  return !(__builtin_isgreaterequal(a1, *a2));
}


x86 assembly (clang, -O0):
<d_bge_rm2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bge_rm2>:
xor    %eax,%eax
ucomisd (%rdi),%xmm0
setb   %al
ret

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

LLVM IR (-O2):
define i32 @d_bge_rm2(double %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fcmp ugt double %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct timespec {
  long tv_nsec;
  long tv_sec;
};

/* Variables and functions */
struct timespec nsec_to_timespec(long int nsec) {
  struct timespec temp;
  temp.tv_nsec = nsec % 1000000000L;
  temp.tv_sec = nsec / 1000000000L;
  return temp;
}


x86 assembly (clang, -O0):
<nsec_to_timespec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movabs $0x112e0be826d694b3,%rcx
0b 2e 11
imul   %rcx
mov    -0x20(%rbp),%rax
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x1a,%rdx
add    %rsi,%rdx
imul   $0x3b9aca00,%rdx,%rdx
sub    %rdx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
imul   %rcx
mov    %rdx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x1a,%rax
add    %rdx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsec_to_timespec>:
movabs $0x112e0be826d694b3,%rcx
0b 2e 11
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1a,%rdx
add    %rax,%rdx
imul   $0x3b9aca00,%rdx,%rax
sub    %rax,%rdi
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define { i64, i64 } @nsec_to_timespec(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = srem i64 %4, 1000000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %3
%8 = sdiv i64 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i64 %8, i64* %9
%10 = bitcast %struct.timespec* %2 to { i64, i64 }*
%11 = load { i64, i64 }, { i64, i64 }* %10
ret { i64, i64 } %11
}

LLVM IR (-O2):
define { i64, i64 } @nsec_to_timespec(i64 %0) {
%2 = srem i64 %0, 1000000000
%3 = sdiv i64 %0, 1000000000
%4 = insertvalue { i64, i64 } poison, i64 %2, 0
%5 = insertvalue { i64, i64 } %4, i64 %3, 1
ret { i64, i64 } %5
}
/* Variables and functions */
void *realloc(void *, int);
void *check_table_size(void *cache, int cache_lines, int *cache_size,
                       int element_size) {
  if (cache_lines > (*cache_size) - 1) {
    (*cache_size) *= 2;
    cache = realloc(cache, (*cache_size) * element_size);
  }
  return cache;
}


x86 assembly (clang, -O0):
<check_table_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jle    115c <check_table_size+0x4c>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
imul   -0x1c(%rbp),%esi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_table_size>:
mov    %esi,%eax
mov    (%rdx),%esi
cmp    %eax,%esi
jle    111c <check_table_size+0xc>
mov    %rdi,%rax
ret
add    %esi,%esi
mov    %esi,(%rdx)
imul   %ecx,%esi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @check_table_size(i8* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32*, i32** %7
%11 = load i32, i32* %10
%12 = sub nsw i32 %11, 1
%13 = icmp sgt i32 %9, %12
br i1 %13, label %14, label %24
14: ; preds = %4
%15 = load i32*, i32** %7
%16 = load i32, i32* %15
%17 = mul nsw i32 %16, 2
store i32 %17, i32* %15
%18 = load i8*, i8** %5
%19 = load i32*, i32** %7
%20 = load i32, i32* %19
%21 = load i32, i32* %8
%22 = mul nsw i32 %20, %21
%23 = call i8* @realloc(i8* %18, i32 %22)
store i8* %23, i8** %5
br label %24
24: ; preds = %14, %4
%25 = load i8*, i8** %5
ret i8* %25
}

LLVM IR (-O2):
define i8* @check_table_size(i8* %0, i32 %1, i32* nocapture %2, i32 %3) {
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, %1
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = shl nsw i32 %5, 1
store i32 %8, i32* %2
%9 = mul nsw i32 %8, %3
%10 = tail call i8* @realloc(i8* %0, i32 %9)
br label %11
11: ; preds = %7, %4
%12 = phi i8* [ %10, %7 ], [ %0, %4 ]
ret i8* %12
}
__getrnge(i, j, k) int *i, *j;
char *k;
{
  *i = (*k++ & 0377);
  if (*k == -1)
    *j = 20000;
  else
    *j = ((*k & 0377) - *i);
  return (1);
}


x86 assembly (clang, -O0):
<__getrnge>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xffffffff,%eax
jne    114d <__getrnge+0x4d>
mov    -0x10(%rbp),%rax
movl   $0x4e20,(%rax)
jmp    1166 <__getrnge+0x66>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
sub    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getrnge>:
movzbl (%rdx),%eax
mov    %eax,(%rdi)
movzbl 0x1(%rdx),%ecx
mov    %ecx,%edx
sub    %eax,%edx
cmp    $0xff,%ecx
mov    $0x4e20,%eax
cmovne %edx,%eax
mov    %eax,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @__getrnge(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i8* nocapture %2) {
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
store i32 %6, i32* %0
%7 = load i8, i8* %4
%8 = icmp eq i8 %7, -1
%9 = zext i8 %7 to i32
%10 = sub nsw i32 %9, %6
%11 = select i1 %8, i32 20000, i32 %10
store i32 %11, i32* %1
ret i32 1
}
/* Variables and functions */
int INT_MIN;
int /*<<< orphan*/ itoa_alt(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int n = INT_MIN;
  char s[12] = {0};
  itoa_alt(n, s);
  printf("number character string is \'%s\'\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
lea    -0x14(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1050 <memset@plt>
mov    -0x8(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1030 <itoa_alt@plt>
lea    -0x14(%rbp),%rsi
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
movl   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <itoa_alt@plt>
lea    0xeb0(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@INT_MIN = global i32 0
@.str = [33 x i8] c"number character string is '%s'\0A\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = load i32, i32* @INT_MIN
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = call i32 @itoa_alt(i32 %2, i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
int test_imm_0Buint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x0B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_0Buint64_highword_mem>:
testb  $0xb,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Buint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 47244640256
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void __nv_fast_sincosf(float, float *, float *);
void __sincosf(float __a, float *__sptr, float *__cptr) {
  return __nv_fast_sincosf(__a, __sptr, __cptr);
}


x86 assembly (clang, -O0):
<__sincosf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <__nv_fast_sincosf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sincosf>:
jmp    1030 <__nv_fast_sincosf@plt>

LLVM IR (-O0):
define void @__sincosf(float %0, float* %1, float* %2) {
%4 = alloca float
%5 = alloca float*
%6 = alloca float*
store float %0, float* %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float, float* %4
%8 = load float*, float** %5
%9 = load float*, float** %6
ret void
}

LLVM IR (-O2):
define void @__sincosf(float %0, float* %1, float* %2) {
tail call void @__nv_fast_sincosf(float %0, float* %1, float* %2)
ret void
}
void acmpDisable(void) {}


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

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

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

LLVM IR (-O2):
define void @acmpDisable() {
ret void
}
/* Variables and functions */
double rand();
double Pl_M_Random_Float(double n) {
  return n * rand() / ((((unsigned)-1) >> 1) + 1.0);
}


x86 assembly (clang, -O0):
<Pl_M_Random_Float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xebe(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pl_M_Random_Float>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mulsd  (%rsp),%xmm0
mulsd  0xed6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Pl_M_Random_Float(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double (...) @rand()
%5 = fmul double %3, %4
%6 = fdiv double %5, 0x41E0000000000000
ret double %6
}

LLVM IR (-O2):
define double @Pl_M_Random_Float(double %0) {
%2 = tail call double (...) @rand()
%3 = fmul double %2, %0
%4 = fmul double %3, 0x3E00000000000000
ret double %4
}
/* Variables and functions */
int anetTcpGenericConnect(char *, char const *, int, int /*<<< orphan*/ *,
                          int /*<<< orphan*/);
int anetTcpConnect(char *err, const char *addr, int port) {
  return anetTcpGenericConnect(err, addr, port, NULL, 0);
}


x86 assembly (clang, -O0):
<anetTcpConnect>:
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
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <anetTcpGenericConnect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<anetTcpConnect>:
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <anetTcpGenericConnect@plt>

LLVM IR (-O0):
define i32 @anetTcpConnect(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @anetTcpGenericConnect(i8* %7, i8* %8, i32 %9, i32* null, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @anetTcpConnect(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @anetTcpGenericConnect(i8* %0, i8* %1, i32 %2, i32* null, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mintty_delete(const void *p) { free((void *)p); }


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

x86 assembly (clang, -O2):
<mintty_delete>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mintty_delete(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mfree(char *);
scalar_t__ mmalloc(int);
void test_usefreed() {
  char *p = (char *)mmalloc(100);
  mfree(p);
  p[4] = 'j';
}


x86 assembly (clang, -O0):
<test_usefreed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1030 <mmalloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mfree@plt>
mov    -0x8(%rbp),%rax
movb   $0x6a,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_usefreed>:
push   %rbx
mov    $0x64,%edi
call   1030 <mmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <mfree@plt>
movb   $0x6a,0x4(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @test_usefreed() {
%1 = alloca i8*
%2 = call i64 @mmalloc(i32 100)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @mfree(i8* %4)
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i64 4
store i8 106, i8* %7
ret void
}

LLVM IR (-O2):
define void @test_usefreed() {
%1 = tail call i64 @mmalloc(i32 100)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @mfree(i8* %2)
%4 = getelementptr inbounds i8, i8* %2, i64 4
store i8 106, i8* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int __byte_encoded_array_size(const uint8_t *p, int elements) {
  return sizeof(uint8_t) * elements;
}


x86 assembly (clang, -O0):
<__byte_encoded_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__byte_encoded_array_size>:
lea    0x0(,%rsi,4),%eax
ret

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

LLVM IR (-O2):
define i32 @__byte_encoded_array_size(i32* nocapture readnone %0, i32 %1) {
%3 = shl i32 %1, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void help(void) {
  fprintf(stdout,
          "Formula1 -y years -g nb_GP -c nb_GP_done -l "
          "current_competitor_score -o first_or_second_score -t TEAM|DRIVER\n"
          "Formula1 -b -y years -g nb_GP -n nb_competitors -t TEAM|DRIVER \n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [174 x i8] c"Formula1 -y years -g nb_GP -c nb_GP_done -l current_competitor_score -o first_or_second_score -t TEAM|DRIVER\0AFormula1 -b -y years -g nb_GP -n nb_competitors -t TEAM|DRIVER \0A\00"
define void @help() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([174 x i8], [174 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [174 x i8] c"Formula1 -y years -g nb_GP -c nb_GP_done -l current_competitor_score -o first_or_second_score -t TEAM|DRIVER\0AFormula1 -b -y years -g nb_GP -n nb_competitors -t TEAM|DRIVER \0A\00"
define void @help() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([174 x i8], [174 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bjk_set_finished(int);
void bjk_glb_finish() { bjk_set_finished(0xf1); }


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

x86 assembly (clang, -O2):
<bjk_glb_finish>:
mov    $0xf1,%edi
jmp    1030 <bjk_set_finished@plt>

LLVM IR (-O0):
define void @bjk_glb_finish() {
%1 = call i32 @bjk_set_finished(i32 241)
ret void
}

LLVM IR (-O2):
define void @bjk_glb_finish() {
%1 = tail call i32 @bjk_set_finished(i32 241)
ret void
}
void ar2315_init_devices(void) {}


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

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

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

LLVM IR (-O2):
define void @ar2315_init_devices() {
ret void
}
void RB_StageIteratorLightmappedMultitexture(void) {}


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

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

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

LLVM IR (-O2):
define void @RB_StageIteratorLightmappedMultitexture() {
ret void
}
void randombytes(unsigned char *p_bytes, unsigned long long length) {
  (void)p_bytes;
  (void)length;
}


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

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

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

LLVM IR (-O2):
define void @randombytes(i8* nocapture %0, i64 %1) {
ret void
}
int null_netmatch(a1, a2)
struct sockaddr *a1, *a2;
{
  return (0);
}


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

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

LLVM IR (-O0):
%struct.sockaddr = type opaque
define i32 @null_netmatch(%struct.sockaddr* %0, %struct.sockaddr* %1) {
%3 = alloca %struct.sockaddr*
%4 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %3
store %struct.sockaddr* %1, %struct.sockaddr** %4
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr = type opaque
define i32 @null_netmatch(%struct.sockaddr* nocapture readnone %0, %struct.sockaddr* nocapture readnone %1) {
ret i32 0
}
void port_lock_from_isr(void) { __asm volatile("nop"); }


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

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

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

LLVM IR (-O2):
define void @port_lock_from_isr() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
double drand(double min, double max) {
  return min + rand() * (max - min) / (double)RAND_MAX;
}


x86 assembly (clang, -O0):
<drand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm1
mov    0x2e98(%rip),%rax
cvtsi2sdq (%rax),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drand>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    0x2ea6(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @drand(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double (...) @rand()
%7 = load double, double* %4
%8 = load double, double* %3
%9 = fsub double %7, %8
%10 = fmul double %6, %9
%11 = load i64, i64* @RAND_MAX
%12 = sitofp i64 %11 to double
%13 = fdiv double %10, %12
%14 = fadd double %5, %13
ret double %14
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @drand(double %0, double %1) {
%3 = tail call double (...) @rand()
%4 = fsub double %1, %0
%5 = fmul double %4, %3
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to double
%8 = fdiv double %5, %7
%9 = fadd double %8, %0
ret double %9
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
void _closedir(void *vp) {
  DIR *dp = (DIR *)vp;
  closedir(dp);
}


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

x86 assembly (clang, -O2):
<_closedir>:
jmp    1030 <closedir@plt>

LLVM IR (-O0):
define void @_closedir(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @closedir(i32* %6)
ret void
}

LLVM IR (-O2):
define void @_closedir(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @closedir(i32* %2)
ret void
}