xunge/DecIR huggingface dataset:
double heap_keycmp_more(double lhs, double rhs) { return lhs - rhs; }


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

x86 assembly (clang, -O2):
<heap_keycmp_more>:
subsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @heap_keycmp_more(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pop(int *a, int **p) {
  if (*p <= a) {
    printf("Underflow - 1\n");
    return -1;
  }
  *p -= 1;
  int x = **p;
  return x;
}


x86 assembly (clang, -O0):
<pop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
ja     1149 <pop+0x39>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <pop+0x59>
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop>:
push   %rax
mov    (%rsi),%rax
cmp    %rdi,%rax
jbe    1125 <pop+0x15>
lea    -0x4(%rax),%rcx
mov    %rcx,(%rsi)
mov    -0x4(%rax),%eax
pop    %rcx
ret
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [14 x i8] c"Underflow - 1\00"
define i32 @pop(i32* readnone %0, i32** nocapture %1) {
%3 = load i32*, i32** %1
%4 = icmp ugt i32* %3, %0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %10
7: ; preds = %2
%8 = getelementptr inbounds i32, i32* %3, i64 -1
store i32* %8, i32** %1
%9 = load i32, i32* %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ -1, %5 ], [ %9, %7 ]
ret i32 %11
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
uint16_t crop_ui16(uint16_t val, uint16_t min, uint16_t max) {
  if (val < min)
    return min;
  if (val > max)
    return max;
  return val;
}


x86 assembly (clang, -O0):
<crop_ui16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    112b <crop_ui16+0x2b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <crop_ui16+0x4e>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    1146 <crop_ui16+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <crop_ui16+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crop_ui16>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovle %rdi,%rax
cmp    %rsi,%rdi
cmovl  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @crop_ui16(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp sgt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
/* Variables and functions */
char *ulltoa_wp(unsigned long long, char *, unsigned int, int, char);
char *ulltoa_w(unsigned long long val, char *buffer, unsigned int base,
               int width) {
  return ulltoa_wp(val, buffer, base, width, ' ');
}


x86 assembly (clang, -O0):
<ulltoa_w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    $0x20,%r8d
call   1030 <ulltoa_wp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulltoa_w>:
mov    $0x20,%r8d
jmp    1030 <ulltoa_wp@plt>

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

LLVM IR (-O2):
define i8* @ulltoa_w(i64 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i8* @ulltoa_wp(i64 %0, i8* %1, i32 %2, i32 %3, i8 signext 32)
ret i8* %5
}
int ipixel_fmt_position(int shift) {
  int table[] = {0,  -1, -1, -1, -1, -1, -1, -1, 1,  -1, -1,
                 -1, -1, -1, -1, -1, 2,  -1, -1, -1, -1, -1,
                 -1, -1, 3,  -1, -1, -1, -1, -1, -1, -1, -1};
  return table[shift];
}


x86 assembly (clang, -O0):
<ipixel_fmt_position>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xed4(%rip),%rsi
mov    $0x84,%edx
call   1030 <memcpy@plt>
movslq -0x4(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipixel_fmt_position>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@__const.ipixel_fmt_position.table = [33 x i32] [i32 0, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 2, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 3, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1]
define i32 @ipixel_fmt_position(i32 %0) {
%2 = alloca i32
%3 = alloca [33 x i32]
store i32 %0, i32* %2
%4 = bitcast [33 x i32]* %3 to i8*
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [33 x i32], [33 x i32]* %3, i64 0, i64 %6
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
@__const.ipixel_fmt_position.table = [33 x i32] [i32 0, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 2, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 3, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1]
define i32 @ipixel_fmt_position(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [33 x i32], [33 x i32]* @__const.ipixel_fmt_position.table, i64 0, i64 %2
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void baz(int y) {
  if (y != 0x10)
    abort();
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
je     112c <baz+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
cmp    $0x10,%edi
jne    1116 <baz+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @baz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 16
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @baz(i32 %0) {
%2 = icmp eq i32 %0, 16
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret void
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECAC(const char *the_title) { return any_decrqss(the_title, ",|"); }


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

x86 assembly (clang, -O2):
<rpt_DECAC>:
lea    0xee9(%rip),%rsi
jmp    1030 <any_decrqss@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c",|\00"
define i32 @rpt_DECAC(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
unsigned int js_fastf_get_unused_bits_num(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @js_fastf_get_unused_bits_num() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *safe_realloc(void *buffer, size_t size) {
  buffer = realloc(buffer, size);
  if (!buffer) {
    fprintf(stderr, "Error: Can't allocate memory (%zu bytes)\n", size);
    abort();
  }
  return buffer;
}


x86 assembly (clang, -O0):
<safe_realloc>:
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   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117c <safe_realloc+0x4c>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_realloc>:
push   %rbx
mov    %rsi,%rbx
call   1050 <realloc@plt>
test   %rax,%rax
je     1140 <safe_realloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Error: Can't allocate memory (%zu bytes)\0A\00"
define i8* @safe_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i64, i64* %4
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %12)
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %2
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Error: Can't allocate memory (%zu bytes)\0A\00"
define noalias i8* @safe_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %1)
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ align(int /*<<< orphan*/, int);
uint32_t align_BS(uint32_t addr) { return align(addr, 512); }


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

x86 assembly (clang, -O2):
<align_BS>:
mov    $0x200,%esi
jmp    1030 <align@plt>

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

LLVM IR (-O2):
define i32 @align_BS(i32 %0) {
%2 = tail call i32 @align(i32 %0, i32 512)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int terminal_print32(int, int, int /*<<< orphan*/ const *);
int terminal_wprint(int x, int y, const wchar_t *s) {
  return terminal_print32(x, y, (const int32_t *)s);
}


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

x86 assembly (clang, -O2):
<terminal_wprint>:
jmp    1030 <terminal_print32@plt>

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

LLVM IR (-O2):
define i32 @terminal_wprint(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @terminal_print32(i32 %0, i32 %1, i32* %2)
ret i32 %4
}
void handle_hup() {}


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

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

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

LLVM IR (-O2):
define void @handle_hup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ converteFB(double);
int main() {
  converteFB(3.5);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <converteFB@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @converteFB(double 3.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @converteFB(double 3.500000e+00)
ret i32 0
}
void vec3_add(const float a[3], const float b[3], float out[3]) {
  out[0] = a[0] + b[0];
  out[1] = a[1] + b[1];
  out[2] = a[2] + b[2];
}


x86 assembly (clang, -O0):
<vec3_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_add>:
movss  (%rdi),%xmm0
addss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
movss  0x4(%rdi),%xmm0
addss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdx)
movss  0x8(%rdi),%xmm0
addss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @vec3_add(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fadd float %9, %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fadd float %18, %21
%23 = load float*, float** %6
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %4
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %5
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fadd float %27, %30
%32 = load float*, float** %6
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @vec3_add(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fadd float %4, %5
store float %6, float* %2
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %2, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 2
%16 = load float, float* %15
%17 = fadd float %14, %16
%18 = getelementptr inbounds float, float* %2, i64 2
store float %17, float* %18
ret void
}
/* Type definitions */
struct label_struct {
  int dummy;
};
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int errno;
int syscall(int, char const *, int /*<<< orphan*/, struct label_struct *);
int mkdir_labeled(const char *pathname, mode_t mode,
                  struct label_struct *label) {
  int rv = syscall(330, pathname, mode, label);
  return rv ? -errno : 0;
}


x86 assembly (clang, -O0):
<mkdir_labeled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x14a,%edi
call   1030 <syscall@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1158 <mkdir_labeled+0x48>
xor    %eax,%eax
mov    0x2e92(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x20(%rbp)
jmp    1162 <mkdir_labeled+0x52>
xor    %eax,%eax
mov    %eax,-0x20(%rbp)
jmp    1162 <mkdir_labeled+0x52>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdir_labeled>:
push   %rax
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x14a,%edi
call   1030 <syscall@plt>
mov    0x2eb6(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
test   %eax,%eax
cmovne %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.label_struct = type { i32 }
@errno = global i32 0
define i32 @mkdir_labeled(i8* %0, i32 %1, %struct.label_struct* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.label_struct*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store %struct.label_struct* %2, %struct.label_struct** %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load %struct.label_struct*, %struct.label_struct** %6
%11 = call i32 @syscall(i32 330, i8* %8, i32 %9, %struct.label_struct* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i32, i32* @errno
%16 = sub nsw i32 0, %15
br label %18
17: ; preds = %3
br label %18
18: ; preds = %17, %14
%19 = phi i32 [ %16, %14 ], [ 0, %17 ]
ret i32 %19
}

LLVM IR (-O2):
%struct.label_struct = type { i32 }
@errno = global i32 0
define i32 @mkdir_labeled(i8* %0, i32 %1, %struct.label_struct* %2) {
%4 = tail call i32 @syscall(i32 330, i8* %0, i32 %1, %struct.label_struct* %2)
%5 = icmp eq i32 %4, 0
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
unsigned int convert_old_type(unsigned int ntype) {
  unsigned int type = ntype & 0xff;
  if (type == 17) {
    if (ntype & (1 << 24))
      type = 36;
    else
      type = 37;
    ntype &= ~((1 << 24) | (1 << 23));
    ntype &= 0xffffff00;
    ntype |= type;
    return ntype;
  } else
    return ntype;
}


x86 assembly (clang, -O0):
<convert_old_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x11,-0xc(%rbp)
jne    116a <convert_old_type+0x6a>
mov    -0x8(%rbp),%eax
and    $0x1000000,%eax
cmp    $0x0,%eax
je     1139 <convert_old_type+0x39>
movl   $0x24,-0xc(%rbp)
jmp    1140 <convert_old_type+0x40>
movl   $0x25,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfe7fffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffffff00,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <convert_old_type+0x70>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_old_type>:
mov    %edi,%eax
cmp    $0x11,%al
jne    111a <convert_old_type+0x1a>
xor    %ecx,%ecx
test   $0x1000000,%eax
sete   %cl
and    $0xfe7fff00,%eax
add    %ecx,%eax
add    $0x24,%eax
ret

LLVM IR (-O0):
define i32 @convert_old_type(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, 255
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 17
br i1 %8, label %9, label %24
9: ; preds = %1
%10 = load i32, i32* %3
%11 = and i32 %10, 16777216
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 36, i32* %4
br label %15
14: ; preds = %9
store i32 37, i32* %4
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
%17 = and i32 %16, -25165825
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = and i32 %18, -256
store i32 %19, i32* %3
%20 = load i32, i32* %4
%21 = load i32, i32* %3
%22 = or i32 %21, %20
store i32 %22, i32* %3
%23 = load i32, i32* %3
store i32 %23, i32* %2
br label %26
24: ; preds = %1
%25 = load i32, i32* %3
store i32 %25, i32* %2
br label %26
26: ; preds = %24, %15
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @convert_old_type(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 17
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = and i32 %0, 16777216
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 37, i32 36
%8 = and i32 %0, -25166080
%9 = or i32 %7, %8
br label %10
10: ; preds = %1, %4
%11 = phi i32 [ %9, %4 ], [ %0, %1 ]
ret i32 %11
}
void port_init(void) {}


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

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

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

LLVM IR (-O2):
define void @port_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void memcpy2() {
  char src[] = {1, 2, 3, 4};
  char dst[1];
  memcpy(dst, src, 4);
}


x86 assembly (clang, -O0):
<memcpy2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x5(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy2>:
push   %rax
movl   $0x4030201,0x4(%rsp)
04
lea    0x3(%rsp),%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.memcpy2.src = [4 x i8] c"\01\02\03\04"
define void @memcpy2() {
%1 = alloca [4 x i8]
%2 = alloca [1 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = call i32 @memcpy(i8* %4, i8* %5, i32 4)
ret void
}

LLVM IR (-O2):
define void @memcpy2() {
%1 = alloca i32
%2 = alloca [1 x i8]
%3 = bitcast i32* %1 to i8*
store i32 67305985, i32* %1
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%5 = call i32 @memcpy(i8* %4, i8* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_vector(void *vec) { free(vec); }


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

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

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

LLVM IR (-O2):
define void @free_vector(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int ol_backend_time_posix_init(struct ol_backend_time_s *self) {
  (void)(self);
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.ol_backend_time_s = type opaque
define i32 @ol_backend_time_posix_init(%struct.ol_backend_time_s* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_42() {
  Assert_real((isqrt(42) == 6),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              215, ("Integer square root of 42 should be 6"));
}


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

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

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

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 42 should be 6\00"
define void @t_sqrt_42() {
%1 = tail call i32 @isqrt(i32 42)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 215, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int int_value();
const char *choose_string(const char *s1, const char *s2, const char *s3) {
  int i = int_value();
  return i < 0 ? s1 : 0 < i ? s3 : s2;
}


x86 assembly (clang, -O0):
<choose_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <int_value@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1145 <choose_string+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    116d <choose_string+0x5d>
xor    %eax,%eax
cmp    -0x1c(%rbp),%eax
jge    115d <choose_string+0x4d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1165 <choose_string+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose_string>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
xor    %eax,%eax
call   1030 <int_value@plt>
test   %eax,%eax
cmovne %r14,%rbx
cmovs  %r15,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @choose_string(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = call i32 (...) @int_value()
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i8*, i8** %4
br label %22
13: ; preds = %3
%14 = load i32, i32* %7
%15 = icmp slt i32 0, %14
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i8*, i8** %6
br label %20
18: ; preds = %13
%19 = load i8*, i8** %5
br label %20
20: ; preds = %18, %16
%21 = phi i8* [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %11
%23 = phi i8* [ %12, %11 ], [ %21, %20 ]
ret i8* %23
}

LLVM IR (-O2):
define i8* @choose_string(i8* readnone %0, i8* readnone %1, i8* readnone %2) {
%4 = tail call i32 (...) @int_value()
%5 = icmp slt i32 %4, 0
%6 = icmp eq i32 %4, 0
%7 = select i1 %6, i8* %1, i8* %2
%8 = select i1 %5, i8* %0, i8* %7
ret i8* %8
}
/* Variables and functions */
int chaz_CC_test_compile(char const *);
int chaz_AtomicOps_osatomic_cas_ptr(void) {
  static const char osatomic_casptr_code[] =
      "#include <libkern/OSAtomic.h>"
      "\n"
      "#include <libkern/OSAtomic.h>"
      "\n"
      "int main() {"
      "\n"
      "int foo = 1;"
      "\n"
      "int *foo_ptr = &foo;"
      "\n"
      "int *target = NULL;"
      "\n"
      "OSAtomicCompareAndSwapPtr(NULL, foo_ptr, (void**)&target);"
      "\n"
      "return 0;"
      "\n"
      "}"
      "\n";
  return chaz_CC_test_compile(osatomic_casptr_code);
}


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

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

LLVM IR (-O0):
@chaz_AtomicOps_osatomic_cas_ptr.osatomic_casptr_code = internal constant [199 x i8] c"#include <libkern/OSAtomic.h>\0A#include <libkern/OSAtomic.h>\0Aint main() {\0Aint foo = 1;\0Aint *foo_ptr = &foo;\0Aint *target = NULL;\0AOSAtomicCompareAndSwapPtr(NULL, foo_ptr, (void**)&target);\0Areturn 0;\0A}\0A\00"
define i32 @chaz_AtomicOps_osatomic_cas_ptr() {
%1 = call i32 @chaz_CC_test_compile(i8* getelementptr inbounds ([199 x i8], [199 x i8]* @chaz_AtomicOps_osatomic_cas_ptr.osatomic_casptr_code, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@chaz_AtomicOps_osatomic_cas_ptr.osatomic_casptr_code = internal constant [199 x i8] c"#include <libkern/OSAtomic.h>\0A#include <libkern/OSAtomic.h>\0Aint main() {\0Aint foo = 1;\0Aint *foo_ptr = &foo;\0Aint *target = NULL;\0AOSAtomicCompareAndSwapPtr(NULL, foo_ptr, (void**)&target);\0Areturn 0;\0A}\0A\00"
define i32 @chaz_AtomicOps_osatomic_cas_ptr() {
%1 = tail call i32 @chaz_CC_test_compile(i8* getelementptr inbounds ([199 x i8], [199 x i8]* @chaz_AtomicOps_osatomic_cas_ptr.osatomic_casptr_code, i64 0, i64 0))
ret i32 %1
}
void setClaw(int power) {}


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

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

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

LLVM IR (-O2):
define void @setClaw(i32 %0) {
ret void
}
/* Variables and functions */
char *strstr(char const *, char const *);
int g_pos(const char *str, const char *to_find) {
  char *pp;
  pp = strstr(str, to_find);
  if (pp == 0) {
    return -1;
  }
  return (pp - str);
}


x86 assembly (clang, -O0):
<g_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1148 <g_pos+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <g_pos+0x46>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_pos>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strstr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @g_pos(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i8* @strstr(i8* %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %20
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = load i8*, i8** %4
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %13, %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @g_pos(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
void do_fstenv(void *p) { asm("movl 8(%esp), %eax ; fstenv (%eax)"); }


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

x86 assembly (clang, -O2):
<do_fstenv>:
mov    0x8(%esp),%eax
fstenv (%eax)
ret

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

LLVM IR (-O2):
define void @do_fstenv(i8* nocapture readnone %0) {
tail call void asm sideeffect "movl 8(%esp), %eax ; fstenv (%eax)", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void PrintArr(int arr[], int len) {
  int i;
  for (i = 0; i < len; ++i) {
    printf("%d", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<PrintArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <PrintArr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <PrintArr+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <PrintArr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <PrintArr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ m5_exit(int /*<<< orphan*/);
int /*<<< orphan*/ parse_int_args(int, char **, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ usage();
void do_exit(int argc, char *argv[]) {
  if (argc > 1)
    usage();
  uint64_t ints[1];
  parse_int_args(argc, argv, ints, 2);
  m5_exit(ints[0]);
}


x86 assembly (clang, -O0):
<do_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1150 <do_exit+0x20>
mov    $0x0,%al
call   1030 <usage@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x2,%ecx
call   1040 <parse_int_args@plt>
mov    -0x14(%rbp),%edi
call   1050 <m5_exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_exit>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0x2,%edi
jl     1144 <do_exit+0x14>
xor    %eax,%eax
call   1030 <usage@plt>
lea    0x4(%rsp),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x2,%ecx
call   1040 <parse_int_args@plt>
mov    0x4(%rsp),%edi
call   1050 <m5_exit@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @do_exit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [1 x i32]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @usage()
br label %10
10: ; preds = %8, %2
%11 = load i32, i32* %3
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%14 = call i32 @parse_int_args(i32 %11, i8** %12, i32* %13, i32 2)
%15 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%16 = load i32, i32* %15
%17 = call i32 @m5_exit(i32 %16)
ret void
}

LLVM IR (-O2):
define void @do_exit(i32 %0, i8** %1) {
%3 = alloca [1 x i32]
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @usage()
br label %7
7: ; preds = %5, %2
%8 = bitcast [1 x i32]* %3 to i8*
%9 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%10 = call i32 @parse_int_args(i32 %0, i8** %1, i32* %9, i32 2)
%11 = load i32, i32* %9
%12 = call i32 @m5_exit(i32 %11)
ret void
}
unsigned long prime_rand(void) {
  static unsigned long stb__rand = 1;
  stb__rand = stb__rand * 2147001325 + 715136305;
  return 0x31415926 ^ ((stb__rand >> 16) + (stb__rand << 16));
}


x86 assembly (clang, -O0):
<prime_rand>:
push   %rbp
mov    %rsp,%rbp
imul   $0x7ff8a3ed,0x2f11(%rip),%rax
ed a3 f8 7f
add    $0x2aa01d31,%rax
mov    %rax,0x2f04(%rip)
mov    0x2efd(%rip),%rax
shr    $0x10,%rax
mov    0x2ef2(%rip),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
xor    $0x31415926,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime_rand>:
imul   $0x7ff8a3ed,0x2f15(%rip),%rax
ed a3 f8 7f
add    $0x2aa01d31,%rax
mov    %rax,0x2f08(%rip)
mov    %rax,%rcx
shr    $0x10,%rcx
shl    $0x10,%rax
add    %rcx,%rax
xor    $0x31415926,%rax
ret

LLVM IR (-O0):
@prime_rand.stb__rand = internal global i64 1
define i64 @prime_rand() {
%1 = load i64, i64* @prime_rand.stb__rand
%2 = mul i64 %1, 2147001325
%3 = add i64 %2, 715136305
store i64 %3, i64* @prime_rand.stb__rand
%4 = load i64, i64* @prime_rand.stb__rand
%5 = lshr i64 %4, 16
%6 = load i64, i64* @prime_rand.stb__rand
%7 = shl i64 %6, 16
%8 = add i64 %5, %7
%9 = xor i64 826366246, %8
ret i64 %9
}

LLVM IR (-O2):
@prime_rand.stb__rand = internal unnamed_addr global i64 1
define i64 @prime_rand() {
%1 = load i64, i64* @prime_rand.stb__rand
%2 = mul i64 %1, 2147001325
%3 = add i64 %2, 715136305
store i64 %3, i64* @prime_rand.stb__rand
%4 = lshr i64 %3, 16
%5 = shl i64 %3, 16
%6 = add i64 %4, %5
%7 = xor i64 %6, 826366246
ret i64 %7
}
unsigned char in(unsigned short _port) {
  unsigned char result;
  __asm__("in %%dx, %%al" : "=a"(result) : "d"(_port));
  return result;
}


x86 assembly (clang, -O0):
<in>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @in(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm "in %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @in(i16 zeroext %0) {
%2 = tail call i8 asm "in %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ insertionBitsTester(int, int, int, int);
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  int32_t original = 0b100000000;
  int32_t bitsToInsert = 0b1101;
  int from = 6, to = 2;
  printf("Case 1\n");
  insertionBitsTester(original, bitsToInsert, from, to);
  printf("\nCase 2\n");
  insertionBitsTester((int32_t)0b1100000011, (int32_t)0b111, 6, 3);
  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)
movl   $0x100,-0x14(%rbp)
movl   $0xd,-0x18(%rbp)
movl   $0x6,-0x1c(%rbp)
movl   $0x2,-0x20(%rbp)
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1040 <insertionBitsTester@plt>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    $0x303,%edi
mov    $0x7,%esi
mov    $0x6,%edx
mov    $0x3,%ecx
call   1040 <insertionBitsTester@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x100,%edi
mov    $0xd,%esi
mov    $0x6,%edx
mov    $0x2,%ecx
call   1040 <insertionBitsTester@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    $0x303,%edi
mov    $0x7,%esi
mov    $0x6,%edx
mov    $0x3,%ecx
call   1040 <insertionBitsTester@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Case 1\0A\00"
@.str.1 = [9 x i8] c"\0ACase 2\0A\00"
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
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 256, i32* %6
store i32 13, i32* %7
store i32 6, i32* %8
store i32 2, i32* %9
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = call i32 @insertionBitsTester(i32 %11, i32 %12, i32 %13, i32 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @insertionBitsTester(i32 771, i32 7, i32 6, i32 3)
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"Case 1\00"
@str.2 = [8 x i8] c"\0ACase 2\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @insertionBitsTester(i32 256, i32 13, i32 6, i32 2)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.2, i64 0, i64 0))
%6 = tail call i32 @insertionBitsTester(i32 771, i32 7, i32 6, i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 1;
  for (i = 0; i = -1; i = 1) {
    printf("%d ", i);
    if (i != 1)
      break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1143 <main+0x33>
jmp    1172 <main+0x62>
mov    -0x8(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
je     1161 <main+0x51>
jmp    1172 <main+0x62>
jmp    1166 <main+0x56>
movl   $0x1,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __eint();
void __nesc_enable_interrupt(void) { __eint(); }


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

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

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

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