xunge/DecIR huggingface dataset:
int Hash_Key(const char *name, int modulus) {
  unsigned int key;
  for (key = 0; *name; name++)
    key += ((key << 3) + (key >> 28) + *name);
  return (int)(key % modulus);
}


x86 assembly (clang, -O0):
<Hash_Key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <Hash_Key+0x4d>
mov    -0x10(%rbp),%eax
shl    $0x3,%eax
mov    -0x10(%rbp),%ecx
shr    $0x1c,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1112 <Hash_Key+0x12>
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Hash_Key>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <Hash_Key+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shr    $0x1c,%edx
movsbl %cl,%ecx
add    %eax,%edx
lea    (%rdx,%rax,8),%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <Hash_Key+0x10>
jmp    112e <Hash_Key+0x2e>
xor    %eax,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @Hash_Key(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %16, %5 ], [ %3, %2 ]
%7 = phi i32 [ %14, %5 ], [ 0, %2 ]
%8 = phi i8* [ %15, %5 ], [ %0, %2 ]
%9 = shl i32 %7, 3
%10 = lshr i32 %7, 28
%11 = sext i8 %6 to i32
%12 = add i32 %10, %7
%13 = add i32 %12, %9
%14 = add i32 %13, %11
%15 = getelementptr inbounds i8, i8* %8, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %5
18: ; preds = %5, %2
%19 = phi i32 [ 0, %2 ], [ %14, %5 ]
%20 = urem i32 %19, %1
ret i32 %20
}
/* Variables and functions */
scalar_t__ max_sum(int *, int);
scalar_t__ max_sum_brute(int *, int);
int test_single_negative() {
  int input[] = {-5};
  return 0 == max_sum_brute(input, 1) && 0 == max_sum(input, 1);
}


