xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ custom_printstring(char *);
void clearscreen(void) {
  char clearScreenSeq[] = {0x1B, '[', '2', 'J', 0x00};
  char cursorHomeSeq[] = {0x1B, '[', 'H'};
  custom_printstring(clearScreenSeq);
  custom_printstring(cursorHomeSeq);
  return;
}


x86 assembly (clang, -O0):
<clearscreen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xedd(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xed4(%rip),%ax
mov    %ax,-0x8(%rbp)
mov    0xecc(%rip),%al
mov    %al,-0x6(%rbp)
lea    -0x5(%rbp),%rdi
call   1030 <custom_printstring@plt>
lea    -0x8(%rbp),%rdi
call   1030 <custom_printstring@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearscreen>:
sub    $0x18,%rsp
movb   $0x0,0x14(%rsp)
movl   $0x4a325b1b,0x10(%rsp)
4a
movb   $0x48,0xe(%rsp)
movw   $0x5b1b,0xc(%rsp)
lea    0x10(%rsp),%rdi
call   1030 <custom_printstring@plt>
lea    0xc(%rsp),%rdi
call   1030 <custom_printstring@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.clearscreen.clearScreenSeq = [5 x i8] c"\1B[2J\00"
@__const.clearscreen.cursorHomeSeq = [3 x i8] c"\1B[H"
define void @clearscreen() {
%1 = alloca [5 x i8]
%2 = alloca [3 x i8]
%3 = bitcast [5 x i8]* %1 to i8*
%4 = bitcast [3 x i8]* %2 to i8*
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%6 = call i32 @custom_printstring(i8* %5)
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%8 = call i32 @custom_printstring(i8* %7)
ret void
}

LLVM IR (-O2):
@__const.clearscreen.clearScreenSeq = [5 x i8] c"\1B[2J\00"
@__const.clearscreen.cursorHomeSeq = [3 x i8] c"\1B[H"
define void @clearscreen() {
%1 = alloca [5 x i8]
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = call i32 @custom_printstring(i8* %3)
%6 = call i32 @custom_printstring(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ btd_backtrace(int);
int /*<<< orphan*/ btd_error(int, char *, char const *, char const *, int,
                             char const *);
void btd_assertion_message_expr(const char *file, int line, const char *func,
                                const char *expr) {
  btd_error(0xffff, "Assertion failed: (%s) %s:%d in %s", expr, file, line,
            func);
  btd_backtrace(0xffff);
}


x86 assembly (clang, -O0):
<btd_assertion_message_expr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
mov    -0x18(%rbp),%r9
mov    $0xffff,%edi
lea    0xead(%rip),%rsi
call   1030 <btd_error@plt>
mov    $0xffff,%edi
call   1040 <btd_backtrace@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btd_assertion_message_expr>:
push   %rax
mov    %rdx,%r9
mov    %esi,%r8d
mov    %rdi,%rax
lea    0xecf(%rip),%rsi
mov    $0xffff,%edi
mov    %rcx,%rdx
mov    %rax,%rcx
call   1030 <btd_error@plt>
mov    $0xffff,%edi
pop    %rax
jmp    1040 <btd_backtrace@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Assertion failed: (%s) %s:%d in %s\00"
define void @btd_assertion_message_expr(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** %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = call i32 @btd_error(i32 65535, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i32 %11, i8* %12)
%14 = call i32 @btd_backtrace(i32 65535)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Assertion failed: (%s) %s:%d in %s\00"
define void @btd_assertion_message_expr(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @btd_error(i32 65535, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %0, i32 %1, i8* %2)
%6 = tail call i32 @btd_backtrace(i32 65535)
ret void
}
int _isatty(int fd) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_isatty(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ from_liba();
void test_libb(void) { from_liba(); }


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

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

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

LLVM IR (-O2):
define void @test_libb() {
%1 = tail call i32 (...) @from_liba()
ret void
}
void av_audio_fifo_reset() {}


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

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

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

LLVM IR (-O2):
define void @av_audio_fifo_reset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IdentityMatrix(float *);
int /*<<< orphan*/ MultiplyMatrix(float *, float *, float *);
int /*<<< orphan*/ ScaleMatrix(float *, float const, float const, float const);
void ScaleMatrixM(float *_matrix, const float x, const float y, const float z) {
  float _m[16];
  IdentityMatrix(_m);
  ScaleMatrix(_m, x, y, z);
  MultiplyMatrix(_m, _matrix, _matrix);
}


x86 assembly (clang, -O0):
<ScaleMatrixM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
lea    -0x60(%rbp),%rdi
call   1030 <IdentityMatrix@plt>
lea    -0x60(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1050 <ScaleMatrix@plt>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1040 <MultiplyMatrix@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScaleMatrixM>:
push   %r14
push   %rbx
sub    $0x58,%rsp
movss  %xmm2,0xc(%rsp)
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0x4(%rsp)
mov    %rdi,%rbx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1030 <IdentityMatrix@plt>
mov    %r14,%rdi
movss  0x4(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
call   1050 <ScaleMatrix@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1040 <MultiplyMatrix@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ScaleMatrixM(float* %0, float %1, float %2, float %3) {
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca [16 x float]
store float* %0, float** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%10 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
%11 = call i32 @IdentityMatrix(float* %10)
%12 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
%13 = load float, float* %6
%14 = load float, float* %7
%15 = load float, float* %8
%16 = call i32 @ScaleMatrix(float* %12, float %13, float %14, float %15)
%17 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
%18 = load float*, float** %5
%19 = load float*, float** %5
%20 = call i32 @MultiplyMatrix(float* %17, float* %18, float* %19)
ret void
}

LLVM IR (-O2):
define void @ScaleMatrixM(float* %0, float %1, float %2, float %3) {
%5 = alloca [16 x float]
%6 = bitcast [16 x float]* %5 to i8*
%7 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
%8 = call i32 @IdentityMatrix(float* %7)
%9 = call i32 @ScaleMatrix(float* %7, float %1, float %2, float %3)
%10 = call i32 @MultiplyMatrix(float* %7, float* %0, float* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int func1(int **array, int m, int n) {
  printf("---\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"---\00"
define i32 @func1(i32** nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_coq_comments() {
  test_parser_verify_parse(test_parser_sourcefile("coq", " (* comment *)"),
                           "coq", "", "(* comment *)", 0);
}


x86 assembly (clang, -O0):
<test_coq_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xecb(%rip),%rdx
lea    0xeb7(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_coq_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xed4(%rip),%rdx
lea    0xec0(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"coq\00"
@.str.1 = [15 x i8] c" (* comment *)\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [14 x i8] c"(* comment *)\00"
define void @test_coq_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"coq\00"
@.str.1 = [15 x i8] c" (* comment *)\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [14 x i8] c"(* comment *)\00"
define void @test_coq_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
void svcraw_destroy() {}


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

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

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

LLVM IR (-O2):
define void @svcraw_destroy() {
ret void
}
double the_number_four() { return 4.0; }


x86 assembly (clang, -O0):
<the_number_four>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<the_number_four>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @the_number_four() {
ret double 4.000000e+00
}

LLVM IR (-O2):
define double @the_number_four() {
ret double 4.000000e+00
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main(int argc, char *argv[]) {
  int c;
  while ((c = getchar()) != EOF)
    putchar(c);
  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    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     115c <main+0x3c>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %11, %2
%8 = call i32 (...) @getchar()
store i32 %8, i32* %6
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %6
%13 = call i32 @putchar(i32 %12)
br label %7
14: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @putchar(i32 %7)
%9 = tail call i32 (...) @getchar()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret i32 0
}
void outer_lock_all(void) {}


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

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

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

LLVM IR (-O2):
define void @outer_lock_all() {
ret void
}
float u2f(u)
unsigned int u;
{ return u; }


x86 assembly (clang, -O0):
<u2f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<u2f>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
ret

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

LLVM IR (-O2):
define float @u2f(i32 %0) {
%2 = uitofp i32 %0 to float
ret float %2
}
int f6(unsigned x) { return x - 1 > 0x7fffffff - 1; }


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cmp    $0x7ffffffe,%eax
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
xor    %eax,%eax
test   %edi,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @f6(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 1
%5 = icmp ugt i32 %4, 2147483646
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f6(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
void gdk_region_union_with_rect() {}


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

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

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

LLVM IR (-O2):
define void @gdk_region_union_with_rect() {
ret void
}
/* Variables and functions */
void *udsdup(void *);
void *uds_copier(void *elem, void *udate) { return udsdup(elem); }


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

x86 assembly (clang, -O2):
<uds_copier>:
jmp    1030 <udsdup@plt>

LLVM IR (-O0):
define i8* @uds_copier(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 = call i8* @udsdup(i8* %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @uds_copier(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i8* @udsdup(i8* %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ print_num(char *, int);
int sqrt_d(int);
int sqrt_i(int);
void arm_float(void) {
  int val;
  int num = 2;
  val = sqrt_i(num);
  print_num("Square root is:", val);
  val = sqrt_d(num);
  print_num("Square root is:", val);
}


x86 assembly (clang, -O0):
<arm_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt_i@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1050 <print_num@plt>
mov    -0x8(%rbp),%edi
call   1040 <sqrt_d@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe92(%rip),%rdi
call   1050 <print_num@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_float>:
push   %rbx
mov    $0x2,%edi
call   1030 <sqrt_i@plt>
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <print_num@plt>
mov    $0x2,%edi
call   1040 <sqrt_d@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1050 <print_num@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Square root is:\00"
define void @arm_float() {
%1 = alloca i32
%2 = alloca i32
store i32 2, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sqrt_i(i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @print_num(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @sqrt_d(i32 %7)
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = call i32 @print_num(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Square root is:\00"
define void @arm_float() {
%1 = tail call i32 @sqrt_i(i32 2)
%2 = tail call i32 @print_num(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @sqrt_d(i32 2)
%4 = tail call i32 @print_num(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ printf(char *);
void close_socket(int sock) {
  printf("\nClosing socket...\n");
  close(sock);
}


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

x86 assembly (clang, -O2):
<close_socket>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

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

LLVM IR (-O2):
@str = [19 x i8] c"\0AClosing socket...\00"
define void @close_socket(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
bool vectorSupport() { return true; }


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

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

LLVM IR (-O0):
define i32 @vectorSupport() {
ret i32 1
}

LLVM IR (-O2):
define i32 @vectorSupport() {
ret i32 1
}
int BuscaBinaria(int x, int n, int v[]) {
  int e, m, d;
  e = -1;
  d = n;
  while (e < d - 1) {
    m = (e + d) / 2;
    if (v[m] < x)
      e = m;
    else
      d = m;
  }
  return d;
}


x86 assembly (clang, -O0):
<BuscaBinaria>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1167 <BuscaBinaria+0x67>
mov    -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x4(%rbp),%eax
jge    115c <BuscaBinaria+0x5c>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1162 <BuscaBinaria+0x62>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <BuscaBinaria+0x1b>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BuscaBinaria>:
test   %esi,%esi
jle    1137 <BuscaBinaria+0x37>
mov    $0xffffffff,%r8d
jmp    111a <BuscaBinaria+0x1a>
nopl   0x0(%rax)
lea    -0x1(%rax),%ecx
mov    %eax,%esi
cmp    %ecx,%r8d
jge    1136 <BuscaBinaria+0x36>
lea    (%rsi,%r8,1),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
movslq %eax,%rcx
cmp    %edi,(%rdx,%rcx,4)
jge    1110 <BuscaBinaria+0x10>
mov    %eax,%r8d
mov    %esi,%eax
jmp    1110 <BuscaBinaria+0x10>
ret
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @BuscaBinaria(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
store i32 -1, i32* %7
%10 = load i32, i32* %5
store i32 %10, i32* %9
br label %11
11: ; preds = %32, %3
%12 = load i32, i32* %7
%13 = load i32, i32* %9
%14 = sub nsw i32 %13, 1
%15 = icmp slt i32 %12, %14
br i1 %15, label %16, label %33
16: ; preds = %11
%17 = load i32, i32* %7
%18 = load i32, i32* %9
%19 = add nsw i32 %17, %18
%20 = sdiv i32 %19, 2
store i32 %20, i32* %8
%21 = load i32*, i32** %6
%22 = load i32, i32* %8
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = load i32, i32* %24
%26 = load i32, i32* %4
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %30
28: ; preds = %16
%29 = load i32, i32* %8
store i32 %29, i32* %7
br label %32
30: ; preds = %16
%31 = load i32, i32* %8
store i32 %31, i32* %9
br label %32
32: ; preds = %30, %28
br label %11
33: ; preds = %11
%34 = load i32, i32* %9
ret i32 %34
}

LLVM IR (-O2):
define i32 @BuscaBinaria(i32 %0, i32 %1, i32* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %18
5: ; preds = %3, %5
%6 = phi i32 [ %15, %5 ], [ %1, %3 ]
%7 = phi i32 [ %14, %5 ], [ -1, %3 ]
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %8, 2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %2, i64 %10
%12 = load i32, i32* %11
%13 = icmp slt i32 %12, %0
%14 = select i1 %13, i32 %9, i32 %7
%15 = select i1 %13, i32 %6, i32 %9
%16 = add nsw i32 %15, -1
%17 = icmp slt i32 %14, %16
br i1 %17, label %5, label %18
18: ; preds = %5, %3
%19 = phi i32 [ %1, %3 ], [ %15, %5 ]
ret i32 %19
}
double centimetresToYards(double centimetres) {
  return centimetres * 0.0109361;
}


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

x86 assembly (clang, -O2):
<centimetresToYards>:
mulsd  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @centimetresToYards(double %0) {
%2 = fmul double %0, 1.093610e-02
ret double %2
}
void RTSemRWRequestRead(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemRWRequestRead() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  scanf("%d", &n);
  if (n % 2 == 1) {
    puts("Red");
  } else {
    puts("Blue");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1164 <main+0x44>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
jmp    1170 <main+0x50>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
cmp    $0x1,%eax
lea    0xeb7(%rip),%rax
lea    0xeb4(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"Red\00"
@.str.2 = [5 x i8] c"Blue\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"Red\00"
@.str.2 = [5 x i8] c"Blue\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 1
%7 = select i1 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
/* Variables and functions */
int __builtin_arm_mrc(int, int /*<<< orphan*/, int, int /*<<< orphan*/, int);
unsigned mrc() { return __builtin_arm_mrc(15, 0, 13, 0, 3); }


x86 assembly (clang, -O0):
<mrc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
xor    %ecx,%ecx
mov    $0xd,%edx
mov    $0x3,%r8d
mov    %ecx,%esi
call   1030 <__builtin_arm_mrc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrc>:
mov    $0xf,%edi
xor    %esi,%esi
mov    $0xd,%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
jmp    1030 <__builtin_arm_mrc@plt>

LLVM IR (-O0):
define i32 @mrc() {
%1 = call i32 @__builtin_arm_mrc(i32 15, i32 0, i32 13, i32 0, i32 3)
ret i32 %1
}

LLVM IR (-O2):
define i32 @mrc() {
%1 = tail call i32 @__builtin_arm_mrc(i32 15, i32 0, i32 13, i32 0, i32 3)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ one;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_BROADCAST;
int /*<<< orphan*/ printf(char *);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
void socket_broadcast(int sd) {
  const int one = 1;
  if (setsockopt(sd, SOL_SOCKET, SO_BROADCAST, (char *)&one, sizeof(one)) ==
      -1) {
    printf("[socket_broadcast] can't set SO_BROADCAST option\n");
  }
}


x86 assembly (clang, -O0):
<socket_broadcast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    116b <socket_broadcast+0x4b>
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_broadcast>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
cmp    $0xffffffff,%eax
je     1152 <socket_broadcast+0x32>
pop    %rax
ret
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
@.str = [50 x i8] c"[socket_broadcast] can't set SO_BROADCAST option\0A\00"
define void @socket_broadcast(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_BROADCAST
%7 = bitcast i32* %3 to i8*
%8 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i8* %7, i32 4)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
@str = [49 x i8] c"[socket_broadcast] can't set SO_BROADCAST option\00"
define void @socket_broadcast(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_BROADCAST
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %3, i32 4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}
void hal(int x) {}


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

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

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

LLVM IR (-O2):
define void @hal(i32 %0) {
ret void
}
/* Type definitions */
struct _Locale_name_hint {
  int dummy;
};
struct _Locale_ctype {
  int dummy;
};

/* Variables and functions */
scalar_t__ _Locale_create(char const *, int *);
struct _Locale_ctype *_Locale_ctype_create(const char *name,
                                           struct _Locale_name_hint *hint,
                                           int *__err_code) {
  return (struct _Locale_ctype *)_Locale_create(name, __err_code);
}


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

x86 assembly (clang, -O2):
<_Locale_ctype_create>:
mov    %rdx,%rsi
jmp    1030 <_Locale_create@plt>

LLVM IR (-O0):
%struct._Locale_ctype = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_ctype* @_Locale_ctype_create(i8* %0, %struct._Locale_name_hint* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca %struct._Locale_name_hint*
%6 = alloca i32*
store i8* %0, i8** %4
store %struct._Locale_name_hint* %1, %struct._Locale_name_hint** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32*, i32** %6
%9 = call i64 @_Locale_create(i8* %7, i32* %8)
%10 = inttoptr i64 %9 to %struct._Locale_ctype*
ret %struct._Locale_ctype* %10
}

LLVM IR (-O2):
%struct._Locale_ctype = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_ctype* @_Locale_ctype_create(i8* %0, %struct._Locale_name_hint* nocapture readnone %1, i32* %2) {
%4 = tail call i64 @_Locale_create(i8* %0, i32* %2)
%5 = inttoptr i64 %4 to %struct._Locale_ctype*
ret %struct._Locale_ctype* %5
}
/* Variables and functions */
int Evt_hdrSize();
void *Evt_data(const void *my) { return (void *)((char *)my + Evt_hdrSize()); }


x86 assembly (clang, -O0):
<Evt_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <Evt_hdrSize@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Evt_data>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <Evt_hdrSize@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @Evt_data(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @Evt_hdrSize()
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %3, i64 %5
ret i8* %6
}

LLVM IR (-O2):
define i8* @Evt_data(i8* readnone %0) {
%2 = tail call i32 (...) @Evt_hdrSize()
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
extern void pinio_reset_sound(void) {}


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

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

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

LLVM IR (-O2):
define void @pinio_reset_sound() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpc_key_press(int);
int /*<<< orphan*/ cpc_key_unpress(int);
void Joy_Opqa_Fire1(int value) {
  if (value) {
    cpc_key_press(0x57);
  } else {
    cpc_key_unpress(0x57);
  };
}


x86 assembly (clang, -O0):
<Joy_Opqa_Fire1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Opqa_Fire1+0x24>
mov    $0x57,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Opqa_Fire1+0x2e>
mov    $0x57,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Opqa_Fire1>:
test   %edi,%edi
je     112e <Joy_Opqa_Fire1+0xe>
mov    $0x57,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x57,%edi
jmp    1040 <cpc_key_unpress@plt>

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

LLVM IR (-O2):
define void @Joy_Opqa_Fire1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 87)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 87)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
long long __lsign(long long, long long);
long long intr_wrap_462(long long p1, long long p2) { return __lsign(p1, p2); }


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

x86 assembly (clang, -O2):
<intr_wrap_462>:
jmp    1030 <__lsign@plt>

LLVM IR (-O0):
define i64 @intr_wrap_462(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i64 @__lsign(i64 %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @intr_wrap_462(i64 %0, i64 %1) {
%3 = tail call i64 @__lsign(i64 %0, i64 %1)
ret i64 %3
}
int hashkey_multiplied(int key, int TABLE_SIZE) {
  float aux = 0.6180339887;
  float value = key * aux;
  value = value - (int)value;
  return (int)(value * TABLE_SIZE);
}


x86 assembly (clang, -O0):
<hashkey_multiplied>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  0xeee(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvttss2si -0x10(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashkey_multiplied>:
cvtsi2ss %edi,%xmm0
mulss  0xef4(%rip),%xmm0
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
cvtsi2ss %esi,%xmm2
subss  %xmm1,%xmm0
mulss  %xmm0,%xmm2
cvttss2si %xmm2,%eax
ret

LLVM IR (-O0):
define i32 @hashkey_multiplied(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
store float 0x3FE3C6EF40000000, float* %5
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to float
%9 = load float, float* %5
%10 = fmul float %8, %9
store float %10, float* %6
%11 = load float, float* %6
%12 = load float, float* %6
%13 = fptosi float %12 to i32
%14 = sitofp i32 %13 to float
%15 = fsub float %11, %14
store float %15, float* %6
%16 = load float, float* %6
%17 = load i32, i32* %4
%18 = sitofp i32 %17 to float
%19 = fmul float %16, %18
%20 = fptosi float %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @hashkey_multiplied(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to float
%4 = fmul float %3, 0x3FE3C6EF40000000
%5 = fptosi float %4 to i32
%6 = sitofp i32 %5 to float
%7 = fsub float %4, %6
%8 = sitofp i32 %1 to float
%9 = fmul float %7, %8
%10 = fptosi float %9 to i32
ret i32 %10
}
void suffix() {}


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

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

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

LLVM IR (-O2):
define void @suffix() {
ret void
}
void bne() {
  asm volatile("popq %%rax\n\t"
               "popq %%rbx\n\t"
               "test %%rax, %%rax\n\t"
               "jnz _skipbne\n\t"
               "jmp *%%rbx\n\t"
               "_skipbne:\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<bne>:
push   %rbp
mov    %rsp,%rbp
pop    %rax
pop    %rbx
test   %rax,%rax
jne    1111 <_skipbne>
jmp    *%rbx

x86 assembly (clang, -O2):
<bne>:
pop    %rax
pop    %rbx
test   %rax,%rax
jne    1109 <_skipbne>
jmp    *%rbx

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

LLVM IR (-O2):
define void @bne() {
tail call void asm sideeffect "popq %rax\0A\09popq %rbx\0A\09test %rax, %rax\0A\09jnz _skipbne\0A\09jmp *%rbx\0A\09_skipbne:\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
long long NumberOfFiles() { return 100000000LL; }


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

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

LLVM IR (-O0):
define i64 @NumberOfFiles() {
ret i64 100000000
}

LLVM IR (-O2):
define i64 @NumberOfFiles() {
ret i64 100000000
}
/* Variables and functions */
int /*<<< orphan*/ __expand(char *, char const *, char, char *, char *, char *,
                            char *);
void expand4(char *str, const char *fmt, char **args, char out) {
  __expand(str, fmt, out, args[0], args[1], args[2], args[3]);
}


x86 assembly (clang, -O0):
<expand4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x19(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%r8
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%r9
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rax
movsbl %dl,%edx
mov    %rax,(%rsp)
call   1030 <__expand@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand4>:
push   %rax
mov    (%rdx),%rax
mov    0x8(%rdx),%r8
mov    0x10(%rdx),%r9
mov    0x18(%rdx),%rdx
mov    %rdx,(%rsp)
mov    %ecx,%edx
mov    %rax,%rcx
call   1030 <__expand@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @expand4(i8* %0, i8* %1, i8** nocapture %2, i8 signext %3) {
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8*, i8** %2, i64 1
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8*, i8** %2, i64 2
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %2, i64 3
%11 = load i8*, i8** %10
%12 = tail call i32 @__expand(i8* %0, i8* %1, i8 signext %3, i8* %5, i8* %7, i8* %9, i8* %11)
ret void
}
int kwad(val)
int val;
{ return val * val; }


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

x86 assembly (clang, -O2):
<kwad>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @kwad(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
int exception_is_valid_char(char c) {
  if (c >= 48 && c <= 122)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<exception_is_valid_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <exception_is_valid_char+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1130 <exception_is_valid_char+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <exception_is_valid_char+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exception_is_valid_char>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0x4b,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @exception_is_valid_char(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 75
%4 = zext i1 %3 to i32
ret i32 %4
}
int x509_certificate_self_signed(struct x509_certificate *cert) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.x509_certificate = type opaque
define i32 @x509_certificate_self_signed(%struct.x509_certificate* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int y = 5;
  int *ptrY = &y;
  printf("%d", *ptrY);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
int Q_isupper(int c) {
  if ((c >= 'A') && (c <= 'Z')) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<Q_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1127 <Q_isupper+0x27>
cmpl   $0x5a,-0x8(%rbp)
jg     1127 <Q_isupper+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <Q_isupper+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Q_isupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @Q_isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
double ldexp(int, int);
double av_int2dbl(int64_t v) {
  if (v + v > 0xFFEULL << 52)
    return 0.0 / 0.0;
  return ldexp(((v & ((1LL << 52) - 1)) + (1LL << 52)) * (v >> 63 | 1),
               (v >> 52 & 0x7FF) - 1075);
}


x86 assembly (clang, -O0):
<av_int2dbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
cltq
movabs $0xffe0000000000000,%rcx
cmp    %rcx,%rax
jbe    1148 <av_int2dbl+0x38>
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119e <av_int2dbl+0x8e>
movslq -0xc(%rbp),%rax
movabs $0xfffffffffffff,%rcx
and    %rcx,%rax
movabs $0x10000000000000,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%edx
mov    $0x3f,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     $0x1,%ecx
movslq %ecx,%rcx
imul   %rcx,%rax
mov    %eax,%edi
mov    -0xc(%rbp),%esi
mov    $0x34,%ecx
sar    %cl,%esi
and    $0x7ff,%esi
sub    $0x433,%esi
call   1030 <ldexp@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_int2dbl>:
test   %edi,%edi
js     1119 <av_int2dbl+0x9>
jmp    1030 <ldexp@plt>
movsd  0xedf(%rip),%xmm0
ret

LLVM IR (-O0):
define double @av_int2dbl(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
%7 = sext i32 %6 to i64
%8 = icmp ugt i64 %7, -9007199254740992
br i1 %8, label %9, label %10
9: ; preds = %1
store double 0x7FF8000000000000, double* %2
br label %26
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = and i64 %12, 4503599627370495
%14 = add nsw i64 %13, 4503599627370496
%15 = load i32, i32* %3
%16 = ashr i32 %15, 63
%17 = or i32 %16, 1
%18 = sext i32 %17 to i64
%19 = mul nsw i64 %14, %18
%20 = trunc i64 %19 to i32
%21 = load i32, i32* %3
%22 = ashr i32 %21, 52
%23 = and i32 %22, 2047
%24 = sub nsw i32 %23, 1075
%25 = call double @ldexp(i32 %20, i32 %24)
store double %25, double* %2
br label %26
26: ; preds = %10, %9
%27 = load double, double* %2
ret double %27
}

LLVM IR (-O2):
define double @av_int2dbl(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call double @ldexp(i32 poison, i32 poison)
br label %5
5: ; preds = %1, %3
%6 = phi double [ %4, %3 ], [ 0x7FF8000000000000, %1 ]
ret double %6
}