xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ emptyBlock(int);
int /*<<< orphan*/ writeToDisk(int, int);
int deleteTimerFromDisk() {
  emptyBlock(21);
  int i;
  for (i = 0; i < 2; i++)
    writeToDisk(21, 3 + i);
  return 0;
}


x86 assembly (clang, -O0):
<deleteTimerFromDisk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x15,%edi
call   1030 <emptyBlock@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1161 <deleteTimerFromDisk+0x41>
mov    -0x4(%rbp),%esi
add    $0x3,%esi
mov    $0x15,%edi
call   1040 <writeToDisk@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <deleteTimerFromDisk+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteTimerFromDisk>:
push   %rax
mov    $0x15,%edi
call   1030 <emptyBlock@plt>
mov    $0x15,%edi
mov    $0x3,%esi
call   1040 <writeToDisk@plt>
mov    $0x15,%edi
mov    $0x4,%esi
call   1040 <writeToDisk@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @deleteTimerFromDisk() {
%1 = tail call i32 @emptyBlock(i32 21)
%2 = tail call i32 @writeToDisk(i32 21, i32 3)
%3 = tail call i32 @writeToDisk(i32 21, i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ decimalToBinary(long);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, long *);
int main() {
  long decimal;
  printf("Enter a decimal number\n");
  scanf("%ld", &decimal);
  printf("Binary number of %ld is %ld", decimal, decimalToBinary(decimal));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <decimalToBinary@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <decimalToBinary@plt>
lea    0xe8a(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Enter a decimal number\0A\00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [28 x i8] c"Binary number of %ld is %ld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%5 = load i64, i64* %2
%6 = load i64, i64* %2
%7 = call i32 @decimalToBinary(i64 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i64 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [28 x i8] c"Binary number of %ld is %ld\00"
@str = [23 x i8] c"Enter a decimal number\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = load i64, i64* %1
%6 = call i32 @decimalToBinary(i64 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i64 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/, long double);
int bar(void) {
  long double l = 1.2345E6;
  foo(0, l);
  return 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
flds   0xee2(%rip)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
xor    %eax,%eax
mov    %rsp,%rax
fstpt  (%rax)
xor    %edi,%edi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
sub    $0x18,%rsp
flds   0xee6(%rip)
fstpt  (%rsp)
xor    %edi,%edi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @bar() {
%1 = alloca x86_fp80
store x86_fp80 0xK401396B2200000000000, x86_fp80* %1
%2 = load x86_fp80, x86_fp80* %1
%3 = call i32 @foo(i32 0, x86_fp80 %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 @foo(i32 0, x86_fp80 0xK401396B2200000000000)
ret i32 0
}
/* Variables and functions */
int mygetline(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int len;
  char line[1000];
  printf("\nType in some lines, I will show you the longest. Enter a '$' "
         "character to end.\n\n");
  while ((len = mygetline(line)) > 0) {
    printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x3f0(%rbp),%rdi
call   1040 <mygetline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1172 <main+0x52>
lea    -0x3f0(%rbp),%rsi
lea    0xeec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1050 <mygetline@plt>
test   %eax,%eax
jle    1179 <main+0x49>
lea    0xea7(%rip),%r14
mov    %rsp,%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <mygetline@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [82 x i8] c"\0AType in some lines, I will show you the longest. Enter a '$' character to end.\0A\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %9, %0
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%7 = call i32 @mygetline(i8* %6)
store i32 %7, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %5
12: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [81 x i8] c"\0AType in some lines, I will show you the longest. Enter a '$' character to end.\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str, i64 0, i64 0))
%4 = call i32 @mygetline(i8* %2)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0, %6
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%8 = call i32 @mygetline(i8* %2)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %6, label %10
10: ; preds = %6, %0
ret i32 0
}
void testAddressOf() {
  int a;
  printf("&a is %d\n", &a);
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"&a is %d\0A\00"
define void @testAddressOf() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"&a is %d\0A\00"
define void @testAddressOf() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}
/* Variables and functions */
scalar_t__ floor(scalar_t__);
scalar_t__ ldexp(double, int);
int fix_ftoi_body(double val, int of) {
  return (int)floor(ldexp(val, of) + (1.0 / 2.0));
}


x86 assembly (clang, -O0):
<fix_ftoi_body>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <ldexp@plt>
cvtsi2sd %rax,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_ftoi_body>:
push   %rax
call   1030 <ldexp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xeca(%rip),%xmm0
cvttsd2si %xmm0,%rdi
pop    %rax
jmp    1040 <floor@plt>

LLVM IR (-O0):
define i32 @fix_ftoi_body(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load i32, i32* %4
%7 = call i64 @ldexp(double %5, i32 %6)
%8 = sitofp i64 %7 to double
%9 = fadd double %8, 5.000000e-01
%10 = fptosi double %9 to i64
%11 = call i64 @floor(i64 %10)
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @fix_ftoi_body(double %0, i32 %1) {
%3 = tail call i64 @ldexp(double %0, i32 %1)
%4 = sitofp i64 %3 to double
%5 = fadd double %4, 5.000000e-01
%6 = fptosi double %5 to i64
%7 = tail call i64 @floor(i64 %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int i = 4;
  int j = i | 4 & 2;
  printf("\n%d", j);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
int test_02(int a) { return ((unsigned int)a >> 1) | (a << 31); }


x86 assembly (clang, -O0):
<test_02>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1f,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_02(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = load i32, i32* %2
%6 = shl i32 %5, 31
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_02(i32 %0) {
%2 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 31)
ret i32 %2
}
void rop3_64_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = S & stk3;
  stk1 = T & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_64_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_64_1_0>:
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_64_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = load i8*, i8** %4
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = and i32 %35, %37
%39 = or i32 %32, %38
%40 = trunc i32 %39 to i8
%41 = load i8*, i8** %4
store i8 %40, i8* %41
ret void
}

LLVM IR (-O2):
define void @rop3_64_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
store i8 %5, i8* %0
ret void
}
void __attribute__((noreturn))
__assert_func(const char *arg1 __attribute__((unused)),
              int arg2 __attribute__((unused)),
              const char *arg3 __attribute__((unused)),
              const char *arg4 __attribute__((unused))) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<__assert_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
jmp    1113 <__assert_func+0x13>

x86 assembly (clang, -O2):
<__assert_func>:
jmp    1100 <__assert_func>

LLVM IR (-O0):
define void @__assert_func(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
br label %9
9: ; preds = %4, %9
br label %9
}

LLVM IR (-O2):
define void @__assert_func(i8* nocapture %0, i32 %1, i8* nocapture %2, i8* nocapture %3) {
br label %5
5: ; preds = %4, %5
br label %5
}
int f3(int (*(**q[])[])[][2]) { return 0; }


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

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

LLVM IR (-O0):
define i32 @f3([0 x [0 x [2 x i32]]*]*** %0) {
%2 = alloca [0 x [0 x [2 x i32]]*]***
store [0 x [0 x [2 x i32]]*]*** %0, [0 x [0 x [2 x i32]]*]**** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @f3([0 x [0 x [2 x i32]]*]*** nocapture readnone %0) {
ret i32 0
}
void glBindTransformFeedback(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glBindTransformFeedback() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void volatile_store_u32(uint32_t *dest, uint32_t val) {
  *((volatile uint32_t *)dest) = val;
}


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

x86 assembly (clang, -O2):
<volatile_store_u32>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @volatile_store_u32(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 = load i32*, i32** %3
store volatile i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @volatile_store_u32(i32* %0, i32 %1) {
store volatile i32 %1, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
int main(void) {
  int i;
  for (i = 123; i < 345; ++i)
    test(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7b,-0x8(%rbp)
cmpl   $0x159,-0x8(%rbp)
jge    1149 <main+0x39>
mov    -0x8(%rbp),%edi
call   1030 <test@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x7b,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <test@plt>
add    $0x1,%ebx
cmp    $0x159,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 123, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 345
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @test(i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 123, %0 ], [ %4, %1 ]
%3 = tail call i32 @test(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 345
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
void XSetICFocus() {}


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

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

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

LLVM IR (-O2):
define void @XSetICFocus() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
int /*<<< orphan*/ set_halt_until_mbus_rx();
int /*<<< orphan*/ set_halt_until_mbus_tx();
void FLASH_pp_off() {
  set_halt_until_mbus_rx();
  mbus_remote_register_write(0x5, 0x13, 0x0 << 1 | 0x0);
  set_halt_until_mbus_tx();
}


x86 assembly (clang, -O0):
<FLASH_pp_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <set_halt_until_mbus_rx@plt>
mov    $0x5,%edi
mov    $0x13,%esi
xor    %edx,%edx
call   1050 <mbus_remote_register_write@plt>
mov    $0x0,%al
call   1040 <set_halt_until_mbus_tx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FLASH_pp_off>:
push   %rax
xor    %eax,%eax
call   1030 <set_halt_until_mbus_rx@plt>
mov    $0x5,%edi
mov    $0x13,%esi
xor    %edx,%edx
call   1050 <mbus_remote_register_write@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <set_halt_until_mbus_tx@plt>

LLVM IR (-O0):
define void @FLASH_pp_off() {
%1 = call i32 (...) @set_halt_until_mbus_rx()
%2 = call i32 @mbus_remote_register_write(i32 5, i32 19, i32 0)
%3 = call i32 (...) @set_halt_until_mbus_tx()
ret void
}

LLVM IR (-O2):
define void @FLASH_pp_off() {
%1 = tail call i32 (...) @set_halt_until_mbus_rx()
%2 = tail call i32 @mbus_remote_register_write(i32 5, i32 19, i32 0)
%3 = tail call i32 (...) @set_halt_until_mbus_tx()
ret void
}
int ccnb_must_recurse() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ccnb_must_recurse() {
ret i32 0
}
float HuiMaQiang_damage(struct Ability *self, struct Hero *attacker,
                        struct Hero *target) {
  return 0;
}


x86 assembly (clang, -O0):
<HuiMaQiang_damage>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<HuiMaQiang_damage>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
%struct.Ability = type opaque
%struct.Hero = type opaque
define float @HuiMaQiang_damage(%struct.Ability* %0, %struct.Hero* %1, %struct.Hero* %2) {
%4 = alloca %struct.Ability*
%5 = alloca %struct.Hero*
%6 = alloca %struct.Hero*
store %struct.Ability* %0, %struct.Ability** %4
store %struct.Hero* %1, %struct.Hero** %5
store %struct.Hero* %2, %struct.Hero** %6
ret float 0.000000e+00
}

LLVM IR (-O2):
%struct.Ability = type opaque
%struct.Hero = type opaque
define float @HuiMaQiang_damage(%struct.Ability* nocapture readnone %0, %struct.Hero* nocapture readnone %1, %struct.Hero* nocapture readnone %2) {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ normalize2_c(float *, float *);
void normalize2_neon(float v[2], float d[2]) { normalize2_c(v, d); }


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

x86 assembly (clang, -O2):
<normalize2_neon>:
jmp    1030 <normalize2_c@plt>

LLVM IR (-O0):
define void @normalize2_neon(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = call i32 @normalize2_c(float* %5, float* %6)
ret void
}

LLVM IR (-O2):
define void @normalize2_neon(float* %0, float* %1) {
%3 = tail call i32 @normalize2_c(float* %0, float* %1)
ret void
}
int clip(int v, int m, int M) { return (v < m) ? m : (v > M) ? M : v; }


x86 assembly (clang, -O0):
<clip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <clip+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <clip+0x47>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <clip+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <clip+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @clip(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 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %5
br label %22
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %6
br label %20
18: ; preds = %12
%19 = load i32, i32* %4
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @clip(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
void *realloc(void *, size_t);
void *_defaultAlloc(void *ptr, size_t newSize) { return realloc(ptr, newSize); }


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

x86 assembly (clang, -O2):
<_defaultAlloc>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @_defaultAlloc(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
%7 = call i8* @realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @_defaultAlloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ log_level(int /*<<< orphan*/);
int log_level_compare(int /*<<< orphan*/, int);
int log_info_enable() { return log_level_compare(log_level(0), 2); }


x86 assembly (clang, -O0):
<log_info_enable>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <log_level@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <log_level_compare@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_info_enable>:
push   %rax
xor    %edi,%edi
call   1030 <log_level@plt>
mov    %eax,%edi
mov    $0x2,%esi
pop    %rax
jmp    1040 <log_level_compare@plt>

LLVM IR (-O0):
define i32 @log_info_enable() {
%1 = call i32 @log_level(i32 0)
%2 = call i32 @log_level_compare(i32 %1, i32 2)
ret i32 %2
}

LLVM IR (-O2):
define i32 @log_info_enable() {
%1 = tail call i32 @log_level(i32 0)
%2 = tail call i32 @log_level_compare(i32 %1, i32 2)
ret i32 %2
}
unsigned int f59(unsigned int x, int y __attribute__((unused))) {
  return (x << (8 * sizeof(unsigned int) - 1)) ^ (x >> 1);
}


x86 assembly (clang, -O0):
<f59>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1f,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f59(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 = shl i32 %5, 31
%7 = load i32, i32* %3
%8 = lshr i32 %7, 1
%9 = xor i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f59(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 31)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(int, unsigned char *);
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(int, unsigned char);
void SensorSetMirrorFlip_GC306(unsigned char val) {
  unsigned char x;
  val = ~val;
  VIM_SIF_I2cReadByte(0x0e, &x);
  VIM_SIF_I2cWriteByte(0x0e, (unsigned char)(x & 0xcf) | ((val & 0x03) << 4));
}


x86 assembly (clang, -O0):
<SensorSetMirrorFlip_GC306>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0x1(%rbp)
mov    $0xe,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
and    $0xcf,%eax
movzbl %al,%eax
movzbl -0x1(%rbp),%ecx
and    $0x3,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    $0xe,%edi
movzbl %al,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetMirrorFlip_GC306>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xf(%rsp),%rsi
mov    $0xe,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    0xf(%rsp),%al
and    $0xcf,%al
shl    $0x4,%bl
and    $0x30,%bl
or     %al,%bl
xor    $0x30,%bl
movzbl %bl,%esi
mov    $0xe,%edi
call   1040 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @SensorSetMirrorFlip_GC306(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = xor i32 %5, -1
%7 = trunc i32 %6 to i8
store i8 %7, i8* %2
%8 = call i32 @VIM_SIF_I2cReadByte(i32 14, i8* %3)
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = and i32 %10, 207
%12 = trunc i32 %11 to i8
%13 = zext i8 %12 to i32
%14 = load i8, i8* %2
%15 = zext i8 %14 to i32
%16 = and i32 %15, 3
%17 = shl i32 %16, 4
%18 = or i32 %13, %17
%19 = trunc i32 %18 to i8
%20 = call i32 @VIM_SIF_I2cWriteByte(i32 14, i8 zeroext %19)
ret void
}

LLVM IR (-O2):
define void @SensorSetMirrorFlip_GC306(i8 zeroext %0) {
%2 = alloca i8
%3 = call i32 @VIM_SIF_I2cReadByte(i32 14, i8* %2)
%4 = load i8, i8* %2
%5 = and i8 %4, -49
%6 = shl i8 %0, 4
%7 = and i8 %6, 48
%8 = or i8 %5, %7
%9 = xor i8 %8, 48
%10 = call i32 @VIM_SIF_I2cWriteByte(i32 14, i8 zeroext %9)
ret void
}
int GetZSCIIShift(char ch) {
  if (ch == ' ')
    return -2;
  if (ch == '\n')
    return -1;
  if ('a' <= ch && ch <= 'z')
    return 0;
  if ('A' <= ch && ch <= 'Z')
    return 1;
  return 2;
}


x86 assembly (clang, -O0):
<GetZSCIIShift>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    1123 <GetZSCIIShift+0x23>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1197 <GetZSCIIShift+0x97>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    113c <GetZSCIIShift+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1197 <GetZSCIIShift+0x97>
movsbl -0x5(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     1166 <GetZSCIIShift+0x66>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1166 <GetZSCIIShift+0x66>
movl   $0x0,-0x4(%rbp)
jmp    1197 <GetZSCIIShift+0x97>
movsbl -0x5(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1190 <GetZSCIIShift+0x90>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1190 <GetZSCIIShift+0x90>
movl   $0x1,-0x4(%rbp)
jmp    1197 <GetZSCIIShift+0x97>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetZSCIIShift>:
cmp    $0x20,%dil
je     1112 <GetZSCIIShift+0x12>
cmp    $0xa,%dil
jne    1118 <GetZSCIIShift+0x18>
mov    $0xffffffff,%eax
ret
mov    $0xfffffffe,%eax
ret
lea    -0x61(%rdi),%ecx
xor    %eax,%eax
cmp    $0x1a,%cl
jb     1132 <GetZSCIIShift+0x32>
add    $0xbf,%dil
cmp    $0x1a,%dil
mov    $0x2,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @GetZSCIIShift(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 32
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -2, i32* %2
br label %32
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 -1, i32* %2
br label %32
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp sle i32 97, %15
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 122
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 0, i32* %2
br label %32
22: ; preds = %17, %13
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = icmp sle i32 65, %24
br i1 %25, label %26, label %31
26: ; preds = %22
%27 = load i8, i8* %3
%28 = sext i8 %27 to i32
%29 = icmp sle i32 %28, 90
br i1 %29, label %30, label %31
30: ; preds = %26
store i32 1, i32* %2
br label %32
31: ; preds = %26, %22
store i32 2, i32* %2
br label %32
32: ; preds = %31, %30, %21, %12, %7
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @GetZSCIIShift(i8 signext %0) {
switch i8 %0, label %3 [
i8 32, label %10
i8 10, label %2
]
2: ; preds = %1
br label %10
3: ; preds = %1
%4 = add i8 %0, -97
%5 = icmp ult i8 %4, 26
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = add i8 %0, -65
%8 = icmp ult i8 %7, 26
%9 = select i1 %8, i32 1, i32 2
br label %10
10: ; preds = %6, %3, %1, %2
%11 = phi i32 [ -1, %2 ], [ -2, %1 ], [ 0, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void emit_cdq() {
  assem_debug("cdq\n");
  assert(0);
}


x86 assembly (clang, -O0):
<emit_cdq>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <assem_debug@plt>
xor    %edi,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_cdq>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <assem_debug@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"cdq\0A\00"
define void @emit_cdq() {
%1 = call i32 @assem_debug(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"cdq\0A\00"
define void @emit_cdq() {
%1 = tail call i32 @assem_debug(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int signbit(double);
int test(double x) { return signbit(x); }


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <signbit@plt>

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

LLVM IR (-O2):
define i32 @test(double %0) {
%2 = tail call i32 @signbit(double %0)
ret i32 %2
}
void quaternion_identity(float out[4]) {
  out[0] = 0.0f;
  out[1] = 0.0f;
  out[2] = 0.0f;
  out[3] = 1.0f;
}


x86 assembly (clang, -O0):
<quaternion_identity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movss  0xec9(%rip),%xmm0
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<quaternion_identity>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @quaternion_identity(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 0.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 2
store float 0.000000e+00, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 3
store float 1.000000e+00, float* %10
ret void
}

LLVM IR (-O2):
define void @quaternion_identity(float* nocapture writeonly %0) {
%2 = bitcast float* %0 to <4 x float>*
store <4 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00>, <4 x float>* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t read(int, void *, size_t);
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream) {
  return read(((int)stream), ptr, size * nmemb);
}


x86 assembly (clang, -O0):
<fread>:
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    -0x20(%rbp),%rax
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
imul   -0x18(%rbp),%rdx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fread>:
mov    %rdi,%rax
imul   %rsi,%rdx
mov    %ecx,%edi
mov    %rax,%rsi
jmp    1030 <read@plt>

LLVM IR (-O0):
define i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i32*, i32** %8
%10 = ptrtoint i32* %9 to i32
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = mul i64 %12, %13
%15 = call i64 @read(i32 %10, i8* %11, i64 %14)
ret i64 %15
}

LLVM IR (-O2):
define i64 @fread(i8* nocapture %0, i64 %1, i64 %2, i32* %3) {
%5 = ptrtoint i32* %3 to i64
%6 = trunc i64 %5 to i32
%7 = mul i64 %2, %1
%8 = tail call i64 @read(i32 %6, i8* %0, i64 %7)
ret i64 %8
}
void set_Parameter(unsigned char *pds, int n) { pds[8] = n; }


x86 assembly (clang, -O0):
<set_Parameter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_Parameter>:
mov    %sil,0x8(%rdi)
ret

LLVM IR (-O0):
define void @set_Parameter(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = trunc i32 %5 to i8
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 8
store i8 %6, i8* %8
ret void
}

LLVM IR (-O2):
define void @set_Parameter(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 8
store i8 %3, i8* %4
ret void
}
/* Type definitions */
struct usbdevfs_ioctl {
  int ifno;
  int ioctl_code;
};

/* Variables and functions */
int ioctl(int, int, struct usbdevfs_ioctl *);
int usbdev_ioctl_me_o2(int fd, int test_num) {
  int cmd = 0;
  struct usbdevfs_ioctl wrapper;
  wrapper.ifno = 1;
  wrapper.ioctl_code = test_num;
  cmd = 1;
  return ioctl(fd, cmd, &wrapper);
}


x86 assembly (clang, -O0):
<usbdev_ioctl_me_o2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x18(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usbdev_ioctl_me_o2>:
push   %rax
movl   $0x1,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rdx
mov    $0x1,%esi
call   1030 <ioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.usbdevfs_ioctl = type { i32, i32 }
define i32 @usbdev_ioctl_me_o2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.usbdevfs_ioctl
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%7 = getelementptr inbounds %struct.usbdevfs_ioctl, %struct.usbdevfs_ioctl* %6, i32 0, i32 0
store i32 1, i32* %7
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.usbdevfs_ioctl, %struct.usbdevfs_ioctl* %6, i32 0, i32 1
store i32 %8, i32* %9
store i32 1, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = call i32 @ioctl(i32 %10, i32 %11, %struct.usbdevfs_ioctl* %6)
ret i32 %12
}

LLVM IR (-O2):
%struct.usbdevfs_ioctl = type { i32, i32 }
define i32 @usbdev_ioctl_me_o2(i32 %0, i32 %1) {
%3 = alloca %struct.usbdevfs_ioctl
%4 = bitcast %struct.usbdevfs_ioctl* %3 to i8*
%5 = getelementptr inbounds %struct.usbdevfs_ioctl, %struct.usbdevfs_ioctl* %3, i64 0, i32 0
store i32 1, i32* %5
%6 = getelementptr inbounds %struct.usbdevfs_ioctl, %struct.usbdevfs_ioctl* %3, i64 0, i32 1
store i32 %1, i32* %6
%7 = call i32 @ioctl(i32 %0, i32 1, %struct.usbdevfs_ioctl* %3)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *ecalloc(size_t num_copy, size_t amount) {
  void *v = calloc(num_copy, amount);
  if (!v) {
    fprintf(stderr, "calloc failed\n");
    exit(EXIT_FAILURE);
  }
  return v;
}


x86 assembly (clang, -O0):
<ecalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <ecalloc+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecalloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <ecalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"calloc failed\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @ecalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"calloc failed\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @ecalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Type definitions */
struct wf_mtllib {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
struct wf_mtllib *wf_fparse_mtllib(int /*<<< orphan*/ *);
struct wf_mtllib const *wf_parse_mtllib(char const *filename) {
  FILE *fp;
  struct wf_mtllib const *result;
  fp = fopen(filename, "r");
  if (fp) {
    result = wf_fparse_mtllib(fp);
    fclose(fp);
  } else {
    result = NULL;
  }
  return result;
}


x86 assembly (clang, -O0):
<wf_parse_mtllib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1176 <wf_parse_mtllib+0x46>
mov    -0x10(%rbp),%rdi
call   1040 <wf_fparse_mtllib@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
jmp    117e <wf_parse_mtllib+0x4e>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wf_parse_mtllib>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1160 <wf_parse_mtllib+0x30>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <wf_fparse_mtllib@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r14,%rax
jmp    1162 <wf_parse_mtllib+0x32>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.wf_mtllib = type { i32 }
@.str = [2 x i8] c"r\00"
define %struct.wf_mtllib* @wf_parse_mtllib(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca %struct.wf_mtllib*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i32*, i32** %3
%11 = call %struct.wf_mtllib* @wf_fparse_mtllib(i32* %10)
store %struct.wf_mtllib* %11, %struct.wf_mtllib** %4
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
br label %15
14: ; preds = %1
store %struct.wf_mtllib* null, %struct.wf_mtllib** %4
br label %15
15: ; preds = %14, %9
%16 = load %struct.wf_mtllib*, %struct.wf_mtllib** %4
ret %struct.wf_mtllib* %16
}

LLVM IR (-O2):
%struct.wf_mtllib = type { i32 }
@.str = [2 x i8] c"r\00"
define %struct.wf_mtllib* @wf_parse_mtllib(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call %struct.wf_mtllib* @wf_fparse_mtllib(i32* %2)
%6 = tail call i32 @fclose(i32* %2)
br label %7
7: ; preds = %1, %4
%8 = phi %struct.wf_mtllib* [ %5, %4 ], [ null, %1 ]
ret %struct.wf_mtllib* %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void version_exit(const char *prg) {
  printf("%s: Start a program if a terminal device is available, "
         "version %s\n",
         prg, "S390_TOOLS_RELEASE");
  printf("Copyright IBM Corp. 2010\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<version_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
lea    0xf05(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version_exit>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
lea    0xf01(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [67 x i8] c"%s: Start a program if a terminal device is available, version %s\0A\00"
@.str.1 = [19 x i8] c"S390_TOOLS_RELEASE\00"
@.str.2 = [26 x i8] c"Copyright IBM Corp. 2010\0A\00"
@EXIT_SUCCESS = global i32 0
define void @version_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [67 x i8] c"%s: Start a program if a terminal device is available, version %s\0A\00"
@.str.1 = [19 x i8] c"S390_TOOLS_RELEASE\00"
@EXIT_SUCCESS = global i32 0
@str = [25 x i8] c"Copyright IBM Corp. 2010\00"
define void @version_exit(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}