xunge/DecIR huggingface dataset:
void outreg(int channel, int reg, unsigned char val) {
  *((volatile unsigned char *)0x08104000 + (channel * 0x2000) + (reg * 0x4)) =
      val;
}


x86 assembly (clang, -O0):
<outreg>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x4(%rbp),%eax
shl    $0xd,%eax
movslq %eax,%rcx
mov    $0x8104000,%eax
add    %rcx,%rax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outreg>:
movslq %edi,%rax
shl    $0xd,%rax
movslq %esi,%rcx
mov    %dl,0x8104000(%rax,%rcx,4)
ret

LLVM IR (-O0):
define void @outreg(i32 %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = load i32, i32* %4
%9 = mul nsw i32 %8, 8192
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* inttoptr (i64 135282688 to i8*), i64 %10
%12 = load i32, i32* %5
%13 = mul nsw i32 %12, 4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
store volatile i8 %7, i8* %15
ret void
}

LLVM IR (-O2):
define void @outreg(i32 %0, i32 %1, i8 zeroext %2) {
%4 = shl nsw i32 %0, 13
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* inttoptr (i64 135282688 to i8*), i64 %5
%7 = shl nsw i32 %1, 2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
store volatile i8 %2, i8* %9
ret void
}
void final_check(const struct ebt_u_entry *entry,
                 const struct ebt_entry_match *match, const char *name,
                 unsigned int hookmask, unsigned int time) {}


