xunge/DecIR huggingface dataset:
int foo(int n) {
  volatile int i = 0;
  int sum = 0;
  for (i = 0; i < n; i++)
    sum += i;
  return sum;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113f <foo+0x3f>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111c <foo+0x1c>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x0,-0x4(%rsp)
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%ecx
xor    %eax,%eax
cmp    %edi,%ecx
jge    1131 <foo+0x31>
xor    %eax,%eax
nopl   0x0(%rax)
add    -0x4(%rsp),%eax
addl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%ecx
cmp    %edi,%ecx
jl     1120 <foo+0x20>
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
store volatile i32 0, i32* %2
%4 = load volatile i32, i32* %2
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %14
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 0, %1 ]
%8 = load volatile i32, i32* %2
%9 = add nsw i32 %8, %7
%10 = load volatile i32, i32* %2
%11 = add nsw i32 %10, 1
store volatile i32 %11, i32* %2
%12 = load volatile i32, i32* %2
%13 = icmp slt i32 %12, %0
br i1 %13, label %6, label %14
14: ; preds = %6, %1
%15 = phi i32 [ 0, %1 ], [ %9, %6 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ w_safe_pawn_squares(int, int);
void w_safe_pawn_squares_test(void **state) {
  assert_int_equal(
      0xFFFF08D7EBFFFFFFul,
      w_safe_pawn_squares(0x000000000C10E300ul, 0x00E3140800000000ul));
}


x86 assembly (clang, -O0):
<w_safe_pawn_squares_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xc10e300,%edi
xor    %esi,%esi
call   1030 <w_safe_pawn_squares@plt>
mov    %eax,%esi
mov    $0xebffffff,%edi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_safe_pawn_squares_test>:
push   %rax
mov    $0xc10e300,%edi
xor    %esi,%esi
call   1030 <w_safe_pawn_squares@plt>
mov    $0xebffffff,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @w_safe_pawn_squares_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @w_safe_pawn_squares(i32 202433280, i32 0)
%4 = call i32 @assert_int_equal(i32 -335544321, i32 %3)
ret void
}

