xunge/DecIR huggingface dataset:
int int_ops_ror(unsigned int l, int r) { return (l >> r) | (l << (32 - r)); }


x86 assembly (clang, -O0):
<int_ops_ror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_ops_ror>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @int_ops_ror(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 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @int_ops_ror(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
struct _index_writer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ flash_ram_segments(struct _index_writer *);
void index_writer_close(struct _index_writer *iw) { flash_ram_segments(iw); }


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

x86 assembly (clang, -O2):
<index_writer_close>:
jmp    1030 <flash_ram_segments@plt>

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

LLVM IR (-O2):
%struct._index_writer = type { i32 }
define void @index_writer_close(%struct._index_writer* %0) {
%2 = tail call i32 @flash_ram_segments(%struct._index_writer* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parse_args(int, char **);
int main(int argc, char *argv[]) { parse_args(argc, argv); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_args(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(unsigned long);
long test(int *x) {
  unsigned long sx, xprec;
  sx = *x >= 0 ? *x : -*x;
  xprec = sx * 64;
  if (sx < 16384)
    foo(sx);
  return xprec;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1137 <test+0x27>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1142 <test+0x32>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x6,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x4000,-0x10(%rbp)
jae    116e <test+0x5e>
mov    -0x10(%rbp),%rdi
call   1030 <foo@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    (%rdi),%eax
mov    %eax,%ebx
neg    %ebx
cmovs  %eax,%ebx
cmp    $0x3fff,%ebx
ja     112a <test+0x1a>
mov    %rbx,%rdi
call   1030 <foo@plt>
shl    $0x6,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @test(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
br label %15
11: ; preds = %1
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = sub nsw i32 0, %13
br label %15
15: ; preds = %11, %8
%16 = phi i32 [ %10, %8 ], [ %14, %11 ]
%17 = sext i32 %16 to i64
store i64 %17, i64* %3
%18 = load i64, i64* %3
%19 = mul i64 %18, 64
store i64 %19, i64* %4
%20 = load i64, i64* %3
%21 = icmp ult i64 %20, 16384
br i1 %21, label %22, label %25
22: ; preds = %15
%23 = load i64, i64* %3
%24 = call i32 @foo(i64 %23)
br label %25
25: ; preds = %22, %15
%26 = load i64, i64* %4
ret i64 %26
}

LLVM IR (-O2):
define i64 @test(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @llvm.abs.i32(i32 %2, i1 true)
%4 = zext i32 %3 to i64
%5 = icmp ult i32 %3, 16384
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @foo(i64 %4)
br label %8
8: ; preds = %6, %1
%9 = shl nuw nsw i64 %4, 6
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int atexit(void (*function)(void)) {
  abort();
  return 1;
}


x86 assembly (clang, -O0):
<atexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<atexit>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @atexit(void ()* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
foo(x) {}


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sigintHandler(int s) {
  (void)s;
  (void)printf("ok, ok I exit\n");
  cleanup();
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<sigintHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <cleanup@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sigintHandler>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <cleanup@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"ok, ok I exit\0A\00"
@EXIT_FAILURE = global i32 0
define void @sigintHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @cleanup()
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [14 x i8] c"ok, ok I exit\00"
define void @sigintHandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @cleanup()
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ g_rm_temp_dir();
void g_deinit(void) { g_rm_temp_dir(); }


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

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

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

LLVM IR (-O2):
define void @g_deinit() {
%1 = tail call i32 (...) @g_rm_temp_dir()
ret void
}
int rl_do_lowercase_version(ignore1, ignore2)
int ignore1 __attribute__((unused)), ignore2 __attribute__((unused));
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rl_do_lowercase_version(i32 %0, i32 %1) {
ret i32 0
}
XAddHost() {}


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

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

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

LLVM IR (-O2):
define i32 @XAddHost() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ gnome_sort(int *, int);
int /*<<< orphan*/ print_array(int *, int);
int /*<<< orphan*/ random_array(int *, int);
int main(void) {
  int a[20];
  random_array(a, 20);
  print_array(a, 20);
  gnome_sort(a, 20);
  print_array(a, 20);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0x14,%esi
call   1050 <random_array@plt>
lea    -0x60(%rbp),%rdi
mov    $0x14,%esi
call   1040 <print_array@plt>
lea    -0x60(%rbp),%rdi
mov    $0x14,%esi
call   1030 <gnome_sort@plt>
lea    -0x60(%rbp),%rdi
mov    $0x14,%esi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1050 <random_array@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <print_array@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <gnome_sort@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%4 = call i32 @random_array(i32* %3, i32 20)
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%6 = call i32 @print_array(i32* %5, i32 20)
%7 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%8 = call i32 @gnome_sort(i32* %7, i32 20)
%9 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%10 = call i32 @print_array(i32* %9, i32 20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @random_array(i32* %3, i32 20)
%5 = call i32 @print_array(i32* %3, i32 20)
%6 = call i32 @gnome_sort(i32* %3, i32 20)
%7 = call i32 @print_array(i32* %3, i32 20)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int /*<<< orphan*/ INLINE_SYSCALL(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                  char const *, char *, size_t);
int /*<<< orphan*/ readlinkat;
ssize_t __readlink(const char *path, char *buf, size_t len) {
  return INLINE_SYSCALL(readlinkat, 4, AT_FDCWD, path, buf, len);
}


x86 assembly (clang, -O0):
<__readlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    $0x4,%esi
call   1030 <INLINE_SYSCALL@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__readlink>:
mov    %rdx,%r9
mov    %rsi,%r8
mov    %rdi,%rcx
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%esi
jmp    1030 <INLINE_SYSCALL@plt>

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

LLVM IR (-O2):
@readlinkat = global i32 0
@AT_FDCWD = global i32 0
define i32 @__readlink(i8* %0, i8* %1, i64 %2) {
%4 = load i32, i32* @readlinkat
%5 = load i32, i32* @AT_FDCWD
%6 = tail call i32 @INLINE_SYSCALL(i32 %4, i32 4, i32 %5, i8* %0, i8* %1, i64 %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_11950() {
  Assert_real((isqrt(11950) == 109),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1530, ("Integer square root of 11950 should be 109"));
}


x86 assembly (clang, -O0):
<t_sqrt_11950>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2eae,%edi
call   1030 <isqrt@plt>
cmp    $0x6d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x5fa,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_11950>:
push   %rax
mov    $0x2eae,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x6d,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x5fa,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 11950 should be 109\00"
define void @t_sqrt_11950() {
%1 = call i32 @isqrt(i32 11950)
%2 = icmp eq i32 %1, 109
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1530, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 11950 should be 109\00"
define void @t_sqrt_11950() {
%1 = tail call i32 @isqrt(i32 11950)
%2 = icmp eq i32 %1, 109
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1530, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double unihrf(double x, double a, double b) {
  double y;
  if ((x >= a) && (x < b))
    y = 1.0 / (b - x);
  else
    y = 0.0;
  return y;
}


x86 assembly (clang, -O0):
<unihrf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1157 <unihrf+0x57>
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1157 <unihrf+0x57>
movsd  -0x18(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0xeb7(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    115f <unihrf+0x5f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<unihrf>:
movapd %xmm0,%xmm3
ucomisd %xmm1,%xmm0
xorpd  %xmm0,%xmm0
jb     1124 <unihrf+0x24>
ucomisd %xmm3,%xmm2
jbe    1124 <unihrf+0x24>
subsd  %xmm3,%xmm2
movsd  0xee0(%rip),%xmm0
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @unihrf(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fcmp oge double %8, %9
br i1 %10, label %11, label %20
11: ; preds = %3
%12 = load double, double* %4
%13 = load double, double* %6
%14 = fcmp olt double %12, %13
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load double, double* %6
%17 = load double, double* %4
%18 = fsub double %16, %17
%19 = fdiv double 1.000000e+00, %18
store double %19, double* %7
br label %21
20: ; preds = %11, %3
store double 0.000000e+00, double* %7
br label %21
21: ; preds = %20, %15
%22 = load double, double* %7
ret double %22
}

LLVM IR (-O2):
define double @unihrf(double %0, double %1, double %2) {
%4 = fcmp oge double %0, %1
%5 = fcmp olt double %0, %2
%6 = and i1 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = fsub double %2, %0
%9 = fdiv double 1.000000e+00, %8
br label %10
10: ; preds = %3, %7
%11 = phi double [ %9, %7 ], [ 0.000000e+00, %3 ]
ret double %11
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 10;
  printf("%d\n", fib(a));
  return 0;
}


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

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

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

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

/* Variables and functions */
uint32_t compute_hash_mad(uint32_t data) {
  int16_t data_low;
  int16_t data_high;
  data_low = data;
  data_high = data >> 16;
  data = 0xFFFFE84B * data_low + 0xFFFF97B1 * data_high;
  data_low = data;
  data_high = data >> 16;
  data = 0xFFFFE84B * data_low + 0xFFFF97B1 * data_high;
  return data;
}


x86 assembly (clang, -O0):
<compute_hash_mad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0xc(%rbp)
imul   $0xffffe84b,-0x8(%rbp),%eax
imul   $0xffff97b1,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0xc(%rbp)
imul   $0xffffe84b,-0x8(%rbp),%eax
imul   $0xffff97b1,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_hash_mad>:
imul   $0xffffe84b,%edi,%eax
sar    $0x10,%edi
imul   $0xffff97b1,%edi,%ecx
add    %eax,%ecx
imul   $0xffffe84b,%ecx,%edx
sar    $0x10,%ecx
imul   $0xffff97b1,%ecx,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compute_hash_mad(i32 %0) {
%2 = ashr i32 %0, 16
%3 = mul i32 %0, -6069
%4 = mul nsw i32 %2, -26703
%5 = add i32 %4, %3
%6 = ashr i32 %5, 16
%7 = mul i32 %5, -6069
%8 = mul nsw i32 %6, -26703
%9 = add i32 %8, %7
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void libopm_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @libopm_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
char *iconv_string_full(char const *, int /*<<< orphan*/, char const *,
                        char const *, int /*<<< orphan*/ *,
                        int /*<<< orphan*/ *, char);
char *iconv_string_lossy(const char *string, ssize_t length,
                         const char *src_encoding, const char *dst_encoding) {
  return iconv_string_full(string, length, src_encoding, dst_encoding, NULL,
                           NULL, '?');
}


x86 assembly (clang, -O0):
<iconv_string_lossy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
movl   $0x3f,(%rsp)
call   1030 <iconv_string_full@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iconv_string_lossy>:
push   %rax
movl   $0x3f,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <iconv_string_full@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @iconv_string_lossy(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i8* @iconv_string_full(i8* %9, i32 %10, i8* %11, i8* %12, i32* null, i32* null, i8 signext 63)
ret i8* %13
}

LLVM IR (-O2):
define i8* @iconv_string_lossy(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i8* @iconv_string_full(i8* %0, i32 %1, i8* %2, i8* %3, i32* null, i32* null, i8 signext 63)
ret i8* %5
}
int irmo_pointer_compare(void *location1, void *location2) {
  if (location1 < location2) {
    return -1;
  } else if (location1 > location2) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<irmo_pointer_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1126 <irmo_pointer_compare+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <irmo_pointer_compare+0x47>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1140 <irmo_pointer_compare+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <irmo_pointer_compare+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<irmo_pointer_compare>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @irmo_pointer_compare(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = icmp ugt i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_log_start_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_log@%p::start (rtpp_log_start) is invoked after "
          "destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_log_start_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_log_start_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [73 x i8] c"Method rtpp_log@%p::start (rtpp_log_start) is invoked after destruction\0A\00"
define void @rtpp_log_start_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [73 x i8] c"Method rtpp_log@%p::start (rtpp_log_start) is invoked after destruction\0A\00"
define void @rtpp_log_start_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
int islower(int ch) { return ch >= 'a' && ch <= 'z'; }


x86 assembly (clang, -O0):
<islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <islower+0x20>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
void RTAvlUIntPtrGetRight(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlUIntPtrGetRight() {
ret void
}
/* Variables and functions */
int __syscall(int, int, char *, int);
int errno;
int _read(int fd, char *buf, int nbytes) {
  int err;
  err = __syscall(3, fd, buf, nbytes);
  if (err < 0) {
    errno = -err;
    return -1;
  }
  return err;
}


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x3,%edi
call   1030 <__syscall@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    115d <_read+0x4d>
xor    %ecx,%ecx
sub    -0x18(%rbp),%ecx
mov    0x2e91(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <_read+0x53>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x3,%edi
call   1030 <__syscall@plt>
test   %eax,%eax
js     1128 <_read+0x18>
pop    %rcx
ret
neg    %eax
mov    0x2eaf(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = call i32 @__syscall(i32 3, i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %3
%16 = load i32, i32* %8
%17 = sub nsw i32 0, %16
store i32 %17, i32* @errno
store i32 -1, i32* %4
br label %20
18: ; preds = %3
%19 = load i32, i32* %8
store i32 %19, i32* %4
br label %20
20: ; preds = %18, %15
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @_read(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @__syscall(i32 3, i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = sub nsw i32 0, %4
store i32 %7, i32* @errno
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ -1, %6 ], [ %4, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ gen_rand32();
double to_real1(int /*<<< orphan*/);
double genrand_real1(void) { return to_real1(gen_rand32()); }


x86 assembly (clang, -O0):
<genrand_real1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_rand32@plt>
mov    %eax,%edi
call   1040 <to_real1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_real1>:
push   %rax
xor    %eax,%eax
call   1030 <gen_rand32@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <to_real1@plt>

LLVM IR (-O0):
define double @genrand_real1() {
%1 = call i32 (...) @gen_rand32()
%2 = call double @to_real1(i32 %1)
ret double %2
}

LLVM IR (-O2):
define double @genrand_real1() {
%1 = tail call i32 (...) @gen_rand32()
%2 = tail call double @to_real1(i32 %1)
ret double %2
}
int test_imm_9Auint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x9A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Auint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0x9a,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Auint64_lowword_mem>:
testb  $0x9a,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Auint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 154
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double copysign(double x, double y) { return x * y; }


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

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

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

LLVM IR (-O2):
define double @copysign(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Type definitions */
struct libusb_ss_endpoint_companion_descriptor {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct libusb_ss_endpoint_companion_descriptor *);
void libusb_free_ss_endpoint_comp(
    struct libusb_ss_endpoint_companion_descriptor *ep_comp) {
  if (ep_comp == NULL)
    return;
  free(ep_comp);
}


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

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

LLVM IR (-O0):
%struct.libusb_ss_endpoint_companion_descriptor = type { i32 }
define void @libusb_free_ss_endpoint_comp(%struct.libusb_ss_endpoint_companion_descriptor* %0) {
%2 = alloca %struct.libusb_ss_endpoint_companion_descriptor*
store %struct.libusb_ss_endpoint_companion_descriptor* %0, %struct.libusb_ss_endpoint_companion_descriptor** %2
%3 = load %struct.libusb_ss_endpoint_companion_descriptor*, %struct.libusb_ss_endpoint_companion_descriptor** %2
%4 = icmp eq %struct.libusb_ss_endpoint_companion_descriptor* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.libusb_ss_endpoint_companion_descriptor*, %struct.libusb_ss_endpoint_companion_descriptor** %2
%8 = call i32 @free(%struct.libusb_ss_endpoint_companion_descriptor* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.libusb_ss_endpoint_companion_descriptor = type { i32 }
define void @libusb_free_ss_endpoint_comp(%struct.libusb_ss_endpoint_companion_descriptor* %0) {
%2 = icmp eq %struct.libusb_ss_endpoint_companion_descriptor* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.libusb_ss_endpoint_companion_descriptor* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_carry_flag(int);
void handle_carry_flag_cmp(const int value1, const int value2) {
  set_carry_flag(value1 < value2);
}


x86 assembly (clang, -O0):
<handle_carry_flag_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_carry_flag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_carry_flag_cmp>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
mov    %eax,%edi
jmp    1030 <set_carry_flag@plt>

LLVM IR (-O0):
define void @handle_carry_flag_cmp(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 slt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @set_carry_flag(i32 %8)
ret void
}

LLVM IR (-O2):
define void @handle_carry_flag_cmp(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @set_carry_flag(i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ *myfopen(char *);
int main() {
  FILE *fp;
  fp = fopen("test1.txt", "a");
  fp = myfopen("test2.txt");
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
lea    0xeb6(%rip),%rdi
call   1030 <myfopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xecb(%rip),%rsi
call   1050 <fopen@plt>
lea    0xec1(%rip),%rdi
call   1030 <myfopen@plt>
mov    %rax,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"test1.txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [10 x i8] c"test2.txt\00"
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = call i32* @myfopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @fclose(i32* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"test1.txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [10 x i8] c"test2.txt\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32* @myfopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @fclose(i32* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat_ptr(char *, char *);
int main() {
  char s[20] = "Hello";
  char t[] = ", world!";
  strcat_ptr(s, t);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xebf(%rip),%rax
mov    %rax,-0x29(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x21(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x29(%rbp),%rsi
call   1030 <strcat_ptr@plt>
lea    -0x20(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
movabs $0x21646c726f77202c,%rax
6c 64 21
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <strcat_ptr@plt>
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [20 x i8] c"Hello\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.t = [9 x i8] c", world!\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [9 x i8]
store i32 0, i32* %1
%4 = bitcast [20 x i8]* %2 to i8*
%5 = bitcast [9 x i8]* %3 to i8*
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%8 = call i32 @strcat_ptr(i8* %6, i8* %7)
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [20 x i8] c"Hello\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.t = [9 x i8] c", world!\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [9 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcat_ptr(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ bits_per_pixel;
};
typedef TYPE_1__ ScreenFormat;

/* Variables and functions */
int get_ScreenFormat_bits_per_pixel(void *_p) {
  return (int)((ScreenFormat *)_p)->bits_per_pixel;
}


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

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

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

LLVM IR (-O2):
define i32 @get_ScreenFormat_bits_per_pixel(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
float sqrt(float);
float g1(float xOld) {
  float xNew = 0;
  xNew = sqrt(xOld + 6);
  return xNew;
}


x86 assembly (clang, -O0):
<g1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed3(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
call   1030 <sqrt@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1>:
addss  0xee8(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1125 <g1+0x15>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @g1(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0.000000e+00, float* %3
%4 = load float, float* %2
%5 = fadd float %4, 6.000000e+00
%6 = call float @sqrt(float %5)
store float %6, float* %3
%7 = load float, float* %3
ret float %7
}

LLVM IR (-O2):
define float @g1(float %0) {
%2 = fadd float %0, 6.000000e+00
%3 = tail call float @sqrt(float %2)
ret float %3
}
char *genSpaceString(int numOfSpaces, char *buffer) {
  int i;
  for (i = 0; i < numOfSpaces; i++) {
    buffer[i] = ' ';
  }
  buffer[numOfSpaces] = 0;
  return buffer;
}


x86 assembly (clang, -O0):
<genSpaceString>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <genSpaceString+0x38>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <genSpaceString+0x12>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<genSpaceString>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
test   %edi,%edi
jle    112b <genSpaceString+0x1b>
mov    %ebp,%edx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <memset@plt>
movslq %ebp,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @genSpaceString(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 32, i8* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
%19 = load i8*, i8** %4
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 0, i8* %22
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
define i8* @genSpaceString(i32 %0, i8* returned writeonly %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %2
%7 = sext i32 %0 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
store i8 0, i8* %8
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int);
void doit(int i) { printf("i's addr : %p  i : %ld\n", &i, i); }


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

x86 assembly (clang, -O2):
<doit>:
push   %rax
mov    %edi,%edx
mov    %edi,0x4(%rsp)
lea    0xee2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [24 x i8] c"i's addr : %p i : %ld\0A\00"
define void @doit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* %2, i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"i's addr : %p i : %ld\0A\00"
define void @doit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* %2, i32 %0)
ret void
}
int test_21(signed char x, int y, int z) { return ((x << 1) & 0x0F) == 0; }


x86 assembly (clang, -O0):
<test_21>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsbl -0x1(%rbp),%eax
shl    $0x1,%eax
and    $0xf,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_21>:
xor    %eax,%eax
test   $0x7,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @test_21(i8 signext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = shl i32 %8, 1
%10 = and i32 %9, 15
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_21(i8 signext %0, i32 %1, i32 %2) {
%4 = and i8 %0, 7
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ errorexit(char *);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *memalloc(size_t size) {
  void *ptr = malloc(size);
  if (!ptr)
    errorexit("out of memory");
  memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<memalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1160 <memalloc+0x30>
lea    0xea5(%rip),%rdi
call   1030 <errorexit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1150 <memalloc+0x20>
lea    0xeb5(%rip),%rdi
call   1030 <errorexit@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @memalloc(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 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @errorexit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
%12 = load i64, i64* %2
%13 = call i32 @memset(i8* %11, i32 0, i64 %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @memalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @errorexit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}