x86 assembly (clang, -O0):
<final_check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ebt_u_entry = type opaque
%struct.ebt_entry_match = type opaque
define void @final_check(%struct.ebt_u_entry* %0, %struct.ebt_entry_match* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca %struct.ebt_u_entry*
%7 = alloca %struct.ebt_entry_match*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store %struct.ebt_u_entry* %0, %struct.ebt_u_entry** %6
store %struct.ebt_entry_match* %1, %struct.ebt_entry_match** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
%struct.ebt_u_entry = type opaque
%struct.ebt_entry_match = type opaque
define void @final_check(%struct.ebt_u_entry* nocapture %0, %struct.ebt_entry_match* nocapture %1, i8* nocapture %2, i32 %3, i32 %4) {
ret void
}
void am_nmi_isr(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<am_nmi_isr>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <am_nmi_isr+0x9>
jmp    1109 <am_nmi_isr+0x9>

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

LLVM IR (-O0):
define void @am_nmi_isr() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @am_nmi_isr() {
br label %1
1: ; preds = %0, %1
br label %1
}
void Vortex_RemoveMemoryBlocks(void) {
  int i;
  for (i = 0; i < 4; i++) {
  }
  for (i = 0; i < 4; i++) {
  }
}


x86 assembly (clang, -O0):
<Vortex_RemoveMemoryBlocks>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    1128 <Vortex_RemoveMemoryBlocks+0x28>
jmp    111a <Vortex_RemoveMemoryBlocks+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <Vortex_RemoveMemoryBlocks+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    114c <Vortex_RemoveMemoryBlocks+0x4c>
jmp    113e <Vortex_RemoveMemoryBlocks+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <Vortex_RemoveMemoryBlocks+0x2f>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @Vortex_RemoveMemoryBlocks() {
ret void
}
int check_for_running_daemons(unsigned minor) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @check_for_running_daemons(i32 %0) {
ret i32 0
}
double vde_chain_nm5_sq(double x) { return x * x; }


x86 assembly (clang, -O0):
<vde_chain_nm5_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm5_sq>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @vde_chain_nm5_sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @vde_chain_nm5_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
int mtd_has_cmdlinepart(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mtd_has_cmdlinepart() {
ret i32 0
}
int tests_hardware_setround(int mode) {
  { return (0); }
}


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

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

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

LLVM IR (-O2):
define i32 @tests_hardware_setround(i32 %0) {
ret i32 0
}
int mdoc_skip_pre(const struct roff_meta *meta, struct roff_node *n,
                  struct html *h) {
  return 0;
}


x86 assembly (clang, -O0):
<mdoc_skip_pre>:
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):
<mdoc_skip_pre>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
%struct.roff_meta = type opaque
%struct.roff_node = type opaque
%struct.html = type opaque
define i32 @mdoc_skip_pre(%struct.roff_meta* nocapture readnone %0, %struct.roff_node* nocapture readnone %1, %struct.html* nocapture readnone %2) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void volatile_set_bit_u16(uint16_t *mask, uint8_t bit) {
  *((volatile uint16_t *)mask) |= 1 << bit;
}


x86 assembly (clang, -O0):
<volatile_set_bit_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<volatile_set_bit_u16>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @volatile_set_bit_u16(i32* %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = load volatile i32, i32* %0
%5 = or i32 %4, %3
store volatile i32 %5, i32* %0
ret void
}
void XGetVisualInfo() {}


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

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

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

LLVM IR (-O2):
define void @XGetVisualInfo() {
ret void
}
/* Variables and functions */
scalar_t__ mu_badv_kmod_loaded(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (mu_badv_kmod_loaded(NULL)) {
    printf("TRUE");
  } else {
    printf("FALSE");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <mu_badv_kmod_loaded@plt>
cmp    $0x0,%rax
je     1153 <main+0x33>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
jmp    115f <main+0x3f>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <mu_badv_kmod_loaded@plt>
test   %rax,%rax
lea    0xed3(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"TRUE\00"
@.str.1 = [6 x i8] c"FALSE\00"
define i32 @main() {
%1 = tail call i64 @mu_badv_kmod_loaded(i32* null)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret i32 0
}
int getuid(void) { return 1000; }


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

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

LLVM IR (-O0):
define i32 @getuid() {
ret i32 1000
}

LLVM IR (-O2):
define i32 @getuid() {
ret i32 1000
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int);
int _mod(int x, int y, void *garb) {
  if (y == 0) {
    error("error: modulo zero exception\n");
    exit(1);
  }
  return (x % y) * (1 - (x % y < 0) * 2);
}


x86 assembly (clang, -O0):
<_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1152 <_mod+0x32>
lea    0xebd(%rip),%rdi
call   1030 <error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x0,%edx
setl   %cl
and    $0x1,%cl
movzbl %cl,%edx
shl    $0x1,%edx
mov    $0x1,%ecx
sub    %edx,%ecx
imul   %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mod>:
test   %esi,%esi
je     113c <_mod+0x1c>
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%ecx
shr    $0x1e,%ecx
and    $0xfffffffe,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
imul   %edx,%eax
ret
push   %rax
lea    0xebc(%rip),%rdi
call   1030 <error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"error: modulo zero exception\0A\00"
define i32 @_mod(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = call i32 @error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = srem i32 %13, %14
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = srem i32 %16, %17
%19 = icmp slt i32 %18, 0
%20 = zext i1 %19 to i32
%21 = mul nsw i32 %20, 2
%22 = sub nsw i32 1, %21
%23 = mul nsw i32 %15, %22
ret i32 %23
}

LLVM IR (-O2):
@.str = [30 x i8] c"error: modulo zero exception\0A\00"
define i32 @_mod(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = tail call i32 @error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %3
%9 = srem i32 %0, %1
%10 = lshr i32 %9, 30
%11 = and i32 %10, 2
%12 = sub nsw i32 1, %11
%13 = mul nsw i32 %12, %9
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int x1 = 5 == 3;
  int x2 = 5 == 5;
  int y1 = 5 > 3;
  int y2 = 5 > 6;
  printf("相等表达式的值：%d %d\n", x1, x2);
  printf("关系表达式的值：%d %d\n", y1, y2);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"\E7\9B\B8\E7\AD\89\E8\A1\A8\E8\BE\BE\E5\BC\8F\E7\9A\84\E5\80\BC\EF\BC\9A%d %d\0A\00"
@.str.1 = [31 x i8] c"\E5\85\B3\E7\B3\BB\E8\A1\A8\E8\BE\BE\E5\BC\8F\E7\9A\84\E5\80\BC\EF\BC\9A%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
store i32 1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"\E7\9B\B8\E7\AD\89\E8\A1\A8\E8\BE\BE\E5\BC\8F\E7\9A\84\E5\80\BC\EF\BC\9A%d %d\0A\00"
@.str.1 = [31 x i8] c"\E5\85\B3\E7\B3\BB\E8\A1\A8\E8\BE\BE\E5\BC\8F\E7\9A\84\E5\80\BC\EF\BC\9A%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 0)
ret i32 0
}
long dot_product(long x1, long y1, long x2, long y2) {
  return ((x1 * x2) + (y1 * y2));
}


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

x86 assembly (clang, -O2):
<dot_product>:
imul   %rdx,%rdi
imul   %rcx,%rsi
lea    (%rsi,%rdi,1),%rax
ret

LLVM IR (-O0):
define i64 @dot_product(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %7
%11 = mul nsw i64 %9, %10
%12 = load i64, i64* %6
%13 = load i64, i64* %8
%14 = mul nsw i64 %12, %13
%15 = add nsw i64 %11, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @dot_product(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = mul nsw i64 %2, %0
%6 = mul nsw i64 %3, %1
%7 = add nsw i64 %6, %5
ret i64 %7
}
void artio_init() { ; }


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

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

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

LLVM IR (-O2):
define void @artio_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int init(int, char **);
int /*<<< orphan*/ riptide(int);
int main(int argc, char *argv[]) {
  int sd;
  sd = init(argc, argv);
  for (;;)
    riptide(sd);
  close(sd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <init@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <riptide@plt>
jmp    1145 <main+0x25>

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1040 <init@plt>
mov    %eax,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <riptide@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
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* %4
%8 = load i8**, i8*** %5
%9 = call i32 @init(i32 %7, i8** %8)
store i32 %9, i32* %6
br label %10
10: ; preds = %10, %2
%11 = load i32, i32* %6
%12 = call i32 @riptide(i32 %11)
br label %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @init(i32 %0, i8** %1)
br label %4
4: ; preds = %4, %2
%5 = tail call i32 @riptide(i32 %3)
br label %4
}
/* Variables and functions */
unsigned id_already_exists(const size_t *ids, unsigned count, size_t new_id) {
  unsigned i;
  for (i = 0; i < count; i++) {
    if (ids[i] == new_id)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<id_already_exists>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1156 <id_already_exists+0x56>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
cmp    -0x20(%rbp),%rax
jne    1143 <id_already_exists+0x43>
movl   $0x1,-0x4(%rbp)
jmp    115d <id_already_exists+0x5d>
jmp    1148 <id_already_exists+0x48>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1116 <id_already_exists+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<id_already_exists>:
test   %esi,%esi
je     111f <id_already_exists+0x1f>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %rdx,(%rdi,%rcx,8)
je     1122 <id_already_exists+0x22>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <id_already_exists+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @id_already_exists(i64* nocapture %0, i32 %1, i64 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i64, i64* %0, i64 %10
%12 = load i64, i64* %11
%13 = icmp eq i64 %12, %2
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a;
  int p;
  int t;
  a = 1;
  p = 0;
  t = 0;
  do {
    printf("%d\n", a);
    t = a;
    a = t + p;
    p = t;
  } while (a < 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x64,-0x8(%rbp)
jl     1134 <main+0x24>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebp,%ebp
mov    $0x1,%eax
lea    0xede(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ebx
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    %ebx,%ebp
mov    %ebp,%eax
cmp    $0x64,%ebp
mov    %ebx,%ebp
jl     1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %5, %1 ]
%3 = phi i32 [ 0, %0 ], [ %2, %1 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = add nsw i32 %3, %2
%6 = icmp slt i32 %5, 100
br i1 %6, label %1, label %7
7: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void got_alarm(int sig) { fprintf(stderr, "Got signal %d\n", sig); }


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

x86 assembly (clang, -O2):
<got_alarm>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Got signal %d\0A\00"
define void @got_alarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Got signal %d\0A\00"
define void @got_alarm(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ clock();
int /*<<< orphan*/ forEachLoopMaxInteger(int);
int /*<<< orphan*/ printf(char *, long);
long timediff(int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  clock_t t1, t2;
  int i;
  float x = 2.7182;
  long elapsed;
  t1 = clock();
  forEachLoopMaxInteger(100000000);
  t2 = clock();
  elapsed = timediff(t1, t2);
  printf("C: %ldms\n", elapsed);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xea9(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x8(%rbp)
mov    $0x5f5e100,%edi
call   1050 <forEachLoopMaxInteger@plt>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <timediff@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe70(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <clock@plt>
mov    %eax,%ebx
mov    $0x5f5e100,%edi
call   1050 <forEachLoopMaxInteger@plt>
xor    %eax,%eax
call   1030 <clock@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <timediff@plt>
lea    0xe95(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"C: %ldms\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca i64
store i32 0, i32* %1
store float 0x4005BEDFA0000000, float* %5
%7 = call i32 (...) @clock()
store i32 %7, i32* %2
%8 = call i32 @forEachLoopMaxInteger(i32 100000000)
%9 = call i32 (...) @clock()
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i64 @timediff(i32 %10, i32 %11)
store i64 %12, i64* %6
%13 = load i64, i64* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"C: %ldms\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @clock()
%2 = tail call i32 @forEachLoopMaxInteger(i32 100000000)
%3 = tail call i32 (...) @clock()
%4 = tail call i64 @timediff(i32 %1, i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int pthread_join(int /*<<< orphan*/, void **);
void Pthread_join(pthread_t th, void **thread_return) {
  int retval;
  retval = pthread_join(th, thread_return);
  if (retval != 0)
    Sys_failure("pthread_join");
}


x86 assembly (clang, -O0):
<Pthread_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <pthread_join@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1154 <Pthread_join+0x34>
lea    0xeb1(%rip),%rdi
call   1030 <Sys_failure@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pthread_join>:
push   %rax
call   1040 <pthread_join@plt>
test   %eax,%eax
je     1137 <Pthread_join+0x17>
lea    0xecf(%rip),%rdi
pop    %rax
jmp    1030 <Sys_failure@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"pthread_join\00"
define void @Pthread_join(i32 %0, i8** %1) {
%3 = tail call i32 @pthread_join(i32 %0, i8** %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
int mus_uninterpreted_int(unsigned char *inp) {
  int o;
  unsigned char *outp;
  outp = (unsigned char *)&o;
  outp[0] = inp[0];
  outp[1] = inp[1];
  outp[2] = inp[2];
  outp[3] = inp[3];
  return (o);
}


x86 assembly (clang, -O0):
<mus_uninterpreted_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_uninterpreted_int>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @mus_uninterpreted_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = bitcast i32* %3 to i8*
store i8* %5, i8** %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8 %18, i8* %20
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i64 3
store i8 %23, i8* %25
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @mus_uninterpreted_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl nuw i32 %9, 24
%11 = zext i8 %6 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = zext i8 %4 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = zext i8 %2 to i32
%16 = or i32 %14, %15
%17 = or i32 %16, %12
%18 = or i32 %17, %10
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int sigemptyset(sigset_t *set) {
  if (set == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  memset(set, 0, sizeof(sigset_t));
  return 0;
}


x86 assembly (clang, -O0):
<sigemptyset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <sigemptyset+0x31>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <sigemptyset+0x48>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigemptyset>:
push   %rbx
test   %rdi,%rdi
je     1136 <sigemptyset+0x16>
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
jmp    1149 <sigemptyset+0x29>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sigemptyset(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EINVAL
%8 = call i32 @__set_errno(i32 %7)
store i32 -1, i32* %2
br label %12
9: ; preds = %1
%10 = load i32*, i32** %3
%11 = call i32 @memset(i32* %10, i32 0, i32 4)
store i32 0, i32* %2
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sigemptyset(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @EINVAL
%5 = tail call i32 @__set_errno(i32 %4)
br label %8
6: ; preds = %1
%7 = tail call i32 @memset(i32* %0, i32 0, i32 4)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ -1, %3 ], [ 0, %6 ]
ret i32 %9
}
void av_format_get_open_cb() {}


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

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

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

LLVM IR (-O2):
define void @av_format_get_open_cb() {
ret void
}
/* Variables and functions */
int loadBitBltFromwarping(int, int /*<<< orphan*/);
int loadBitBltFrom(int bbObj) { return loadBitBltFromwarping(bbObj, 0); }


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

x86 assembly (clang, -O2):
<loadBitBltFrom>:
xor    %esi,%esi
jmp    1030 <loadBitBltFromwarping@plt>

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

LLVM IR (-O2):
define i32 @loadBitBltFrom(i32 %0) {
%2 = tail call i32 @loadBitBltFromwarping(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
double pow(double, double);
__attribute__((__weak__, __always___)) double softboundcets_pow(double x,
                                                                double y) {
  return pow(x, y);
}


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

x86 assembly (clang, -O2):
<softboundcets_pow>:
jmp    1030 <pow@plt>

LLVM IR (-O0):
define weak double @softboundcets_pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @pow(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define weak double @softboundcets_pow(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
/* Type definitions */
struct map {
  int dummy;
};

/* Variables and functions */
void *map_iget(struct map *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void *map_get(struct map *m, char *key) {
  return map_iget(m, key, strlen(key));
}


x86 assembly (clang, -O0):
<map_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <map_iget@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_get>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <map_iget@plt>

LLVM IR (-O0):
%struct.map = type { i32 }
define i8* @map_get(%struct.map* %0, i8* %1) {
%3 = alloca %struct.map*
%4 = alloca i8*
store %struct.map* %0, %struct.map** %3
store i8* %1, i8** %4
%5 = load %struct.map*, %struct.map** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i8* @map_iget(%struct.map* %5, i8* %6, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.map = type { i32 }
define i8* @map_get(%struct.map* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i8* @map_iget(%struct.map* %0, i8* %1, i32 %3)
ret i8* %4
}
RCU_DEF_DESTROY_FUNC(user_f3_destroy, param) {}


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

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

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

LLVM IR (-O2):
define i32 @RCU_DEF_DESTROY_FUNC(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mem_free(void *ptr) { free(ptr); }


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

LLVM IR (-O0):
define void @mem_free(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 @mem_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void print_entry(const char *type, const char *usuario, const char *linea,
                 const char *strtiempo, const char *idlinea, const char *host,
                 const char *str_salida) {
  printf("(%s)\t%s\t\t%s\t%s\t%c%c\t%s\t%s\n", type, usuario, linea, strtiempo,
         idlinea[0], idlinea[1], host, str_salida);
}


x86 assembly (clang, -O0):
<print_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%rax
movsbl (%rax),%r9d
mov    -0x28(%rbp),%rax
movsbl 0x1(%rax),%r11d
mov    -0x30(%rbp),%r10
mov    0x10(%rbp),%rax
lea    0xe9c(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_entry>:
push   %rax
mov    %r9,%r10
mov    %rcx,%rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
movsbl (%r8),%r9d
movsbl 0x1(%r8),%r11d
sub    $0x8,%rsp
lea    0xecc(%rip),%rdi
mov    %rax,%r8
xor    %eax,%eax
push   0x18(%rsp)
push   %r10
push   %r11
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"(%s)\09%s\09\09%s\09%s\09%c%c\09%s\09%s\0A\00"
define void @print_entry(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i8*, i8** %10
%18 = load i8*, i8** %11
%19 = load i8*, i8** %12
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = load i8*, i8** %12
%24 = getelementptr inbounds i8, i8* %23, i64 1
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = load i8*, i8** %13
%28 = load i8*, i8** %14
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16, i8* %17, i8* %18, i32 %22, i32 %26, i8* %27, i8* %28)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"(%s)\09%s\09\09%s\09%s\09%c%c\09%s\09%s\0A\00"
define void @print_entry(i8* %0, i8* %1, i8* %2, i8* %3, i8* nocapture %4, i8* %5, i8* %6) {
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = getelementptr inbounds i8, i8* %4, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2, i8* %3, i32 %9, i32 %12, i8* %5, i8* %6)
ret void
}
/* Type definitions */
typedef int uint16_t;
struct ByteStream {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ByteStream_write_byte(struct ByteStream *, int);
void ByteStream_write_u16(struct ByteStream *self, uint16_t value) {
  ByteStream_write_byte(self, value >> 8 & 0xff);
  ByteStream_write_byte(self, value & 0xff);
}


x86 assembly (clang, -O0):
<ByteStream_write_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x8,%esi
and    $0xff,%esi
call   1030 <ByteStream_write_byte@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
and    $0xff,%esi
call   1030 <ByteStream_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ByteStream_write_u16>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%eax
mov    %rdi,%rbx
movzbl %ah,%esi
mov    %eax,%ebp
call   1030 <ByteStream_write_byte@plt>
movzbl %bpl,%esi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <ByteStream_write_byte@plt>

LLVM IR (-O0):
%struct.ByteStream = type { i32 }
define void @ByteStream_write_u16(%struct.ByteStream* %0, i32 %1) {
%3 = alloca %struct.ByteStream*
%4 = alloca i32
store %struct.ByteStream* %0, %struct.ByteStream** %3
store i32 %1, i32* %4
%5 = load %struct.ByteStream*, %struct.ByteStream** %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = call i32 @ByteStream_write_byte(%struct.ByteStream* %5, i32 %8)
%10 = load %struct.ByteStream*, %struct.ByteStream** %3
%11 = load i32, i32* %4
%12 = and i32 %11, 255
%13 = call i32 @ByteStream_write_byte(%struct.ByteStream* %10, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.ByteStream = type { i32 }
define void @ByteStream_write_u16(%struct.ByteStream* %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
%5 = tail call i32 @ByteStream_write_byte(%struct.ByteStream* %0, i32 %4)
%6 = and i32 %1, 255
%7 = tail call i32 @ByteStream_write_byte(%struct.ByteStream* %0, i32 %6)
ret void
}
/* Variables and functions */
char *ft_strnew(int /*<<< orphan*/);
int ft_init_line(char **line) {
  *line = ft_strnew(0);
  if (!*line)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_init_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <ft_strnew@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1147 <ft_init_line+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <ft_init_line+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_init_line>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <ft_strnew@plt>
mov    %rax,(%rbx)
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_init_line(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = call i8* @ft_strnew(i32 0)
%5 = load i8**, i8*** %3
store i8* %4, i8** %5
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i32 -1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_init_line(i8** nocapture writeonly %0) {
%2 = tail call i8* @ft_strnew(i32 0)
store i8* %2, i8** %0
%3 = icmp eq i8* %2, null
%4 = sext i1 %3 to i32
ret i32 %4
}
void flush_freed_pages(void) {}


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

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

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

LLVM IR (-O2):
define void @flush_freed_pages() {
ret void
}
int vga_switcheroo_register_handler(
    const struct vga_switcheroo_handler *handler) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.vga_switcheroo_handler = type opaque
define i32 @vga_switcheroo_register_handler(%struct.vga_switcheroo_handler* nocapture readnone %0) {
ret i32 0
}
void _STD_UNLOCK() { return; }


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

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

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

LLVM IR (-O2):
define void @_STD_UNLOCK() {
ret void
}
/* Variables and functions */
int addDigits(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) { printf("%d\n", addDigits(341)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x155,%edi
call   1040 <addDigits@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @addDigits(i32 341)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ isns_security_init();
int init_server(void) {
  if (!isns_security_init())
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<init_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <isns_security_init@plt>
cmp    $0x0,%eax
jne    1134 <init_server+0x24>
movl   $0x0,-0x4(%rbp)
jmp    113b <init_server+0x2b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_server>:
push   %rax
xor    %eax,%eax
call   1030 <isns_security_init@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @init_server() {
%1 = alloca i32
%2 = call i32 (...) @isns_security_init()
%3 = icmp ne i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @init_server() {
%1 = tail call i32 (...) @isns_security_init()
%2 = icmp ne i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}