xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ freeing_pointers_not_allocated();
int /*<<< orphan*/ freeing_pointers_not_returned_from_malloc();
int /*<<< orphan*/ perfectly_valid();
int /*<<< orphan*/ redundant_freeing_of_the_same_pointer();
int main(int argc, char const *argv[]) {
  freeing_pointers_not_allocated();
  freeing_pointers_not_returned_from_malloc();
  redundant_freeing_of_the_same_pointer();
  perfectly_valid();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <freeing_pointers_not_allocated@plt>
mov    $0x0,%al
call   1050 <freeing_pointers_not_returned_from_malloc@plt>
mov    $0x0,%al
call   1040 <redundant_freeing_of_the_same_pointer@plt>
mov    $0x0,%al
call   1060 <perfectly_valid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <freeing_pointers_not_allocated@plt>
xor    %eax,%eax
call   1050 <freeing_pointers_not_returned_from_malloc@plt>
xor    %eax,%eax
call   1040 <redundant_freeing_of_the_same_pointer@plt>
xor    %eax,%eax
call   1060 <perfectly_valid@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @freeing_pointers_not_allocated()
%7 = call i32 (...) @freeing_pointers_not_returned_from_malloc()
%8 = call i32 (...) @redundant_freeing_of_the_same_pointer()
%9 = call i32 (...) @perfectly_valid()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @freeing_pointers_not_allocated()
%4 = tail call i32 (...) @freeing_pointers_not_returned_from_malloc()
%5 = tail call i32 (...) @redundant_freeing_of_the_same_pointer()
%6 = tail call i32 (...) @perfectly_valid()
ret i32 0
}
/* Variables and functions */
char *nmalloc(size_t);
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
char *concatenate(const char *path, const char *name) {
  size_t pathlen = strlen(path);
  char *joined = nmalloc(pathlen + strlen(name) + 1);
  strcpy(joined, path);
  strcpy(joined + pathlen, name);
  return joined;
}


x86 assembly (clang, -O0):
<concatenate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1050 <nmalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
add    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concatenate>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%rbx,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <nmalloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
add    %r12,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @concatenate(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i8*, i8** %4
%11 = call i64 @strlen(i8* %10)
%12 = add i64 %9, %11
%13 = add i64 %12, 1
%14 = call i8* @nmalloc(i64 %13)
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = load i8*, i8** %3
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %6
%19 = load i64, i64* %5
%20 = getelementptr inbounds i8, i8* %18, i64 %19
%21 = load i8*, i8** %4
%22 = call i32 @strcpy(i8* %20, i8* %21)
%23 = load i8*, i8** %6
ret i8* %23
}

