xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ close(int);
void __cleanup_close_func(int *fd) {
  if (*fd >= 0)
    close(*fd);
}


x86 assembly (clang, -O0):
<__cleanup_close_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1134 <__cleanup_close_func+0x24>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cleanup_close_func>:
mov    (%rdi),%edi
test   %edi,%edi
js     111b <__cleanup_close_func+0xb>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @__cleanup_close_func(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @close(i32 %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
void *DummyMalloc(size_t);
void *DummyCalloc(size_t nmemb, size_t size) {
  void *ptr = DummyMalloc(nmemb * size);
  unsigned int i = 0;
  for (; i < nmemb * size; ++i) {
    ((char *)ptr)[i] = 0;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<DummyCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1030 <DummyMalloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x8(%rbp),%rcx
imul   -0x10(%rbp),%rcx
cmp    %rcx,%rax
jae    1167 <DummyCalloc+0x57>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1139 <DummyCalloc+0x29>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DummyCalloc>:
push   %rbx
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1030 <DummyMalloc@plt>
test   %rbx,%rbx
je     113c <DummyCalloc+0x2c>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
movb   $0x0,(%rax,%rcx,1)
add    $0x1,%ecx
cmp    %rcx,%rbx
ja     1130 <DummyCalloc+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @DummyCalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @DummyMalloc(i64 %3)
%5 = icmp eq i64 %3, 0
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i64 [ %10, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %4, i64 %7
store i8 0, i8* %8
%9 = add nuw nsw i64 %7, 1
%10 = and i64 %9, 4294967295
%11 = icmp ugt i64 %3, %10
br i1 %11, label %6, label %12
12: ; preds = %6, %2
ret i8* %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int ntohl(int);
int random();
uint32_t make_random_addr(uint32_t mask, uint8_t subnet) {
  uint32_t addr;
  addr = random();
  return (ntohl(addr >> subnet) | mask);
}


x86 assembly (clang, -O0):
<make_random_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%ecx
sar    %cl,%edi
call   1040 <ntohl@plt>
or     -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_random_addr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <random@plt>
mov    %ebx,%ecx
sar    %cl,%eax
mov    %eax,%edi
call   1040 <ntohl@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @make_random_addr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...) @random()
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = ashr i32 %7, %8
%10 = call i32 @ntohl(i32 %9)
%11 = load i32, i32* %3
%12 = or i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @make_random_addr(i32 %0, i32 %1) {
%3 = tail call i32 (...) @random()
%4 = ashr i32 %3, %1
%5 = tail call i32 @ntohl(i32 %4)
%6 = or i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int f(int);
int w(int i1, int i2, int i3, int i4, int i5, int i6, int i7) {
  int a = f(i5);
  return i1 + i2 + i3 + i4 + a + i6 + i7;
}


x86 assembly (clang, -O0):
<w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <f@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x1c(%rbp),%eax
add    -0x18(%rbp),%eax
add    0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r9d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebp
mov    %edi,%ebx
mov    %r8d,%edi
call   1030 <f@plt>
add    %ebp,%ebx
add    %r12d,%ebx
add    %r15d,%ebx
add    %r14d,%ebx
add    0x30(%rsp),%ebx
add    %ebx,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @w(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @f(i32 %4)
%9 = add nsw i32 %1, %0
%10 = add nsw i32 %9, %2
%11 = add nsw i32 %10, %3
%12 = add i32 %11, %5
%13 = add i32 %12, %6
%14 = add i32 %13, %8
ret i32 %14
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit_interpreter();
int /*<<< orphan*/ get_program();
int /*<<< orphan*/ init_interpreter();
int /*<<< orphan*/ interpreter();
int /*<<< orphan*/ print_program(int, int);
int main(int argc, char *argv[]) {
  init_interpreter();
  get_program();
  print_program(-1, -1);
  interpreter();
  exit_interpreter();
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <init_interpreter@plt>
mov    $0x0,%al
call   1040 <get_program@plt>
mov    $0xffffffff,%esi
mov    %esi,%edi
call   1050 <print_program@plt>
mov    $0x0,%al
call   1070 <interpreter@plt>
mov    $0x0,%al
call   1030 <exit_interpreter@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <init_interpreter@plt>
xor    %eax,%eax
call   1040 <get_program@plt>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
call   1050 <print_program@plt>
xor    %eax,%eax
call   1070 <interpreter@plt>
xor    %eax,%eax
call   1030 <exit_interpreter@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%eax
pop    %rcx
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**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @init_interpreter()
%7 = call i32 (...) @get_program()
%8 = call i32 @print_program(i32 -1, i32 -1)
%9 = call i32 (...) @interpreter()
%10 = call i32 (...) @exit_interpreter()
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init_interpreter()
%4 = tail call i32 (...) @get_program()
%5 = tail call i32 @print_program(i32 -1, i32 -1)
%6 = tail call i32 (...) @interpreter()
%7 = tail call i32 (...) @exit_interpreter()
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
int foo(int x) { return x * x; }


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

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

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void fild_Usleep(unsigned int useconds) {
  usleep(useconds);
  return;
}


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

x86 assembly (clang, -O2):
<fild_Usleep>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @fild_Usleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
int add_rightchild() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @add_rightchild() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int same_screen;
};
typedef TYPE_1__ XButtonEvent;

/* Variables and functions */
void set_XButtonEvent_same_screen(void *_p, int _v) {
  ((XButtonEvent *)_p)->same_screen = (int)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XButtonEvent_same_screen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonEvent_same_screen(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ILLutil_freerus(void *p) { free(p); }


x86 assembly (clang, -O0):
<ILLutil_freerus>:
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):
<ILLutil_freerus>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @ILLutil_freerus(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 @ILLutil_freerus(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t ReverseBits(uint16_t val) {
  val = ((val >> 1) & 0x5555) | ((val & 0x5555) << 1);
  val = ((val >> 2) & 0x3333) | ((val & 0x3333) << 2);
  val = ((val >> 4) & 0x0F0F) | ((val & 0x0F0F) << 4);
  return (val >> 8) | (val << 8);
}


x86 assembly (clang, -O0):
<ReverseBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
and    $0x5555,%eax
mov    -0x4(%rbp),%ecx
and    $0x5555,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
and    $0x3333,%eax
mov    -0x4(%rbp),%ecx
and    $0x3333,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
and    $0xf0f,%eax
mov    -0x4(%rbp),%ecx
and    $0xf0f,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReverseBits>:
mov    %edi,%eax
shr    %eax
and    $0x5555,%eax
and    $0x5555,%edi
lea    (%rax,%rdi,2),%eax
mov    %eax,%ecx
shr    $0x2,%ecx
and    $0x3333,%ecx
and    $0x3333,%eax
lea    (%rcx,%rax,4),%eax
mov    %eax,%ecx
shr    $0x4,%ecx
and    $0xf0f,%ecx
shl    $0x4,%eax
and    $0xf0f0,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
shl    $0x8,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ReverseBits(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 21845
%4 = shl i32 %0, 1
%5 = and i32 %4, 43690
%6 = or i32 %3, %5
%7 = lshr i32 %6, 2
%8 = and i32 %7, 13107
%9 = shl nuw nsw i32 %6, 2
%10 = and i32 %9, 52428
%11 = or i32 %8, %10
%12 = lshr i32 %11, 4
%13 = and i32 %12, 3855
%14 = shl nuw nsw i32 %11, 4
%15 = and i32 %14, 61680
%16 = or i32 %13, %15
%17 = lshr i32 %16, 8
%18 = shl nuw nsw i32 %16, 8
%19 = or i32 %17, %18
ret i32 %19
}
/* Variables and functions */
unsigned int RGB16(unsigned int, unsigned int, unsigned int);
unsigned int GrOffScreen16BPPColorTranslate(void *pvDisplayData,
                                            unsigned int ulValue) {
  return RGB16((ulValue >> 16) & 0xff, (ulValue >> 8) & 0xff,
               (ulValue >> 0) & 0xff);
}


x86 assembly (clang, -O0):
<GrOffScreen16BPPColorTranslate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
shr    $0x10,%edi
and    $0xff,%edi
mov    -0xc(%rbp),%esi
shr    $0x8,%esi
and    $0xff,%esi
mov    -0xc(%rbp),%edx
shr    $0x0,%edx
and    $0xff,%edx
call   1030 <RGB16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GrOffScreen16BPPColorTranslate>:
mov    %esi,%eax
movzbl %ah,%esi
movzbl %al,%edx
shr    $0x10,%eax
movzbl %al,%edi
jmp    1030 <RGB16@plt>

LLVM IR (-O0):
define i32 @GrOffScreen16BPPColorTranslate(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = lshr i32 %5, 16
%7 = and i32 %6, 255
%8 = load i32, i32* %4
%9 = lshr i32 %8, 8
%10 = and i32 %9, 255
%11 = load i32, i32* %4
%12 = lshr i32 %11, 0
%13 = and i32 %12, 255
%14 = call i32 @RGB16(i32 %7, i32 %10, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @GrOffScreen16BPPColorTranslate(i8* nocapture readnone %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 255
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = and i32 %1, 255
%8 = tail call i32 @RGB16(i32 %4, i32 %6, i32 %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void greet() { printf("Hello\n\n"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Hello\0A\0A\00"
define void @greet() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Hello\0A\00"
define void @greet() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
#define STDERR_FILENO 130
#define STDIN_FILENO 129
#define STDOUT_FILENO 128
int /*<<< orphan*/ errno;
int isatty(int file) {
  switch (file) {
  case STDOUT_FILENO:
  case STDERR_FILENO:
  case STDIN_FILENO:
    return 1;
  default:
    errno = EBADF;
    return 0;
  }
}


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x2,%eax
ja     1127 <isatty+0x27>
jmp    111b <isatty+0x1b>
movl   $0x1,-0x4(%rbp)
jmp    1140 <isatty+0x40>
mov    0x2eaa(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea9(%rip),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isatty>:
add    $0xffffff80,%edi
mov    $0x1,%eax
cmp    $0x3,%edi
jb     1121 <isatty+0x21>
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
mov    0x2ec3(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@EBADF = global i32 0
@errno = global i32 0
define i32 @isatty(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 128, label %5
i32 130, label %5
i32 129, label %5
]
5: ; preds = %1, %1, %1
store i32 1, i32* %2
br label %8
6: ; preds = %1
%7 = load i32, i32* @EBADF
store i32 %7, i32* @errno
store i32 0, i32* %2
br label %8
8: ; preds = %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@EBADF = global i32 0
@errno = global i32 0
define i32 @isatty(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 3
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = load i32, i32* @EBADF
store i32 %5, i32* @errno
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %7
}
char const *_Locale_extract_monetary_name(const char *__DUMMY_PAR1,
                                          char *__DUMMY_PAR,
                                          struct _Locale_name_hint *hint) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct._Locale_name_hint = type opaque
define i8* @_Locale_extract_monetary_name(i8* %0, i8* %1, %struct._Locale_name_hint* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct._Locale_name_hint*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct._Locale_name_hint* %2, %struct._Locale_name_hint** %6
ret i8* null
}

LLVM IR (-O2):
%struct._Locale_name_hint = type opaque
define noalias i8* @_Locale_extract_monetary_name(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct._Locale_name_hint* nocapture readnone %2) {
ret i8* null
}
/* Type definitions */
typedef int value;

/* Variables and functions */
int bnode_is_black(size_t value) { return ((((value)&1)) ^ (1)); }


x86 assembly (clang, -O0):
<bnode_is_black>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
xor    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bnode_is_black>:
mov    %rdi,%rax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bnode_is_black(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 1
%5 = xor i64 %4, 1
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @bnode_is_black(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 1
%4 = xor i32 %3, 1
ret i32 %4
}
/* Type definitions */
struct file_tags {
  int dummy;
};

/* Variables and functions */
struct file_tags *player_get_curr_tags();
struct file_tags *audio_get_curr_tags() {
  return player_get_curr_tags();
}


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

x86 assembly (clang, -O2):
<audio_get_curr_tags>:
xor    %eax,%eax
jmp    1030 <player_get_curr_tags@plt>

LLVM IR (-O0):
%struct.file_tags = type { i32 }
define %struct.file_tags* @audio_get_curr_tags() {
%1 = call %struct.file_tags* (...) @player_get_curr_tags()
ret %struct.file_tags* %1
}

LLVM IR (-O2):
%struct.file_tags = type { i32 }
define %struct.file_tags* @audio_get_curr_tags() {
%1 = tail call %struct.file_tags* (...) @player_get_curr_tags()
ret %struct.file_tags* %1
}
/* Variables and functions */
int /*<<< orphan*/ e_addrr(int, int);
int /*<<< orphan*/ ra_mchange(int, int);
int ra_mgetv(int);
void co_add(int ra, int rb, int rc) {
  int mab, mc;
  mab = ra_mgetv(rb);
  mc = ra_mgetv(rc);
  ra_mchange(mab, ra);
  e_addrr(mab, mc);
}


x86 assembly (clang, -O0):
<co_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <ra_mgetv@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <ra_mgetv@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <ra_mchange@plt>
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <e_addrr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<co_add>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %edi,%r14d
mov    %esi,%edi
call   1040 <ra_mgetv@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <ra_mgetv@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r14d,%esi
call   1050 <ra_mchange@plt>
mov    %ebp,%edi
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <e_addrr@plt>

LLVM IR (-O0):
define void @co_add(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = call i32 @ra_mgetv(i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %6
%12 = call i32 @ra_mgetv(i32 %11)
store i32 %12, i32* %8
%13 = load i32, i32* %7
%14 = load i32, i32* %4
%15 = call i32 @ra_mchange(i32 %13, i32 %14)
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = call i32 @e_addrr(i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @co_add(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @ra_mgetv(i32 %1)
%5 = tail call i32 @ra_mgetv(i32 %2)
%6 = tail call i32 @ra_mchange(i32 %4, i32 %0)
%7 = tail call i32 @e_addrr(i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ADXL362_stop();
int /*<<< orphan*/ delay(int);
void ADXL362_power_off() {
  ADXL362_stop();
  delay(200 * 10);
  delay(200 * 50);
}


x86 assembly (clang, -O0):
<ADXL362_power_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ADXL362_stop@plt>
mov    $0x7d0,%edi
call   1030 <delay@plt>
mov    $0x2710,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADXL362_power_off>:
push   %rax
xor    %eax,%eax
call   1040 <ADXL362_stop@plt>
mov    $0x7d0,%edi
call   1030 <delay@plt>
mov    $0x2710,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @ADXL362_power_off() {
%1 = call i32 (...) @ADXL362_stop()
%2 = call i32 @delay(i32 2000)
%3 = call i32 @delay(i32 10000)
ret void
}

LLVM IR (-O2):
define void @ADXL362_power_off() {
%1 = tail call i32 (...) @ADXL362_stop()
%2 = tail call i32 @delay(i32 2000)
%3 = tail call i32 @delay(i32 10000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int benchmark_fini() {
  (void)fprintf(stderr, "benchmark_fini\n");
  return (0);
}


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

x86 assembly (clang, -O2):
<benchmark_fini>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"benchmark_fini\0A\00"
define i32 @benchmark_fini() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"benchmark_fini\0A\00"
define i32 @benchmark_fini() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
float asinhf(float);
float futrts_asinh32(float x) { return asinhf(x); }


x86 assembly (clang, -O0):
<futrts_asinh32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <asinhf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futrts_asinh32>:
jmp    1030 <asinhf@plt>

LLVM IR (-O0):
define float @futrts_asinh32(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @asinhf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @futrts_asinh32(float %0) {
%2 = tail call float @asinhf(float %0)
ret float %2
}
void printStatus(struct Chip8 *chip8) {
  int r = 0;
  int s = 0;
}


x86 assembly (clang, -O0):
<printStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Chip8 = type opaque
define void @printStatus(%struct.Chip8* %0) {
%2 = alloca %struct.Chip8*
%3 = alloca i32
%4 = alloca i32
store %struct.Chip8* %0, %struct.Chip8** %2
store i32 0, i32* %3
store i32 0, i32* %4
ret void
}

LLVM IR (-O2):
%struct.Chip8 = type opaque
define void @printStatus(%struct.Chip8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ snprintf_d(char *, int, char const *, int);
void printf_d(const char *fmt, int x) {
  char buf[200];
  snprintf_d(buf, 200, fmt, x);
  puts(buf);
}


x86 assembly (clang, -O0):
<printf_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0xc8,%esi
call   1040 <snprintf_d@plt>
lea    -0xe0(%rbp),%rdi
call   1030 <puts@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_d>:
push   %rbx
sub    $0xd0,%rsp
mov    %esi,%ecx
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1040 <snprintf_d@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @printf_d(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [200 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @snprintf_d(i8* %6, i32 200, i8* %7, i32 %8)
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%11 = call i32 @puts(i8* %10)
ret void
}

LLVM IR (-O2):
define void @printf_d(i8* %0, i32 %1) {
%3 = alloca [200 x i8]
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf_d(i8* %4, i32 200, i8* %0, i32 %1)
%6 = call i32 @puts(i8* %4)
ret void
}
/* Variables and functions */
scalar_t__ is_digit(char const);
char *skip_digit(const char *s, int sz) {
  while (sz > 0 && is_digit(*s)) {
    s++;
    sz--;
  }
  return (char *)s;
}


x86 assembly (clang, -O0):
<skip_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jle    1144 <skip_digit+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_digit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1154 <skip_digit+0x44>
jmp    116e <skip_digit+0x5e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <skip_digit+0xf>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_digit>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %esi,%esi
jle    1139 <skip_digit+0x29>
mov    %esi,%ebp
add    $0x1,%ebp
nop
movsbl (%rbx),%edi
call   1030 <is_digit@plt>
test   %rax,%rax
je     1139 <skip_digit+0x29>
add    $0x1,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
jg     1120 <skip_digit+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @skip_digit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %15, %2
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = call i64 @is_digit(i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %5
%14 = phi i1 [ false, %5 ], [ %12, %8 ]
br i1 %14, label %15, label %20
15: ; preds = %13
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
%18 = load i32, i32* %4
%19 = add nsw i32 %18, -1
store i32 %19, i32* %4
br label %5
20: ; preds = %13
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @skip_digit(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %10
%5 = phi i32 [ %12, %10 ], [ %1, %2 ]
%6 = phi i8* [ %11, %10 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = tail call i64 @is_digit(i8 signext %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = add nsw i32 %5, -1
%13 = icmp sgt i32 %5, 1
br i1 %13, label %4, label %14
14: ; preds = %4, %10, %2
%15 = phi i8* [ %0, %2 ], [ %11, %10 ], [ %6, %4 ]
ret i8* %15
}
int namegen_cap(int c, int capitalize) {
  return capitalize && c >= 'a' && c <= 'z' ? c & ~0x20 : c;
}


x86 assembly (clang, -O0):
<namegen_cap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1136 <namegen_cap+0x36>
cmpl   $0x61,-0x4(%rbp)
jl     1136 <namegen_cap+0x36>
cmpl   $0x7a,-0x4(%rbp)
jg     1136 <namegen_cap+0x36>
mov    -0x4(%rbp),%eax
and    $0xffffffdf,%eax
mov    %eax,-0xc(%rbp)
jmp    113c <namegen_cap+0x3c>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<namegen_cap>:
mov    %edi,%eax
and    $0xffffffdf,%eax
test   %esi,%esi
cmove  %edi,%eax
lea    -0x61(%rdi),%ecx
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @namegen_cap(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 97
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp sle i32 %11, 122
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %3
%15 = and i32 %14, -33
br label %18
16: ; preds = %10, %7, %2
%17 = load i32, i32* %3
br label %18
18: ; preds = %16, %13
%19 = phi i32 [ %15, %13 ], [ %17, %16 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @namegen_cap(i32 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = add i32 %0, -97
%5 = icmp ult i32 %4, 26
%6 = and i1 %5, %3
%7 = and i32 %0, -33
%8 = select i1 %6, i32 %7, i32 %0
ret i32 %8
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcat(char *, char const *);
int strlen(char const *);
char *ATI_strdup(const char *s) {
  size_t t;
  char *p;
  t = strlen(s) + 1;
  p = malloc(sizeof(char) * t);
  if (p == NULL)
    return p;
  *p = '\0';
  strcat(p, s);
  return p;
}


x86 assembly (clang, -O0):
<ATI_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1179 <ATI_strdup+0x49>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1195 <ATI_strdup+0x65>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ATI_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115a <ATI_strdup+0x2a>
movb   $0x0,(%rbx)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ATI_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
store i8 0, i8* %4
%7 = tail call i32 @strcat(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ AnimationCamera();
scalar_t__ GetAnimationCamera();
int /*<<< orphan*/ glutPostRedisplay();
void OurAnimation(void) {
  glutPostRedisplay();
  if (GetAnimationCamera())
    AnimationCamera();
}


x86 assembly (clang, -O0):
<OurAnimation>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <glutPostRedisplay@plt>
mov    $0x0,%al
call   1040 <GetAnimationCamera@plt>
cmp    $0x0,%rax
je     1153 <OurAnimation+0x23>
mov    $0x0,%al
call   1030 <AnimationCamera@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OurAnimation>:
push   %rax
xor    %eax,%eax
call   1050 <glutPostRedisplay@plt>
xor    %eax,%eax
call   1040 <GetAnimationCamera@plt>
test   %rax,%rax
je     114c <OurAnimation+0x1c>
xor    %eax,%eax
pop    %rcx
jmp    1030 <AnimationCamera@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @OurAnimation() {
%1 = call i32 (...) @glutPostRedisplay()
%2 = call i64 (...) @GetAnimationCamera()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @AnimationCamera()
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @OurAnimation() {
%1 = tail call i32 (...) @glutPostRedisplay()
%2 = tail call i64 (...) @GetAnimationCamera()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @AnimationCamera()
br label %6
6: ; preds = %4, %0
ret void
}
void hclib_init_stats(int set_start_worker, int set_end_worker) {}


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

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

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

LLVM IR (-O2):
define void @hclib_init_stats(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pmesg(int, char *, int, char *);
int oph_subset_validate(const char *cond, unsigned long len) {
  pmesg(2,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/OphidiaBigData/ophidia-primitives/refs/"
        "heads/master/src/oph_core_subset.c",
        73, "Unsupported function 'oph_subset_validate'\n");
  return 0;
}


x86 assembly (clang, -O0):
<oph_subset_validate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%edi
lea    0xed4(%rip),%rsi
mov    $0x49,%edx
lea    0xf6c(%rip),%rcx
call   1030 <pmesg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oph_subset_validate>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xf85(%rip),%rcx
mov    $0x2,%edi
mov    $0x49,%edx
call   1030 <pmesg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/OphidiaBigData/ophidia-primitives/refs/heads/master/src/oph_core_subset.c\00"
@.str.1 = [44 x i8] c"Unsupported function 'oph_subset_validate'\0A\00"
define i32 @oph_subset_validate(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = call i32 @pmesg(i32 2, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i32 73, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/OphidiaBigData/ophidia-primitives/refs/heads/master/src/oph_core_subset.c\00"
@.str.1 = [44 x i8] c"Unsupported function 'oph_subset_validate'\0A\00"
define i32 @oph_subset_validate(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i32 @pmesg(i32 2, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i32 73, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void usage(void) {
  puts("usage: kbdlogd [OPTIONS]...\n"
       "Capure keyboard stream data from /dev/input/*\n\n"
       "Avaiable options.\n"
       "  -d, --debug     enable debug mode.\n"
       "  -i, --device    set alternate keyboard device (default: "
       "/dev/input/event0).\n"
       "  -o, --outfile   set alternate logfile.\n"
       "  -u, --update    set PTS update time (default: 60secs).\n"
       "      --version   show the keylogger version.\n"
       "      --help      display this help.");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [389 x i8] c"usage: kbdlogd [OPTIONS]...\0ACapure keyboard stream data from /dev/input/*\0A\0AAvaiable options.\0A -d, --debug enable debug mode.\0A -i, --device set alternate keyboard device (default: /dev/input/event0).\0A -o, --outfile set alternate logfile.\0A -u, --update set PTS update time (default: 60secs).\0A --version show the keylogger version.\0A --help display this help.\00"
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([389 x i8], [389 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@.str = [389 x i8] c"usage: kbdlogd [OPTIONS]...\0ACapure keyboard stream data from /dev/input/*\0A\0AAvaiable options.\0A -d, --debug enable debug mode.\0A -i, --device set alternate keyboard device (default: /dev/input/event0).\0A -o, --outfile set alternate logfile.\0A -u, --update set PTS update time (default: 60secs).\0A --version show the keylogger version.\0A --help display this help.\00"
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([389 x i8], [389 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int random();
int /*<<< orphan*/ srand(unsigned int);
int get_random() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  srand((unsigned int)tv.tv_usec);
  return random();
}


x86 assembly (clang, -O0):
<get_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1050 <random@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%edi
call   1040 <srand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <random@plt>

LLVM IR (-O0):
%struct.timeval = type { i64 }
define i32 @get_random() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = call i32 @srand(i32 %5)
%7 = call i32 (...) @random()
ret i32 %7
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
define i32 @get_random() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = tail call i32 @srand(i32 %6)
%8 = tail call i32 (...) @random()
ret i32 %8
}
int find_in_power_serise(int number, int power) {
  do {
    if ((number % power) == 0) {
      number = number / power;
    } else {
      break;
    }
  } while (number > 1);
  if (number == 1) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<find_in_power_serise>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1129 <find_in_power_serise+0x29>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    112e <find_in_power_serise+0x2e>
jmp    113d <find_in_power_serise+0x3d>
jmp    1133 <find_in_power_serise+0x33>
cmpl   $0x1,-0x8(%rbp)
jg     110a <find_in_power_serise+0xa>
cmpl   $0x1,-0x8(%rbp)
jne    1153 <find_in_power_serise+0x53>
movl   $0x1,-0x4(%rbp)
jmp    115a <find_in_power_serise+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_in_power_serise>:
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
jne    1110 <find_in_power_serise+0x10>
mov    %eax,%edi
cmp    $0x1,%eax
jg     1100 <find_in_power_serise>
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @find_in_power_serise(i32 %0, i32 %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i32 [ %0, %2 ], [ %6, %8 ]
%5 = srem i32 %4, %1
%6 = sdiv i32 %4, %1
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = icmp sgt i32 %6, 1
br i1 %9, label %3, label %10
10: ; preds = %3, %8
%11 = phi i32 [ %6, %8 ], [ %4, %3 ]
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i32
ret i32 %13
}
int test_tagged_typedef_bitmask3(int val) { return val; }


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

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

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

LLVM IR (-O2):
define i32 @test_tagged_typedef_bitmask3(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
float ceilf(float);
void vec3_ceil(float *dst) {
  dst[0] = ceilf(dst[0]);
  dst[1] = ceilf(dst[1]);
  dst[2] = ceilf(dst[2]);
}


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

x86 assembly (clang, -O2):
<vec3_ceil>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  %xmm1,0xc(%rsp)
call   1030 <ceilf@plt>
movss  %xmm0,(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <ceilf@plt>
movss  %xmm0,0x4(%rbx)
movss  0x8(%rbx),%xmm0
call   1030 <ceilf@plt>
movss  %xmm0,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @vec3_ceil(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = call float @llvm.ceil.f32(float %5)
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
store float %6, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = call float @llvm.ceil.f32(float %11)
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %2
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = call float @llvm.ceil.f32(float %17)
%19 = load float*, float** %2
%20 = getelementptr inbounds float, float* %19, i64 2
store float %18, float* %20
ret void
}

LLVM IR (-O2):
define void @vec3_ceil(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @llvm.ceil.f32(float %2)
store float %3, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = tail call float @llvm.ceil.f32(float %5)
store float %6, float* %4
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.ceil.f32(float %8)
store float %9, float* %7
ret void
}