xunge/DecIR huggingface dataset:
int power_of_ten(int num) {
  if (num <= 0)
    return 0;
  while (num % 10 == 0)
    num /= 10;
  return num == 1;
}


x86 assembly (clang, -O0):
<power_of_ten>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     111d <power_of_ten+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1158 <power_of_ten+0x58>
jmp    1122 <power_of_ten+0x22>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1149 <power_of_ten+0x49>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1122 <power_of_ten+0x22>
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_of_ten>:
test   %edi,%edi
jle    1154 <power_of_ten+0x54>
imul   $0xcccccccd,%edi,%eax
ror    %eax
cmp    $0x19999999,%eax
ja     114b <power_of_ten+0x4b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq %edi,%rax
imul   $0x66666667,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x22,%rdi
add    %eax,%edi
imul   $0xcccccccd,%edi,%eax
add    $0x19999998,%eax
ror    %eax
cmp    $0x19999999,%eax
jb     1120 <power_of_ten+0x20>
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @power_of_ten(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %19
7: ; preds = %1
br label %8
8: ; preds = %12, %7
%9 = load i32, i32* %3
%10 = srem i32 %9, 10
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %3
%14 = sdiv i32 %13, 10
store i32 %14, i32* %3
br label %8
15: ; preds = %8
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 1
%18 = zext i1 %17 to i32
store i32 %18, i32* %2
br label %19
19: ; preds = %15, %6
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @power_of_ten(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = urem i32 %0, 10
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3, %6
%7 = phi i32 [ %8, %6 ], [ %0, %3 ]
%8 = sdiv i32 %7, 10
%9 = srem i32 %8, 10
%10 = icmp eq i32 %9, 0
br i1 %10, label %6, label %11
11: ; preds = %6, %3
%12 = phi i32 [ %0, %3 ], [ %8, %6 ]
%13 = icmp eq i32 %12, 1
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %1, %11
%16 = phi i32 [ %14, %11 ], [ 0, %1 ]
ret i32 %16
}
int abs(int number) { return (number < 0) ? -number : number; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printByte(unsigned char);
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, unsigned char *);
int main() {
  unsigned char byte;
  while (scanf("%c", &byte) != EOF)
    printByte(byte);
  printf("\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
je     116d <main+0x3d>
movzbl -0x5(%rbp),%edi
call   1040 <printByte@plt>
jmp    113f <main+0xf>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e97(%rip),%r15
cmp    (%r15),%rax
je     118a <main+0x5a>
lea    0xea3(%rip),%r14
lea    0xf(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0xf(%rsp),%edi
call   1040 <printByte@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    (%r15),%rax
jne    1170 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@EOF = global i64 0
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i8, i8* %2
%9 = call i32 @printByte(i8 zeroext %8)
br label %3
10: ; preds = %3
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i8
%2 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i64, i64* @EOF
%4 = icmp eq i64 %2, %3
br i1 %4, label %11, label %5
5: ; preds = %0, %5
%6 = load i8, i8* %1
%7 = call i32 @printByte(i8 zeroext %6)
%8 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%9 = load i64, i64* @EOF
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %5
11: ; preds = %5, %0
%12 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int searchIndex(int *, int /*<<< orphan*/, int, int);
int search0(int *nums, int size, int target) {
  return searchIndex(nums, 0, size - 1, target);
}


x86 assembly (clang, -O0):
<search0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
mov    -0x10(%rbp),%ecx
xor    %esi,%esi
call   1030 <searchIndex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search0>:
mov    %edx,%ecx
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <searchIndex@plt>

LLVM IR (-O0):
define i32 @search0(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 1
%10 = load i32, i32* %6
%11 = call i32 @searchIndex(i32* %7, i32 0, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @search0(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @searchIndex(i32* %0, i32 0, i32 %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sta_deauth_usage(void) {
  printf("\nUsage : sta_deauth <STA_MAC_ADDRESS>\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"\0AUsage : sta_deauth <STA_MAC_ADDRESS>\0A\00"
define void @print_sta_deauth_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"\0AUsage : sta_deauth <STA_MAC_ADDRESS>\00"
define void @print_sta_deauth_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret void
}
int recursive_fib(int n) {
  if (n < 2)
    return n;
  else
    return recursive_fib(n - 1) + recursive_fib(n - 2);
}


x86 assembly (clang, -O0):
<recursive_fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1130 <recursive_fib+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <recursive_fib+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <recursive_fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <recursive_fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursive_fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <recursive_fib+0x10>
mov    %ebx,%ecx
jmp    1144 <recursive_fib+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <recursive_fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <recursive_fib+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @recursive_fib(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %16
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = call i32 @recursive_fib(i32 %10)
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 2
%14 = call i32 @recursive_fib(i32 %13)
%15 = add nsw i32 %11, %14
store i32 %15, i32* %2
br label %16
16: ; preds = %8, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @recursive_fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @recursive_fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
bool nrf52_errata_215(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_215() {
ret i32 0
}
int seq_utils_warp_change(int oldval, int change, int divisor) {
  return ((oldval / divisor) + 1) * change;
}


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

x86 assembly (clang, -O2):
<seq_utils_warp_change>:
mov    %edx,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
add    $0x1,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @seq_utils_warp_change(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = sdiv i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = load i32, i32* %5
%12 = mul nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @seq_utils_warp_change(i32 %0, i32 %1, i32 %2) {
%4 = sdiv i32 %0, %2
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %5, %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void _echo(void) {
  system("stty sane");
  system("stty -echo -icanon -ixon");
}


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

x86 assembly (clang, -O2):
<_echo>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
lea    0xee6(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"stty sane\00"
@.str.1 = [25 x i8] c"stty -echo -icanon -ixon\00"
define void @_echo() {
%1 = call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"stty sane\00"
@.str.1 = [25 x i8] c"stty -echo -icanon -ixon\00"
define void @_echo() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int nearest2(unsigned int req) {
  req--;
  req |= req >> 1;
  req |= req >> 2;
  req |= req >> 4;
  req |= req >> 8;
  req |= req >> 16;
  req++;
  return req;
}


x86 assembly (clang, -O0):
<nearest2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nearest2>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
shr    %ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @nearest2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = lshr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = lshr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = lshr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = lshr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @nearest2(i32 %0) {
%2 = add i32 %0, -1
%3 = lshr i32 %2, 1
%4 = or i32 %3, %2
%5 = lshr i32 %4, 2
%6 = or i32 %5, %4
%7 = lshr i32 %6, 4
%8 = or i32 %7, %6
%9 = lshr i32 %8, 8
%10 = or i32 %9, %8
%11 = lshr i32 %10, 16
%12 = or i32 %11, %10
%13 = add i32 %12, 1
ret i32 %13
}
int _close(int file __attribute__((unused))) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_close(i32 %0) {
ret i32 -1
}
double squared_euclidean2d(double x[2], double y[2]) {
  double diff = x[0] - y[0];
  double sum = diff * diff;
  diff = x[1] - y[1];
  return sum + diff * diff;
}


x86 assembly (clang, -O0):
<squared_euclidean2d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<squared_euclidean2d>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
subsd  (%rsi),%xmm1
mulsd  %xmm1,%xmm1
subsd  0x8(%rsi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @squared_euclidean2d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%7 = load double*, double** %3
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fsub double %9, %12
store double %13, double* %5
%14 = load double, double* %5
%15 = load double, double* %5
%16 = fmul double %14, %15
store double %16, double* %6
%17 = load double*, double** %3
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = load double*, double** %4
%21 = getelementptr inbounds double, double* %20, i64 1
%22 = load double, double* %21
%23 = fsub double %19, %22
store double %23, double* %5
%24 = load double, double* %6
%25 = load double, double* %5
%26 = load double, double* %5
%27 = call double @llvm.fmuladd.f64(double %25, double %26, double %24)
ret double %27
}

LLVM IR (-O2):
define double @squared_euclidean2d(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fsub double %3, %4
%6 = fmul double %5, %5
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = tail call double @llvm.fmuladd.f64(double %11, double %11, double %6)
ret double %12
}
/* Variables and functions */
void *malloc(size_t);
void *gssalloc_malloc(size_t size) { return malloc(size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @gssalloc_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ init(char *);
int ok();
int /*<<< orphan*/ test();
int main() {
  init("struct");
  test();
  return ok();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <init@plt>
mov    $0x0,%al
call   1050 <test@plt>
mov    $0x0,%al
call   1030 <ok@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <init@plt>
xor    %eax,%eax
call   1050 <test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ok@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"struct\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @init(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @test()
%4 = call i32 (...) @ok()
ret i32 %4
}

LLVM IR (-O2):
@.str = [7 x i8] c"struct\00"
define i32 @main() {
%1 = tail call i32 @init(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @test()
%3 = tail call i32 (...) @ok()
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_u32x3_jenkins2v_data32(int /*<<< orphan*/ const *,
                                               size_t, uintptr_t,
                                               int /*<<< orphan*/ *);
void rgph_u32x3_jenkins2v_u32a(const uint32_t *key, size_t len, uintptr_t seed,
                               uint32_t *h) {
  rgph_u32x3_jenkins2v_data32(key, len, seed, h);
}


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

x86 assembly (clang, -O2):
<rgph_u32x3_jenkins2v_u32a>:
jmp    1030 <rgph_u32x3_jenkins2v_data32@plt>

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

LLVM IR (-O2):
define void @rgph_u32x3_jenkins2v_u32a(i32* %0, i64 %1, i64 %2, i32* %3) {
%5 = tail call i32 @rgph_u32x3_jenkins2v_data32(i32* %0, i64 %1, i64 %2, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void wczytaj_liczbe_calkowita(int *n_p) {
  printf("Podaj liczbe calkowita wieksza od 0: ");
  scanf("%d", n_p);
  if (*n_p <= 0) {
    printf("Liczba musi byc wieksza od 0.\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<wczytaj_liczbe_calkowita>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed3(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jg     117b <wczytaj_liczbe_calkowita+0x4b>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wczytaj_liczbe_calkowita>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmpl   $0x0,(%rbx)
jle    1166 <wczytaj_liczbe_calkowita+0x26>
pop    %rbx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Podaj liczbe calkowita wieksza od 0: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"Liczba musi byc wieksza od 0.\0A\00"
define void @wczytaj_liczbe_calkowita(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Podaj liczbe calkowita wieksza od 0: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [30 x i8] c"Liczba musi byc wieksza od 0.\00"
define void @wczytaj_liczbe_calkowita(i32* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
%4 = load i32, i32* %0
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ os_printoutput(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char const *);
void llsif_rename_xml_full(const char *newname) {
  char cmd[2048] = {0};
  sprintf(cmd,
          "adb shell \"su -c 'mv "
          "%s/GameEngineActivity.xml "
          "%s/%s"
          "'\"",
          "/data/data/klb.android.lovelive_en/shared_prefs",
          "/data/data/klb.android.lovelive_en/shared_prefs", newname);
  os_printoutput(cmd);
}


x86 assembly (clang, -O0):
<llsif_rename_xml_full>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x810(%rbp),%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   1040 <memset@plt>
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%r8
lea    0xe9c(%rip),%rsi
lea    0xecc(%rip),%rcx
mov    %rcx,%rdx
call   1050 <sprintf@plt>
lea    -0x810(%rbp),%rdi
call   1030 <os_printoutput@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llsif_rename_xml_full>:
push   %r14
push   %rbx
sub    $0x808,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    $0x800,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
lea    0xeaa(%rip),%rsi
lea    0xeda(%rip),%rcx
mov    %r14,%rdi
mov    %rcx,%rdx
mov    %rbx,%r8
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1030 <os_printoutput@plt>
add    $0x808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [55 x i8] c"adb shell \22su -c 'mv %s/GameEngineActivity.xml %s/%s'\22\00"
@.str.1 = [48 x i8] c"/data/data/klb.android.lovelive_en/shared_prefs\00"
define void @llsif_rename_xml_full(i8* %0) {
%2 = alloca i8*
%3 = alloca [2048 x i8]
store i8* %0, i8** %2
%4 = bitcast [2048 x i8]* %3 to i8*
%5 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%9 = call i32 @os_printoutput(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"adb shell \22su -c 'mv %s/GameEngineActivity.xml %s/%s'\22\00"
@.str.1 = [48 x i8] c"/data/data/klb.android.lovelive_en/shared_prefs\00"
define void @llsif_rename_xml_full(i8* %0) {
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = call i32 @os_printoutput(i8* %3)
ret void
}
int isVioConsole(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @isVioConsole() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ conv;

/* Variables and functions */
int htonl(int);
int /*<<< orphan*/ perror(char *);
scalar_t__ send(int, int *, int, int /*<<< orphan*/);
int send_response(int sockfd, int rc) {
  int conv = htonl(rc);
  if (send(sockfd, &conv, sizeof(conv), 0) < 0) {
    perror("error sending.... \n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<send_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0x0,%rax
jge    117e <send_response+0x4e>
lea    0xe93(%rip),%rdi
call   1050 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <send_response+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_response>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    %esi,%edi
call   1040 <htonl@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
xor    %ebx,%ebx
mov    %ebp,%edi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
test   %rax,%rax
js     1163 <send_response+0x33>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe96(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%ebx
jmp    115a <send_response+0x2a>

LLVM IR (-O0):
@.str = [20 x i8] c"error sending.... \0A\00"
define i32 @send_response(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = call i32 @htonl(i32 %7)
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = call i64 @send(i32 %9, i32* %6, i32 4, i32 0)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [20 x i8] c"error sending.... \0A\00"
define i32 @send_response(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @htonl(i32 %1)
store i32 %5, i32* %3
%6 = call i64 @send(i32 %0, i32* %3, i32 4, i32 0)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ -1, %8 ], [ 0, %2 ]
ret i32 %11
}
void setup_done(void) {}


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

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

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

LLVM IR (-O2):
define void @setup_done() {
ret void
}
/* Variables and functions */
double snabova(double, double);
double csabova(double a, double b) {
  double term = snabova(.5 * a, b);
  return .5 * term * term;
}


x86 assembly (clang, -O0):
<csabova>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xed6(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <snabova@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xeba(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csabova>:
push   %rax
mulsd  0xee7(%rip),%xmm0
call   1030 <snabova@plt>
movsd  0xeda(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @csabova(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fmul double 5.000000e-01, %6
%8 = load double, double* %4
%9 = call double @snabova(double %7, double %8)
store double %9, double* %5
%10 = load double, double* %5
%11 = fmul double 5.000000e-01, %10
%12 = load double, double* %5
%13 = fmul double %11, %12
ret double %13
}

LLVM IR (-O2):
define double @csabova(double %0, double %1) {
%3 = fmul double %0, 5.000000e-01
%4 = tail call double @snabova(double %3, double %1)
%5 = fmul double %4, 5.000000e-01
%6 = fmul double %4, %5
ret double %6
}
void arch_local_irq_enable(void) { asm volatile("sti" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @arch_local_irq_enable() {
tail call void asm sideeffect "sti", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
signed short signedshort_ignoring_signedshortint(signed short x,
                                                 signed short int y) {
  return x;
}


x86 assembly (clang, -O0):
<signedshort_ignoring_signedshortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i16 @signedshort_ignoring_signedshortint(i16 returned signext %0, i16 signext %1) {
ret i16 %0
}
/* Variables and functions */
void *ft_memset(void *b, int c, size_t len) {
  size_t i;
  unsigned char *str_b;
  str_b = (unsigned char *)b;
  i = 0;
  while (i < len)
    str_b[i++] = c;
  return (b);
}


x86 assembly (clang, -O0):
<ft_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114d <ft_memset+0x4d>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,-0x20(%rbp)
mov    %dl,(%rax,%rcx,1)
jmp    111f <ft_memset+0x1f>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <ft_memset+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
int SDL_imageFilterShiftLeftMMX(unsigned char *Src1, unsigned char *Dest,
                                int length, unsigned char N) {
  return (0);
}


x86 assembly (clang, -O0):
<SDL_imageFilterShiftLeftMMX>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %al,-0x15(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @SDL_imageFilterShiftLeftMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8 zeroext %3) {
ret i32 0
}
/* Variables and functions */
int setcns(int, int, char *);
int cmd_gps_end(int argc, char **argv) {
  char data[] = {0x00, 0x01, 0x00, 0x00};
  return setcns(0x0F05, 4, data);
}


x86 assembly (clang, -O0):
<cmd_gps_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdx
mov    $0xf05,%edi
mov    $0x4,%esi
call   1030 <setcns@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_gps_end>:
push   %rax
movl   $0x100,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0xf05,%edi
mov    $0x4,%esi
call   1030 <setcns@plt>
pop    %rcx
ret

LLVM IR (-O0):
@__const.cmd_gps_end.data = [4 x i8] c"\00\01\00\00"
define i32 @cmd_gps_end(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [4 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [4 x i8]* %5 to i8*
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%8 = call i32 @setcns(i32 3845, i32 4, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @cmd_gps_end(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 256, i32* %3
%5 = call i32 @setcns(i32 3845, i32 4, i8* %4)
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t bl_custom_cm4_start_address(void) { return 0x08010000; }


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

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

LLVM IR (-O0):
define i32 @bl_custom_cm4_start_address() {
ret i32 134283264
}

LLVM IR (-O2):
define i32 @bl_custom_cm4_start_address() {
ret i32 134283264
}
extern unsigned char rbits8(unsigned char w) {
  w = ((w >> 1) & 0x55) | ((w << 1) & 0xaa);
  w = ((w >> 2) & 0x33) | ((w << 2) & 0xcc);
  w = ((w >> 4) & 0x0f) | ((w << 4) & 0xf0);
  return w;
}


x86 assembly (clang, -O0):
<rbits8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x1,%eax
and    $0x55,%eax
movzbl -0x1(%rbp),%ecx
shl    $0x1,%ecx
and    $0xaa,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x2,%eax
and    $0x33,%eax
movzbl -0x1(%rbp),%ecx
shl    $0x2,%ecx
and    $0xcc,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
movzbl -0x1(%rbp),%ecx
shl    $0x4,%ecx
and    $0xf0,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @rbits8(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 1
%6 = and i32 %5, 85
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 1
%10 = and i32 %9, 170
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = ashr i32 %14, 2
%16 = and i32 %15, 51
%17 = load i8, i8* %2
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 2
%20 = and i32 %19, 204
%21 = or i32 %16, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %2
%23 = load i8, i8* %2
%24 = zext i8 %23 to i32
%25 = ashr i32 %24, 4
%26 = and i32 %25, 15
%27 = load i8, i8* %2
%28 = zext i8 %27 to i32
%29 = shl i32 %28, 4
%30 = and i32 %29, 240
%31 = or i32 %26, %30
%32 = trunc i32 %31 to i8
store i8 %32, i8* %2
%33 = load i8, i8* %2
ret i8 %33
}

LLVM IR (-O2):
define zeroext i8 @rbits8(i8 zeroext %0) {
%2 = tail call i8 @llvm.bitreverse.i8(i8 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ finit();
int /*<<< orphan*/ heap_init();
int /*<<< orphan*/ probe_mem();
int init_stdlib() {
  probe_mem();
  heap_init();
  finit();
  return 0;
}


x86 assembly (clang, -O0):
<init_stdlib>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <probe_mem@plt>
mov    $0x0,%al
call   1050 <heap_init@plt>
mov    $0x0,%al
call   1040 <finit@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_stdlib>:
push   %rax
xor    %eax,%eax
call   1030 <probe_mem@plt>
xor    %eax,%eax
call   1050 <heap_init@plt>
xor    %eax,%eax
call   1040 <finit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @init_stdlib() {
%1 = call i32 (...) @probe_mem()
%2 = call i32 (...) @heap_init()
%3 = call i32 (...) @finit()
ret i32 0
}

LLVM IR (-O2):
define i32 @init_stdlib() {
%1 = tail call i32 (...) @probe_mem()
%2 = tail call i32 (...) @heap_init()
%3 = tail call i32 (...) @finit()
ret i32 0
}
/* Variables and functions */
double abs(double);
int MathDoubleEqual(double a, double b) { return abs(a - b) < 0.0000001; }


x86 assembly (clang, -O0):
<MathDoubleEqual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <abs@plt>
movaps %xmm0,%xmm1
movsd  0xec4(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MathDoubleEqual>:
push   %rax
subsd  %xmm1,%xmm0
call   1030 <abs@plt>
movsd  0xede(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @MathDoubleEqual(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 = fsub double %5, %6
%8 = call double @abs(double %7)
%9 = fcmp olt double %8, 0x3E7AD7F29ABCAF48
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @MathDoubleEqual(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @abs(double %3)
%5 = fcmp olt double %4, 0x3E7AD7F29ABCAF48
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int rand();
int main(int argc, char **argv) {
  int val1 = rand();
  int val2 = rand();
  int val3 = rand();
  int val4 = rand();
  printf("%d %d %d %d.\n", val1, val2, val3, val4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
lea    0xeb2(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%d %d %d %d.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 (...) @rand()
store i32 %10, i32* %6
%11 = call i32 (...) @rand()
store i32 %11, i32* %7
%12 = call i32 (...) @rand()
store i32 %12, i32* %8
%13 = call i32 (...) @rand()
store i32 %13, i32* %9
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %16, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d %d %d %d.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = tail call i32 (...) @rand()
%5 = tail call i32 (...) @rand()
%6 = tail call i32 (...) @rand()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5, i32 %6)
ret i32 0
}
/* Type definitions */
struct timeval {
  long tv_sec;
  long long tv_usec;
};

/* Variables and functions */
long long time_diff(struct timeval *start, struct timeval *end) {
  return ((end->tv_sec - start->tv_sec) * 1000000L) +
         (end->tv_usec - start->tv_usec);
}


x86 assembly (clang, -O0):
<time_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%rax
imul   $0xf4240,%rax,%rax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
mov    -0x8(%rbp),%rdx
sub    0x8(%rdx),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_diff>:
mov    (%rsi),%rcx
mov    0x8(%rsi),%rax
sub    (%rdi),%rcx
imul   $0xf4240,%rcx,%rcx
sub    0x8(%rdi),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @time_diff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = load %struct.timeval*, %struct.timeval** %3
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = mul nsw i64 %11, 1000000
%13 = load %struct.timeval*, %struct.timeval** %4
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 1
%15 = load i64, i64* %14
%16 = load %struct.timeval*, %struct.timeval** %3
%17 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 1
%18 = load i64, i64* %17
%19 = sub nsw i64 %15, %18
%20 = add nsw i64 %12, %19
ret i64 %20
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @time_diff(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = mul nsw i64 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i64, i64* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%12 = load i64, i64* %11
%13 = sub i64 %10, %12
%14 = add nsw i64 %13, %8
ret i64 %14
}
/* Type definitions */
struct async_signal_handler {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ call_async_signal_handler(struct async_signal_handler *);
int /*<<< orphan*/ mark_async_signal_handler(struct async_signal_handler *);
void gdb_call_async_signal_handler(struct async_signal_handler *handler,
                                   int immediate_p) {
  if (immediate_p)
    call_async_signal_handler(handler);
  else
    mark_async_signal_handler(handler);
}


x86 assembly (clang, -O0):
<gdb_call_async_signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1147 <gdb_call_async_signal_handler+0x27>
mov    -0x8(%rbp),%rdi
call   1040 <call_async_signal_handler@plt>
jmp    1150 <gdb_call_async_signal_handler+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <mark_async_signal_handler@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdb_call_async_signal_handler>:
test   %esi,%esi
je     1129 <gdb_call_async_signal_handler+0x9>
jmp    1040 <call_async_signal_handler@plt>
jmp    1030 <mark_async_signal_handler@plt>

LLVM IR (-O0):
%struct.async_signal_handler = type { i32 }
define void @gdb_call_async_signal_handler(%struct.async_signal_handler* %0, i32 %1) {
%3 = alloca %struct.async_signal_handler*
%4 = alloca i32
store %struct.async_signal_handler* %0, %struct.async_signal_handler** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load %struct.async_signal_handler*, %struct.async_signal_handler** %3
%9 = call i32 @call_async_signal_handler(%struct.async_signal_handler* %8)
br label %13
10: ; preds = %2
%11 = load %struct.async_signal_handler*, %struct.async_signal_handler** %3
%12 = call i32 @mark_async_signal_handler(%struct.async_signal_handler* %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
%struct.async_signal_handler = type { i32 }
define void @gdb_call_async_signal_handler(%struct.async_signal_handler* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @call_async_signal_handler(%struct.async_signal_handler* %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @mark_async_signal_handler(%struct.async_signal_handler* %0)
br label %8
8: ; preds = %6, %4
ret void
}