LLVM IR (-O2):
define i8* @concatenate(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @nmalloc(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = getelementptr inbounds i8, i8* %7, i64 %3
%10 = tail call i32 @strcpy(i8* %9, i8* %1)
ret i8* %7
}
signed int fn4(int a) { return (unsigned)a - (unsigned)((a / 3) * 3); }


x86 assembly (clang, -O0):
<fn4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   $0x3,%ecx,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn4>:
movslq %edi,%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fn4(i32 %0) {
%2 = srem i32 %0, 3
ret i32 %2
}
void f(int i, int j) {
#pragma hlt unroll
  for (i = 0; i < 100; i++) {
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    112e <f+0x2e>
jmp    1120 <f+0x20>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1111 <f+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f(i32 %0, i32 %1) {
ret void
}
int hm_int_equals(const void *keyA, const void *keyB) {
  int a = *((int *)keyA);
  int b = *((int *)keyB);
  return a == b;
}


x86 assembly (clang, -O0):
<hm_int_equals>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hm_int_equals>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @hm_int_equals(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp eq i32 %13, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @hm_int_equals(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
const char *Start_Name(void) { return "Start"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"Start\00"
define i8* @Start_Name() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"Start\00"
define i8* @Start_Name() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct tipc_msg {
  int dummy;
};

/* Variables and functions */
int msg_bits(struct tipc_msg *, int /*<<< orphan*/, int, int);
int msg_is_syn(struct tipc_msg *m) { return msg_bits(m, 0, 17, 1); }


x86 assembly (clang, -O0):
<msg_is_syn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x11,%edx
mov    $0x1,%ecx
call   1030 <msg_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_is_syn>:
xor    %esi,%esi
mov    $0x11,%edx
mov    $0x1,%ecx
jmp    1030 <msg_bits@plt>

LLVM IR (-O0):
%struct.tipc_msg = type { i32 }
define i32 @msg_is_syn(%struct.tipc_msg* %0) {
%2 = alloca %struct.tipc_msg*
store %struct.tipc_msg* %0, %struct.tipc_msg** %2
%3 = load %struct.tipc_msg*, %struct.tipc_msg** %2
%4 = call i32 @msg_bits(%struct.tipc_msg* %3, i32 0, i32 17, i32 1)
ret i32 %4
}

LLVM IR (-O2):
%struct.tipc_msg = type { i32 }
define i32 @msg_is_syn(%struct.tipc_msg* %0) {
%2 = tail call i32 @msg_bits(%struct.tipc_msg* %0, i32 0, i32 17, i32 1)
ret i32 %2
}
/* Variables and functions */
scalar_t__ get_size(int);
int /*<<< orphan*/ printf(char *, int, long);
void do_size(int which) {
  printf("<<< size(%d) = %ld >>>\n", which, (long)get_size(which));
}


x86 assembly (clang, -O0):
<do_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_size@plt>
mov    -0x8(%rbp),%esi
mov    %rax,%rdx
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_size>:
push   %rbx
mov    %edi,%ebx
call   1030 <get_size@plt>
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"<<< size(%d) = %ld >>>\0A\00"
define void @do_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @get_size(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3, i64 %5)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"<<< size(%d) = %ld >>>\0A\00"
define void @do_size(i32 %0) {
%2 = tail call i64 @get_size(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, double);
extern void dblemessage_(const char *string, double *f) {
  printf("%s %f\r", string, *f);
}


x86 assembly (clang, -O0):
<dblemessage_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dblemessage_>:
mov    %rdi,%rax
movsd  (%rsi),%xmm0
lea    0xee2(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s %f\0D\00"
define void @dblemessage_(i8* %0, double* %1) {
%3 = alloca i8*
%4 = alloca double*
store i8* %0, i8** %3
store double* %1, double** %4
%5 = load i8*, i8** %3
%6 = load double*, double** %4
%7 = load double, double* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5, double %7)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %f\0D\00"
define void @dblemessage_(i8* %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, double %3)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int DMApoll(long addr) {
  struct timespec interval;
  struct timespec remaining;
  struct timespec start;
  struct timespec stop;
  float loops = 1e12, count;
  int temp_in;
  return 0;
}


x86 assembly (clang, -O0):
<DMApoll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  0xef0(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @DMApoll(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
%5 = alloca %struct.timespec
%6 = alloca %struct.timespec
%7 = alloca float
%8 = alloca float
%9 = alloca i32
store i64 %0, i64* %2
store float 0x426D1A94A0000000, float* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @DMApoll(i64 %0) {
ret i32 0
}
/* Variables and functions */
float _sqrtf(float);
float sqrtf(float in) { return _sqrtf(in); }


x86 assembly (clang, -O0):
<sqrtf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <_sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrtf>:
jmp    1030 <_sqrtf@plt>

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

LLVM IR (-O2):
define float @sqrtf(float %0) {
%2 = tail call float @_sqrtf(float %0)
ret float %2
}
int satuw(int x) {
  if (x < 0)
    return 0;
  else if (x > 65535)
    return 65535;
  else
    return x;
}


x86 assembly (clang, -O0):
<satuw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <satuw+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    113c <satuw+0x3c>
cmpl   $0xffff,-0x8(%rbp)
jle    1136 <satuw+0x36>
movl   $0xffff,-0x4(%rbp)
jmp    113c <satuw+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<satuw>:
cmp    $0xffff,%edi
mov    $0xffff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @satuw(i32 %0) {
%2 = icmp slt i32 %0, 65535
%3 = select i1 %2, i32 %0, i32 65535
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void announce(const char *text) { printf("Testing %s ... ", text); }


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

x86 assembly (clang, -O2):
<announce>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"Testing %s ... \00"
define void @announce(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
char *shape_text(int t) {
  switch (t) {
  case 0:
    return ("box");
  case 1:
    return ("rhomb");
  case 2:
    return ("ellipse");
  case 3:
    return ("triangle");
  }
  return ("none");
}


x86 assembly (clang, -O0):
<shape_text>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x3,%rax
ja     116c <shape_text+0x6c>
mov    -0x18(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xedd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <shape_text+0x77>
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <shape_text+0x77>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <shape_text+0x77>
lea    0xebf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <shape_text+0x77>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shape_text>:
cmp    $0x3,%edi
ja     1117 <shape_text+0x17>
movslq %edi,%rax
lea    0xf11(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xefd(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"box\00"
@.str.1 = [6 x i8] c"rhomb\00"
@.str.2 = [8 x i8] c"ellipse\00"
@.str.3 = [9 x i8] c"triangle\00"
@.str.4 = [5 x i8] c"none\00"
define i8* @shape_text(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
6: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %10
8: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %10
9: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [4 x i8] c"box\00"
@.str.1 = [6 x i8] c"rhomb\00"
@.str.2 = [8 x i8] c"ellipse\00"
@.str.3 = [9 x i8] c"triangle\00"
@.str.4 = [5 x i8] c"none\00"
@reltable.shape_text = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([4 x i32]* @reltable.shape_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.shape_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.shape_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.shape_text to i64)) to i32)]
define i8* @shape_text(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.shape_text to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %1 ]
ret i8* %8
}
unsigned int null_write(struct fs_node *node, unsigned int offset,
                        unsigned int size, char *buffer) {
  (void)node;
  (void)offset;
  (void)size;
  (void)buffer;
  return 0;
}


x86 assembly (clang, -O0):
<null_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.fs_node = type opaque
define i32 @null_write(%struct.fs_node* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca %struct.fs_node*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store %struct.fs_node* %0, %struct.fs_node** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load %struct.fs_node*, %struct.fs_node** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
ret i32 0
}

LLVM IR (-O2):
%struct.fs_node = type opaque
define i32 @null_write(%struct.fs_node* nocapture readnone %0, i32 %1, i32 %2, i8* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_struct_help() {
  printf("          none\n\n");
  printf("Based on multi-class SVM formulation described in:\n");
  printf("          K. Crammer and Y. Singer. On the Algorithmic "
         "Implementation of\n");
  printf("          Multi-class SVMs, JMLR, 2001.\n");
}


x86 assembly (clang, -O0):
<print_struct_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
call   1030 <printf@plt>
lea    0xf12(%rip),%rdi
call   1030 <printf@plt>
lea    0xf50(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_struct_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
lea    0xf50(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c" none\0A\0A\00"
@.str.1 = [52 x i8] c"Based on multi-class SVM formulation described in:\0A\00"
@.str.2 = [74 x i8] c" K. Crammer and Y. Singer. On the Algorithmic Implementation of\0A\00"
@.str.3 = [41 x i8] c" Multi-class SVMs, JMLR, 2001.\0A\00"
define void @print_struct_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c" none\0A\00"
@str.4 = [51 x i8] c"Based on multi-class SVM formulation described in:\00"
@str.5 = [73 x i8] c" K. Crammer and Y. Singer. On the Algorithmic Implementation of\00"
@str.6 = [40 x i8] c" Multi-class SVMs, JMLR, 2001.\00"
define void @print_struct_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.6, i64 0, i64 0))
ret void
}
void *default_data_update(const void *key, void *oldData,
                          const void *rarNewData) {
  (void)(key);
  (void)(oldData);
  return (void *)rarNewData;
}


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

x86 assembly (clang, -O2):
<default_data_update>:
mov    %rdx,%rax
ret

LLVM IR (-O0):
define i8* @default_data_update(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
ret i8* %9
}

LLVM IR (-O2):
define i8* @default_data_update(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* readnone returned %2) {
ret i8* %2
}
float _Complex sub_float_cc(float _Complex a, float _Complex b) {
  return a - b;
}


x86 assembly (clang, -O0):
<sub_float_cc>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x10(%rbp)
movlpd %xmm1,-0x18(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x18(%rbp),%xmm3
movss  -0x14(%rbp),%xmm2
subss  %xmm3,%xmm1
subss  %xmm2,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_float_cc>:
subps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define <2 x float> @sub_float_cc(<2 x float> %0, <2 x float> %1) {
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = alloca { float, float }
%6 = bitcast { float, float }* %4 to <2 x float>*
store <2 x float> %0, <2 x float>* %6
%7 = bitcast { float, float }* %5 to <2 x float>*
store <2 x float> %1, <2 x float>* %7
%8 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%9 = load float, float* %8
%10 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
%11 = load float, float* %10
%12 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 0
%13 = load float, float* %12
%14 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 1
%15 = load float, float* %14
%16 = fsub float %9, %13
%17 = fsub float %11, %15
%18 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%19 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %16, float* %18
store float %17, float* %19
%20 = bitcast { float, float }* %3 to <2 x float>*
%21 = load <2 x float>, <2 x float>* %20
ret <2 x float> %21
}

LLVM IR (-O2):
define <2 x float> @sub_float_cc(<2 x float> %0, <2 x float> %1) {
%3 = fsub <2 x float> %0, %1
ret <2 x float> %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *buf;
  buf = malloc(size);
  if (!buf) {
    fprintf(stderr, "Error: Out of memory. Exiting.\n");
    exit(1);
  }
  return buf;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <xmalloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Error: Out of memory. Exiting.\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Error: Out of memory. Exiting.\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int atan2(int, int);
int SSL_DegreeBetweenPoints(int x1, int y1, int x2, int y2) {
  int deltaX = x1 - x2;
  int deltaY = y1 - y2;
  return atan2(deltaX, -deltaY) * 180 / 3.14159265359;
}


x86 assembly (clang, -O0):
<SSL_DegreeBetweenPoints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
xor    %esi,%esi
sub    -0x18(%rbp),%esi
call   1030 <atan2@plt>
imul   $0xb4,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  0xeab(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSL_DegreeBetweenPoints>:
push   %rax
sub    %edx,%edi
sub    %esi,%ecx
mov    %ecx,%esi
call   1030 <atan2@plt>
imul   $0xb4,%eax,%eax
cvtsi2sd %eax,%xmm0
divsd  0xed2(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SSL_DegreeBetweenPoints(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %9
%14 = load i32, i32* %6
%15 = load i32, i32* %8
%16 = sub nsw i32 %14, %15
store i32 %16, i32* %10
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = sub nsw i32 0, %18
%20 = call i32 @atan2(i32 %17, i32 %19)
%21 = mul nsw i32 %20, 180
%22 = sitofp i32 %21 to double
%23 = fdiv double %22, 0x400921FB54442EEA
%24 = fptosi double %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @SSL_DegreeBetweenPoints(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = sub i32 %3, %1
%7 = tail call i32 @atan2(i32 %5, i32 %6)
%8 = mul nsw i32 %7, 180
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 0x400921FB54442EEA
%11 = fptosi double %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ test_prng_sha256prng_seed1_u32();
int /*<<< orphan*/ test_prng_sha256prng_seed2_u8();
int main(void) {
  test_prng_sha256prng_seed1_u32();
  test_prng_sha256prng_seed2_u8();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_prng_sha256prng_seed1_u32()
%3 = call i32 (...) @test_prng_sha256prng_seed2_u8()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_prng_sha256prng_seed1_u32()
%2 = tail call i32 (...) @test_prng_sha256prng_seed2_u8()
ret i32 0
}
/* Type definitions */
struct ir_remote {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
struct ir_remote *read_config_recursive(int /*<<< orphan*/ *, char const *,
                                        int /*<<< orphan*/);
struct ir_remote *read_config(FILE *f, const char *name) {
  return read_config_recursive(f, name, 0);
}


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

x86 assembly (clang, -O2):
<read_config>:
xor    %edx,%edx
jmp    1030 <read_config_recursive@plt>

LLVM IR (-O0):
%struct.ir_remote = type { i32 }
define %struct.ir_remote* @read_config(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call %struct.ir_remote* @read_config_recursive(i32* %5, i8* %6, i32 0)
ret %struct.ir_remote* %7
}

LLVM IR (-O2):
%struct.ir_remote = type { i32 }
define %struct.ir_remote* @read_config(i32* %0, i8* %1) {
%3 = tail call %struct.ir_remote* @read_config_recursive(i32* %0, i8* %1, i32 0)
ret %struct.ir_remote* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int a = 23, b = 16;
  swap(&a, &b);
  printf("a: %d, b: %d\n", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x17,-0x4(%rbp)
movl   $0x10,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x17,0x4(%rsp)
movl   $0x10,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"a: %d, b: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 23, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 16, i32* %2
%5 = call i32 @swap(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
extern int plugin_is_GPL_compatible(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @plugin_is_GPL_compatible() {
ret i32 0
}

LLVM IR (-O2):
define i32 @plugin_is_GPL_compatible() {
ret i32 0
}
extern __attribute__((__gnu___)) float __attribute__((__const__))
cargf(float _Complex _Z) {
  float res;
  __asm__("fpatan;" : "=t"(res) : "0"(__real__ _Z), "u"(__imag__ _Z) : "st(1)");
  return res;
}


x86 assembly (clang, -O0):
<cargf>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
movss  %xmm1,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
flds   -0x10(%rbp)
flds   -0x14(%rbp)
fxch   %st(1)
fpatan
fstps  -0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cargf>:
movss  %xmm0,-0x8(%rsp)
shufps $0x55,%xmm0,%xmm0
movss  %xmm0,-0x4(%rsp)
flds   -0x8(%rsp)
flds   -0x4(%rsp)
fxch   %st(1)
fpatan
fstps  -0xc(%rsp)
movss  -0xc(%rsp),%xmm0
ret

LLVM IR (-O0):
define float @cargf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca float
%4 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %4
%5 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%6 = load float, float* %5
%7 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%8 = load float, float* %7
%9 = call float asm "fpatan;", "={st},0,{st(1)},~{st(1)},~{dirflag},~{fpsr},~{flags}"(float %6, float %8)
store float %9, float* %3
%10 = load float, float* %3
ret float %10
}

LLVM IR (-O2):
define float @cargf(<2 x float> %0) {
%2 = extractelement <2 x float> %0, i64 0
%3 = extractelement <2 x float> %0, i64 1
%4 = tail call float asm "fpatan;", "={st},0,{st(1)},~{st(1)},~{dirflag},~{fpsr},~{flags}"(float %2, float %3)
ret float %4
}
void foo229() {}


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

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

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

LLVM IR (-O2):
define void @foo229() {
ret void
}
double Radians(double arg) { return (arg * 1.74532925E-2); }


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

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

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

LLVM IR (-O2):
define double @Radians(double %0) {
%2 = fmul double %0, 0x3F91DF46A1FAE711
ret double %2
}
/* Variables and functions */
int mvm_enable_irq(unsigned int);
int xnarch_enable_irq(unsigned irq) { return mvm_enable_irq(irq); }


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

x86 assembly (clang, -O2):
<xnarch_enable_irq>:
jmp    1030 <mvm_enable_irq@plt>

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

LLVM IR (-O2):
define i32 @xnarch_enable_irq(i32 %0) {
%2 = tail call i32 @mvm_enable_irq(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ FreeFDTD();
int /*<<< orphan*/ InitFDTD();
int /*<<< orphan*/ UsingStdC();
void RunCalculation() {
  InitFDTD();
  UsingStdC();
  FreeFDTD();
}


x86 assembly (clang, -O0):
<RunCalculation>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <InitFDTD@plt>
mov    $0x0,%al
call   1040 <UsingStdC@plt>
mov    $0x0,%al
call   1050 <FreeFDTD@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RunCalculation>:
push   %rax
xor    %eax,%eax
call   1030 <InitFDTD@plt>
xor    %eax,%eax
call   1040 <UsingStdC@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <FreeFDTD@plt>

LLVM IR (-O0):
define void @RunCalculation() {
%1 = call i32 (...) @InitFDTD()
%2 = call i32 (...) @UsingStdC()
%3 = call i32 (...) @FreeFDTD()
ret void
}

LLVM IR (-O2):
define void @RunCalculation() {
%1 = tail call i32 (...) @InitFDTD()
%2 = tail call i32 (...) @UsingStdC()
%3 = tail call i32 (...) @FreeFDTD()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ US2ST(int);
int /*<<< orphan*/ chSysPolledDelayX(int /*<<< orphan*/);
void eink_delay(int us) { chSysPolledDelayX(US2ST(us)); }


x86 assembly (clang, -O0):
<eink_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <US2ST@plt>
mov    %eax,%edi
call   1030 <chSysPolledDelayX@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eink_delay>:
push   %rax
call   1040 <US2ST@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <chSysPolledDelayX@plt>

LLVM IR (-O0):
define void @eink_delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @US2ST(i32 %3)
%5 = call i32 @chSysPolledDelayX(i32 %4)
ret void
}

LLVM IR (-O2):
define void @eink_delay(i32 %0) {
%2 = tail call i32 @US2ST(i32 %0)
%3 = tail call i32 @chSysPolledDelayX(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
int /*<<< orphan*/ inet_aton(char const *, struct in_addr *);
uint32_t string_to_addr(const char const *restrict str) {
  static struct in_addr a;
  inet_aton(str, &a);
  return a.s_addr;
}


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

x86 assembly (clang, -O2):
<string_to_addr>:
push   %rax
lea    0x2f14(%rip),%rsi
call   1030 <inet_aton@plt>
mov    0x2f09(%rip),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@string_to_addr.a = internal global %struct.in_addr zeroinitializer
define i32 @string_to_addr(i8* noalias %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @inet_aton(i8* %3, %struct.in_addr* @string_to_addr.a)
%5 = load i32, i32* getelementptr inbounds (%struct.in_addr, %struct.in_addr* @string_to_addr.a, i32 0, i32 0)
ret i32 %5
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@string_to_addr.a = internal global %struct.in_addr zeroinitializer
define i32 @string_to_addr(i8* noalias %0) {
%2 = tail call i32 @inet_aton(i8* %0, %struct.in_addr* @string_to_addr.a)
%3 = load i32, i32* getelementptr inbounds (%struct.in_addr, %struct.in_addr* @string_to_addr.a, i64 0, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ attroff(int);
int /*<<< orphan*/ attron(int);
int /*<<< orphan*/ mvaddch(int, int, int);
int random();
void code_draw(int y, int x, int color) {
  attron(color);
  mvaddch(y, x, 33 + (random() % 60));
  attroff(color);
}


x86 assembly (clang, -O0):
<code_draw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <attron@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <random@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x3c,%ecx
cltd
idiv   %ecx
add    $0x21,%edx
call   1060 <mvaddch@plt>
mov    -0xc(%rbp),%edi
call   1030 <attroff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code_draw>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
mov    %edx,%edi
call   1040 <attron@plt>
xor    %eax,%eax
call   1050 <random@plt>
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x3c,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edx
add    $0x21,%edx
mov    %ebp,%edi
mov    %r14d,%esi
call   1060 <mvaddch@plt>
mov    %ebx,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <attroff@plt>

LLVM IR (-O0):
define void @code_draw(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @attron(i32 %7)
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 (...) @random()
%12 = srem i32 %11, 60
%13 = add nsw i32 33, %12
%14 = call i32 @mvaddch(i32 %9, i32 %10, i32 %13)
%15 = load i32, i32* %6
%16 = call i32 @attroff(i32 %15)
ret void
}

LLVM IR (-O2):
define void @code_draw(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @attron(i32 %2)
%5 = tail call i32 (...) @random()
%6 = srem i32 %5, 60
%7 = add nsw i32 %6, 33
%8 = tail call i32 @mvaddch(i32 %0, i32 %1, i32 %7)
%9 = tail call i32 @attroff(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int getcpu(uint32_t *cpu, uint32_t *node, void *tcache) {
  uint32_t cpunum = 0;
  if (cpu != NULL) {
    *node = cpunum;
  }
  if (node != NULL) {
    *node = 0;
  }
  if (tcache != NULL) {
    return -22;
  }
  return 0;
}


x86 assembly (clang, -O0):
<getcpu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     112b <getcpu+0x2b>
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1140 <getcpu+0x40>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1157 <getcpu+0x57>
movl   $0xffffffea,-0x4(%rbp)
jmp    115e <getcpu+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcpu>:
or     %rsi,%rdi
je     110b <getcpu+0xb>
movl   $0x0,(%rsi)
xor    %ecx,%ecx
test   %rdx,%rdx
mov    $0xffffffea,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getcpu(i32* readnone %0, i32* writeonly %1, i8* readnone %2) {
%4 = icmp ne i32* %0, null
%5 = icmp ne i32* %1, null
%6 = or i1 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %3
store i32 0, i32* %1
br label %8
8: ; preds = %3, %7
%9 = icmp eq i8* %2, null
%10 = select i1 %9, i32 0, i32 -22
ret i32 %10
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  unsigned int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void sleep_ms(unsigned int ms) {
  struct timespec ts;
  ts.tv_sec = ms / 1000;
  ts.tv_nsec = (ms % 1000) * 1000000;
  nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<sleep_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
imul   $0xf4240,%edx,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep_ms>:
push   %rax
mov    %edi,%eax
imul   $0x10624dd3,%rax,%rax
shr    $0x26,%rax
mov    %eax,(%rsp)
imul   $0x3e8,%eax,%eax
sub    %eax,%edi
imul   $0xf4240,%edi,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @sleep_ms(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = udiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = urem i32 %7, 1000
%9 = mul i32 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @sleep_ms(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = udiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = urem i32 %0, 1000
%7 = mul nuw nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close_port(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
scalar_t__ tcgetattr(int, struct termios *);
void get_old_attr(int fd, struct termios *old_options) {
  if (tcgetattr(fd, old_options) != 0) {
    perror("Error getting old Razor IMU uart options!\n");
    close_port(fd);
    exit(-2);
  }
}


x86 assembly (clang, -O0):
<get_old_attr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <tcgetattr@plt>
cmp    $0x0,%rax
je     1183 <get_old_attr+0x43>
lea    0xe94(%rip),%rdi
call   1050 <perror@plt>
mov    -0x4(%rbp),%edi
call   1030 <close_port@plt>
mov    $0xfffffffe,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_old_attr>:
push   %rbx
mov    %edi,%ebx
call   1040 <tcgetattr@plt>
test   %rax,%rax
jne    114f <get_old_attr+0xf>
pop    %rbx
ret
lea    0xeaa(%rip),%rdi
call   1050 <perror@plt>
mov    %ebx,%edi
call   1030 <close_port@plt>
mov    $0xfffffffe,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@.str = [43 x i8] c"Error getting old Razor IMU uart options!\0A\00"
define void @get_old_attr(i32 %0, %struct.termios* %1) {
%3 = alloca i32
%4 = alloca %struct.termios*
store i32 %0, i32* %3
store %struct.termios* %1, %struct.termios** %4
%5 = load i32, i32* %3
%6 = load %struct.termios*, %struct.termios** %4
%7 = call i64 @tcgetattr(i32 %5, %struct.termios* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %3
%12 = call i32 @close_port(i32 %11)
%13 = call i32 @exit(i32 -2)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@.str = [43 x i8] c"Error getting old Razor IMU uart options!\0A\00"
define void @get_old_attr(i32 %0, %struct.termios* %1) {
%3 = tail call i64 @tcgetattr(i32 %0, %struct.termios* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @close_port(i32 %0)
%8 = tail call i32 @exit(i32 -2)
unreachable
9: ; preds = %2
ret void
}