xunge/DecIR huggingface dataset:
long long suss() { return 0xffff7fffffffffffLL; }


x86 assembly (clang, -O0):
<suss>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffff7fffffffffff,%rax
7f ff ff
pop    %rbp
ret

x86 assembly (clang, -O2):
<suss>:
movabs $0xffff7fffffffffff,%rax
7f ff ff
ret

LLVM IR (-O0):
define i64 @suss() {
ret i64 -140737488355329
}

LLVM IR (-O2):
define i64 @suss() {
ret i64 -140737488355329
}
int cdiEncodeDate(int year, int month, int day) {
  int date;
  int iyear;
  iyear = year;
  if (iyear < 0)
    iyear = -iyear;
  date = iyear * 10000 + month * 100 + day;
  if (year < 0)
    date = -date;
  return (date);
}


x86 assembly (clang, -O0):
<cdiEncodeDate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1125 <cdiEncodeDate+0x25>
xor    %eax,%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0x2710,-0x14(%rbp),%eax
imul   $0x64,-0x8(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    114a <cdiEncodeDate+0x4a>
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdiEncodeDate>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
imul   $0x2710,%eax,%eax
imul   $0x64,%esi,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %ecx,%eax
neg    %eax
test   %edi,%edi
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cdiEncodeDate(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
store i32 %9, i32* %8
%10 = load i32, i32* %8
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i32, i32* %8
%14 = sub nsw i32 0, %13
store i32 %14, i32* %8
br label %15
15: ; preds = %12, %3
%16 = load i32, i32* %8
%17 = mul nsw i32 %16, 10000
%18 = load i32, i32* %5
%19 = mul nsw i32 %18, 100
%20 = add nsw i32 %17, %19
%21 = load i32, i32* %6
%22 = add nsw i32 %20, %21
store i32 %22, i32* %7
%23 = load i32, i32* %4
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %15
%26 = load i32, i32* %7
%27 = sub nsw i32 0, %26
store i32 %27, i32* %7
br label %28
28: ; preds = %25, %15
%29 = load i32, i32* %7
ret i32 %29
}

LLVM IR (-O2):
define i32 @cdiEncodeDate(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, 0
%5 = sub nsw i32 0, %0
%6 = select i1 %4, i32 %5, i32 %0
%7 = mul nsw i32 %6, 10000
%8 = mul nsw i32 %1, 100
%9 = add i32 %8, %2
%10 = add i32 %9, %7
%11 = sub nsw i32 0, %10
%12 = select i1 %4, i32 %11, i32 %10
ret i32 %12
}
main() {
  double p[10];
  double b = p[1] - p[0];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movsd  -0x48(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [10 x double]
%2 = alloca double
%3 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 1
%4 = load double, double* %3
%5 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
%6 = load double, double* %5
%7 = fsub double %4, %6
store double %7, double* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
scalar_t__ pthread_self();
void handle(int sig) {
  do {
    printf("[%u]--", (unsigned int)pthread_self());
    printf("handle signal : [%d]", sig);
    printf("\n");
  } while (0);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <pthread_self@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
pop    %rbx
jmp    1050 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"[%u]--\00"
@.str.1 = [21 x i8] c"handle signal : [%d]\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
%4 = call i64 (...) @pthread_self()
%5 = trunc i64 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %3
%11 = call i32 @pthread_exit(i32* null)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"[%u]--\00"
@.str.1 = [21 x i8] c"handle signal : [%d]\00"
define void @handle(i32 %0) {
%2 = tail call i64 (...) @pthread_self()
%3 = trunc i64 %2 to i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 @pthread_exit(i32* null)
ret void
}
void testMemoryLayout() {}


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

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

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

LLVM IR (-O2):
define void @testMemoryLayout() {
ret void
}
const char *Pointer_Description(void) {
  return "The `Pointer` class is implemented by types which act as references "
         "to "
         "other objects. Primarily this class is implemented by `Ref` and "
         "`Box` "
         "which provide the two main pointer types in Cello.";
}


x86 assembly (clang, -O0):
<Pointer_Description>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pointer_Description>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [192 x i8] c"The `Pointer` class is implemented by types which act as references to other objects. Primarily this class is implemented by `Ref` and `Box` which provide the two main pointer types in Cello.\00"
define i8* @Pointer_Description() {
ret i8* getelementptr inbounds ([192 x i8], [192 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [192 x i8] c"The `Pointer` class is implemented by types which act as references to other objects. Primarily this class is implemented by `Ref` and `Box` which provide the two main pointer types in Cello.\00"
define i8* @Pointer_Description() {
ret i8* getelementptr inbounds ([192 x i8], [192 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void make_checks_document_footer(FILE *latex_file) {
  fprintf(latex_file, "\\end{document}\n");
}


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

x86 assembly (clang, -O2):
<make_checks_document_footer>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0xf,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\\end{document}\0A\00"
define void @make_checks_document_footer(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\\end{document}\0A\00"
define void @make_checks_document_footer(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 15, i64 1, i32* %0)
ret void
}
/* Variables and functions */
char const *bprintf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ getgid();
const char *gid(void) { return bprintf("%d", getgid()); }


x86 assembly (clang, -O0):
<gid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getgid@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <bprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gid>:
push   %rax
xor    %eax,%eax
call   1040 <getgid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <bprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @gid() {
%1 = call i32 (...) @getgid()
%2 = call i8* @bprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @gid() {
%1 = tail call i32 (...) @getgid()
%2 = tail call i8* @bprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %2
}
int test_imm_D8uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xD8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D8uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 216
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  char str[5] = {1, 2, 3, 4, 5};
  char(*p)[5] = &str;
  printf("p + 1 = %p\n", p++);
  return 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x9(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x5,%rcx
mov    %rcx,-0x18(%rbp)
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x5,0x4(%rsp)
movl   $0x4030201,(%rsp)
mov    %rsp,%rsi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str = [5 x i8] c"\01\02\03\04\05"
@.str = [12 x i8] c"p + 1 = %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca [5 x i8]*
store i32 0, i32* %1
%4 = bitcast [5 x i8]* %2 to i8*
store [5 x i8]* %2, [5 x i8]** %3
%5 = load [5 x i8]*, [5 x i8]** %3
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i32 1
store [5 x i8]* %6, [5 x i8]** %3
%7 = ptrtoint [5 x i8]* %5 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [5 x i8] c"\01\02\03\04\05"
@.str = [12 x i8] c"p + 1 = %p\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = ptrtoint [5 x i8]* %1 to i64
%4 = trunc i64 %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test1();
int main(void) {
  printf("Starting YABI Tests...\n");
  test1();
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"Starting YABI Tests...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test1()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ concat_rpn(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, double);
void concat_double(char *str, double val) {
  char val_str[255];
  sprintf(val_str, "%lf", val);
  concat_rpn(str, val_str);
}


x86 assembly (clang, -O0):
<concat_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <concat_rpn@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat_double>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
lea    0xecc(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <concat_rpn@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define void @concat_double(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca [255 x i8]
store i8* %0, i8** %3
store double %1, double* %4
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%7 = load double, double* %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%11 = call i32 @concat_rpn(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define void @concat_double(i8* %0, double %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
%6 = call i32 @concat_rpn(i8* %0, i8* %4)
ret void
}
/* Type definitions */
struct twopence_target {
  int dummy;
};
struct twopence_pipe_target {
  int dummy;
};

/* Variables and functions */
int __twopence_pipe_interrupt_command(struct twopence_pipe_target *);
int twopence_pipe_interrupt_command(struct twopence_target *opaque_handle) {
  struct twopence_pipe_target *handle =
      (struct twopence_pipe_target *)opaque_handle;
  return __twopence_pipe_interrupt_command(handle);
}


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

x86 assembly (clang, -O2):
<twopence_pipe_interrupt_command>:
jmp    1030 <__twopence_pipe_interrupt_command@plt>

LLVM IR (-O0):
%struct.twopence_target = type { i32 }
%struct.twopence_pipe_target = type { i32 }
define i32 @twopence_pipe_interrupt_command(%struct.twopence_target* %0) {
%2 = alloca %struct.twopence_target*
%3 = alloca %struct.twopence_pipe_target*
store %struct.twopence_target* %0, %struct.twopence_target** %2
%4 = load %struct.twopence_target*, %struct.twopence_target** %2
%5 = bitcast %struct.twopence_target* %4 to %struct.twopence_pipe_target*
store %struct.twopence_pipe_target* %5, %struct.twopence_pipe_target** %3
%6 = load %struct.twopence_pipe_target*, %struct.twopence_pipe_target** %3
%7 = call i32 @__twopence_pipe_interrupt_command(%struct.twopence_pipe_target* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.twopence_target = type { i32 }
%struct.twopence_pipe_target = type { i32 }
define i32 @twopence_pipe_interrupt_command(%struct.twopence_target* %0) {
%2 = bitcast %struct.twopence_target* %0 to %struct.twopence_pipe_target*
%3 = tail call i32 @__twopence_pipe_interrupt_command(%struct.twopence_pipe_target* %2)
ret i32 %3
}
long NET_shutdown() { return 0; }


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

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

LLVM IR (-O0):
define i64 @NET_shutdown() {
ret i64 0
}

LLVM IR (-O2):
define i64 @NET_shutdown() {
ret i64 0
}
void vec4_negate(float *dst) {
  dst[0] = -dst[0];
  dst[1] = -dst[1];
  dst[2] = -dst[2];
  dst[3] = -dst[3];
}


x86 assembly (clang, -O0):
<vec4_negate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec4_negate>:
movups (%rdi),%xmm0
xorps  0xef6(%rip),%xmm0
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @vec4_negate(float* nocapture %0) {
%2 = bitcast float* %0 to <4 x float>*
%3 = load <4 x float>, <4 x float>* %2
%4 = fneg <4 x float> %3
%5 = bitcast float* %0 to <4 x float>*
store <4 x float> %4, <4 x float>* %5
ret void
}
void WDT_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<WDT_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <WDT_Handler+0x9>
jmp    1109 <WDT_Handler+0x9>

x86 assembly (clang, -O2):
<WDT_Handler>:
jmp    1100 <WDT_Handler>

LLVM IR (-O0):
define void @WDT_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @WDT_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void ProcWait(int x) {}


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

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

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

LLVM IR (-O2):
define void @ProcWait(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int return_2() {
  printf("This function always returns 2.\n");
  return 2;
}


x86 assembly (clang, -O0):
<return_2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [33 x i8] c"This function always returns 2.\0A\00"
define i32 @return_2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 2
}

LLVM IR (-O2):
@str = [32 x i8] c"This function always returns 2.\00"
define i32 @return_2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 2
}
/* Variables and functions */
int RAND_MAX;
int rand();
int timeRand(int min, int max) {
  return (1 * min + 1 * rand() / RAND_MAX * (max - min));
}


x86 assembly (clang, -O0):
<timeRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x0,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
shl    $0x0,%eax
mov    0x2eb0(%rip),%rcx
cltd
idivl  (%rcx)
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%edx
sub    -0x4(%rbp),%edx
imul   %edx,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeRand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec3(%rip),%rcx
cltd
idivl  (%rcx)
sub    %ebp,%ebx
imul   %ebx,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @timeRand(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 = mul nsw i32 1, %5
%7 = call i32 (...) @rand()
%8 = mul nsw i32 1, %7
%9 = load i32, i32* @RAND_MAX
%10 = sdiv i32 %8, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = sub nsw i32 %11, %12
%14 = mul nsw i32 %10, %13
%15 = add nsw i32 %6, %14
ret i32 %15
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @timeRand(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = load i32, i32* @RAND_MAX
%5 = sdiv i32 %3, %4
%6 = sub nsw i32 %1, %0
%7 = mul nsw i32 %5, %6
%8 = add nsw i32 %7, %0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int releasePtr(void *_ctx) {
  free(_ctx);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @releasePtr(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x93() {
  Assert_real((isupper(147) == 0),
              "/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_isupper.c",
              740, ("isupper should be 0 for 0x93"));
}


x86 assembly (clang, -O0):
<t_isupper_0x93>:
push   %rbp
mov    %rsp,%rbp
mov    $0x93,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2e4,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x93>:
push   %rax
mov    $0x93,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2e4,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x93\00"
define void @t_isupper_0x93() {
%1 = call i64 @isupper(i32 147)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 740, i8* getelementptr inbounds ([29 x i8], [29 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x93\00"
define void @t_isupper_0x93() {
%1 = tail call i64 @isupper(i32 147)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 740, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, unsigned char *, int);
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
void unpack(unsigned char *b, uint16_t *c, int32_t *v) {
  memcpy(c, &b[(0x00)], sizeof(uint16_t));
  *c = ntohs(*c);
  memcpy(v, &b[(0x02)], sizeof(int32_t));
  *v = ntohl(*v);
}


x86 assembly (clang, -O0):
<unpack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <ntohs@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x2,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1050 <ntohl@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    (%r15),%edi
call   1040 <ntohs@plt>
mov    %eax,(%r15)
add    $0x2,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    (%r14),%edi
call   1050 <ntohl@plt>
mov    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @unpack(i8* %0, i32* %1, i32* %2) {
%4 = tail call i32 @memcpy(i32* %1, i8* %0, i32 4)
%5 = load i32, i32* %1
%6 = tail call i32 @ntohs(i32 %5)
store i32 %6, i32* %1
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = tail call i32 @memcpy(i32* %2, i8* %7, i32 4)
%9 = load i32, i32* %2
%10 = tail call i32 @ntohl(i32 %9)
store i32 %10, i32* %2
ret void
}
/* Variables and functions */
float finn_vec2_magnitude(float *);
void finn_vec2_normalize(float *result, float *vec) {
  float mag = finn_vec2_magnitude(vec);
  result[0] = vec[0] / mag;
  result[1] = vec[1] / mag;
}


x86 assembly (clang, -O0):
<finn_vec2_normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <finn_vec2_magnitude@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
divss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
divss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finn_vec2_normalize>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <finn_vec2_magnitude@plt>
movss  (%rbx),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,(%r14)
movss  0x4(%rbx),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x4(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @finn_vec2_normalize(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %4
%7 = call float @finn_vec2_magnitude(float* %6)
store float %7, float* %5
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float, float* %5
%12 = fdiv float %10, %11
%13 = load float*, float** %3
%14 = getelementptr inbounds float, float* %13, i64 0
store float %12, float* %14
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 1
%17 = load float, float* %16
%18 = load float, float* %5
%19 = fdiv float %17, %18
%20 = load float*, float** %3
%21 = getelementptr inbounds float, float* %20, i64 1
store float %19, float* %21
ret void
}

LLVM IR (-O2):
define void @finn_vec2_normalize(float* nocapture writeonly %0, float* %1) {
%3 = tail call float @finn_vec2_magnitude(float* %1)
%4 = load float, float* %1
%5 = fdiv float %4, %3
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = fdiv float %7, %3
%9 = getelementptr inbounds float, float* %0, i64 1
store float %8, float* %9
ret void
}
signed short signedshort_ignoring_unsignedlong(signed short x,
                                               unsigned long y) {
  return x;
}


x86 assembly (clang, -O0):
<signedshort_ignoring_unsignedlong>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @signedshort_ignoring_unsignedlong(i16 signext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @signedshort_ignoring_unsignedlong(i16 returned signext %0, i64 %1) {
ret i16 %0
}
void BIO_free_all(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_free_all() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *);
void *realloc(void *, size_t);
void *erealloc(void *p, size_t size) {
  p = realloc(p, size);
  if (!p)
    eprintf("realloc: out of memory\n");
  return p;
}


x86 assembly (clang, -O0):
<erealloc>:
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   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1158 <erealloc+0x38>
lea    0xead(%rip),%rdi
call   1030 <eprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <erealloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <eprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"realloc: out of memory\0A\00"
define i8* @erealloc(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 %12, label %10
10: ; preds = %2
%11 = call i32 @eprintf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [24 x i8] c"realloc: out of memory\0A\00"
define noalias i8* @erealloc(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 %7
5: ; preds = %2
%6 = tail call i32 @eprintf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ core3_swap(char *, int);
void U_EMRSETARCDIRECTION_swap(char *record, int torev) {
  core3_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMRSETARCDIRECTION_swap>:
jmp    1030 <core3_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRSETARCDIRECTION_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core3_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Memory_NotAligned(size_t);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
size_t Memory_Align(size_t nSize) {
  assert(Memory_NotAligned(nSize));
  return (nSize & ~(16 - 1)) + 16;
}


x86 assembly (clang, -O0):
<Memory_Align>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <Memory_NotAligned@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
and    $0xfffffffffffffff0,%rax
add    $0x10,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Memory_Align>:
push   %rbx
mov    %rdi,%rbx
call   1040 <Memory_NotAligned@plt>
mov    %eax,%edi
call   1030 <assert@plt>
add    $0x10,%rbx
and    $0xfffffffffffffff0,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @Memory_Align(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @Memory_NotAligned(i64 %3)
%5 = call i32 @assert(i32 %4)
%6 = load i64, i64* %2
%7 = and i64 %6, -16
%8 = add i64 %7, 16
ret i64 %8
}

LLVM IR (-O2):
define i64 @Memory_Align(i64 %0) {
%2 = tail call i32 @Memory_NotAligned(i64 %0)
%3 = tail call i32 @assert(i32 %2)
%4 = add i64 %0, 16
%5 = and i64 %4, -16
ret i64 %5
}
/* Type definitions */
typedef int ptr_arr;

/* Variables and functions */
double **malloc(int);
int main() {
  double a = 3;
  double b = 2;
  double **ptr_arr = malloc(sizeof(double *) * 3);
  ptr_arr[0] = &a;
  ptr_arr[1] = &b;
  ptr_arr[2] = &b;
  b = 5;
  return *(ptr_arr[0]) + *(ptr_arr[1]) + *(ptr_arr[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed4(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
lea    -0x10(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
lea    -0x18(%rbp),%rcx
mov    %rcx,0x8(%rax)
mov    -0x20(%rbp),%rax
lea    -0x18(%rbp),%rcx
mov    %rcx,0x10(%rax)
movsd  0xe8e(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
addsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
addsd  (%rax),%xmm0
cvttsd2si %xmm0,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    $0xd,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double**
store i32 0, i32* %1
store double 3.000000e+00, double* %2
store double 2.000000e+00, double* %3
%5 = call double** @malloc(i32 24)
store double** %5, double*** %4
%6 = load double**, double*** %4
%7 = getelementptr inbounds double*, double** %6, i64 0
store double* %2, double** %7
%8 = load double**, double*** %4
%9 = getelementptr inbounds double*, double** %8, i64 1
store double* %3, double** %9
%10 = load double**, double*** %4
%11 = getelementptr inbounds double*, double** %10, i64 2
store double* %3, double** %11
store double 5.000000e+00, double* %3
%12 = load double**, double*** %4
%13 = getelementptr inbounds double*, double** %12, i64 0
%14 = load double*, double** %13
%15 = load double, double* %14
%16 = load double**, double*** %4
%17 = getelementptr inbounds double*, double** %16, i64 1
%18 = load double*, double** %17
%19 = load double, double* %18
%20 = fadd double %15, %19
%21 = load double**, double*** %4
%22 = getelementptr inbounds double*, double** %21, i64 2
%23 = load double*, double** %22
%24 = load double, double* %23
%25 = fadd double %20, %24
%26 = fptosi double %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double** @malloc(i32 24)
ret i32 13
}
int check_results(int *array, long numberofitems) {
  long i;
  for (i = 1; i < numberofitems; i++)
    if (array[i] < array[i - 1])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<check_results>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1164 <check_results+0x64>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rdx
sub    $0x1,%rdx
cmp    (%rcx,%rdx,4),%eax
jge    114e <check_results+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    116b <check_results+0x6b>
jmp    1153 <check_results+0x53>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1114 <check_results+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_results>:
mov    $0x1,%eax
cmp    $0x2,%rsi
jl     1134 <check_results+0x34>
mov    (%rdi),%ecx
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ecx,%r8d
mov    (%rdi,%rdx,4),%ecx
cmp    %r8d,%ecx
jl     1135 <check_results+0x35>
add    $0x1,%rdx
cmp    %rdx,%rsi
jne    1120 <check_results+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @check_results(i32* nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = load i32, i32* %0
br label %8
6: ; preds = %8
%7 = icmp eq i64 %14, %1
br i1 %7, label %15, label %8
8: ; preds = %4, %6
%9 = phi i32 [ %12, %6 ], [ %5, %4 ]
%10 = phi i64 [ %14, %6 ], [ 1, %4 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp slt i32 %12, %9
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %6
15: ; preds = %8, %6, %2
%16 = phi i32 [ 1, %2 ], [ 1, %6 ], [ 0, %8 ]
ret i32 %16
}
float f(float x) { return 1.0 / (1 + x); }


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

x86 assembly (clang, -O2):
<f>:
movss  0xef8(%rip),%xmm1
addss  %xmm1,%xmm0
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @f(float %0) {
%2 = fadd float %0, 1.000000e+00
%3 = fdiv float 1.000000e+00, %2
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_destroy(pthread_attr_t *attr) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_attr_destroy(i32* nocapture readnone %0) {
ret i32 1
}
void INT_Excep_RIIC2_TXI2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RIIC2_TXI2() {
ret void
}
/* Variables and functions */
int sum(float, float);
float average(float a, float b) { return sum(a, b) / 2; }


x86 assembly (clang, -O0):
<average>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <sum@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<average>:
push   %rax
call   1030 <sum@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @average(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i32 @sum(float %5, float %6)
%8 = sdiv i32 %7, 2
%9 = sitofp i32 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @average(float %0, float %1) {
%3 = tail call i32 @sum(float %0, float %1)
%4 = sdiv i32 %3, 2
%5 = sitofp i32 %4 to float
ret float %5
}
/* Variables and functions */
int memcmp(char *, char *, int);
int uwsgi_starts_with(char *src, int slen, char *dst, int dlen) {
  if (slen < dlen)
    return -1;
  return memcmp(src, dst, dlen);
}


x86 assembly (clang, -O0):
<uwsgi_starts_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    113e <uwsgi_starts_with+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <uwsgi_starts_with+0x41>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <memcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_starts_with>:
cmp    %ecx,%esi
jge    111a <uwsgi_starts_with+0xa>
mov    $0xffffffff,%eax
ret
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @uwsgi_starts_with(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp slt i32 %1, %3
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @memcmp(i8* %0, i8* %2, i32 %3)
br label %8
8: ; preds = %4, %6
%9 = phi i32 [ %7, %6 ], [ -1, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ __u16;
typedef scalar_t__ __le16;

/* Variables and functions */
int /*<<< orphan*/ le16toh(int /*<<< orphan*/);
uint16_t le16_to_cpu(__le16 x) { return le16toh((__u16)x); }


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

x86 assembly (clang, -O2):
<le16_to_cpu>:
jmp    1030 <le16toh@plt>

LLVM IR (-O0):
define i32 @le16_to_cpu(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @le16toh(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @le16_to_cpu(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @le16toh(i32 %2)
ret i32 %3
}
/* Variables and functions */
double atan2(double, double);
unsigned int ComputeAngle(int dx, int dy) {
  double w;
  w = (atan2((double)dy, (double)dx) *
       (double)(65536 / (3.14159265358979323846 * 2)));
  if (w < 0)
    w = (double)65536 + w;
  return (unsigned)w;
}


x86 assembly (clang, -O0):
<ComputeAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
call   1030 <atan2@plt>
movsd  0xecb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    115e <ComputeAngle+0x4e>
movsd  0xeb4(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComputeAngle>:
push   %rax
cvtsi2sd %esi,%xmm0
cvtsi2sd %edi,%xmm1
call   1030 <atan2@plt>
mulsd  0xeda(%rip),%xmm0
movsd  0xeda(%rip),%xmm1
addsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm3
cmpltsd %xmm2,%xmm3
andpd  %xmm3,%xmm1
andnpd %xmm0,%xmm3
orpd   %xmm1,%xmm3
cvttsd2si %xmm3,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ComputeAngle(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to double
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to double
%10 = call double @atan2(double %7, double %9)
%11 = fmul double %10, 0x40C45F306DC9C883
store double %11, double* %5
%12 = load double, double* %5
%13 = fcmp olt double %12, 0.000000e+00
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load double, double* %5
%16 = fadd double 6.553600e+04, %15
store double %16, double* %5
br label %17
17: ; preds = %14, %2
%18 = load double, double* %5
%19 = fptoui double %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @ComputeAngle(i32 %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = sitofp i32 %0 to double
%5 = tail call double @atan2(double %3, double %4)
%6 = fmul double %5, 0x40C45F306DC9C883
%7 = fcmp olt double %6, 0.000000e+00
%8 = fadd double %6, 6.553600e+04
%9 = select i1 %7, double %8, double %6
%10 = fptoui double %9 to i32
ret i32 %10
}