xunge/DecIR huggingface dataset:
/* Type definitions */
struct radix_tree_root {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rst_init(struct radix_tree_root *,
                            unsigned long (*)(void const *), int);
void init_single_radix_tree(struct radix_tree_root *tree,
                            unsigned long (*get_value)(const void *),
                            int max_b) {
  rst_init(tree, get_value, max_b);
}


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

x86 assembly (clang, -O2):
<init_single_radix_tree>:
jmp    1030 <rst_init@plt>

LLVM IR (-O0):
%struct.radix_tree_root = type { i32 }
define void @init_single_radix_tree(%struct.radix_tree_root* %0, i64 (i8*)* %1, i32 %2) {
%4 = alloca %struct.radix_tree_root*
%5 = alloca i64 (i8*)*
%6 = alloca i32
store %struct.radix_tree_root* %0, %struct.radix_tree_root** %4
store i64 (i8*)* %1, i64 (i8*)** %5
store i32 %2, i32* %6
%7 = load %struct.radix_tree_root*, %struct.radix_tree_root** %4
%8 = load i64 (i8*)*, i64 (i8*)** %5
%9 = load i32, i32* %6
%10 = call i32 @rst_init(%struct.radix_tree_root* %7, i64 (i8*)* %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.radix_tree_root = type { i32 }
define void @init_single_radix_tree(%struct.radix_tree_root* %0, i64 (i8*)* %1, i32 %2) {
%4 = tail call i32 @rst_init(%struct.radix_tree_root* %0, i64 (i8*)* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float random = 23.69;
  printf("number=%.2f\n", random);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"number=%.2f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float 0x4037B0A3E0000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TimerUpdate();
void TIMER0_ISR(void) {
  (*((volatile unsigned long *)0xE0004000)) = 0x01;
  (*((volatile unsigned long *)0xFFFFF030)) = 0;
  TimerUpdate();
}


x86 assembly (clang, -O0):
<TIMER0_ISR>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0004000,%eax
movq   $0x1,(%rax)
mov    $0xfffff030,%eax
movq   $0x0,(%rax)
mov    $0x0,%al
call   1030 <TimerUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TIMER0_ISR>:
mov    $0xe0004000,%eax
movq   $0x1,(%rax)
movq   $0x0,0x1fffb030(%rax)
xor    %eax,%eax
jmp    1030 <TimerUpdate@plt>

LLVM IR (-O0):
define void @TIMER0_ISR() {
store volatile i64 1, i64* inttoptr (i64 3758112768 to i64*)
store volatile i64 0, i64* inttoptr (i64 4294963248 to i64*)
%1 = call i32 (...) @TimerUpdate()
ret void
}

LLVM IR (-O2):
define void @TIMER0_ISR() {
store volatile i64 1, i64* inttoptr (i64 3758112768 to i64*)
store volatile i64 0, i64* inttoptr (i64 4294963248 to i64*)
%1 = tail call i32 (...) @TimerUpdate()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xrand(int, int);
size_t generate_number_of_columns(void) { return (size_t)xrand(2, 16); }


x86 assembly (clang, -O0):
<generate_number_of_columns>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x10,%esi
call   1030 <xrand@plt>
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_number_of_columns>:
push   %rax
mov    $0x2,%edi
mov    $0x10,%esi
call   1030 <xrand@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @generate_number_of_columns() {
%1 = call i32 @xrand(i32 2, i32 16)
%2 = sext i32 %1 to i64
ret i64 %2
}

LLVM IR (-O2):
define i64 @generate_number_of_columns() {
%1 = tail call i32 @xrand(i32 2, i32 16)
%2 = sext i32 %1 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ chroot(char *);
int /*<<< orphan*/ foo();
void f3(void) {
  chroot("/usr/local");
  chdir("../");
  foo();
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <chroot@plt>
lea    0xec4(%rip),%rdi
call   1040 <chdir@plt>
mov    $0x0,%al
call   1050 <foo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <chroot@plt>
lea    0xec7(%rip),%rdi
call   1040 <chdir@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <foo@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"/usr/local\00"
@.str.1 = [4 x i8] c"../\00"
define void @f3() {
%1 = call i32 @chroot(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @chdir(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"/usr/local\00"
@.str.1 = [4 x i8] c"../\00"
define void @f3() {
%1 = tail call i32 @chroot(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @chdir(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
void *curr_stack_first_frame();
void *currcontext() { return curr_stack_first_frame(); }


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

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

LLVM IR (-O0):
define i8* @currcontext() {
%1 = call i8* (...) @curr_stack_first_frame()
ret i8* %1
}

LLVM IR (-O2):
define i8* @currcontext() {
%1 = tail call i8* (...) @curr_stack_first_frame()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ ext();
void n1(int a) { ext(); }


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

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

LLVM IR (-O0):
define void @n1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @ext()
ret void
}

LLVM IR (-O2):
define void @n1(i32 %0) {
%2 = tail call i32 (...) @ext()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compute_edit_offset(char *, int, int, int *,
                                       int /*<<< orphan*/);
int dlg_edit_offset(char *string, int chr_offset, int x_last) {
  int result;
  compute_edit_offset(string, chr_offset, x_last, &result, 0);
  return result;
}


x86 assembly (clang, -O0):
<dlg_edit_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    -0x14(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <compute_edit_offset@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlg_edit_offset>:
push   %rax
lea    0x4(%rsp),%rcx
xor    %r8d,%r8d
call   1030 <compute_edit_offset@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @dlg_edit_offset(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @compute_edit_offset(i8* %0, i32 %1, i32 %2, i32* %4, i32 0)
%7 = load i32, i32* %4
ret i32 %7
}
/* Type definitions */
struct board_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ce_parse_fen(char *, struct board_s *);
int /*<<< orphan*/ ce_print_board(struct board_s *);
void ce_parse_and_print(char *fen, struct board_s *board) {
  ce_parse_fen(fen, board);
  ce_print_board(board);
  ;
}


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

x86 assembly (clang, -O2):
<ce_parse_and_print>:
push   %rbx
mov    %rsi,%rbx
call   1040 <ce_parse_fen@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ce_print_board@plt>

LLVM IR (-O0):
%struct.board_s = type { i32 }
define void @ce_parse_and_print(i8* %0, %struct.board_s* %1) {
%3 = alloca i8*
%4 = alloca %struct.board_s*
store i8* %0, i8** %3
store %struct.board_s* %1, %struct.board_s** %4
%5 = load i8*, i8** %3
%6 = load %struct.board_s*, %struct.board_s** %4
%7 = call i32 @ce_parse_fen(i8* %5, %struct.board_s* %6)
%8 = load %struct.board_s*, %struct.board_s** %4
%9 = call i32 @ce_print_board(%struct.board_s* %8)
ret void
}

LLVM IR (-O2):
%struct.board_s = type { i32 }
define void @ce_parse_and_print(i8* %0, %struct.board_s* %1) {
%3 = tail call i32 @ce_parse_fen(i8* %0, %struct.board_s* %1)
%4 = tail call i32 @ce_print_board(%struct.board_s* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int countMax(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a[] = {3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 3};
  int n = countMax(a, sizeof(a) / sizeof(int));
  printf("The maximum number of repitations %d\n", n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x10,%esi
call   1030 <countMax@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%esi
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x10,%esi
call   1030 <countMax@plt>
lea    0xed9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [16 x i32] [i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 3]
@.str = [38 x i8] c"The maximum number of repitations %d\0A\00"
define i32 @main() {
%1 = alloca [16 x i32]
%2 = alloca i32
%3 = bitcast [16 x i32]* %1 to i8*
%4 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%5 = call i32 @countMax(i32* %4, i32 16)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [16 x i32] [i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 3]
@.str = [38 x i8] c"The maximum number of repitations %d\0A\00"
define i32 @main() {
%1 = alloca [16 x i32]
%2 = bitcast [16 x i32]* %1 to i8*
%3 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%4 = call i32 @countMax(i32* %3, i32 16)
%5 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lovrGpuPresent();
int /*<<< orphan*/ lovrGraphicsFlush();
int /*<<< orphan*/ os_window_swap();
void lovrGraphicsPresent() {
  lovrGraphicsFlush();
  os_window_swap();
  lovrGpuPresent();
}


x86 assembly (clang, -O0):
<lovrGraphicsPresent>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <lovrGraphicsFlush@plt>
mov    $0x0,%al
call   1040 <os_window_swap@plt>
mov    $0x0,%al
call   1030 <lovrGpuPresent@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lovrGraphicsPresent>:
push   %rax
xor    %eax,%eax
call   1050 <lovrGraphicsFlush@plt>
xor    %eax,%eax
call   1040 <os_window_swap@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <lovrGpuPresent@plt>

LLVM IR (-O0):
define void @lovrGraphicsPresent() {
%1 = call i32 (...) @lovrGraphicsFlush()
%2 = call i32 (...) @os_window_swap()
%3 = call i32 (...) @lovrGpuPresent()
ret void
}

LLVM IR (-O2):
define void @lovrGraphicsPresent() {
%1 = tail call i32 (...) @lovrGraphicsFlush()
%2 = tail call i32 (...) @os_window_swap()
%3 = tail call i32 (...) @lovrGpuPresent()
ret void
}
int main() { return 2; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
int chain(int i, long num) {
  if (num == 1)
    return i;
  if (num % 2 == 0)
    return chain(i + 1, num / 2);
  return chain(i + 1, num * 3 + 1);
}


x86 assembly (clang, -O0):
<chain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    1135 <chain+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1188 <chain+0x78>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1171 <chain+0x61>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rsi
call   1030 <chain@plt>
mov    %eax,-0x4(%rbp)
jmp    1188 <chain+0x78>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
imul   $0x3,-0x10(%rbp),%rsi
add    $0x1,%rsi
call   1030 <chain@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chain>:
mov    %edi,%eax
cmp    $0x1,%rsi
jne    1121 <chain+0x21>
jmp    1140 <chain+0x40>
nopw   0x0(%rax,%rax,1)
lea    (%rsi,%rsi,2),%rsi
add    $0x1,%rsi
add    $0x1,%eax
cmp    $0x1,%rsi
je     1140 <chain+0x40>
test   $0x1,%sil
jne    1110 <chain+0x10>
mov    %rsi,%rcx
shr    $0x3f,%rcx
add    %rsi,%rcx
sar    %rcx
mov    %rcx,%rsi
add    $0x1,%eax
cmp    $0x1,%rsi
jne    1121 <chain+0x21>
ret

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

LLVM IR (-O2):
define i32 @chain(i32 %0, i64 %1) {
%3 = icmp eq i64 %1, 1
br i1 %3, label %18, label %4
4: ; preds = %2, %11
%5 = phi i64 [ %12, %11 ], [ %1, %2 ]
%6 = phi i32 [ %13, %11 ], [ %0, %2 ]
%7 = and i64 %5, 1
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = sdiv i64 %5, 2
br label %11
11: ; preds = %9, %15
%12 = phi i64 [ %10, %9 ], [ %17, %15 ]
%13 = add nsw i32 %6, 1
%14 = icmp eq i64 %12, 1
br i1 %14, label %18, label %4
15: ; preds = %4
%16 = mul nsw i64 %5, 3
%17 = add nsw i64 %16, 1
br label %11
18: ; preds = %11, %2
%19 = phi i32 [ %0, %2 ], [ %13, %11 ]
ret i32 %19
}
/* Variables and functions */
int is_str_conversion_ok(const char *str_remainder) {
  if (str_remainder == NULL)
    return 0;
  if (*str_remainder == '\0')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_str_conversion_ok>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <is_str_conversion_ok+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1142 <is_str_conversion_ok+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113b <is_str_conversion_ok+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <is_str_conversion_ok+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_str_conversion_ok>:
xor    %eax,%eax
test   %rdi,%rdi
je     110d <is_str_conversion_ok+0xd>
cmpb   $0x0,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_str_conversion_ok(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
int decryptBlock(int *block, int *key) {
  block = H(block, key);
  block = RG(block, getkeydirective(key), getkeywidth(key));
  return block;
}


x86 assembly (clang, -O0):
<decryptBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <H@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <getkeydirective@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <getkeywidth@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
mov    $0x0,%al
call   1060 <RG@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decryptBlock>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1040 <H@plt>
movslq %eax,%r14
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <getkeydirective@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <getkeywidth@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <RG@plt>

LLVM IR (-O0):
define i32 @decryptBlock(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @H to i32 (i32*, i32*, ...)*)(i32* %5, i32* %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = load i32*, i32** %4
%12 = call i32 (i32*, ...) bitcast (i32 (...)* @getkeydirective to i32 (i32*, ...)*)(i32* %11)
%13 = load i32*, i32** %4
%14 = call i32 (i32*, ...) bitcast (i32 (...)* @getkeywidth to i32 (i32*, ...)*)(i32* %13)
%15 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @RG to i32 (i32*, i32, i32, ...)*)(i32* %10, i32 %12, i32 %14)
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
store i32* %17, i32** %3
%18 = load i32*, i32** %3
%19 = ptrtoint i32* %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @decryptBlock(i32* %0, i32* %1) {
%3 = tail call i32 (i32*, i32*, ...) bitcast (i32 (...)* @H to i32 (i32*, i32*, ...)*)(i32* %0, i32* %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 (i32*, ...) bitcast (i32 (...)* @getkeydirective to i32 (i32*, ...)*)(i32* %1)
%7 = tail call i32 (i32*, ...) bitcast (i32 (...)* @getkeywidth to i32 (i32*, ...)*)(i32* %1)
%8 = tail call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @RG to i32 (i32*, i32, i32, ...)*)(i32* %5, i32 %6, i32 %7)
ret i32 %8
}
void gpio_pmic_active(void) {}


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

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

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

LLVM IR (-O2):
define void @gpio_pmic_active() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void __iec_error(void) { fprintf(stderr, "IEC 61131-3 runtime error.\n"); }


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"IEC 61131-3 runtime error.\0A\00"
define void @__iec_error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"IEC 61131-3 runtime error.\0A\00"
define void @__iec_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_mem(void *data) {
  if (data != NULL) {
    free(data);
  }
}


x86 assembly (clang, -O0):
<free_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_mem+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_mem>:
test   %rdi,%rdi
je     111a <free_mem+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @free_mem(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ createDirectory(int /*<<< orphan*/, char *,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ getCacheDir();
int /*<<< orphan*/ getUserGameDataDir();
void InitCacheDirectory() {
  createDirectory(getUserGameDataDir(), "user data", 0);
  createDirectory(getCacheDir(), "cache data", 0);
}


x86 assembly (clang, -O0):
<InitCacheDirectory>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getUserGameDataDir@plt>
mov    %eax,%edi
lea    0xebc(%rip),%rsi
xor    %edx,%edx
call   1030 <createDirectory@plt>
mov    $0x0,%al
call   1050 <getCacheDir@plt>
mov    %eax,%edi
lea    0xeaf(%rip),%rsi
xor    %edx,%edx
call   1030 <createDirectory@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitCacheDirectory>:
push   %rax
xor    %eax,%eax
call   1040 <getUserGameDataDir@plt>
lea    0xec1(%rip),%rsi
mov    %eax,%edi
xor    %edx,%edx
call   1030 <createDirectory@plt>
xor    %eax,%eax
call   1050 <getCacheDir@plt>
lea    0xeb4(%rip),%rsi
mov    %eax,%edi
xor    %edx,%edx
pop    %rax
jmp    1030 <createDirectory@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"user data\00"
@.str.1 = [11 x i8] c"cache data\00"
define void @InitCacheDirectory() {
%1 = call i32 (...) @getUserGameDataDir()
%2 = call i32 @createDirectory(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = call i32 (...) @getCacheDir()
%4 = call i32 @createDirectory(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"user data\00"
@.str.1 = [11 x i8] c"cache data\00"
define void @InitCacheDirectory() {
%1 = tail call i32 (...) @getUserGameDataDir()
%2 = tail call i32 @createDirectory(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = tail call i32 (...) @getCacheDir()
%4 = tail call i32 @createDirectory(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int __u32_cmp(void *a, void *b) {
  return (int)(*(uint32_t *)a - *(uint32_t *)b);
}


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

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

LLVM IR (-O0):
define i32 @__u32_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @__u32_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
double rectanglePerimeter(double side1, double side2) {
  return 2 * (side1 + side2);
}


x86 assembly (clang, -O0):
<rectanglePerimeter>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rectanglePerimeter>:
addsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @rectanglePerimeter(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 = fadd double %5, %6
%8 = fmul double 2.000000e+00, %7
ret double %8
}

LLVM IR (-O2):
define double @rectanglePerimeter(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fmul double %3, 2.000000e+00
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ test_crystal_comment_entities();
int /*<<< orphan*/ test_crystal_comments();
void all_crystal_tests() {
  test_crystal_comments();
  test_crystal_comment_entities();
}


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

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

LLVM IR (-O0):
define void @all_crystal_tests() {
%1 = call i32 (...) @test_crystal_comments()
%2 = call i32 (...) @test_crystal_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_crystal_tests() {
%1 = tail call i32 (...) @test_crystal_comments()
%2 = tail call i32 (...) @test_crystal_comment_entities()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(int /*<<< orphan*/ const *, int, int,
                          int /*<<< orphan*/ *);
void serialize_uint64(FILE *out, const uint64_t x) {
  assert(fwrite(&x, sizeof(uint64_t), 1, out));
}


x86 assembly (clang, -O0):
<serialize_uint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    %eax,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialize_uint64>:
push   %rax
mov    %rdi,%rcx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define void @serialize_uint64(i32* nocapture %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %0)
%5 = tail call i32 @assert(i32 %4)
ret void
}
void ExttServiceAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttServiceAuxTable() {
ret void
}
int type_sz(unsigned type) {
  switch (type) {
  case 0:
  case 1:
  case 7:
    return 4;
  case 6:
  case 2:
  case 3:
    return 2;
  case 4:
  case 5:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<type_sz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2,%eax
jb     1165 <type_sz+0x65>
jmp    111b <type_sz+0x1b>
mov    -0xc(%rbp),%eax
add    $0xfffffffe,%eax
sub    $0x2,%eax
jb     1171 <type_sz+0x71>
jmp    112f <type_sz+0x2f>
mov    -0xc(%rbp),%eax
add    $0xfffffffc,%eax
sub    $0x2,%eax
jb     117d <type_sz+0x7d>
jmp    1143 <type_sz+0x43>
mov    -0xc(%rbp),%eax
sub    $0x6,%eax
je     1171 <type_sz+0x71>
jmp    1154 <type_sz+0x54>
mov    -0xc(%rbp),%eax
sub    $0x7,%eax
jne    1189 <type_sz+0x89>
jmp    1165 <type_sz+0x65>
movl   $0x4,-0x4(%rbp)
jmp    1190 <type_sz+0x90>
movl   $0x2,-0x4(%rbp)
jmp    1190 <type_sz+0x90>
movl   $0x1,-0x4(%rbp)
jmp    1190 <type_sz+0x90>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_sz>:
xor    %eax,%eax
cmp    $0x7,%edi
ja     1114 <type_sz+0x14>
movslq %edi,%rax
lea    0xeef(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.type_sz = [8 x i32] [i32 4, i32 4, i32 2, i32 2, i32 1, i32 1, i32 2, i32 4]
define i32 @type_sz(i32 %0) {
%2 = icmp ult i32 %0, 8
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.type_sz, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void governor_lve_exit(uint32_t *u1) { printf("%d, governor_lve_exit\n", *u1); }


x86 assembly (clang, -O0):
<governor_lve_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<governor_lve_exit>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [23 x i8] c"%d, governor_lve_exit\0A\00"
define void @governor_lve_exit(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
char *strcpy(char *dst, const char *src) {
  char *d = dst;
  while ((*dst++ = *src++) != '\0')
    ;
  return d;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
int emac2_etherstatspkts_set(unsigned int dev_id,
                             union emac2_etherstatspkts_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac2_etherstatspkts_u = type opaque
define i32 @emac2_etherstatspkts_set(i32 %0, %union.emac2_etherstatspkts_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac2_etherstatspkts_u*
store i32 %0, i32* %3
store %union.emac2_etherstatspkts_u* %1, %union.emac2_etherstatspkts_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac2_etherstatspkts_u = type opaque
define i32 @emac2_etherstatspkts_set(i32 %0, %union.emac2_etherstatspkts_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *);
void BSP_message(char const *msg) { printf(msg); }


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

x86 assembly (clang, -O2):
<BSP_message>:
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @BSP_message(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
double shell_volume(double length_a, double b2a_ratio, double c2a_ratio) {
  const double length_b = length_a * b2a_ratio;
  const double length_c = length_a * c2a_ratio;
  const double shell_volume =
      2.0 * (length_a * length_b + length_a * length_c + length_b * length_c);
  return shell_volume;
}


x86 assembly (clang, -O0):
<shell_volume>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe99(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @shell_volume(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%10 = load double, double* %4
%11 = load double, double* %5
%12 = fmul double %10, %11
store double %12, double* %7
%13 = load double, double* %4
%14 = load double, double* %6
%15 = fmul double %13, %14
store double %15, double* %8
%16 = load double, double* %4
%17 = load double, double* %7
%18 = load double, double* %4
%19 = load double, double* %8
%20 = fmul double %18, %19
%21 = call double @llvm.fmuladd.f64(double %16, double %17, double %20)
%22 = load double, double* %7
%23 = load double, double* %8
%24 = call double @llvm.fmuladd.f64(double %22, double %23, double %21)
%25 = fmul double 2.000000e+00, %24
store double %25, double* %9
%26 = load double, double* %9
ret double %26
}

LLVM IR (-O2):
define double @shell_volume(double %0, double %1, double %2) {
%4 = fmul double %0, %1
%5 = fmul double %0, %2
%6 = fmul double %5, %0
%7 = tail call double @llvm.fmuladd.f64(double %0, double %4, double %6)
%8 = tail call double @llvm.fmuladd.f64(double %4, double %5, double %7)
%9 = fmul double %8, 2.000000e+00
ret double %9
}
int convertNameColorToHex(const char colorname[], const char value[7]) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @convertNameColorToHex(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __enable_irq();
void port_enable(void) { __enable_irq(); }


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

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

LLVM IR (-O0):
define void @port_enable() {
%1 = call i32 (...) @__enable_irq()
ret void
}

LLVM IR (-O2):
define void @port_enable() {
%1 = tail call i32 (...) @__enable_irq()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *mem_delete(void *p) {
  free(p);
  return NULL;
}


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

x86 assembly (clang, -O2):
<mem_delete>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @mem_delete(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i8* null
}
/* Variables and functions */
int strcmp(char const *, char const *);
int key_cmp(const char *a, const char *b) { return strcmp(a, b); }


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

x86 assembly (clang, -O2):
<key_cmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @key_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
int test_imm_FCuint32_reg(unsigned int val) {
  return ((val) & (0xFC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FCuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xfc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FCuint32_reg>:
test   $0xfc,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FCuint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 252
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_FCuint32_reg(i32 %0) {
%2 = and i32 %0, 252
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, int /*<<< orphan*/);
int pthread_cond_broadcast(int /*<<< orphan*/ *);
int /*<<< orphan*/ strerror(int);
void checked_broadcast(pthread_cond_t *c) {
  int err = pthread_cond_broadcast(c);
  if (err != 0) {
    errx(1, "Failed to broadcast a condition variable: %s", strerror(err));
  }
}


x86 assembly (clang, -O0):
<checked_broadcast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_cond_broadcast@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     116d <checked_broadcast+0x3d>
mov    -0xc(%rbp),%edi
call   1050 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe98(%rip),%rsi
call   1040 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_broadcast>:
push   %rax
call   1030 <pthread_cond_broadcast@plt>
test   %eax,%eax
je     1155 <checked_broadcast+0x25>
mov    %eax,%edi
call   1050 <strerror@plt>
lea    0xeb8(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
pop    %rax
jmp    1040 <errx@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Failed to broadcast a condition variable: %s\00"
define void @checked_broadcast(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_cond_broadcast(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @strerror(i32 %9)
%11 = call i32 @errx(i32 1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"Failed to broadcast a condition variable: %s\00"
define void @checked_broadcast(i32* %0) {
%2 = tail call i32 @pthread_cond_broadcast(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @strerror(i32 %2)
%6 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %1
ret void
}
int head_check(unsigned long head) {
  if ((head & 0xffe00000) != 0xffe00000)
    return 0;
  if (!((head >> 17) & 3))
    return 0;
  if (((head >> 12) & 0xf) == 0xf)
    return 0;
  if (((head >> 10) & 0x3) == 0x3)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<head_check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movabs $0xffe00000,%rax
and    -0x10(%rbp),%rax
mov    $0xffe00000,%ecx
cmp    %rcx,%rax
je     1130 <head_check+0x30>
movl   $0x0,-0x4(%rbp)
jmp    119d <head_check+0x9d>
mov    -0x10(%rbp),%rax
shr    $0x11,%rax
and    $0x3,%rax
cmp    $0x0,%rax
jne    1152 <head_check+0x52>
movl   $0x0,-0x4(%rbp)
jmp    119d <head_check+0x9d>
mov    -0x10(%rbp),%rax
shr    $0xc,%rax
and    $0xf,%rax
cmp    $0xf,%rax
jne    1174 <head_check+0x74>
movl   $0x0,-0x4(%rbp)
jmp    119d <head_check+0x9d>
mov    -0x10(%rbp),%rax
shr    $0xa,%rax
and    $0x3,%rax
cmp    $0x3,%rax
jne    1196 <head_check+0x96>
movl   $0x0,-0x4(%rbp)
jmp    119d <head_check+0x9d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<head_check>:
mov    %edi,%eax
not    %eax
test   $0xffe00000,%eax
sete   %cl
test   $0x60000,%edi
setne  %dl
and    %cl,%dl
test   $0xf000,%eax
setne  %cl
test   $0xc00,%eax
setne  %al
and    %cl,%al
and    %dl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @head_check(i64 %0) {
%2 = and i64 %0, 4292870144
%3 = icmp ne i64 %2, 4292870144
%4 = and i64 %0, 393216
%5 = icmp eq i64 %4, 0
%6 = or i1 %3, %5
%7 = and i64 %0, 61440
%8 = icmp eq i64 %7, 61440
%9 = or i1 %8, %6
%10 = and i64 %0, 3072
%11 = icmp ne i64 %10, 3072
%12 = xor i1 %9, true
%13 = and i1 %11, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
scalar_t__ malloc(int);
void get_memory(char *p) { p = (char *)malloc(100); }


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

x86 assembly (clang, -O2):
<get_memory>:
mov    $0x64,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @get_memory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 @malloc(i32 100)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
ret void
}

LLVM IR (-O2):
define void @get_memory(i8* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 100)
ret void
}