xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x74() {
  Assert_real((isprint(116)),
              "/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/ctype/test_isprint.c",
              585, ("isprint should be 1 for t"));
}


x86 assembly (clang, -O0):
<t_isprint_0x74>:
push   %rbp
mov    %rsp,%rbp
mov    $0x74,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x249,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x74>:
push   %rax
mov    $0x74,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x249,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for t\00"
define void @t_isprint_0x74() {
%1 = call i32 @isprint(i32 116)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 585, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for t\00"
define void @t_isprint_0x74() {
%1 = tail call i32 @isprint(i32 116)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 585, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void gen_swap_stack(void) {
  output_line("ldx ,s");
  output_line("std ,s");
  output_line("tfr x,d");
}


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

x86 assembly (clang, -O2):
<gen_swap_stack>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <output_line@plt>
lea    0xee3(%rip),%rdi
call   1030 <output_line@plt>
lea    0xede(%rip),%rdi
pop    %rax
jmp    1030 <output_line@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"ldx ,s\00"
@.str.1 = [7 x i8] c"std ,s\00"
@.str.2 = [8 x i8] c"tfr x,d\00"
define void @gen_swap_stack() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @output_line(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"ldx ,s\00"
@.str.1 = [7 x i8] c"std ,s\00"
@.str.2 = [8 x i8] c"tfr x,d\00"
define void @gen_swap_stack() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @output_line(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ publish_and_consume_single_message();
int /*<<< orphan*/ publish_and_wrap_multiple_messages();
int /*<<< orphan*/ return_null_when_no_messages_available();
int /*<<< orphan*/ stop_accepting_messages_when_full();
int /*<<< orphan*/ stop_accepting_messages_when_full_when_polled_not_released();
int main(int argc, char **argv) {
  publish_and_consume_single_message();
  publish_and_wrap_multiple_messages();
  stop_accepting_messages_when_full();
  stop_accepting_messages_when_full_when_polled_not_released();
  return_null_when_no_messages_available();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <publish_and_consume_single_message@plt>
mov    $0x0,%al
call   1030 <publish_and_wrap_multiple_messages@plt>
mov    $0x0,%al
call   1050 <stop_accepting_messages_when_full@plt>
mov    $0x0,%al
call   1060 <stop_accepting_messages_when_full_when_polled_not_released@plt>
mov    $0x0,%al
call   1070 <return_null_when_no_messages_available@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <publish_and_consume_single_message@plt>
xor    %eax,%eax
call   1030 <publish_and_wrap_multiple_messages@plt>
xor    %eax,%eax
call   1050 <stop_accepting_messages_when_full@plt>
xor    %eax,%eax
call   1060 <stop_accepting_messages_when_full_when_polled_not_released@plt>
xor    %eax,%eax
call   1070 <return_null_when_no_messages_available@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 = call i32 (...) @publish_and_consume_single_message()
%6 = call i32 (...) @publish_and_wrap_multiple_messages()
%7 = call i32 (...) @stop_accepting_messages_when_full()
%8 = call i32 (...) @stop_accepting_messages_when_full_when_polled_not_released()
%9 = call i32 (...) @return_null_when_no_messages_available()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @publish_and_consume_single_message()
%4 = tail call i32 (...) @publish_and_wrap_multiple_messages()
%5 = tail call i32 (...) @stop_accepting_messages_when_full()
%6 = tail call i32 (...) @stop_accepting_messages_when_full_when_polled_not_released()
%7 = tail call i32 (...) @return_null_when_no_messages_available()
ret i32 0
}
int test_imm_13int32_reg(int val) { return ((val) & (0x13 << 0)) ? -20 : -40; }


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

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

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

LLVM IR (-O2):
define i32 @test_imm_13int32_reg(i32 %0) {
%2 = and i32 %0, 19
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
const char *print_string_maybe_null(const char *s) {
  return s == NULL ? "(NULL)" : s;
}


x86 assembly (clang, -O0):
<print_string_maybe_null>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1123 <print_string_maybe_null+0x23>
lea    0xee6(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    112b <print_string_maybe_null+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string_maybe_null>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"(NULL)\00"
define i8* @print_string_maybe_null(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i8*, i8** %2
br label %8
8: ; preds = %6, %5
%9 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %5 ], [ %7, %6 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"(NULL)\00"
define i8* @print_string_maybe_null(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ s2disp(int, int);
void s2disp_(int *idelay, int *irestorecamera) {
  s2disp(*idelay, *irestorecamera);
}


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

x86 assembly (clang, -O2):
<s2disp_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <s2disp@plt>

LLVM IR (-O0):
define void @s2disp_(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = call i32 @s2disp(i32 %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @s2disp_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = tail call i32 @s2disp(i32 %3, i32 %4)
ret void
}
/* Type definitions */
struct fcb {
  int dummy;
};

/* Variables and functions */
int kf_delete_rec(struct fcb *, int /*<<< orphan*/, unsigned char *,
                  unsigned int);
int kf7_delete_rec(struct fcb *f, unsigned char key[], unsigned key_lc) {
  return (kf_delete_rec(f, 0, key, key_lc));
}


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

x86 assembly (clang, -O2):
<kf7_delete_rec>:
mov    %edx,%ecx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <kf_delete_rec@plt>

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

LLVM IR (-O2):
%struct.fcb = type { i32 }
define i32 @kf7_delete_rec(%struct.fcb* %0, i8* %1, i32 %2) {
%4 = tail call i32 @kf_delete_rec(%struct.fcb* %0, i32 0, i8* %1, i32 %2)
ret i32 %4
}
void emit_utf8_data(struct processor_explicatory_state *process_state,
                    struct modern_stream *stream, void *stream_state,
                    struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_utf8_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_utf8_data(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_utf8_data(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t
hfp_subevent_enhanced_call_status_get_clcc_status(const uint8_t *event) {
  return event[5];
}


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

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

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

LLVM IR (-O2):
define i32 @hfp_subevent_enhanced_call_status_get_clcc_status(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
ret i32 %3
}
int fun1061() { return 1061; }


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

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

LLVM IR (-O0):
define i32 @fun1061() {
ret i32 1061
}

LLVM IR (-O2):
define i32 @fun1061() {
ret i32 1061
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, ...);
void tag(const char *tagName) {
  printf("git tag -a %s -m \"%s\"\n", tagName, tagName);
  printf("git push origin %s\n", tagName);
}


x86 assembly (clang, -O0):
<tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"git tag -a %s -m \22%s\22\0A\00"
@.str.1 = [20 x i8] c"git push origin %s\0A\00"
define void @tag(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"git tag -a %s -m \22%s\22\0A\00"
@.str.1 = [20 x i8] c"git push origin %s\0A\00"
define void @tag(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
%3 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int ch;
  for (ch = 0; ch <= 255; ch = ch + 1) {
    printf("%d=%c\t", ch, ch);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d=%c\09\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int reportfilename(char *, char *);
int writereportdata(char *, char *, int);
int printhoursreport(char usefile[12], int weekends) {
  int e, f;
  char reportfile[12];
  e = reportfilename(usefile, &reportfile[0]);
  f = writereportdata(usefile, reportfile, weekends);
  return 0;
}


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

x86 assembly (clang, -O2):
<printhoursreport>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rsi
call   1040 <reportfilename@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <writereportdata@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @printhoursreport(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [12 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i8*, i8** %3
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%10 = call i32 @reportfilename(i8* %8, i8* %9)
store i32 %10, i32* %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%13 = load i32, i32* %4
%14 = call i32 @writereportdata(i8* %11, i8* %12, i32 %13)
store i32 %14, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @printhoursreport(i8* %0, i32 %1) {
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%5 = call i32 @reportfilename(i8* %0, i8* %4)
%6 = call i32 @writereportdata(i8* %0, i8* %4, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gadgetclose();
int /*<<< orphan*/ gadgetopen();
void gadgetrefresh(void) {
  gadgetclose();
  gadgetopen();
}


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

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

LLVM IR (-O0):
define void @gadgetrefresh() {
%1 = call i32 (...) @gadgetclose()
%2 = call i32 (...) @gadgetopen()
ret void
}

LLVM IR (-O2):
define void @gadgetrefresh() {
%1 = tail call i32 (...) @gadgetclose()
%2 = tail call i32 (...) @gadgetopen()
ret void
}
int fn8(int x, int y) {
  int tem1 = y ^ ~x;
  int tem2 = y | x;
  return tem1 & tem2;
}


x86 assembly (clang, -O0):
<fn8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn8>:
mov    %edi,%eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @fn8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = xor i32 %8, -1
%10 = xor i32 %7, %9
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = or i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = and i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @fn8(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int lace_builtin_void_main(unsigned int, char **, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *);
int lace_main_void(unsigned argc, char **argv) {
  return lace_builtin_void_main(argc, argv, NULL, NULL);
}


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

x86 assembly (clang, -O2):
<lace_main_void>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <lace_builtin_void_main@plt>

LLVM IR (-O0):
define i32 @lace_main_void(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 @lace_builtin_void_main(i32 %5, i8** %6, i32* null, i32* null)
ret i32 %7
}

LLVM IR (-O2):
define i32 @lace_main_void(i32 %0, i8** %1) {
%3 = tail call i32 @lace_builtin_void_main(i32 %0, i8** %1, i32* null, i32* null)
ret i32 %3
}
double calcSphereVol(float radius) {
  return (4.0 / 3.0) * 3.14 * (radius * radius * radius);
}


x86 assembly (clang, -O0):
<calcSphereVol>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xedc(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcSphereVol>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  0xee6(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calcSphereVol(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = load float, float* %2
%7 = fmul float %5, %6
%8 = fpext float %7 to double
%9 = fmul double 0x4010BF258BF258BF, %8
ret double %9
}

LLVM IR (-O2):
define double @calcSphereVol(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %2, %0
%4 = fpext float %3 to double
%5 = fmul double %4, 0x4010BF258BF258BF
ret double %5
}
/* Variables and functions */
int f296(int *);
int f297(int *p) { return f296(p); }


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

x86 assembly (clang, -O2):
<f297>:
jmp    1030 <f296@plt>

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

LLVM IR (-O2):
define i32 @f297(i32* %0) {
%2 = tail call i32 @f296(i32* %0)
ret i32 %2
}
int test_imm_6Cuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x6C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Cuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7077888
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int mkfifo(char *, int);
int create_fifo(char *path) { return mkfifo(path, 0660); }


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

x86 assembly (clang, -O2):
<create_fifo>:
mov    $0x1b0,%esi
jmp    1030 <mkfifo@plt>

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

LLVM IR (-O2):
define i32 @create_fifo(i8* %0) {
%2 = tail call i32 @mkfifo(i8* %0, i32 432)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void binaire_rec(unsigned int n) {
  if (n > 1)
    binaire_rec(n / 2);
  printf("%d", n % 2);
}


x86 assembly (clang, -O0):
<binaire_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jbe    1140 <binaire_rec+0x20>
mov    -0x4(%rbp),%edi
shr    $0x1,%edi
call   1040 <binaire_rec@plt>
mov    -0x4(%rbp),%esi
and    $0x1,%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binaire_rec>:
push   %rbx
mov    %edi,%ebx
cmp    $0x2,%edi
jb     1131 <binaire_rec+0x11>
mov    %ebx,%edi
shr    %edi
call   1040 <binaire_rec@plt>
and    $0x1,%ebx
lea    0xec5(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @binaire_rec(i32 %0) {
%2 = icmp ugt i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = lshr i32 %0, 1
tail call void @binaire_rec(i32 %4)
br label %5
5: ; preds = %3, %1
%6 = and i32 %0, 1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
void vmk_AssertNoSPLocksHeld(void) {}


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

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

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

LLVM IR (-O2):
define void @vmk_AssertNoSPLocksHeld() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
void outputimgraw(char *fname, unsigned char *img, int ny, int nx, int dim) {
  FILE *fimg;
  fimg = fopen(fname, "wb");
  fwrite(img, sizeof(unsigned char), ny * nx * dim, fimg);
  fclose(fimg);
}


x86 assembly (clang, -O0):
<outputimgraw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
imul   -0x18(%rbp),%edx
imul   -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fwrite@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outputimgraw>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r12d
mov    %edx,%ebx
mov    %rsi,%r15
lea    0xeb6(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbp
imul   %r12d,%ebx
imul   %r14d,%ebx
mov    %r15,%rdi
mov    $0x1,%esi
mov    %ebx,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"wb\00"
define void @outputimgraw(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i8*, i8** %6
%13 = call i32* @fopen(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %13, i32** %11
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = mul nsw i32 %15, %16
%18 = load i32, i32* %10
%19 = mul nsw i32 %17, %18
%20 = load i32*, i32** %11
%21 = call i32 @fwrite(i8* %14, i32 1, i32 %19, i32* %20)
%22 = load i32*, i32** %11
%23 = call i32 @fclose(i32* %22)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define void @outputimgraw(i8* nocapture %0, i8* nocapture %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = mul nsw i32 %3, %2
%8 = mul nsw i32 %7, %4
%9 = tail call i32 @fwrite(i8* %1, i32 1, i32 %8, i32* %6)
%10 = tail call i32 @fclose(i32* %6)
ret void
}
int deinit(struct opt *opt) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.opt = type opaque
define i32 @deinit(%struct.opt* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *, int *);
char *solve() {
  int b, w;
  scanf("%d %d", &w, &b);
  return b % 2 == 0 ? "WHITE" : "BLACK";
}


x86 assembly (clang, -O0):
<solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x4(%rbp),%rdx
call   1030 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
lea    0xece(%rip),%rax
lea    0xec1(%rip),%rcx
cmp    $0x0,%edx
cmove  %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <scanf@plt>
testb  $0x1,(%rsp)
lea    0xed6(%rip),%rcx
lea    0xed5(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [6 x i8] c"WHITE\00"
@.str.2 = [6 x i8] c"BLACK\00"
define i8* @solve() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %1)
%4 = load i32, i32* %1
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
ret i8* %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [6 x i8] c"WHITE\00"
@.str.2 = [6 x i8] c"BLACK\00"
define i8* @solve() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %1)
%6 = load i32, i32* %1
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
ret i8* %9
}
int main(int argc, char **argv) {
  int start = 0,
      last = ((((typeof(last))-1) < 0)
                  ? ((1 << (sizeof(typeof(last)) * 8 - 1)) - 1)
                  : (~(typeof(last))0)),
      count = last - start;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x7fffffff,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
float pow(int, float);
float fa_get_scaling_para(int scale_factor) {
  return pow(2, (float)scale_factor / 4.0);
}


x86 assembly (clang, -O0):
<fa_get_scaling_para>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa_get_scaling_para>:
cvtsi2ss %edi,%xmm0
mulss  0xee4(%rip),%xmm0
mov    $0x2,%edi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define float @fa_get_scaling_para(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to float
%5 = fpext float %4 to double
%6 = fdiv double %5, 4.000000e+00
%7 = fptrunc double %6 to float
%8 = call float @pow(i32 2, float %7)
ret float %8
}

LLVM IR (-O2):
define float @fa_get_scaling_para(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = fmul float %2, 2.500000e-01
%4 = tail call float @pow(i32 2, float %3)
ret float %4
}
void cook_buf(void *fp) {}


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

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

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

LLVM IR (-O2):
define void @cook_buf(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int cache_invalidate_file_(char const *, int);
int cache_invalidate_file(const char *filename) {
  return cache_invalidate_file_(filename, true);
}


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

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

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

LLVM IR (-O2):
define i32 @cache_invalidate_file(i8* %0) {
%2 = tail call i32 @cache_invalidate_file_(i8* %0, i32 1)
ret i32 %2
}
int max1363_register_ring_funcs_and_init(struct iio_dev *indio_dev) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @max1363_register_ring_funcs_and_init(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
void EZI2C_SCB_IRQ_Interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @EZI2C_SCB_IRQ_Interrupt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func_9(int, char *, unsigned long);
void func_8(int a, char *b, unsigned long c) { func_9(a, b, c); }


x86 assembly (clang, -O0):
<func_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <func_9@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_8>:
jmp    1030 <func_9@plt>

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

LLVM IR (-O2):
define void @func_8(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @func_9(i32 %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t sg_get_unaligned_le32(const void *p) {
  return ((const uint8_t *)p)[3] << 24 | ((const uint8_t *)p)[2] << 16 |
         ((const uint8_t *)p)[1] << 8 | ((const uint8_t *)p)[0];
}


x86 assembly (clang, -O0):
<sg_get_unaligned_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_get_unaligned_le32>:
mov    0xc(%rdi),%ecx
shl    $0x18,%ecx
mov    0x4(%rdi),%eax
mov    0x8(%rdi),%edx
shl    $0x10,%edx
or     %ecx,%edx
shl    $0x8,%eax
or     %edx,%eax
or     (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @sg_get_unaligned_le32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = getelementptr inbounds i8, i8* %0, i64 12
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = getelementptr inbounds i8, i8* %0, i64 8
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %10, %6
%12 = getelementptr inbounds i8, i8* %0, i64 4
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32, i32* %2
%18 = or i32 %16, %17
ret i32 %18
}
f(x) {
  if (x != 0 || x == 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111b <f+0x1b>
cmpl   $0x0,-0x8(%rbp)
jne    1127 <f+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <f+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 0
}
void initTimer() {
  (*(unsigned int *)0x40048080) |= 1 << 7;
  (*(unsigned int *)0x4000C004) |= 1;
  (*(unsigned int *)0x4000C004) &= ~2;
  (*(unsigned int *)0x4000C00C) = 25 * 12 - 1;
}


x86 assembly (clang, -O0):
<initTimer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40048080,%eax
mov    (%rax),%ecx
or     $0x80,%ecx
mov    $0x40048080,%eax
mov    %ecx,(%rax)
mov    $0x4000c004,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x4000c004,%eax
mov    %ecx,(%rax)
mov    $0x4000c004,%eax
mov    (%rax),%ecx
and    $0xfffffffd,%ecx
mov    $0x4000c004,%eax
mov    %ecx,(%rax)
mov    $0x4000c00c,%eax
movl   $0x12b,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initTimer>:
orb    $0x80,0x40048080
80
mov    0x4000c004,%eax
and    $0xfffffffc,%eax
or     $0x1,%eax
mov    %eax,0x4000c004
movl   $0x12b,0x4000c00c
ret

LLVM IR (-O0):
define void @initTimer() {
%1 = load i32, i32* inttoptr (i64 1074036864 to i32*)
%2 = or i32 %1, 128
store i32 %2, i32* inttoptr (i64 1074036864 to i32*)
%3 = load i32, i32* inttoptr (i64 1073790980 to i32*)
%4 = or i32 %3, 1
store i32 %4, i32* inttoptr (i64 1073790980 to i32*)
%5 = load i32, i32* inttoptr (i64 1073790980 to i32*)
%6 = and i32 %5, -3
store i32 %6, i32* inttoptr (i64 1073790980 to i32*)
store i32 299, i32* inttoptr (i64 1073790988 to i32*)
ret void
}

LLVM IR (-O2):
define void @initTimer() {
%1 = load i32, i32* inttoptr (i64 1074036864 to i32*)
%2 = or i32 %1, 128
store i32 %2, i32* inttoptr (i64 1074036864 to i32*)
%3 = load i32, i32* inttoptr (i64 1073790980 to i32*)
%4 = and i32 %3, -4
%5 = or i32 %4, 1
store i32 %5, i32* inttoptr (i64 1073790980 to i32*)
store i32 299, i32* inttoptr (i64 1073790988 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ unlink(char *);
void ipc_deinit(int fd) {
  if (fd >= 0)
    close(fd);
  unlink("/run/ldm.socket");
}


x86 assembly (clang, -O0):
<ipc_deinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     113d <ipc_deinit+0x1d>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
lea    0xebc(%rip),%rdi
call   1030 <unlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipc_deinit>:
test   %edi,%edi
js     112e <ipc_deinit+0xe>
push   %rax
call   1040 <close@plt>
add    $0x8,%rsp
lea    0xecb(%rip),%rdi
jmp    1030 <unlink@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"/run/ldm.socket\00"
define void @ipc_deinit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
br label %8
8: ; preds = %5, %1
%9 = call i32 @unlink(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"/run/ldm.socket\00"
define void @ipc_deinit(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @unlink(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
int div(int a, int b) {
  int quotient = 0;
  while ((quotient + 1) * b <= a) {
    quotient++;
  }
  return quotient;
}


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
imul   -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1132 <div+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <div+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
mov    $0xffffffff,%eax
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
add    %esi,%ecx
cmp    %edi,%ecx
jle    1110 <div+0x10>
ret

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

LLVM IR (-O2):
define i32 @div(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %5, %3 ]
%5 = add nuw nsw i32 %4, 1
%6 = mul nsw i32 %5, %1
%7 = icmp sgt i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char *ponteiro = malloc(100);
  printf("String: ");
  scanf("%99s", ponteiro);
  free(ponteiro);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
lea    0xea8(%rip),%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"String: \00"
@.str.1 = [5 x i8] c"%99s\00"
define i32 @main() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 100)
store i8* %2, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"String: \00"
@.str.1 = [5 x i8] c"%99s\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t RGB(uint16_t r, uint16_t g, uint16_t b) {
  return (b << 10) | (g << 5) | r;
}


x86 assembly (clang, -O0):
<RGB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0xa,%eax
mov    -0x8(%rbp),%ecx
shl    $0x5,%ecx
or     %ecx,%eax
or     -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RGB>:
mov    %esi,%eax
shl    $0xa,%edx
shl    $0x5,%eax
or     %edi,%eax
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @RGB(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 10
%5 = shl i32 %1, 5
%6 = or i32 %5, %0
%7 = or i32 %6, %4
ret i32 %7
}