xunge/DecIR huggingface dataset:
float floorf(float value) { return (int)value; }


x86 assembly (clang, -O0):
<floorf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floorf>:
cvttps2dq %xmm0,%xmm0
cvtdq2ps %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @floorf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
%5 = sitofp i32 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @floorf(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
ret float %3
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i, n;
  n = __VERIFIER_nondet_int();
  i = n - 1;
  while (i > 1) {
    i = i - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    114a <main+0x3a>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <main+0x22>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = sub nsw i32 %5, 1
store i32 %6, i32* %2
br label %7
7: ; preds = %10, %0
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %2
br label %7
13: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int open(char const *, int, int);
int open_trunc(const char *filename) {
  return open(filename, O_WRONLY | 0 | O_TRUNC | O_CREAT, 0644);
}


x86 assembly (clang, -O0):
<open_trunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
or     $0x0,%esi
mov    0x2ebd(%rip),%rax
or     (%rax),%esi
mov    0x2ebc(%rip),%rax
or     (%rax),%esi
mov    $0x1a4,%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_trunc>:
mov    0x2eb1(%rip),%rax
mov    0x2ed2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ecf(%rip),%rax
or     (%rax),%esi
mov    $0x1a4,%edx
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
define i32 @open_trunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_WRONLY
%5 = or i32 %4, 0
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = load i32, i32* @O_CREAT
%9 = or i32 %7, %8
%10 = call i32 @open(i8* %3, i32 %9, i32 420)
ret i32 %10
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
define i32 @open_trunc(i8* nocapture %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_TRUNC
%4 = or i32 %3, %2
%5 = load i32, i32* @O_CREAT
%6 = or i32 %4, %5
%7 = tail call i32 @open(i8* %0, i32 %6, i32 420)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ displayBits(unsigned int);
int /*<<< orphan*/ displayBitsReversed(unsigned int);
int /*<<< orphan*/ printf(char *);
int main() {
  unsigned result = 1135;
  printf("Original bits:\n");
  displayBits(result);
  printf("Reversed bits:\n");
  displayBitsReversed(result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x46f,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <displayBits@plt>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <displayBitsReversed@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x46f,%edi
call   1050 <displayBits@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x46f,%edi
call   1040 <displayBitsReversed@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [15 x i8] c"Original bits:\00"
@str.2 = [15 x i8] c"Reversed bits:\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @displayBits(i32 1135)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @displayBitsReversed(i32 1135)
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World!\n");
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void assert(const char *info, bool exp) {
  if (!exp) {
    printf("%s", info);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1153 <assert+0x33>
mov    -0x8(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
test   %esi,%esi
je     1125 <assert+0x5>
ret
push   %rax
mov    %rdi,%rax
lea    0xed0(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @assert(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret void
}
/* Variables and functions */
int internal_thingy();
int pkgdep() { return internal_thingy(); }


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

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

LLVM IR (-O0):
define i32 @pkgdep() {
%1 = call i32 (...) @internal_thingy()
ret i32 %1
}

LLVM IR (-O2):
define i32 @pkgdep() {
%1 = tail call i32 (...) @internal_thingy()
ret i32 %1
}
int _times(struct tms *buf) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.tms = type opaque
define i32 @_times(%struct.tms* nocapture readnone %0) {
ret i32 -1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int governor_enter_lve(uint32_t *u0, char *u1) {
  printf("User %s - %d, governor_enter_lve\n", u1, *u0);
  return 0;
}


x86 assembly (clang, -O0):
<governor_enter_lve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<governor_enter_lve>:
push   %rax
mov    (%rdi),%edx
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [34 x i8] c"User %s - %d, governor_enter_lve\0A\00"
define i32 @governor_enter_lve(i32* nocapture %0, i8* %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %3)
ret i32 0
}
/* Variables and functions */
int ap_cmd_get_int(int, int, int *);
int ap_is_looping(int session, int *looping) {
  return (ap_cmd_get_int(session, 0xcc2d, looping));
}


x86 assembly (clang, -O0):
<ap_is_looping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0xcc2d,%esi
call   1030 <ap_cmd_get_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_is_looping>:
mov    %rsi,%rdx
mov    $0xcc2d,%esi
jmp    1030 <ap_cmd_get_int@plt>

LLVM IR (-O0):
define i32 @ap_is_looping(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 @ap_cmd_get_int(i32 %5, i32 52269, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ap_is_looping(i32 %0, i32* %1) {
%3 = tail call i32 @ap_cmd_get_int(i32 %0, i32 52269, i32* %1)
ret i32 %3
}
/* Variables and functions */
int run_unit_tests();
int main(void) { return run_unit_tests(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @run_unit_tests()
ret i32 %1
}
void hdmi_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @hdmi_iomux_config() {
ret void
}
void n_buf_check(const struct n_buf *nb) {}


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

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

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

LLVM IR (-O2):
%struct.n_buf = type opaque
define void @n_buf_check(%struct.n_buf* nocapture %0) {
ret void
}
extern void gui_ksys_get_standart_colors_table(char *buf) {
  __asm__ __volatile__("int $0x40" : : "a"(48), "b"(3), "c"(buf), "d"(40));
}


x86 assembly (clang, -O0):
<gui_ksys_get_standart_colors_table>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x30,%eax
mov    $0x3,%ebx
mov    $0x28,%edx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_ksys_get_standart_colors_table>:
push   %rbx
mov    %rdi,%rcx
mov    $0x30,%eax
mov    $0x3,%ebx
mov    $0x28,%edx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @gui_ksys_get_standart_colors_table(i8* %0) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 48, i32 3, i8* %0, i32 40)
ret void
}
void kobject_del(struct kobject *kobj) { return; }


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

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

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

LLVM IR (-O2):
%struct.kobject = type opaque
define void @kobject_del(%struct.kobject* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int int_size();
  printf("%i\n", int_size());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @int_size()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
void *_memory_allocate(size_t);
void *rpmalloc(size_t size) { return _memory_allocate(size); }


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

x86 assembly (clang, -O2):
<rpmalloc>:
jmp    1030 <_memory_allocate@plt>

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

LLVM IR (-O2):
define i8* @rpmalloc(i64 %0) {
%2 = tail call i8* @_memory_allocate(i64 %0)
ret i8* %2
}
/* Variables and functions */
int readchr();
scalar_t__ waitinput_stdin(int);
int readchr_wait() {
  if (waitinput_stdin(1))
    return readchr();
  return 0;
}


x86 assembly (clang, -O0):
<readchr_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <waitinput_stdin@plt>
cmp    $0x0,%rax
je     114b <readchr_wait+0x2b>
mov    $0x0,%al
call   1030 <readchr@plt>
mov    %eax,-0x4(%rbp)
jmp    1152 <readchr_wait+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readchr_wait>:
push   %rax
mov    $0x1,%edi
call   1040 <waitinput_stdin@plt>
test   %rax,%rax
je     1138 <readchr_wait+0x18>
xor    %eax,%eax
pop    %rcx
jmp    1030 <readchr@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @readchr_wait() {
%1 = tail call i64 @waitinput_stdin(i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @readchr()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 0, %0 ]
ret i32 %6
}
char *_strcat_chk(char *__dest, const char *__src) {
  return __builtin___strcat_chk(__dest, __src,
                                __builtin_object_size(__dest, 2 > 1));
}


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

x86 assembly (clang, -O2):
<_strcat_chk>:
jmp    1030 <strcat@plt>

LLVM IR (-O0):
define i8* @_strcat_chk(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 = load i8*, i8** %3
%8 = call i64 @llvm.objectsize.i64.p0i8(i8* %7, i1 false, i1 true, i1 false)
%9 = call i8* @__strcat_chk(i8* %5, i8* %6, i64 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @_strcat_chk(i8* %0, i8* %1) {
%3 = tail call i8* @strcat(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}
/* Type definitions */
struct stat64 {
  int dummy;
};

/* Variables and functions */
int __xstat64(int /*<<< orphan*/, char const *, struct stat64 *);
int stat64(const char *path, struct stat64 *buf) {
  return __xstat64(0, path, buf);
}


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

x86 assembly (clang, -O2):
<stat64>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <__xstat64@plt>

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

LLVM IR (-O2):
%struct.stat64 = type { i32 }
define i32 @stat64(i8* %0, %struct.stat64* %1) {
%3 = tail call i32 @__xstat64(i32 0, i8* %0, %struct.stat64* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void version(void) {
  printf("XML Indent, version %s\n", "0.2.18");
  printf("Copyright (C) 2002-2004 Pekka Enberg\n");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee9(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee2(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"XML Indent, version %s\0A\00"
@.str.1 = [7 x i8] c"0.2.18\00"
@.str.2 = [38 x i8] c"Copyright (C) 2002-2004 Pekka Enberg\0A\00"
define void @version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"XML Indent, version %s\0A\00"
@.str.1 = [7 x i8] c"0.2.18\00"
@str = [37 x i8] c"Copyright (C) 2002-2004 Pekka Enberg\00"
define void @version() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ thr1(int /*<<< orphan*/);
int /*<<< orphan*/ thr2(int /*<<< orphan*/);
int /*<<< orphan*/ thr3(int /*<<< orphan*/);
int main() {
__CPROVER_ASYNC_1:
  thr1(0);
__CPROVER_ASYNC_2:
  thr2(0);
__CPROVER_ASYNC_3:
  thr3(0);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <thr1@plt>
xor    %edi,%edi
call   1040 <thr2@plt>
xor    %edi,%edi
call   1050 <thr3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
%3 = call i32 @thr1(i32 0)
br label %4
4: ; preds = %2
%5 = call i32 @thr2(i32 0)
br label %6
6: ; preds = %4
%7 = call i32 @thr3(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @thr1(i32 0)
%2 = tail call i32 @thr2(i32 0)
%3 = tail call i32 @thr3(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ core5_swap(char *, int);
void U_EMRFLATTENPATH_swap(char *record, int torev) {
  core5_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMRFLATTENPATH_swap>:
jmp    1030 <core5_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRFLATTENPATH_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core5_swap(i8* %0, i32 %1)
ret void
}
int Operand_mr1_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~0x3) != 0;
  return error;
}


x86 assembly (clang, -O0):
<Operand_mr1_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xfffffffc,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_mr1_encode>:
xor    %eax,%eax
cmpl   $0x4,(%rdi)
setae  %al
ret

LLVM IR (-O0):
define i32 @Operand_mr1_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = and i32 %5, -4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @Operand_mr1_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ugt i32 %2, 3
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t fmix(uint32_t h) {
  h ^= h >> 16;
  h *= 0x85ebca6b;
  h ^= h >> 13;
  h *= 0xc2b2ae35;
  h ^= h >> 16;
  return h;
}


x86 assembly (clang, -O0):
<fmix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
imul   $0x85ebca6b,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xd,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
imul   $0xc2b2ae35,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmix>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
imul   $0x85ebca6b,%eax,%eax
mov    %eax,%ecx
sar    $0xd,%ecx
xor    %eax,%ecx
imul   $0xc2b2ae35,%ecx,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fmix(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = mul i32 %7, -2048144789
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 13
%11 = load i32, i32* %2
%12 = xor i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = mul i32 %13, -1028477387
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 16
%17 = load i32, i32* %2
%18 = xor i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @fmix(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = mul i32 %3, -2048144789
%5 = ashr i32 %4, 13
%6 = xor i32 %5, %4
%7 = mul i32 %6, -1028477387
%8 = ashr i32 %7, 16
%9 = xor i32 %8, %7
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char *argv[]) {
  int i, n = argc;
  for (i = 0; i < n; i++) {
    printf("Argument %d is %s\n", i, argv[i]);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1168 <main+0x58>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Argument %d is %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int o_pthread_mutex_trylock(int /*<<< orphan*/ *);
int pthread_mutex_trylock(pthread_mutex_t *mutex) {
  return o_pthread_mutex_trylock(mutex);
}


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

x86 assembly (clang, -O2):
<pthread_mutex_trylock>:
jmp    1030 <o_pthread_mutex_trylock@plt>

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

LLVM IR (-O2):
define i32 @pthread_mutex_trylock(i32* %0) {
%2 = tail call i32 @o_pthread_mutex_trylock(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char *, size_t);
void swap(void *a, void *b, size_t n) {
  char tmp[n];
  memcpy(tmp, a, n);
  memcpy(a, b, n);
  memcpy(b, tmp, n);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x30(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rsi
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsp,%rbx
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1030 <memcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1030 <memcpy@plt>
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i64, i64* %6
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %7
%11 = alloca i8, i64 %9
store i64 %9, i64* %8
%12 = load i8*, i8** %4
%13 = load i64, i64* %6
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = call i32 @memcpy(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %5
%20 = load i64, i64* %6
%21 = call i32 @memcpy(i8* %19, i8* %11, i64 %20)
%22 = load i8*, i8** %7
ret void
}

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8, i64 %2
%5 = call i32 @memcpy(i8* %4, i8* %0, i64 %2)
%6 = call i32 @memcpy(i8* %0, i8* %1, i64 %2)
%7 = call i32 @memcpy(i8* %1, i8* %4, i64 %2)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t gdbstub_to_hex_digit(uint8_t b) {
  b &= 0xf;
  return (b < 0xa ? '0' : 'a' - 0xa) + b;
}


x86 assembly (clang, -O0):
<gdbstub_to_hex_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x57,%eax
mov    $0x30,%ecx
cmp    $0xa,%edx
cmovl  %ecx,%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdbstub_to_hex_digit>:
and    $0xf,%edi
lea    0x57(%rdi),%ecx
lea    0x30(%rdi),%eax
cmp    $0xa,%edi
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gdbstub_to_hex_digit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 48, i32 87
%9 = load i32, i32* %2
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @gdbstub_to_hex_digit(i32 %0) {
%2 = and i32 %0, 15
%3 = icmp ult i32 %2, 10
%4 = select i1 %3, i32 48, i32 87
%5 = add nuw nsw i32 %4, %2
ret i32 %5
}
void foo633() {}


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

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

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

LLVM IR (-O2):
define void @foo633() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *mutt_substrcpy(char *dest, const char *beg, const char *end,
                     size_t destlen) {
  size_t len;
  len = end - beg;
  if (len > destlen - 1)
    len = destlen - 1;
  memcpy(dest, beg, len);
  dest[len] = 0;
  return dest;
}


x86 assembly (clang, -O0):
<mutt_substrcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jbe    1158 <mutt_substrcpy+0x48>
mov    -0x20(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutt_substrcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdi,%r14
sub    %rsi,%rdx
add    $0xffffffffffffffff,%rbx
cmp    %rbx,%rdx
cmovbe %rdx,%rbx
mov    %rbx,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%r14,%rbx,1)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @mutt_substrcpy(i8* returned %0, i8* %1, i8* %2, i64 %3) {
%5 = ptrtoint i8* %2 to i64
%6 = ptrtoint i8* %1 to i64
%7 = sub i64 %5, %6
%8 = add i64 %3, -1
%9 = icmp ugt i64 %7, %8
%10 = select i1 %9, i64 %8, i64 %7
%11 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %10)
%12 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 0, i8* %12
ret i8* %0
}
unsigned int test_loop_sum(unsigned int n) {
  unsigned i;
  volatile unsigned int s = 0;
  for (i = 0; i < n; i++) {
    s++;
  }
  return s;
}


x86 assembly (clang, -O0):
<test_loop_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1138 <test_loop_sum+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <test_loop_sum+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_loop_sum>:
movl   $0x0,-0x4(%rsp)
test   %edi,%edi
je     114a <test_loop_sum+0x4a>
lea    -0x1(%rdi),%ecx
mov    %edi,%eax
and    $0x3,%eax
cmp    $0x3,%ecx
jb     1139 <test_loop_sum+0x39>
and    $0xfffffffc,%edi
nopl   0x0(%rax)
addl   $0x1,-0x4(%rsp)
addl   $0x1,-0x4(%rsp)
addl   $0x1,-0x4(%rsp)
addl   $0x1,-0x4(%rsp)
add    $0xfffffffc,%edi
jne    1120 <test_loop_sum+0x20>
test   %eax,%eax
je     114a <test_loop_sum+0x4a>
nopl   (%rax)
addl   $0x1,-0x4(%rsp)
add    $0xffffffff,%eax
jne    1140 <test_loop_sum+0x40>
mov    -0x4(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @test_loop_sum(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%4 = icmp eq i32 %0, 0
br i1 %4, label %31, label %5
5: ; preds = %1
%6 = add i32 %0, -1
%7 = and i32 %0, 3
%8 = icmp ult i32 %6, 3
br i1 %8, label %23, label %9
9: ; preds = %5
%10 = and i32 %0, -4
br label %11
11: ; preds = %11, %9
%12 = phi i32 [ 0, %9 ], [ %21, %11 ]
%13 = load volatile i32, i32* %2
%14 = add i32 %13, 1
store volatile i32 %14, i32* %2
%15 = load volatile i32, i32* %2
%16 = add i32 %15, 1
store volatile i32 %16, i32* %2
%17 = load volatile i32, i32* %2
%18 = add i32 %17, 1
store volatile i32 %18, i32* %2
%19 = load volatile i32, i32* %2
%20 = add i32 %19, 1
store volatile i32 %20, i32* %2
%21 = add i32 %12, 4
%22 = icmp eq i32 %21, %10
br i1 %22, label %23, label %11
23: ; preds = %11, %5
%24 = icmp eq i32 %7, 0
br i1 %24, label %31, label %25
25: ; preds = %23, %25
%26 = phi i32 [ %29, %25 ], [ 0, %23 ]
%27 = load volatile i32, i32* %2
%28 = add i32 %27, 1
store volatile i32 %28, i32* %2
%29 = add i32 %26, 1
%30 = icmp eq i32 %29, %7
br i1 %30, label %31, label %25
31: ; preds = %23, %25, %1
%32 = load volatile i32, i32* %2
ret i32 %32
}
float mi_to_nm(float mph) { return mph / 1.15078; }


x86 assembly (clang, -O0):
<mi_to_nm>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mi_to_nm>:
cvtss2sd %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @mi_to_nm(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 1.150780e+00
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @mi_to_nm(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, 1.150780e+00
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
scalar_t__ FLOOR(float);
float frac(float x) { return x - (float)FLOOR(x); }


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

x86 assembly (clang, -O2):
<frac>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <FLOOR@plt>
cvtsi2ss %rax,%xmm1
movss  0x4(%rsp),%xmm0
subss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @frac(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call i64 @FLOOR(float %4)
%6 = sitofp i64 %5 to float
%7 = fsub float %3, %6
ret float %7
}

LLVM IR (-O2):
define float @frac(float %0) {
%2 = tail call i64 @FLOOR(float %0)
%3 = sitofp i64 %2 to float
%4 = fsub float %0, %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *foo(void *t) {
  for (int i = 0; i < 3; i++) {
    printf("This is a loop");
  }
  return NULL;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1147 <foo+0x37>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <foo+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"This is a loop\00"
define noalias i8* @foo(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int bar(int);
int foo(int j) { return bar(j); }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 @bar(i32 %0)
ret i32 %2
}
void av_codec_is_decoder() {}


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

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

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

LLVM IR (-O2):
define void @av_codec_is_decoder() {
ret void
}
/* Variables and functions */
scalar_t__ checkCPUendian();
int /*<<< orphan*/ printf(char *);
int main() {
  if (0 == checkCPUendian()) {
    printf("This CPU is big-endian!\n");
  } else {
    printf("This CPU is little-enidan!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <checkCPUendian@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1155 <main+0x35>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
jmp    1161 <main+0x41>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"This CPU is big-endian!\0A\00"
@.str.1 = [28 x i8] c"This CPU is little-enidan!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @checkCPUendian()
%3 = icmp eq i64 0, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"This CPU is little-enidan!\00"
@str.2 = [24 x i8] c"This CPU is big-endian!\00"
define i32 @main() {
%1 = tail call i64 (...) @checkCPUendian()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
/* Variables and functions */
int exp(double);
double btic1g_sexp(double f) {
  return ((f >= 0) ? exp(f) - 1 : (-exp(-f) + 1));
}


x86 assembly (clang, -O0):
<btic1g_sexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1144 <btic1g_sexp+0x34>
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1171 <btic1g_sexp+0x61>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btic1g_sexp>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    1133 <btic1g_sexp+0x23>
xorpd  0xedd(%rip),%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
jmp    113b <btic1g_sexp+0x2b>
call   1030 <exp@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @btic1g_sexp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = call i32 @exp(double %6)
%8 = sub nsw i32 %7, 1
br label %15
9: ; preds = %1
%10 = load double, double* %2
%11 = fneg double %10
%12 = call i32 @exp(double %11)
%13 = sub nsw i32 0, %12
%14 = add nsw i32 %13, 1
br label %15
15: ; preds = %9, %5
%16 = phi i32 [ %8, %5 ], [ %14, %9 ]
%17 = sitofp i32 %16 to double
ret double %17
}

LLVM IR (-O2):
define double @btic1g_sexp(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @exp(double %0)
%5 = add nsw i32 %4, -1
br label %10
6: ; preds = %1
%7 = fneg double %0
%8 = tail call i32 @exp(double %7)
%9 = sub i32 1, %8
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ %5, %3 ], [ %9, %6 ]
%12 = sitofp i32 %11 to double
ret double %12
}
ge(a, b) { return a >= b; }


x86 assembly (clang, -O0):
<ge>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ge>:
xor    %eax,%eax
cmp    %esi,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @ge(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 = icmp sge i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ge(i32 %0, i32 %1) {
%3 = icmp sge i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void hash_die(table) struct hash_control *table;
{ free(table); }


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

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

LLVM IR (-O0):
%struct.hash_control = type opaque
define void @hash_die(%struct.hash_control* %0) {
%2 = alloca %struct.hash_control*
store %struct.hash_control* %0, %struct.hash_control** %2
%3 = load %struct.hash_control*, %struct.hash_control** %2
%4 = bitcast %struct.hash_control* %3 to i8*
ret void
}

LLVM IR (-O2):
%struct.hash_control = type opaque
define void @hash_die(%struct.hash_control* nocapture %0) {
%2 = bitcast %struct.hash_control* %0 to i8*
tail call void @free(i8* %2)
ret void
}