LLVM IR (-O2):
define void @w_safe_pawn_squares_test(i8** nocapture readnone %0) {
%2 = tail call i32 @w_safe_pawn_squares(i32 202433280, i32 0)
%3 = tail call i32 @assert_int_equal(i32 -335544321, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int /*<<< orphan*/ initArray(int *);
void testConstraintOnRegionOffsetStack(int *values, int length, int i) {
  if (values[0] == 4) {
    initArray(values);
    clang_analyzer_eval(values[0] == 4);
  }
}


x86 assembly (clang, -O0):
<testConstraintOnRegionOffsetStack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x4,(%rax)
jne    115c <testConstraintOnRegionOffsetStack+0x3c>
mov    -0x8(%rbp),%rdi
call   1030 <initArray@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x4,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testConstraintOnRegionOffsetStack>:
push   %rbx
cmpl   $0x4,(%rdi)
jne    113d <testConstraintOnRegionOffsetStack+0x1d>
mov    %rdi,%rbx
call   1030 <initArray@plt>
xor    %edi,%edi
cmpl   $0x4,(%rbx)
sete   %dil
pop    %rbx
jmp    1040 <clang_analyzer_eval@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @testConstraintOnRegionOffsetStack(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 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 4
br i1 %10, label %11, label %20
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = call i32 @initArray(i32* %12)
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 0
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 4
%18 = zext i1 %17 to i32
%19 = call i32 @clang_analyzer_eval(i32 %18)
br label %20
20: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @testConstraintOnRegionOffsetStack(i32* %0, i32 %1, i32 %2) {
%4 = load i32, i32* %0
%5 = icmp eq i32 %4, 4
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = tail call i32 @initArray(i32* %0)
%8 = load i32, i32* %0
%9 = icmp eq i32 %8, 4
%10 = zext i1 %9 to i32
%11 = tail call i32 @clang_analyzer_eval(i32 %10)
br label %12
12: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef int __u8;
typedef int const __u16;

/* Variables and functions */
__u16 __get_unaligned_le16(const __u8 *p) { return p[0] | p[1] << 8; }


x86 assembly (clang, -O0):
<__get_unaligned_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__get_unaligned_le16>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @__get_unaligned_le16(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = or i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @__get_unaligned_le16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
ret i32 %6
}
int prefix_update(const char *ifname, int ifindex, const char *prefixPlain,
                  int prefixLength, unsigned long prefered,
                  unsigned long valid) {
  return 0;
}


x86 assembly (clang, -O0):
<prefix_update>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @prefix_update(i8* %0, i32 %1, i8* %2, i32 %3, i64 %4, i64 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i64
%12 = alloca i64
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @prefix_update(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3, i64 %4, i64 %5) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_fast8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntEnable(int /*<<< orphan*/);
int /*<<< orphan*/ IntRegister(int /*<<< orphan*/, void (*)());
int /*<<< orphan*/ _CANIntNumberGet(int /*<<< orphan*/);
void CANIntRegister(uint32_t ui32Base, void (*pfnHandler)(void)) {
  uint_fast8_t ui8IntNumber;
  ;
  ui8IntNumber = _CANIntNumberGet(ui32Base);
  ;
  IntRegister(ui8IntNumber, pfnHandler);
  IntEnable(ui8IntNumber);
}


x86 assembly (clang, -O0):
<CANIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_CANIntNumberGet@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <IntRegister@plt>
mov    -0x14(%rbp),%edi
call   1030 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANIntRegister>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <_CANIntNumberGet@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <IntRegister@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @CANIntRegister(i32 %0, void ()* %1) {
%3 = alloca i32
%4 = alloca void ()*
%5 = alloca i32
store i32 %0, i32* %3
store void ()* %1, void ()** %4
%6 = load i32, i32* %3
%7 = call i32 @_CANIntNumberGet(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load void ()*, void ()** %4
%10 = bitcast void ()* %9 to void (...)*
%11 = call i32 @IntRegister(i32 %8, void (...)* %10)
%12 = load i32, i32* %5
%13 = call i32 @IntEnable(i32 %12)
ret void
}

LLVM IR (-O2):
define void @CANIntRegister(i32 %0, void ()* %1) {
%3 = tail call i32 @_CANIntNumberGet(i32 %0)
%4 = bitcast void ()* %1 to void (...)*
%5 = tail call i32 @IntRegister(i32 %3, void (...)* %4)
%6 = tail call i32 @IntEnable(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clearscreen();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int manager(char userid[4], int usertype, int weekends) {
  clearscreen();
  printf("\n\nManager Functions");
  printf("\n\nPress <ENTER> to exit\n");
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<manager>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clearscreen@plt>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<manager>:
push   %rax
xor    %eax,%eax
call   1040 <clearscreen@plt>
lea    0xeb1(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\0A\0AManager Functions\00"
@.str.1 = [25 x i8] c"\0A\0APress <ENTER> to exit\0A\00"
define i32 @manager(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 (...) @clearscreen()
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0A\0AManager Functions\00"
@str = [24 x i8] c"\0A\0APress <ENTER> to exit\00"
define i32 @manager(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @clearscreen()
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int write(int, int /*<<< orphan*/ *, int);
int Serialize_WriteSync(int Stream, uint32_t Sync) {
  return write(Stream, &Sync, sizeof(uint32_t));
}


x86 assembly (clang, -O0):
<Serialize_WriteSync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Serialize_WriteSync>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Serialize_WriteSync(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 = call i32 @write(i32 %5, i32* %4, i32 4)
ret i32 %6
}

LLVM IR (-O2):
define i32 @Serialize_WriteSync(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @write(i32 %0, i32* %3, i32 4)
ret i32 %4
}
/* Variables and functions */
int dtype(double);
int bayes_dm_CheckDoubleValueValid(double Value, int *Type) {
  *Type = dtype(Value);
  if ((0 == *Type) || (4 == *Type))
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<bayes_dm_CheckDoubleValueValid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <dtype@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    (%rcx),%eax
je     1152 <bayes_dm_CheckDoubleValueValid+0x42>
mov    -0x18(%rbp),%rcx
mov    $0x4,%eax
cmp    (%rcx),%eax
jne    115e <bayes_dm_CheckDoubleValueValid+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <bayes_dm_CheckDoubleValueValid+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bayes_dm_CheckDoubleValueValid>:
push   %rbx
mov    %rdi,%rbx
call   1030 <dtype@plt>
mov    %eax,(%rbx)
xor    %ecx,%ecx
test   $0xfffffffb,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @bayes_dm_CheckDoubleValueValid(double %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @dtype(double %0)
store i32 %3, i32* %1
%4 = and i32 %3, -5
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
void *buddy_allocate(int);
int /*<<< orphan*/ buddy_free(void *);
int /*<<< orphan*/ buddy_init();
int main(void) {
  buddy_init();
  void *ptr = buddy_allocate(42);
  void *ptr2 = buddy_allocate(1000);
  void *ptr3 = buddy_allocate(1);
  buddy_free(ptr);
  buddy_free(ptr2);
  buddy_free(ptr3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <buddy_init@plt>
mov    $0x2a,%edi
call   1040 <buddy_allocate@plt>
mov    %rax,-0x10(%rbp)
mov    $0x3e8,%edi
call   1040 <buddy_allocate@plt>
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
call   1040 <buddy_allocate@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <buddy_free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <buddy_free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <buddy_free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <buddy_init@plt>
mov    $0x2a,%edi
call   1040 <buddy_allocate@plt>
mov    %rax,%r14
mov    $0x3e8,%edi
call   1040 <buddy_allocate@plt>
mov    %rax,%r15
mov    $0x1,%edi
call   1040 <buddy_allocate@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <buddy_free@plt>
mov    %r15,%rdi
call   1030 <buddy_free@plt>
mov    %rbx,%rdi
call   1030 <buddy_free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
%5 = call i32 (...) @buddy_init()
%6 = call i8* @buddy_allocate(i32 42)
store i8* %6, i8** %2
%7 = call i8* @buddy_allocate(i32 1000)
store i8* %7, i8** %3
%8 = call i8* @buddy_allocate(i32 1)
store i8* %8, i8** %4
%9 = load i8*, i8** %2
%10 = call i32 @buddy_free(i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @buddy_free(i8* %11)
%13 = load i8*, i8** %4
%14 = call i32 @buddy_free(i8* %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @buddy_init()
%2 = tail call i8* @buddy_allocate(i32 42)
%3 = tail call i8* @buddy_allocate(i32 1000)
%4 = tail call i8* @buddy_allocate(i32 1)
%5 = tail call i32 @buddy_free(i8* %2)
%6 = tail call i32 @buddy_free(i8* %3)
%7 = tail call i32 @buddy_free(i8* %4)
ret i32 0
}
void hrightjustify_(i) int *i;
{ hrightjustify(*i); }


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

x86 assembly (clang, -O2):
<hrightjustify_>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <hrightjustify@plt>

LLVM IR (-O0):
define void @hrightjustify_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @hrightjustify to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @hrightjustify_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @hrightjustify to i32 (i32, ...)*)(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lcd_cmd_transmit(int);
void lcd_new_msg_first_line(void) {
  lcd_cmd_transmit(0x38);
  lcd_cmd_transmit(0x80);
  lcd_cmd_transmit(0x06);
}


x86 assembly (clang, -O0):
<lcd_new_msg_first_line>:
push   %rbp
mov    %rsp,%rbp
mov    $0x38,%edi
call   1030 <lcd_cmd_transmit@plt>
mov    $0x80,%edi
call   1030 <lcd_cmd_transmit@plt>
mov    $0x6,%edi
call   1030 <lcd_cmd_transmit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_new_msg_first_line>:
push   %rax
mov    $0x38,%edi
call   1030 <lcd_cmd_transmit@plt>
mov    $0x80,%edi
call   1030 <lcd_cmd_transmit@plt>
mov    $0x6,%edi
pop    %rax
jmp    1030 <lcd_cmd_transmit@plt>

LLVM IR (-O0):
define void @lcd_new_msg_first_line() {
%1 = call i32 @lcd_cmd_transmit(i32 56)
%2 = call i32 @lcd_cmd_transmit(i32 128)
%3 = call i32 @lcd_cmd_transmit(i32 6)
ret void
}

LLVM IR (-O2):
define void @lcd_new_msg_first_line() {
%1 = tail call i32 @lcd_cmd_transmit(i32 56)
%2 = tail call i32 @lcd_cmd_transmit(i32 128)
%3 = tail call i32 @lcd_cmd_transmit(i32 6)
ret void
}
void transpose2(double out[2][2][2], _Atomic double in[2][2][2]) {}


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

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

LLVM IR (-O0):
define void @transpose2([2 x [2 x double]]* %0, [2 x [2 x double]]* %1) {
%3 = alloca [2 x [2 x double]]*
%4 = alloca [2 x [2 x double]]*
store [2 x [2 x double]]* %0, [2 x [2 x double]]** %3
store [2 x [2 x double]]* %1, [2 x [2 x double]]** %4
ret void
}

LLVM IR (-O2):
define void @transpose2([2 x [2 x double]]* nocapture %0, [2 x [2 x double]]* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_line(char *);
int /*<<< orphan*/ output_with_tab(char *);
int /*<<< orphan*/ print_label(int);
void gen_test_jump(int label, int ft) {
  output_line("test r1");
  if (ft)
    output_with_tab("jumpnz ");
  else
    output_with_tab("jumpz ");
  print_label(label);
  newline();
}


x86 assembly (clang, -O0):
<gen_test_jump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xeab(%rip),%rdi
call   1060 <output_line@plt>
cmpl   $0x0,-0x8(%rbp)
je     1175 <gen_test_jump+0x35>
lea    0xe9d(%rip),%rdi
call   1050 <output_with_tab@plt>
jmp    1181 <gen_test_jump+0x41>
lea    0xe94(%rip),%rdi
call   1050 <output_with_tab@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_label@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_test_jump>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xeb2(%rip),%rdi
call   1060 <output_line@plt>
test   %ebx,%ebx
lea    0xeb4(%rip),%rax
lea    0xea5(%rip),%rdi
cmove  %rax,%rdi
call   1050 <output_with_tab@plt>
mov    %ebp,%edi
call   1040 <print_label@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"test r1\00"
@.str.1 = [8 x i8] c"jumpnz \00"
@.str.2 = [7 x i8] c"jumpz \00"
define void @gen_test_jump(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @output_line(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @output_with_tab(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %12
10: ; preds = %2
%11 = call i32 @output_with_tab(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %3
%14 = call i32 @print_label(i32 %13)
%15 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"test r1\00"
@.str.1 = [8 x i8] c"jumpnz \00"
@.str.2 = [7 x i8] c"jumpz \00"
define void @gen_test_jump(i32 %0, i32 %1) {
%3 = tail call i32 @output_line(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @output_with_tab(i8* %5)
%7 = tail call i32 @print_label(i32 %0)
%8 = tail call i32 (...) @newline()
ret void
}
unsigned short unsignedshort_ignoring_longdouble(unsigned short x,
                                                 long double y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshort_ignoring_longdouble>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
fldt   0x10(%rbp)
mov    %ax,-0x2(%rbp)
fstpt  -0x20(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i16 @unsignedshort_ignoring_longdouble(i16 returned zeroext %0, x86_fp80 %1) {
ret i16 %0
}
void av_mdct_end() {}


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

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

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

LLVM IR (-O2):
define void @av_mdct_end() {
ret void
}
/* Variables and functions */
bool nrf52_errata_74(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_74() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit_program(int);
int /*<<< orphan*/ perror(char *);
void exit_program_err(int code, char *func) {
  perror(func);
  exit_program(code);
}


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

x86 assembly (clang, -O2):
<exit_program_err>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1040 <perror@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <exit_program@plt>

LLVM IR (-O0):
define void @exit_program_err(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @perror(i8* %5)
%7 = load i32, i32* %3
%8 = call i32 @exit_program(i32 %7)
ret void
}

LLVM IR (-O2):
define void @exit_program_err(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @perror(i8* %1)
%4 = tail call i32 @exit_program(i32 %0)
ret void
}
__attribute__((no)) int foo(struct A *a) { return 123; }


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

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

LLVM IR (-O0):
%struct.A = type opaque
define i32 @foo(%struct.A* %0) {
%2 = alloca %struct.A*
store %struct.A* %0, %struct.A** %2
ret i32 123
}

LLVM IR (-O2):
%struct.A = type opaque
define i32 @foo(%struct.A* nocapture readnone %0) {
ret i32 123
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Dispose(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @Dispose(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
const char *ls_info_compilation_options() {
  return "Compilation options not stored.\n"
         "To do so, recompile with: -DSTORE_COMPILATION_OPTIONS=1";
}


x86 assembly (clang, -O0):
<ls_info_compilation_options>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_info_compilation_options>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [88 x i8] c"Compilation options not stored.\0ATo do so, recompile with: -DSTORE_COMPILATION_OPTIONS=1\00"
define i8* @ls_info_compilation_options() {
ret i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [88 x i8] c"Compilation options not stored.\0ATo do so, recompile with: -DSTORE_COMPILATION_OPTIONS=1\00"
define i8* @ls_info_compilation_options() {
ret i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0)
}
void checkCompileTimeAssertions() {}


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

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

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

LLVM IR (-O2):
define void @checkCompileTimeAssertions() {
ret void
}
unsigned char get_flipped_byte(unsigned char c) {
  return c ^ ((unsigned char)255);
}


x86 assembly (clang, -O0):
<get_flipped_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
xor    $0xff,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @get_flipped_byte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = xor i32 %4, 255
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @get_flipped_byte(i8 zeroext %0) {
%2 = xor i8 %0, -1
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_l2();
int /*<<< orphan*/ take_struct_l2(int /*<<< orphan*/);
void test_struct_l2() { take_struct_l2(return_struct_l2()); }


x86 assembly (clang, -O0):
<test_struct_l2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <return_struct_l2@plt>
mov    %eax,%edi
call   1030 <take_struct_l2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_l2>:
push   %rax
xor    %eax,%eax
call   1040 <return_struct_l2@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <take_struct_l2@plt>

LLVM IR (-O0):
define void @test_struct_l2() {
%1 = call i32 (...) @return_struct_l2()
%2 = call i32 @take_struct_l2(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_l2() {
%1 = tail call i32 (...) @return_struct_l2()
%2 = tail call i32 @take_struct_l2(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
Usage() {
  fprintf(stderr, "Usage: compress [-dfvcV] [-b maxbits] [file ...]\n");
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: compress [-dfvcV] [-b maxbits] [file ...]\0A\00"
define i32 @Usage() {
%1 = alloca i32
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: compress [-dfvcV] [-b maxbits] [file ...]\0A\00"
define i32 @Usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t unaligned_read_be16(const void *_u) {
  const uint8_t *u = _u;
  return (((uint16_t)u[0]) << 8) | ((uint16_t)u[1]);
}


x86 assembly (clang, -O0):
<unaligned_read_be16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unaligned_read_be16>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @unaligned_read_be16(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = load i64*, i64** %3
%7 = getelementptr inbounds i64, i64* %6, i64 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 8
%11 = load i64*, i64** %3
%12 = getelementptr inbounds i64, i64* %11, i64 1
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = or i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @unaligned_read_be16(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = bitcast i8* %6 to i64*
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = or i32 %5, %9
ret i32 %10
}
__attribute__((always_)) void
account_scheduler_latency(struct task_struct *task, int usecs, int inter) {}


x86 assembly (clang, -O0):
<account_scheduler_latency>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @account_scheduler_latency(%struct.task_struct* %0, i32 %1, i32 %2) {
%4 = alloca %struct.task_struct*
%5 = alloca i32
%6 = alloca i32
store %struct.task_struct* %0, %struct.task_struct** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @account_scheduler_latency(%struct.task_struct* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int log(int);
double mylndbern(int x, double p) { return x * log(p) + (1 - x) * log(1 - p); }


x86 assembly (clang, -O0):
<mylndbern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cvttsd2si -0x10(%rbp),%edi
call   1030 <log@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0x1,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
movsd  0xeb2(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
mov    -0x18(%rbp),%ecx
mov    %eax,%edx
mov    -0x14(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mylndbern>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %edi,%r14d
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
mov    %eax,%ebp
imul   %r14d,%ebp
mov    $0x1,%ebx
sub    %r14d,%ebx
movsd  0xec0(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
imul   %ebx,%eax
add    %ebp,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define double @mylndbern(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = load double, double* %4
%7 = fptosi double %6 to i32
%8 = call i32 @log(i32 %7)
%9 = mul nsw i32 %5, %8
%10 = load i32, i32* %3
%11 = sub nsw i32 1, %10
%12 = load double, double* %4
%13 = fsub double 1.000000e+00, %12
%14 = fptosi double %13 to i32
%15 = call i32 @log(i32 %14)
%16 = mul nsw i32 %11, %15
%17 = add nsw i32 %9, %16
%18 = sitofp i32 %17 to double
ret double %18
}

LLVM IR (-O2):
define double @mylndbern(i32 %0, double %1) {
%3 = fptosi double %1 to i32
%4 = tail call i32 @log(i32 %3)
%5 = mul nsw i32 %4, %0
%6 = sub nsw i32 1, %0
%7 = fsub double 1.000000e+00, %1
%8 = fptosi double %7 to i32
%9 = tail call i32 @log(i32 %8)
%10 = mul nsw i32 %9, %6
%11 = add nsw i32 %10, %5
%12 = sitofp i32 %11 to double
ret double %12
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int mmio_read(int);
uint32_t mbox_read(uint8_t channel) {
  while (1) {
    while (mmio_read(0x2000b880 + 0x18) & 0x40000000)
      ;
    uint32_t data = mmio_read(0x2000b880 + 0x00);
    uint8_t read_channel = (uint8_t)(data & 0xf);
    if (read_channel == channel)
      return (data & 0xfffffff0);
  }
}


x86 assembly (clang, -O0):
<mbox_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
jmp    1121 <mbox_read+0x11>
mov    $0x2000b898,%edi
call   1030 <mmio_read@plt>
and    $0x40000000,%eax
cmp    $0x0,%eax
je     113e <mbox_read+0x2e>
jmp    1121 <mbox_read+0x11>
mov    $0x2000b880,%edi
call   1030 <mmio_read@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xf,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jne    1171 <mbox_read+0x61>
mov    -0xc(%rbp),%eax
and    $0xfffffff0,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    111c <mbox_read+0xc>

x86 assembly (clang, -O2):
<mbox_read>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2000b898,%edi
call   1030 <mmio_read@plt>
test   $0x40000000,%eax
jne    1120 <mbox_read+0x10>
mov    $0x2000b880,%edi
call   1030 <mmio_read@plt>
mov    %eax,%ecx
and    $0xf,%ecx
cmp    %rbx,%rcx
jne    1120 <mbox_read+0x10>
and    $0xfffffff0,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mbox_read(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
store i64 %0, i64* %2
br label %5
5: ; preds = %1, %22
br label %6
6: ; preds = %10, %5
%7 = call i32 @mmio_read(i32 536918168)
%8 = and i32 %7, 1073741824
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
br label %6
11: ; preds = %6
%12 = call i32 @mmio_read(i32 536918144)
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = and i32 %13, 15
%15 = sext i32 %14 to i64
store i64 %15, i64* %4
%16 = load i64, i64* %4
%17 = load i64, i64* %2
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %22
19: ; preds = %11
%20 = load i32, i32* %3
%21 = and i32 %20, -16
ret i32 %21
22: ; preds = %11
br label %5
}

LLVM IR (-O2):
define i32 @mbox_read(i64 %0) {
br label %2
2: ; preds = %6, %1
%3 = tail call i32 @mmio_read(i32 536918168)
%4 = and i32 %3, 1073741824
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %2, %7
br label %2
7: ; preds = %2
%8 = tail call i32 @mmio_read(i32 536918144)
%9 = and i32 %8, 15
%10 = zext i32 %9 to i64
%11 = icmp eq i64 %10, %0
br i1 %11, label %12, label %6
12: ; preds = %7
%13 = and i32 %8, -16
ret i32 %13
}
char test_47_0(char *mem) { return __atomic_and_fetch(mem + 0, 1, 4); }


x86 assembly (clang, -O0):
<test_47_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
and    %sil,%dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114a <test_47_0+0x4a>
jmp    111f <test_47_0+0x1f>
mov    -0xc(%rbp),%cl
mov    -0x19(%rbp),%al
and    %cl,%al
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_47_0>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
and    $0x1,%cl
lock cmpxchg %cl,(%rdi)
jne    1110 <test_47_0+0x10>
and    $0x1,%al
ret

LLVM IR (-O0):
define signext i8 @test_47_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 1, i8* %3
%7 = load i8, i8* %3
%8 = atomicrmw and i8* %6, i8 %7 acq_rel
%9 = and i8 %8, %7
store i8 %9, i8* %4
%10 = load i8, i8* %4
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @test_47_0(i8* nocapture %0) {
%2 = atomicrmw and i8* %0, i8 1 acq_rel
%3 = and i8 %2, 1
ret i8 %3
}
int getBinomialCoefficientOf2(int n) { return (n * (n - 1)) / 2; }


x86 assembly (clang, -O0):
<getBinomialCoefficientOf2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBinomialCoefficientOf2>:
lea    -0x1(%rdi),%ecx
imul   %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @getBinomialCoefficientOf2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = mul nsw i32 %3, %5
%7 = sdiv i32 %6, 2
ret i32 %7
}

LLVM IR (-O2):
define i32 @getBinomialCoefficientOf2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = mul nsw i32 %2, %0
%4 = sdiv i32 %3, 2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void list_dlts() { printf("dlt {number=1}{name=EN10MB}{display=Ethernet}\n"); }


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"dlt {number=1}{name=EN10MB}{display=Ethernet}\0A\00"
define void @list_dlts() {
%1 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [46 x i8] c"dlt {number=1}{name=EN10MB}{display=Ethernet}\00"
define void @list_dlts() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned int dictCharKeyHash(const void *key) {
  const unsigned char *buf = key;
  unsigned int hash = 5381;
  while (*buf) {
    hash = ((hash << 5) + hash) + (*buf++);
  }
  return hash;
}


x86 assembly (clang, -O0):
<dictCharKeyHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1505,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <dictCharKeyHash+0x49>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <dictCharKeyHash+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dictCharKeyHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <dictCharKeyHash+0x28>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movzbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <dictCharKeyHash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @dictCharKeyHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = zext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
bool valid_file_size(int size) { return size <= 100; }


x86 assembly (clang, -O0):
<valid_file_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_file_size>:
xor    %eax,%eax
cmp    $0x65,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @valid_file_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 100
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @valid_file_size(i32 %0) {
%2 = icmp slt i32 %0, 101
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test_bit_print();
int main(int argc, char *argv[]) {
  int exitcode = EXIT_SUCCESS;
  test_bit_print();
  return exitcode;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <test_bit_print@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <test_bit_print@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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
%7 = load i32, i32* @EXIT_SUCCESS
store i32 %7, i32* %6
%8 = call i32 (...) @test_bit_print()
%9 = load i32, i32* %6
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 (...) @test_bit_print()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *);
int mouse_handler() {
  kprintf("12 enter the mouse interrupt\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<mouse_handler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <kprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"12 enter the mouse interrupt\0A\00"
define i32 @mouse_handler() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"12 enter the mouse interrupt\0A\00"
define i32 @mouse_handler() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int __res_dnok(char const *dn) {
  int ch;
  char const *tmp;
  char __cil_tmp4;
  {
    {
      while (1) {
      while_continue:;
        tmp = dn;
        dn = dn + 1;
        __cil_tmp4 = *tmp;
        ch = (int)__cil_tmp4;
        if (ch != 0) {
        } else {
          goto while_break;
        }
        if (ch > 32) {
          if (ch < 127) {
          } else {
            return (0);
          }
        } else {
          return (0);
        }
      }
    while_break:;
    }
    return (1);
  }
}


x86 assembly (clang, -O0):
<__res_dnok>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
jmp    110d <__res_dnok+0xd>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x21(%rbp)
movsbl -0x21(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1140 <__res_dnok+0x40>
jmp    1145 <__res_dnok+0x45>
jmp    1180 <__res_dnok+0x80>
cmpl   $0x20,-0x14(%rbp)
jle    116f <__res_dnok+0x6f>
cmpl   $0x7f,-0x14(%rbp)
jge    115e <__res_dnok+0x5e>
jmp    116a <__res_dnok+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1187 <__res_dnok+0x87>
jmp    117b <__res_dnok+0x7b>
movl   $0x0,-0x4(%rbp)
jmp    1187 <__res_dnok+0x87>
jmp    1108 <__res_dnok+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__res_dnok>:
movzbl (%rdi),%eax
test   %al,%al
je     1114 <__res_dnok+0x14>
add    $0x1,%rdi
add    $0x81,%al
cmp    $0xa1,%al
ja     1100 <__res_dnok>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @__res_dnok(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = add i8 %4, -127
%9 = icmp ult i8 %8, -94
br i1 %9, label %10, label %2
10: ; preds = %2, %6
%11 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %11
}