xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void welcomeMessage() { printf("\nWelcome to mini-shell\n"); }


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"\0AWelcome to mini-shell\00"
define void @welcomeMessage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
void popdown_help_dialog(void) {}


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

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

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

LLVM IR (-O2):
define void @popdown_help_dialog() {
ret void
}
void ff_hevc_put_hevc_epel_hv64_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv64_8_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pipe_unix_exit();
void e_comm_exit(void) { pipe_unix_exit(); }


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

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

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

LLVM IR (-O2):
define void @e_comm_exit() {
%1 = tail call i32 (...) @pipe_unix_exit()
ret void
}
__attribute__((no, noclone)) unsigned __int128 t170_3mul(unsigned __int128 y) {
  unsigned __int128 r;
  if (__builtin_mul_overflow((unsigned __int128)(2), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t170_3mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
add    %rdx,%rdx
adc    %rcx,%rcx
setb   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1156 <t170_3mul+0x46>
jmp    115d <t170_3mul+0x4d>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t170_3mul>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    %rdi,%rbx
adc    %rsi,%r14
jae    1129 <t170_3mul+0x19>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t170_3mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.umul.with.overflow.i128(i128 2, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t170_3mul(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %6, i128 2)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
void pcie_iomux_config() {}


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

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

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

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


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <__MINIK_main@plt>
mov    %eax,%ebx
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @__MINIK_main()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %1
}
/* Type definitions */
struct transient {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sfile_log_sample_count(struct transient const *, int);
void sfile_log_sample(struct transient const *trans) {
  sfile_log_sample_count(trans, 1);
}


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

x86 assembly (clang, -O2):
<sfile_log_sample>:
mov    $0x1,%esi
jmp    1030 <sfile_log_sample_count@plt>

LLVM IR (-O0):
%struct.transient = type { i32 }
define void @sfile_log_sample(%struct.transient* %0) {
%2 = alloca %struct.transient*
store %struct.transient* %0, %struct.transient** %2
%3 = load %struct.transient*, %struct.transient** %2
%4 = call i32 @sfile_log_sample_count(%struct.transient* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.transient = type { i32 }
define void @sfile_log_sample(%struct.transient* %0) {
%2 = tail call i32 @sfile_log_sample_count(%struct.transient* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sfree(void *);
void cccsp_sfifilehook_free(void *hook) {
  if (!hook) {
    return;
  }
  sfree(hook);
}


x86 assembly (clang, -O0):
<cccsp_sfifilehook_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <cccsp_sfifilehook_free+0x1c>
jmp    1135 <cccsp_sfifilehook_free+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <sfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cccsp_sfifilehook_free(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 %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @sfree(i8* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @cccsp_sfifilehook_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sfree(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
void g_completion_remove_items() {}


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

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

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

LLVM IR (-O2):
define void @g_completion_remove_items() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ board_power_off();
int poweroff_main(int argc, char *argv[]) {
  board_power_off();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @poweroff_main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @board_power_off()
ret i32 0
}
void *foo(void) { __sync_synchronize(); }


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

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

LLVM IR (-O0):
define i8* @foo() {
%1 = alloca i8*
fence seq_cst
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @foo() {
fence seq_cst
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int strcmp(char *, char *);
char *string_to_lower(char const *);
int compare_ignore_case(const char *s1, const char *s2) {
  char *t1 = string_to_lower(s1);
  char *t2 = string_to_lower(s2);
  int result = strcmp(t1, t2);
  free(t1);
  free(t2);
  return result;
}


x86 assembly (clang, -O0):
<compare_ignore_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <string_to_lower@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <string_to_lower@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_ignore_case>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1050 <string_to_lower@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1050 <string_to_lower@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <strcmp@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @compare_ignore_case(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i8* @string_to_lower(i8* %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = call i8* @string_to_lower(i8* %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = call i32 @strcmp(i8* %12, i8* %13)
store i32 %14, i32* %7
%15 = load i8*, i8** %5
%16 = call i32 @free(i8* %15)
%17 = load i8*, i8** %6
%18 = call i32 @free(i8* %17)
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @compare_ignore_case(i8* %0, i8* %1) {
%3 = tail call i8* @string_to_lower(i8* %0)
%4 = tail call i8* @string_to_lower(i8* %1)
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
%6 = tail call i32 @free(i8* %3)
%7 = tail call i32 @free(i8* %4)
ret i32 %5
}
unsigned short string_33_to_int(char c) {
  if ((c <= '9') && (c >= '0'))
    return c - '0';
  if ((c <= 'A') && (c >= 'Z'))
    return c - 'A' + 10;
  return 0;
}


x86 assembly (clang, -O0):
<string_33_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
cmp    $0x39,%eax
jg     1134 <string_33_to_int+0x34>
movsbl -0x3(%rbp),%eax
cmp    $0x30,%eax
jl     1134 <string_33_to_int+0x34>
movsbl -0x3(%rbp),%eax
sub    $0x30,%eax
mov    %ax,-0x2(%rbp)
jmp    1167 <string_33_to_int+0x67>
movsbl -0x3(%rbp),%eax
cmp    $0x41,%eax
jg     1161 <string_33_to_int+0x61>
movsbl -0x3(%rbp),%eax
cmp    $0x5a,%eax
jl     1161 <string_33_to_int+0x61>
movsbl -0x3(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %ax,-0x2(%rbp)
jmp    1167 <string_33_to_int+0x67>
movw   $0x0,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_33_to_int>:
lea    -0x30(%rdi),%ecx
lea    -0x30(%rdi),%edx
xor    %eax,%eax
cmp    $0xa,%cl
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @string_33_to_int(i8 signext %0) {
%2 = alloca i16
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 %5, 57
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 48
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
%15 = trunc i32 %14 to i16
store i16 %15, i16* %2
br label %31
16: ; preds = %7, %1
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 65
br i1 %19, label %20, label %30
20: ; preds = %16
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = icmp sge i32 %22, 90
br i1 %23, label %24, label %30
24: ; preds = %20
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = sub nsw i32 %26, 65
%28 = add nsw i32 %27, 10
%29 = trunc i32 %28 to i16
store i16 %29, i16* %2
br label %31
30: ; preds = %20, %16
store i16 0, i16* %2
br label %31
31: ; preds = %30, %24, %11
%32 = load i16, i16* %2
ret i16 %32
}

LLVM IR (-O2):
define zeroext i16 @string_33_to_int(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = sext i8 %0 to i16
%5 = add nsw i16 %4, -48
%6 = select i1 %3, i16 %5, i16 0
ret i16 %6
}
/* Variables and functions */
int /*<<< orphan*/ function_which_gives_up_settonull(int **);
void coverage9(int *x) {
  int y = 5;
  function_which_gives_up_settonull(&x);
  y = (*x);
}


x86 assembly (clang, -O0):
<coverage9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <function_which_gives_up_settonull@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coverage9>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <function_which_gives_up_settonull@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @coverage9(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @function_which_gives_up_settonull(i32** %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *);
void doit() {
  fork();
  fork();
  printf("hello\n");
  return;
}


x86 assembly (clang, -O0):
<doit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <fork@plt>
mov    $0x0,%al
call   1040 <fork@plt>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<doit>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
xor    %eax,%eax
call   1040 <fork@plt>
lea    0xeca(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define void @doit() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 (...) @fork()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
int calc_places(int x) {
  int k, count;
  k = 1;
  count = 0;
  while (k < x - 1) {
    k = k << 1;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<calc_places>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    113d <calc_places+0x3d>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <calc_places+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_places>:
xor    %eax,%eax
cmp    $0x3,%edi
jl     1129 <calc_places+0x29>
add    $0xffffffff,%edi
mov    $0x1,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    %ecx,%ecx
add    $0x1,%eax
cmp    %edi,%ecx
jl     1120 <calc_places+0x20>
ret

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

LLVM IR (-O2):
define i32 @calc_places(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32 [ %7, %4 ], [ 1, %1 ]
%7 = shl i32 %6, 1
%8 = add nuw nsw i32 %5, 1
%9 = icmp slt i32 %7, %2
br i1 %9, label %4, label %10
10: ; preds = %4, %1
%11 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ recoverableError(char *);
int /*<<< orphan*/ stderr;
void labelAlreadyDefinedError(const char *label) {
  recoverableError("Label Already defined. Labels cannot be re-used");
  fprintf(stderr, "     %s was already defined elsewhere\n", label);
  exit(1);
}


x86 assembly (clang, -O0):
<labelAlreadyDefinedError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <recoverableError@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed4(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<labelAlreadyDefinedError>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <recoverableError@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Label Already defined. Labels cannot be re-used\00"
@stderr = global i32 0
@.str.1 = [39 x i8] c" %s was already defined elsewhere\0A\00"
define void @labelAlreadyDefinedError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @recoverableError(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [48 x i8] c"Label Already defined. Labels cannot be re-used\00"
@stderr = global i32 0
@.str.1 = [39 x i8] c" %s was already defined elsewhere\0A\00"
define void @labelAlreadyDefinedError(i8* %0) {
%2 = tail call i32 @recoverableError(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void lgtd_tests_hr(void) { puts("----"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"----\00"
define void @lgtd_tests_hr() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
int __test() { return ((3) * (((2) + (4)))); }


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

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

LLVM IR (-O0):
define i32 @__test() {
ret i32 18
}

LLVM IR (-O2):
define i32 @__test() {
ret i32 18
}
/* Variables and functions */
int max_subarray(int *, int);
int test_max_subarray() {
  int array[] = {1, 2, -4, 3, 1, -2, -1};
  return 4 == max_subarray(array, 7);
}


x86 assembly (clang, -O0):
<test_max_subarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed9(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1030 <max_subarray@plt>
mov    %eax,%ecx
mov    $0x4,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_max_subarray>:
sub    $0x28,%rsp
movups 0xef1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <max_subarray@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
sete   %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_max_subarray.array = [7 x i32] [i32 1, i32 2, i32 -4, i32 3, i32 1, i32 -2, i32 -1]
define i32 @test_max_subarray() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @max_subarray(i32* %3, i32 7)
%5 = icmp eq i32 4, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@__const.test_max_subarray.array = [7 x i32] [i32 1, i32 2, i32 -4, i32 3, i32 1, i32 -2, i32 -1]
define i32 @test_max_subarray() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @max_subarray(i32* %3, i32 7)
%5 = icmp eq i32 %4, 4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ cpu6502_clk();
int /*<<< orphan*/ vic_clk();
void do_clock_cycle(void) {
  static uint32_t irq_clk = 0;
  cpu6502_clk();
  vic_clk();
  irq_clk++;
  if (irq_clk >= 1000) {
    irq_clk = 0;
  }
}


x86 assembly (clang, -O0):
<do_clock_cycle>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <cpu6502_clk@plt>
mov    $0x0,%al
call   1030 <vic_clk@plt>
mov    0x2efc(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef3(%rip)
cmpl   $0x3e8,0x2ee9(%rip)
jl     115b <do_clock_cycle+0x3b>
movl   $0x0,0x2ed9(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_clock_cycle>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <cpu6502_clk@plt>
xor    %eax,%eax
call   1030 <vic_clk@plt>
mov    0x2efd(%rip),%eax
lea    0x1(%rax),%ecx
cmp    $0x3e7,%eax
cmovge %ebx,%ecx
mov    %ecx,0x2eec(%rip)
pop    %rbx
ret

LLVM IR (-O0):
@do_clock_cycle.irq_clk = internal global i32 0
define void @do_clock_cycle() {
%1 = call i32 (...) @cpu6502_clk()
%2 = call i32 (...) @vic_clk()
%3 = load i32, i32* @do_clock_cycle.irq_clk
%4 = add nsw i32 %3, 1
store i32 %4, i32* @do_clock_cycle.irq_clk
%5 = load i32, i32* @do_clock_cycle.irq_clk
%6 = icmp sge i32 %5, 1000
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 0, i32* @do_clock_cycle.irq_clk
br label %8
8: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
@do_clock_cycle.irq_clk = internal unnamed_addr global i32 0
define void @do_clock_cycle() {
%1 = tail call i32 (...) @cpu6502_clk()
%2 = tail call i32 (...) @vic_clk()
%3 = load i32, i32* @do_clock_cycle.irq_clk
%4 = add nsw i32 %3, 1
%5 = icmp sgt i32 %3, 998
%6 = select i1 %5, i32 0, i32 %4
store i32 %6, i32* @do_clock_cycle.irq_clk
ret void
}
/* Type definitions */
struct minix_dir_entry {
  int dummy;
};

/* Variables and functions */
int mx_read_write_dir_entry(int, int, int, struct minix_dir_entry *,
                            int /*<<< orphan*/);
int mx_read_dir_entry(int device, int inodenr, int entrynr,
                      struct minix_dir_entry *entry) {
  return mx_read_write_dir_entry(device, inodenr, entrynr, entry, 0);
}


x86 assembly (clang, -O0):
<mx_read_dir_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <mx_read_write_dir_entry@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mx_read_dir_entry>:
xor    %r8d,%r8d
jmp    1030 <mx_read_write_dir_entry@plt>

LLVM IR (-O0):
%struct.minix_dir_entry = type { i32 }
define i32 @mx_read_dir_entry(i32 %0, i32 %1, i32 %2, %struct.minix_dir_entry* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.minix_dir_entry*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.minix_dir_entry* %3, %struct.minix_dir_entry** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load %struct.minix_dir_entry*, %struct.minix_dir_entry** %8
%13 = call i32 @mx_read_write_dir_entry(i32 %9, i32 %10, i32 %11, %struct.minix_dir_entry* %12, i32 0)
ret i32 %13
}

LLVM IR (-O2):
%struct.minix_dir_entry = type { i32 }
define i32 @mx_read_dir_entry(i32 %0, i32 %1, i32 %2, %struct.minix_dir_entry* %3) {
%5 = tail call i32 @mx_read_write_dir_entry(i32 %0, i32 %1, i32 %2, %struct.minix_dir_entry* %3, i32 0)
ret i32 %5
}
float warp_minf(float a, float b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<warp_minf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <warp_minf+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <warp_minf+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<warp_minf>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @warp_minf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @warp_minf(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ attendClient(int);
void *attendClientThread(void *arg) {
  attendClient((int)arg);
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @attendClientThread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = call i32 @attendClient(i32 %4)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @attendClientThread(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @attendClient(i32 %3)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_SNDBUF;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
int fnet_set_send_buffsize(int fd, int size) {
  return setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&size, sizeof(int));
}


x86 assembly (clang, -O0):
<fnet_set_send_buffsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnet_set_send_buffsize>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_SNDBUF = global i32 0
define i32 @fnet_set_send_buffsize(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* @SOL_SOCKET
%7 = load i32, i32* @SO_SNDBUF
%8 = bitcast i32* %4 to i8*
%9 = call i32 @setsockopt(i32 %5, i32 %6, i32 %7, i8* %8, i32 4)
ret i32 %9
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_SNDBUF = global i32 0
define i32 @fnet_set_send_buffsize(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_SNDBUF
%6 = bitcast i32* %3 to i8*
%7 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %6, i32 4)
ret i32 %7
}
/* Variables and functions */
char *strdup(char *);
char *tgl_strdup(char *s) { return strdup(s); }


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

x86 assembly (clang, -O2):
<tgl_strdup>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @tgl_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert(sizeof(0) == sizeof(int));
  assert(sizeof(0U) == sizeof(unsigned));
  assert(sizeof(0L) == sizeof(long));
  assert(sizeof(0UL) == sizeof(unsigned long));
  assert(sizeof(0LL) == sizeof(long long));
  assert(sizeof(0ULL) == sizeof(unsigned long long));
  assert(sizeof(4294967296) == sizeof(long));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
%5 = tail call i32 @assert(i32 1)
%6 = tail call i32 @assert(i32 1)
%7 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void writeToFile(char *filename, char *value) {
  FILE *fp;
  fp = fopen(filename, "w");
  if (fp != NULL) {
    fputs(value, fp);
    fclose(fp);
  }
}


x86 assembly (clang, -O0):
<writeToFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1175 <writeToFile+0x45>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeToFile>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1165 <writeToFile+0x35>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @writeToFile(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @fputs(i8* %1, i32* %3)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int destroy_driver() { printf("\ndestory called in pluggable driver\n"); }


x86 assembly (clang, -O0):
<destroy_driver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [37 x i8] c"\0Adestory called in pluggable driver\0A\00"
define i32 @destroy_driver() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [36 x i8] c"\0Adestory called in pluggable driver\00"
define i32 @destroy_driver() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int floor(float);
int /*<<< orphan*/ printf(char *, float, float);
void roundToHundreths(float number) {
  float rounded = floor(number * 100 + .5) / 100;
  printf("original = %f  Rounded to Hundredth = %.2f\n", number, rounded);
}


x86 assembly (clang, -O0):
<roundToHundreths>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xed3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeba(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <floor@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundToHundreths>:
push   %rax
movaps %xmm0,%xmm1
movss  %xmm0,0x4(%rsp)
movss  0xece(%rip),%xmm0
mulss  %xmm1,%xmm0
addss  0xec6(%rip),%xmm0
call   1040 <floor@plt>
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
lea    0xea1(%rip),%rdi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"original = %f Rounded to Hundredth = %.2f\0A\00"
define void @roundToHundreths(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fmul float %4, 1.000000e+02
%6 = fpext float %5 to double
%7 = fadd double %6, 5.000000e-01
%8 = fptrunc double %7 to float
%9 = call i32 @floor(float %8)
%10 = sdiv i32 %9, 100
%11 = sitofp i32 %10 to float
store float %11, float* %3
%12 = load float, float* %2
%13 = load float, float* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), float %12, float %13)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"original = %f Rounded to Hundredth = %.2f\0A\00"
define void @roundToHundreths(float %0) {
%2 = fmul float %0, 1.000000e+02
%3 = fadd float %2, 5.000000e-01
%4 = tail call i32 @floor(float %3)
%5 = sdiv i32 %4, 100
%6 = sitofp i32 %5 to float
%7 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), float %0, float %6)
ret void
}
long div_long(void) {
  long a = 4, b = 2;
  (void)_Generic((a / b), long : 0);
}


x86 assembly (clang, -O0):
<div_long>:
push   %rbp
mov    %rsp,%rbp
movq   $0x4,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @div_long() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
store i64 4, i64* %2
store i64 2, i64* %3
%4 = load i64, i64* %1
ret i64 %4
}

LLVM IR (-O2):
define i64 @div_long() {
ret i64 undef
}
/* Variables and functions */
char *malloc(size_t);
char *ace_str_alloc(size_t length) {
  char *str = malloc(length);
  str[0] = '\0';
  return str;
}


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

x86 assembly (clang, -O2):
<ace_str_alloc>:
push   %rax
call   1030 <malloc@plt>
movb   $0x0,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @ace_str_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 0, i8* %7
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @ace_str_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
store i8 0, i8* %2
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ ssse3_test();
void __attribute__((no)) do_test(void) { ssse3_test(); }


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

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

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

LLVM IR (-O2):
define void @do_test() {
%1 = tail call i32 (...) @ssse3_test()
ret void
}
char *cnv_help(void) {
  return "Syntax: bin2bas { -t | -z | -p } infile outfile\n\n"
         "-t=filename: Output in .TAP format\n"
         "-z=filename: Output in .ZXT format\n"
         "-p: Output in +3DOS format (default)\n";
}


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

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

LLVM IR (-O0):
@.str = [157 x i8] c"Syntax: bin2bas { -t | -z | -p } infile outfile\0A\0A-t=filename: Output in .TAP format\0A-z=filename: Output in .ZXT format\0A-p: Output in +3DOS format (default)\0A\00"
define i8* @cnv_help() {
ret i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [157 x i8] c"Syntax: bin2bas { -t | -z | -p } infile outfile\0A\0A-t=filename: Output in .TAP format\0A-z=filename: Output in .ZXT format\0A-p: Output in +3DOS format (default)\0A\00"
define i8* @cnv_help() {
ret i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
char *executable_file_in_path(char *, char *);
scalar_t__ getenv(char *);
char *find_man_formatter(void) {
  return (executable_file_in_path("man", (char *)getenv("PATH")));
}


x86 assembly (clang, -O0):
<find_man_formatter>:
push   %rbp
mov    %rsp,%rbp
lea    0xed9(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xec6(%rip),%rdi
call   1040 <executable_file_in_path@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_man_formatter>:
push   %rax
lea    0xedc(%rip),%rdi
call   1030 <getenv@plt>
lea    0xecc(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <executable_file_in_path@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"man\00"
@.str.1 = [5 x i8] c"PATH\00"
define i8* @find_man_formatter() {
%1 = call i64 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = inttoptr i64 %1 to i8*
%3 = call i8* @executable_file_in_path(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i8* %3
}

LLVM IR (-O2):
@.str = [4 x i8] c"man\00"
@.str.1 = [5 x i8] c"PATH\00"
define i8* @find_man_formatter() {
%1 = tail call i64 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = inttoptr i64 %1 to i8*
%3 = tail call i8* @executable_file_in_path(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i8* %3
}
int valuegen(int i) { return 3 * i % 10; }


x86 assembly (clang, -O0):
<valuegen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valuegen>:
lea    (%rdi,%rdi,2),%eax
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @valuegen(i32 %0) {
%2 = mul nsw i32 %0, 3
%3 = srem i32 %2, 10
ret i32 %3
}
/* Variables and functions */
bool between(int n, int m, int o) {
  if ((m >= n && n >= o) || (m <= n && n <= o)) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<between>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1125 <between+0x25>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    113d <between+0x3d>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1149 <between+0x49>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1149 <between+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1150 <between+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<between>:
cmp    %edi,%esi
setge  %sil
setle  %cl
cmp    %edx,%edi
setge  %dl
setle  %al
and    %cl,%al
and    %sil,%dl
or     %al,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
define i32 @between(i32 %0, i32 %1, i32 %2) {
%4 = icmp sge i32 %1, %0
%5 = icmp sge i32 %0, %2
%6 = icmp sle i32 %1, %0
%7 = icmp sle i32 %0, %2
%8 = and i1 %6, %7
%9 = and i1 %4, %5
%10 = or i1 %9, %8
%11 = zext i1 %10 to i32
ret i32 %11
}
void i810fb_remove_stale_memory(void) {}


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

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

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

LLVM IR (-O2):
define void @i810fb_remove_stale_memory() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  system("pause");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"pause\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
int /*<<< orphan*/ printf(char *, void *, void *, void *);
int main() {
  void *x = malloc(15);
  printf("%p, %p, %p\n", x, *(void **)(0xb7faed7c), *(void **)(0xb7faed80));
  free(x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xf,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0xb7faed7c,%eax
mov    (%rax),%rdx
mov    $0xb7faed80,%eax
mov    (%rax),%rcx
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xf,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0xb7faed7c,%eax
mov    (%rax),%rdx
mov    0x4(%rax),%rcx
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%p, %p, %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 15)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** inttoptr (i64 3086675324 to i8**)
%6 = load i8*, i8** inttoptr (i64 3086675328 to i8**)
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5, i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%p, %p, %p\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(15) i8* @malloc(i32 15)
%2 = load i8*, i8** inttoptr (i64 3086675324 to i8**)
%3 = load i8*, i8** inttoptr (i64 3086675328 to i8**)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
%5 = tail call i32 @free(i8* %1)
ret i32 0
}