x86 assembly (clang, -O0):
<test_single_negative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x1,%esi
call   1040 <max_sum_brute@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x5(%rbp)
jne    116e <test_single_negative+0x4e>
lea    -0x4(%rbp),%rdi
mov    $0x1,%esi
call   1030 <max_sum@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_single_negative>:
push   %rax
movl   $0xfffffffb,0x4(%rsp)
ff
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
call   1040 <max_sum_brute@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1144 <test_single_negative+0x24>
pop    %rcx
ret
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
call   1030 <max_sum@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@__const.test_single_negative.input = [1 x i32] [i32 -5]
define i32 @test_single_negative() {
%1 = alloca [1 x i32]
%2 = bitcast [1 x i32]* %1 to i8*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%4 = call i64 @max_sum_brute(i32* %3, i32 1)
%5 = icmp eq i64 0, %4
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%8 = call i64 @max_sum(i32* %7, i32 1)
%9 = icmp eq i64 0, %8
br label %10
10: ; preds = %6, %0
%11 = phi i1 [ false, %0 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_single_negative() {
%1 = alloca [1 x i32]
%2 = bitcast [1 x i32]* %1 to i8*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 -5, i32* %3
%4 = call i64 @max_sum_brute(i32* %3, i32 1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i64 @max_sum(i32* %3, i32 1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %0
%11 = phi i32 [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double r;
  scanf("%lf", &r);
  printf("VOLUME = %.3lf\n", (4 / 3.0) * 3.14159 * r * r * r);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xeb9(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
movsd  0xec3(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [16 x i8] c"VOLUME = %.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = load double, double* %2
%5 = fmul double 0x4010C1514ABD0449, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = load double, double* %2
%9 = fmul double %7, %8
%10 = fptosi double %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [16 x i8] c"VOLUME = %.3lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, 0x4010C1514ABD0449
%6 = fmul double %4, %5
%7 = fmul double %4, %6
%8 = fptosi double %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < argc; i++)
    printf("argv[%d] = %s\n", i, argv[i]);
  getchar();
  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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1172 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1157 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <main+0x20>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [15 x i8] c"argv[%d] = %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %6
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
%23 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"argv[%d] = %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int FD_ISSET(int, int /*<<< orphan*/ *);
int _d_gnu_fd_isset(int n, fd_set *p) { return FD_ISSET(n, p); }


x86 assembly (clang, -O0):
<_d_gnu_fd_isset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <FD_ISSET@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_d_gnu_fd_isset>:
jmp    1030 <FD_ISSET@plt>

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

LLVM IR (-O2):
define i32 @_d_gnu_fd_isset(i32 %0, i32* %1) {
%3 = tail call i32 @FD_ISSET(i32 %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int syscall(int, void *, size_t, unsigned char *);
int mincore(void *addr, size_t len, unsigned char *vec) {
  return syscall(219, addr, len, vec);
}


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

x86 assembly (clang, -O2):
<mincore>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xdb,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @mincore(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @syscall(i32 219, i8* %0, i64 %1, i8* %2)
ret i32 %4
}
void unipiSetup() {}


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

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

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

LLVM IR (-O2):
define void @unipiSetup() {
ret void
}
double LSKeyframeAnimationFunctionEaseInCubic(double t, double b, double c,
                                              double d) {
  return c * (t /= d) * t * t + b;
}


x86 assembly (clang, -O0):
<LSKeyframeAnimationFunctionEaseInCubic>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
divsd  %xmm2,%xmm1
movsd  %xmm1,-0x8(%rbp)
mulsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<LSKeyframeAnimationFunctionEaseInCubic>:
divsd  %xmm3,%xmm0
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @LSKeyframeAnimationFunctionEaseInCubic(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %8
%11 = load double, double* %5
%12 = fdiv double %11, %10
store double %12, double* %5
%13 = fmul double %9, %12
%14 = load double, double* %5
%15 = fmul double %13, %14
%16 = load double, double* %5
%17 = load double, double* %6
%18 = call double @llvm.fmuladd.f64(double %15, double %16, double %17)
ret double %18
}

LLVM IR (-O2):
define double @LSKeyframeAnimationFunctionEaseInCubic(double %0, double %1, double %2, double %3) {
%5 = fdiv double %0, %3
%6 = fmul double %5, %2
%7 = fmul double %5, %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double %5, double %1)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ keyboard_update();
int /*<<< orphan*/ mouse_update();
void event_pump(void) {
  keyboard_update();
  mouse_update();
}


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

x86 assembly (clang, -O2):
<event_pump>:
push   %rax
xor    %eax,%eax
call   1040 <keyboard_update@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <mouse_update@plt>

LLVM IR (-O0):
define void @event_pump() {
%1 = call i32 (...) @keyboard_update()
%2 = call i32 (...) @mouse_update()
ret void
}

LLVM IR (-O2):
define void @event_pump() {
%1 = tail call i32 (...) @keyboard_update()
%2 = tail call i32 (...) @mouse_update()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int get_bit(uint8_t *block_group, int index) {
  return (*block_group >> index) & 1u;
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
mov    %esi,%ecx
mov    (%rdi),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_bit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = ashr i32 %6, %7
%9 = and i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_bit(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = lshr i32 %3, %1
%5 = and i32 %4, 1
ret i32 %5
}
void INT_Excep_TPU4_TCI4V(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU4_TCI4V() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ heap_sift_down(long *, int, int);
void heapify(long *ary, int ary_len) {
  for (int i = ary_len - 1; i >= 0; i--) {
    ;
    heap_sift_down(ary, ary_len, i);
  }
}


x86 assembly (clang, -O0):
<heapify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     114f <heapify+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <heap_sift_down@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <heapify+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapify>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1146 <heapify+0x36>
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x2(%rbx),%edx
mov    %r14,%rdi
mov    %r15d,%esi
call   1030 <heap_sift_down@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <heapify+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @heapify(i64* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %7, %5 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = tail call i32 @heap_sift_down(i64* %0, i32 %1, i32 %7)
%9 = icmp ugt i32 %6, 1
br i1 %9, label %5, label %4
}
void cache_init(void) {}


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

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

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

LLVM IR (-O2):
define void @cache_init() {
ret void
}
void initialiseConstants(double *variables) { variables[0] = 123.0; }


x86 assembly (clang, -O0):
<initialiseConstants>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialiseConstants>:
movabs $0x405ec00000000000,%rax
c0 5e 40
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @initialiseConstants(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
store double 1.230000e+02, double* %4
ret void
}

LLVM IR (-O2):
define void @initialiseConstants(double* nocapture writeonly %0) {
store double 1.230000e+02, double* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
double query();
void queryMenu() {
  double balance = query();
  printf("===========================\n");
  printf("your balance is $[%lf]!\n", balance);
  printf("===========================\n");
}


x86 assembly (clang, -O0):
<queryMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <query@plt>
movsd  %xmm0,-0x8(%rbp)
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xecf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<queryMenu>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1050 <query@plt>
movsd  %xmm0,0x8(%rsp)
lea    0xed0(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"===========================\0A\00"
@.str.1 = [25 x i8] c"your balance is $[%lf]!\0A\00"
define void @queryMenu() {
%1 = alloca double
%2 = call double (...) @query()
store double %2, double* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = load double, double* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c"your balance is $[%lf]!\0A\00"
@str.2 = [28 x i8] c"===========================\00"
define void @queryMenu() {
%1 = tail call double (...) @query()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), double %1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.2, i64 0, i64 0))
ret void
}
int any_MSB_one(unsigned x) {
  unsigned msb_mask = 0xFFu << (sizeof(int) - 1u << 3);
  return !!(x & msb_mask);
}


x86 assembly (clang, -O0):
<any_MSB_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xff000000,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any_MSB_one>:
xor    %eax,%eax
cmp    $0x1000000,%edi
setae  %al
ret

LLVM IR (-O0):
define i32 @any_MSB_one(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -16777216, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = and i32 %4, %5
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @any_MSB_one(i32 %0) {
%2 = icmp ugt i32 %0, 16777215
%3 = zext i1 %2 to i32
ret i32 %3
}
int mpi_get_i1(int ng, int rang, int p) {
  int step = ng / p;
  if (rang + 1 == p) {
    return ng;
  } else {
    return (rang + 1) * step;
  }
}


x86 assembly (clang, -O0):
<mpi_get_i1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cmp    -0x10(%rbp),%eax
jne    1131 <mpi_get_i1+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113e <mpi_get_i1+0x3e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpi_get_i1>:
mov    %edi,%eax
add    $0x1,%esi
cmp    %edx,%esi
je     1111 <mpi_get_i1+0x11>
mov    %edx,%ecx
cltd
idiv   %ecx
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @mpi_get_i1(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 1
%5 = icmp eq i32 %4, %2
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = sdiv i32 %0, %2
%8 = mul nsw i32 %7, %4
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ %8, %6 ], [ %0, %3 ]
ret i32 %10
}
OP(fd, df) {
  illegal_1();
  op_df();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_df@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_df@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_df()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_df()
ret i32 undef
}
struct D {
  int a;
  float b, c;
  int d;
} df() {
  return (struct D){1, 2, 3, 4};
}


x86 assembly (clang, -O0):
<df>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x10(%rbp)
movl   $0x40000000,-0xc(%rbp)
movl   $0x40400000,-0x8(%rbp)
movl   $0x4,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<df>:
movabs $0x4000000000000001,%rax
movabs $0x440400000,%rdx
ret

LLVM IR (-O0):
%struct.D = type { i32, float, float, i32 }
define { i64, i64 } @df() {
%1 = alloca %struct.D
%2 = getelementptr inbounds %struct.D, %struct.D* %1, i32 0, i32 0
store i32 1, i32* %2
%3 = getelementptr inbounds %struct.D, %struct.D* %1, i32 0, i32 1
store float 2.000000e+00, float* %3
%4 = getelementptr inbounds %struct.D, %struct.D* %1, i32 0, i32 2
store float 3.000000e+00, float* %4
%5 = getelementptr inbounds %struct.D, %struct.D* %1, i32 0, i32 3
store i32 4, i32* %5
%6 = bitcast %struct.D* %1 to { i64, i64 }*
%7 = load { i64, i64 }, { i64, i64 }* %6
ret { i64, i64 } %7
}

LLVM IR (-O2):
define { i64, i64 } @df() {
ret { i64, i64 } { i64 4611686018427387905, i64 18257805312 }
}
int sys$find(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(10), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$find>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0xa,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$find>:
mov    $0xa,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$find"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 10, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$find"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 10, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
size_t formatThreadName(char *buffer, size_t size) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @formatThreadName(i8* nocapture readnone %0, i64 %1) {
ret i64 0
}
void dealloc(void *bp) { return; }


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

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

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

LLVM IR (-O2):
define void @dealloc(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ ft_islower(int);
scalar_t__ ft_isupper(int);
int ft_isalpha(int c) {
  int res;
  res = 1;
  if (ft_isupper(c) || ft_islower(c))
    return (res);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <ft_isupper@plt>
cmp    $0x0,%rax
jne    1156 <ft_isalpha+0x36>
mov    -0x8(%rbp),%edi
call   1030 <ft_islower@plt>
cmp    $0x0,%rax
je     1161 <ft_isalpha+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <ft_isalpha+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalpha>:
push   %rbx
mov    %edi,%ebx
call   1040 <ft_isupper@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <ft_isalpha+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <ft_islower@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = tail call i64 @ft_isupper(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @ft_islower(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char lvl_char(const int lvl) {
  switch (lvl) {
  case 1:
    return 'V';
  case 2:
    return 'D';
  case 3:
    return 'I';
  case 4:
    return 'W';
  case 5:
    return 'E';
  case 6:
    return 'F';
  default:
    assert(!sizeof("Bad log level"));
    return '?';
  }
}


x86 assembly (clang, -O0):
<lvl_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     117a <lvl_char+0x6a>
mov    -0x10(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x56,-0x1(%rbp)
jmp    1185 <lvl_char+0x75>
movb   $0x44,-0x1(%rbp)
jmp    1185 <lvl_char+0x75>
movb   $0x49,-0x1(%rbp)
jmp    1185 <lvl_char+0x75>
movb   $0x57,-0x1(%rbp)
jmp    1185 <lvl_char+0x75>
movb   $0x45,-0x1(%rbp)
jmp    1185 <lvl_char+0x75>
movb   $0x46,-0x1(%rbp)
jmp    1185 <lvl_char+0x75>
xor    %edi,%edi
call   1030 <assert@plt>
movb   $0x3f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvl_char>:
add    $0xffffffff,%edi
cmp    $0x6,%edi
jae    112b <lvl_char+0x1b>
shl    $0x3,%edi
movabs $0x464557494456,%rax
mov    %edi,%ecx
shr    %cl,%rax
ret
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0x3f,%al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define signext i8 @lvl_char(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
i32 6, label %10
]
5: ; preds = %1
store i8 86, i8* %2
br label %13
6: ; preds = %1
store i8 68, i8* %2
br label %13
7: ; preds = %1
store i8 73, i8* %2
br label %13
8: ; preds = %1
store i8 87, i8* %2
br label %13
9: ; preds = %1
store i8 69, i8* %2
br label %13
10: ; preds = %1
store i8 70, i8* %2
br label %13
11: ; preds = %1
%12 = call i32 @assert(i32 0)
store i8 63, i8* %2
br label %13
13: ; preds = %11, %10, %9, %8, %7, %6, %5
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @lvl_char(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 6
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @assert(i32 0)
br label %11
6: ; preds = %1
%7 = zext i32 %2 to i48
%8 = shl nuw nsw i48 %7, 3
%9 = lshr i48 77263631107158, %8
%10 = trunc i48 %9 to i8
br label %11
11: ; preds = %6, %4
%12 = phi i8 [ 63, %4 ], [ %10, %6 ]
ret i8 %12
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void LCDRasterACBiasIntCountSet(uint32_t ui32Base, uint8_t ui8Count) {
  uint32_t ui32Val;
  ;
  ;
  ui32Val = (*((volatile uint32_t *)(ui32Base + 0x00000034)));
  ui32Val &= ~0x000F0000;
  ui32Val |= ((ui8Count << 16) & 0x000F0000);
  (*((volatile uint32_t *)(ui32Base + 0x00000034))) = ui32Val;
}


x86 assembly (clang, -O0):
<LCDRasterACBiasIntCountSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x34,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xfff0ffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
and    $0xf0000,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x34,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDRasterACBiasIntCountSet>:
movslq %edi,%rax
mov    $0xfff0ffff,%ecx
and    0x34(%rax),%ecx
and    $0xf,%esi
shl    $0x10,%esi
or     %ecx,%esi
mov    %esi,0x34(%rax)
ret

LLVM IR (-O0):
define void @LCDRasterACBiasIntCountSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 52
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = and i32 %11, -983041
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = shl i32 %13, 16
%15 = and i32 %14, 983040
%16 = load i32, i32* %5
%17 = or i32 %16, %15
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 52
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
store volatile i32 %18, i32* %22
ret void
}

LLVM IR (-O2):
define void @LCDRasterACBiasIntCountSet(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 52
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -983041
%8 = shl i32 %1, 16
%9 = and i32 %8, 983040
%10 = or i32 %7, %9
store volatile i32 %10, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OutC(char const);
void OutS(const char *s) {
  for (; *s != 0x0; s++)
    OutC(*s);
}


x86 assembly (clang, -O0):
<OutS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <OutS+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <OutC@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <OutS+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OutS>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <OutS+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <OutC@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <OutS+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @OutS(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %12, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @OutC(i8 signext %10)
br label %12
12: ; preds = %8
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @OutS(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @OutC(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
int main(void) {
  FILE *input;
  input = fopen("data3.txt", "r");
  if (input == NULL) {
    perror("heroare:");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1169 <main+0x49>
lea    0xeb4(%rip),%rdi
call   1040 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1170 <main+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1140 <main+0x20>
pop    %rcx
ret
lea    0xec5(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"data3.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [9 x i8] c"heroare:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %9
8: ; preds = %0
store i32 0, i32* %1
br label %9
9: ; preds = %8, %6
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [10 x i8] c"data3.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [9 x i8] c"heroare:\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 1, %3 ], [ 0, %0 ]
ret i32 %6
}
void lsi_b_syslog(int prio, const char *fmt, ...) {}


x86 assembly (clang, -O0):
<lsi_b_syslog>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @lsi_b_syslog(i32 %0, i8* nocapture %1, ...) {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void pit_set_oneshot_ms(int ms) {
  uint16_t ticks = (uint16_t)(ms * ((3579545 / 3) / 1000) - 1);
  outb(0x43, 0x30);
  outb(0x40, ticks & 0xFF);
  outb(0x40, ticks >> 8);
}


x86 assembly (clang, -O0):
<pit_set_oneshot_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x4a9,-0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x43,%edi
mov    $0x30,%esi
call   1030 <outb@plt>
mov    -0x8(%rbp),%esi
and    $0xff,%esi
mov    $0x40,%edi
call   1030 <outb@plt>
mov    -0x8(%rbp),%esi
sar    $0x8,%esi
mov    $0x40,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pit_set_oneshot_ms>:
push   %rbx
imul   $0x4a9,%edi,%ebx
add    $0xffffffff,%ebx
mov    $0x43,%edi
mov    $0x30,%esi
call   1030 <outb@plt>
movzbl %bl,%esi
mov    $0x40,%edi
call   1030 <outb@plt>
sar    $0x8,%ebx
mov    $0x40,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @pit_set_oneshot_ms(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 1193
%6 = sub nsw i32 %5, 1
store i32 %6, i32* %3
%7 = call i32 @outb(i32 67, i32 48)
%8 = load i32, i32* %3
%9 = and i32 %8, 255
%10 = call i32 @outb(i32 64, i32 %9)
%11 = load i32, i32* %3
%12 = ashr i32 %11, 8
%13 = call i32 @outb(i32 64, i32 %12)
ret void
}

LLVM IR (-O2):
define void @pit_set_oneshot_ms(i32 %0) {
%2 = mul nsw i32 %0, 1193
%3 = add nsw i32 %2, -1
%4 = tail call i32 @outb(i32 67, i32 48)
%5 = and i32 %3, 255
%6 = tail call i32 @outb(i32 64, i32 %5)
%7 = ashr i32 %3, 8
%8 = tail call i32 @outb(i32 64, i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int pthread_rwlock_unlock(int /*<<< orphan*/ *);
void __safe_p_rwlock_unlock(pthread_rwlock_t *rw) {
  int en = pthread_rwlock_unlock(rw);
  if (en) {
    abort();
  }
}


x86 assembly (clang, -O0):
<__safe_p_rwlock_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_rwlock_unlock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1149 <__safe_p_rwlock_unlock+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__safe_p_rwlock_unlock>:
push   %rax
call   1040 <pthread_rwlock_unlock@plt>
test   %eax,%eax
jne    112c <__safe_p_rwlock_unlock+0xc>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @__safe_p_rwlock_unlock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_rwlock_unlock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @__safe_p_rwlock_unlock(i32* %0) {
%2 = tail call i32 @pthread_rwlock_unlock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
int size(char *str) {
  int i;
  i = 0;
  while (str[i] != '\0') {
    i++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <size+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <size+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<size>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <size+0x10>
ret

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

LLVM IR (-O2):
define i32 @size(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int bar();
int printf(char *, int);
int main(void) {
  int a = bar();
  return printf("%d\n", a);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
void setup_special_sighandler(int sig) {
  (void)sig;
  return;
}


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

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

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

LLVM IR (-O2):
define void @setup_special_sighandler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getloadavg(double *, int);
void md_loadav(double *avg) { getloadavg(avg, 3); }


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

x86 assembly (clang, -O2):
<md_loadav>:
mov    $0x3,%esi
jmp    1030 <getloadavg@plt>

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

LLVM IR (-O2):
define void @md_loadav(double* %0) {
%2 = tail call i32 @getloadavg(double* %0, i32 3)
ret void
}
int sign(int x) {
  if (x > 0)
    return 1;
  if (x < 0)
    return -1;
  if (x == 0)
    return 0;
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111d <sign+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <sign+0x44>
cmpl   $0x0,-0x8(%rbp)
jge    1133 <sign+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1144 <sign+0x44>
cmpl   $0x0,-0x8(%rbp)
jne    1144 <sign+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
mov    %edi,%ecx
sar    $0x1f,%ecx
test   %edi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sign(i32 %0) {
%2 = ashr i32 %0, 31
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 %2, i32 1
ret i32 %4
}