xunge/DecIR huggingface dataset:
int isalnum(int c) {
  return !!(((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) ||
            ((c >= '0') && (c <= '9')));
}


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <isalnum+0x20>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isalnum+0x58>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <isalnum+0x39>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isalnum+0x58>
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <isalnum+0x52>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
mov    %edi,%eax
and    $0xffffffdf,%eax
add    $0xffffffbf,%eax
cmp    $0x1a,%eax
setb   %al
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 48
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 57
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = xor i1 %23, true
%25 = xor i1 %24, true
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = add i32 %0, -48
%6 = icmp ult i32 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
void *ip_dup(const void *ip, const size_t len) { return (void *)ip; }


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

x86 assembly (clang, -O2):
<ip_dup>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @ip_dup(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
ret i8* %5
}

LLVM IR (-O2):
define i8* @ip_dup(i8* readnone returned %0, i64 %1) {
ret i8* %0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool get_bit(volatile uint8_t *byteaddress, uint8_t bitpos) {
  return (*byteaddress & (1 << bitpos));
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_bit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load volatile i32, i32* %5
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_bit(i32* %0, i32 %1) {
%3 = load volatile i32, i32* %0
%4 = shl nuw i32 1, %1
%5 = and i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int);
void mergeSort(int vec[], int vecSize) {
  int mid;
  if (vecSize > 1) {
    mid = vecSize / 2;
    mergeSort(vec, mid);
    mergeSort(vec + mid, vecSize - mid);
    merge(vec, vecSize);
  }
}


x86 assembly (clang, -O0):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1179 <mergeSort+0x59>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <merge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeSort>:
cmp    $0x1,%esi
jle    1154 <mergeSort+0x34>
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
mov    %ebx,%esi
call   1030 <mergeSort@plt>
lea    (%r14,%rbx,4),%rdi
mov    %ebp,%esi
sub    %ebx,%esi
call   1030 <mergeSort@plt>
mov    %r14,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <merge@plt>
ret

LLVM IR (-O0):
define void @mergeSort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %23
8: ; preds = %2
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 2
store i32 %10, i32* %5
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = sub nsw i32 %17, %18
%20 = load i32*, i32** %3
%21 = load i32, i32* %4
%22 = call i32 @merge(i32* %20, i32 %21)
br label %23
23: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @mergeSort(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %5, label %4
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = lshr i32 %1, 1
tail call void @mergeSort(i32* %0, i32 %6)
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = sub nsw i32 %1, %6
tail call void @mergeSort(i32* %8, i32 %9)
%10 = tail call i32 @merge(i32* %0, i32 %1)
br label %4
}
/* Variables and functions */
size_t SIZE_MAX;
int balign_up_overflows(size_t x, size_t n) {
  size_t r = x % n;
  return (r && x > SIZE_MAX - (n - r));
}


x86 assembly (clang, -O0):
<balign_up_overflows>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     114e <balign_up_overflows+0x4e>
mov    -0x8(%rbp),%rax
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%rcx
mov    -0x10(%rbp),%rdx
sub    -0x18(%rbp),%rdx
sub    %rdx,%rcx
cmp    %rcx,%rax
seta   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<balign_up_overflows>:
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     112f <balign_up_overflows+0x2f>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
test   %rdx,%rdx
je     113a <balign_up_overflows+0x3a>
mov    0x2eb8(%rip),%rax
sub    %rsi,%rdx
add    (%rax),%rdx
xor    %eax,%eax
cmp    %rdi,%rdx
setb   %al
ret
mov    %edi,%eax
xor    %edx,%edx
div    %esi
test   %rdx,%rdx
jne    1119 <balign_up_overflows+0x19>
xor    %eax,%eax
ret

LLVM IR (-O0):
@SIZE_MAX = global i64 0
define i32 @balign_up_overflows(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = urem i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i64, i64* %3
%13 = load i64, i64* @SIZE_MAX
%14 = load i64, i64* %4
%15 = load i64, i64* %5
%16 = sub i64 %14, %15
%17 = sub i64 %13, %16
%18 = icmp ugt i64 %12, %17
br label %19
19: ; preds = %11, %2
%20 = phi i1 [ false, %2 ], [ %18, %11 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
@SIZE_MAX = global i64 0
define i32 @balign_up_overflows(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = load i64, i64* @SIZE_MAX
%7 = sub i64 %3, %1
%8 = add i64 %7, %6
%9 = icmp ult i64 %8, %0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %5, %2
%12 = phi i32 [ 0, %2 ], [ %10, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ test_awk_comment_entities();
int /*<<< orphan*/ test_awk_comments();
int /*<<< orphan*/ test_awk_double_slash();
void all_awk_tests() {
  test_awk_comments();
  test_awk_double_slash();
  test_awk_comment_entities();
}


x86 assembly (clang, -O0):
<all_awk_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_awk_comments@plt>
mov    $0x0,%al
call   1040 <test_awk_double_slash@plt>
mov    $0x0,%al
call   1030 <test_awk_comment_entities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_awk_tests>:
push   %rax
xor    %eax,%eax
call   1050 <test_awk_comments@plt>
xor    %eax,%eax
call   1040 <test_awk_double_slash@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_awk_comment_entities@plt>

LLVM IR (-O0):
define void @all_awk_tests() {
%1 = call i32 (...) @test_awk_comments()
%2 = call i32 (...) @test_awk_double_slash()
%3 = call i32 (...) @test_awk_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_awk_tests() {
%1 = tail call i32 (...) @test_awk_comments()
%2 = tail call i32 (...) @test_awk_double_slash()
%3 = tail call i32 (...) @test_awk_comment_entities()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *msg) {
  fprintf(stderr, "Detect_Pattern Error: %s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Detect_Pattern Error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Detect_Pattern Error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int d_bge_cr1(double a1) { return (__builtin_isgreaterequal(100, a1)); }


x86 assembly (clang, -O0):
<d_bge_cr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bge_cr1>:
movsd  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @d_bge_cr1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double 1.000000e+02, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @d_bge_cr1(double %0) {
%2 = fcmp ole double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
void setSignflag(char flags[]) { flags[8 - 8] = '1'; }


x86 assembly (clang, -O0):
<setSignflag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x31,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setSignflag>:
movb   $0x31,(%rdi)
ret

LLVM IR (-O0):
define void @setSignflag(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 49, i8* %4
ret void
}

LLVM IR (-O2):
define void @setSignflag(i8* nocapture writeonly %0) {
store i8 49, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M164_f(char *s) {
  debug("M164_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M164_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M164_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M164_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M164_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M164_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M164_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void writewin(char *s) {}


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

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

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

LLVM IR (-O2):
define void @writewin(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void say_hello_to_jenkins(void) {
  printf("Hello Jenkins, nice to meet you...\n");
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Hello Jenkins, nice to meet you...\0A\00"
define void @say_hello_to_jenkins() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"Hello Jenkins, nice to meet you...\00"
define void @say_hello_to_jenkins() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double log(double);
double hypso_del_alt(double tbar, double pres1, double pres2) {
  double dalt;
  dalt = -((287.04 * 1000.0 * tbar) / 9.81) * log(pres2 / pres1);
  return (dalt);
}


x86 assembly (clang, -O0):
<hypso_del_alt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xed9(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
divsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hypso_del_alt>:
push   %rax
movapd %xmm0,%xmm3
mulsd  0xee3(%rip),%xmm3
movapd %xmm2,%xmm0
divsd  0xedf(%rip),%xmm3
movsd  %xmm3,(%rsp)
divsd  %xmm1,%xmm0
call   1030 <log@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @hypso_del_alt(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = fmul double 2.870400e+05, %8
%10 = fdiv double %9, 9.810000e+00
%11 = fneg double %10
%12 = load double, double* %6
%13 = load double, double* %5
%14 = fdiv double %12, %13
%15 = call double @log(double %14)
%16 = fmul double %11, %15
store double %16, double* %7
%17 = load double, double* %7
ret double %17
}

LLVM IR (-O2):
define double @hypso_del_alt(double %0, double %1, double %2) {
%4 = fmul double %0, 2.870400e+05
%5 = fdiv double %4, -9.810000e+00
%6 = fdiv double %2, %1
%7 = tail call double @log(double %6)
%8 = fmul double %5, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void cleanExit(int n) { exit(0); }


x86 assembly (clang, -O0):
<cleanExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<cleanExit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @cleanExit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @cleanExit(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double fabs(double);
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("The absolute value of 3.1416 is %f\n", fabs(3.1416));
  printf("The absolute value of -10.6 is %f\n", fabs(-10.6));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
movsd  0xed4(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"The absolute value of 3.1416 is %f\0A\00"
@.str.1 = [35 x i8] c"The absolute value of -10.6 is %f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @llvm.fabs.f64(double 3.141600e+00)
%3 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @llvm.fabs.f64(double -1.060000e+01)
%5 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), double %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"The absolute value of 3.1416 is %f\0A\00"
@.str.1 = [35 x i8] c"The absolute value of -10.6 is %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), double 3.141600e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), double 1.060000e+01)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ write_stats_core(int, int, int, int, char *, char *);
void write_stats_avg(int curr, int dis) {
  char string[16];
  strcpy(string, ("Average:"));
  write_stats_core(2, curr, dis, 1, string, string);
}


x86 assembly (clang, -O0):
<write_stats_avg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    -0x20(%rbp),%r8
lea    -0x20(%rbp),%r9
mov    $0x2,%edi
mov    $0x1,%ecx
call   1040 <write_stats_core@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_stats_avg>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r14d
mov    %edi,%ebp
lea    0xecc(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    $0x2,%edi
mov    %ebp,%esi
mov    %r14d,%edx
mov    $0x1,%ecx
mov    %rbx,%r8
mov    %rbx,%r9
call   1040 <write_stats_core@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Average:\00"
define void @write_stats_avg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [16 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%12 = call i32 @write_stats_core(i32 2, i32 %8, i32 %9, i32 1, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Average:\00"
define void @write_stats_avg(i32 %0, i32 %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @write_stats_core(i32 2, i32 %0, i32 %1, i32 1, i8* %4, i8* %4)
ret void
}
void foo492(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo492(i32 %0) {
ret void
}
/* Variables and functions */
long FD_SETSIZE;
long __NFDBITS;
long int __fdelt_chk(long int d) {
  if (d >= FD_SETSIZE) {
    return 0;
  }
  return d / __NFDBITS;
}


x86 assembly (clang, -O0):
<__fdelt_chk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%rax
jl     1129 <__fdelt_chk+0x29>
movq   $0x0,-0x8(%rbp)
jmp    113d <__fdelt_chk+0x3d>
mov    -0x10(%rbp),%rax
mov    0x2e9c(%rip),%rcx
cqto
idivq  (%rcx)
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fdelt_chk>:
mov    0x2ed9(%rip),%rax
cmp    %rdi,(%rax)
jle    112b <__fdelt_chk+0x2b>
mov    0x2ebd(%rip),%rax
mov    (%rax),%rcx
mov    %rdi,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     112e <__fdelt_chk+0x2e>
mov    %rdi,%rax
cqto
idiv   %rcx
ret
xor    %eax,%eax
ret
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
ret

LLVM IR (-O0):
@FD_SETSIZE = global i64 0
@__NFDBITS = global i64 0
define i64 @__fdelt_chk(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = load i64, i64* @FD_SETSIZE
%6 = icmp sge i64 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 0, i64* %2
br label %12
8: ; preds = %1
%9 = load i64, i64* %3
%10 = load i64, i64* @__NFDBITS
%11 = sdiv i64 %9, %10
store i64 %11, i64* %2
br label %12
12: ; preds = %8, %7
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
@FD_SETSIZE = global i64 0
@__NFDBITS = global i64 0
define i64 @__fdelt_chk(i64 %0) {
%2 = load i64, i64* @FD_SETSIZE
%3 = icmp sgt i64 %2, %0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i64, i64* @__NFDBITS
%6 = sdiv i64 %0, %5
br label %7
7: ; preds = %1, %4
%8 = phi i64 [ %6, %4 ], [ 0, %1 ]
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ unit_error(char *, char const *, int, void *, void *);
void assert_equal_p(void *exp, void *real, char const *caller, int line) {
  if (exp != real) {
    unit_error("%s:%d - expected %p, got %p", caller, line, exp, real);
  }
}


x86 assembly (clang, -O0):
<assert_equal_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1150 <assert_equal_p+0x40>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xeb5(%rip),%rdi
call   1030 <unit_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_equal_p>:
cmp    %rsi,%rdi
je     112f <assert_equal_p+0x1f>
mov    %rsi,%r8
mov    %rdi,%rax
lea    0xede(%rip),%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
mov    %rax,%rcx
jmp    1030 <unit_error@plt>
ret

LLVM IR (-O0):
@.str = [28 x i8] c"%s:%d - expected %p, got %p\00"
define void @assert_equal_p(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = icmp ne i8* %9, %10
br i1 %11, label %12, label %18
12: ; preds = %4
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i8*, i8** %5
%16 = load i8*, i8** %6
%17 = call i32 @unit_error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14, i8* %15, i8* %16)
br label %18
18: ; preds = %12, %4
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"%s:%d - expected %p, got %p\00"
define void @assert_equal_p(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = icmp eq i8* %0, %1
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @unit_error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i8* %0, i8* %1)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int sha256_NSS(unsigned char *, unsigned char *, int);
int nss_entry() {
  unsigned char input[] = "This is a test string";
  unsigned char result[32] = "";
  return sha256_NSS(input, result, 21);
}


x86 assembly (clang, -O0):
<nss_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec6(%rip),%ax
mov    %ax,-0xc(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x15,%edx
call   1030 <sha256_NSS@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nss_entry>:
sub    $0x48,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x676e6972747320,%rax
mov    %rax,0xe(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
mov    %rsp,%rdi
lea    0x20(%rsp),%rsi
mov    $0x15,%edx
call   1030 <sha256_NSS@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.nss_entry.input = [22 x i8] c"This is a test string\00"
define i32 @nss_entry() {
%1 = alloca [22 x i8]
%2 = alloca [32 x i8]
%3 = bitcast [22 x i8]* %1 to i8*
%4 = bitcast [32 x i8]* %2 to i8*
%5 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%7 = call i32 @sha256_NSS(i8* %5, i8* %6, i32 21)
ret i32 %7
}

LLVM IR (-O2):
@__const.nss_entry.input = [22 x i8] c"This is a test string\00"
define i32 @nss_entry() {
%1 = alloca [22 x i8]
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%5 = call i32 @sha256_NSS(i8* %3, i8* %4, i32 21)
ret i32 %5
}
int _cmpgt2(int src1, int src2) {
  short s1[2], s2[2];
  int r1, r0;
  int result;
  *((int *)s1) = src1;
  *((int *)s2) = src2;
  r0 = s1[0] > s2[0] ? 1 : 0;
  r1 = s1[1] > s2[1] ? 1 : 0;
  result = (r1 << 1) | r0;
  return result;
}


x86 assembly (clang, -O0):
<_cmpgt2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movswl -0xc(%rbp),%edx
movswl -0x10(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
mov    %eax,-0x18(%rbp)
movswl -0xa(%rbp),%edx
movswl -0xe(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cmpgt2>:
mov    %edi,%eax
shl    $0x10,%eax
mov    %esi,%ecx
shl    $0x10,%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setg   %dl
sar    $0x10,%edi
sar    $0x10,%esi
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
lea    (%rdx,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @_cmpgt2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i16]
%6 = alloca [2 x i16]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%10 = load i32, i32* %3
%11 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 0
%12 = bitcast i16* %11 to i32*
store i32 %10, i32* %12
%13 = load i32, i32* %4
%14 = getelementptr inbounds [2 x i16], [2 x i16]* %6, i64 0, i64 0
%15 = bitcast i16* %14 to i32*
store i32 %13, i32* %15
%16 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 0
%17 = load i16, i16* %16
%18 = sext i16 %17 to i32
%19 = getelementptr inbounds [2 x i16], [2 x i16]* %6, i64 0, i64 0
%20 = load i16, i16* %19
%21 = sext i16 %20 to i32
%22 = icmp sgt i32 %18, %21
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 1, i32 0
store i32 %24, i32* %8
%25 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 1
%26 = load i16, i16* %25
%27 = sext i16 %26 to i32
%28 = getelementptr inbounds [2 x i16], [2 x i16]* %6, i64 0, i64 1
%29 = load i16, i16* %28
%30 = sext i16 %29 to i32
%31 = icmp sgt i32 %27, %30
%32 = zext i1 %31 to i64
%33 = select i1 %31, i32 1, i32 0
store i32 %33, i32* %7
%34 = load i32, i32* %7
%35 = shl i32 %34, 1
%36 = load i32, i32* %8
%37 = or i32 %35, %36
store i32 %37, i32* %9
%38 = load i32, i32* %9
ret i32 %38
}

LLVM IR (-O2):
define i32 @_cmpgt2(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = shl i32 %1, 16
%5 = icmp sgt i32 %3, %4
%6 = zext i1 %5 to i32
%7 = ashr i32 %0, 16
%8 = ashr i32 %1, 16
%9 = icmp sgt i32 %7, %8
%10 = select i1 %9, i32 2, i32 0
%11 = or i32 %10, %6
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void display_menu() { printf("\xC9"); }


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

x86 assembly (clang, -O2):
<display_menu>:
mov    $0xffffffc9,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\C9\00"
define void @display_menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @display_menu() {
%1 = tail call i32 @putchar(i32 -55)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: enq[-p num] e_file args\n"
         "\t-p num\t\t specify the job priority\n"
         "\te_file\t\t the absolute path of the exefile\n"
         "\targs\t\t the args passed to the e_file\n");
}


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

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

LLVM IR (-O0):
@.str = [148 x i8] c"Usage: enq[-p num] e_file args\0A\09-p num\09\09 specify the job priority\0A\09e_file\09\09 the absolute path of the exefile\0A\09args\09\09 the args passed to the e_file\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [147 x i8] c"Usage: enq[-p num] e_file args\0A\09-p num\09\09 specify the job priority\0A\09e_file\09\09 the absolute path of the exefile\0A\09args\09\09 the args passed to the e_file\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([147 x i8], [147 x i8]* @str, i64 0, i64 0))
ret void
}
int numanuma__set_thread_priority(const double prio) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @numanuma__set_thread_priority(double %0) {
ret i32 -1
}
/* Variables and functions */
int flash();
int wrap_flash(void) { return flash(); }


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

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

LLVM IR (-O0):
define i32 @wrap_flash() {
%1 = call i32 (...) @flash()
ret i32 %1
}

LLVM IR (-O2):
define i32 @wrap_flash() {
%1 = tail call i32 (...) @flash()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ reset_source_get();
char const *reset_source_to_string(int /*<<< orphan*/);
const char *reset_source_name(void) {
  return reset_source_to_string(reset_source_get());
}


x86 assembly (clang, -O0):
<reset_source_name>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <reset_source_get@plt>
mov    %eax,%edi
call   1030 <reset_source_to_string@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_source_name>:
push   %rax
xor    %eax,%eax
call   1040 <reset_source_get@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <reset_source_to_string@plt>

LLVM IR (-O0):
define i8* @reset_source_name() {
%1 = call i32 (...) @reset_source_get()
%2 = call i8* @reset_source_to_string(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
define i8* @reset_source_name() {
%1 = tail call i32 (...) @reset_source_get()
%2 = tail call i8* @reset_source_to_string(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int);
void Lizard_copy8(void *dst, const void *src) { memcpy(dst, src, 8); }


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

x86 assembly (clang, -O2):
<Lizard_copy8>:
mov    $0x8,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @Lizard_copy8(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 8)
ret void
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int gettimeofday(struct timeval *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, ...);
main() {
  struct timeval t;
  printf("%d\n", gettimeofday(&t, 0));
  printf("%lu %lu\n", t.tv_sec, t.tv_usec);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%edx
mov    0x4(%rsp),%esi
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [9 x i8] c"%lu %lu\0A\00"
define i32 @main() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [9 x i8] c"%lu %lu\0A\00"
define i32 @main() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %8)
ret i32 0
}
void virtual_mcu_TimerMilli_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @virtual_mcu_TimerMilli_targetInit__I() {
ret void
}
int b(int x) { return (x > 0 ? x : -x) == 0; }


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111c <b+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <b+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @b(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @b(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int O_CREAT;
int O_RDWR;
int open(char const *, int, int);
int open_rw(const char *filename) {
  return open(filename, O_RDWR | O_CREAT | 0, 0644);
}


x86 assembly (clang, -O0):
<open_rw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
or     (%rax),%esi
or     $0x0,%esi
mov    $0x1a4,%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_rw>:
mov    0x2ec9(%rip),%rax
mov    0x2eda(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    $0x1a4,%edx
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_CREAT = global i32 0
define i32 @open_rw(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_RDWR
%5 = load i32, i32* @O_CREAT
%6 = or i32 %4, %5
%7 = or i32 %6, 0
%8 = call i32 @open(i8* %3, i32 %7, i32 420)
ret i32 %8
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_CREAT = global i32 0
define i32 @open_rw(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4, i32 420)
ret i32 %5
}
/* Variables and functions */
int exp(float);
double log1p(int);
float log10_chi2_k4_CDF(float x) {
  return log1p(-exp(-x / 2) * (1 + x / 2)) * 0.43429448190325176;
}


x86 assembly (clang, -O0):
<log10_chi2_k4_CDF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xec5(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xea5(%rip),%xmm1
divss  %xmm1,%xmm2
movss  0xe95(%rip),%xmm1
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1040 <log1p@plt>
movsd  0xe74(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10_chi2_k4_CDF>:
push   %rax
movaps %xmm0,%xmm1
movss  %xmm0,0x4(%rsp)
movss  0xece(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1030 <exp@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0x4(%rsp),%xmm1
mulss  0xeb2(%rip),%xmm1
addss  0xeae(%rip),%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
call   1040 <log1p@plt>
mulsd  0xea1(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @log10_chi2_k4_CDF(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = fdiv float %4, 2.000000e+00
%6 = call i32 @exp(float %5)
%7 = sub nsw i32 0, %6
%8 = sitofp i32 %7 to float
%9 = load float, float* %2
%10 = fdiv float %9, 2.000000e+00
%11 = fadd float 1.000000e+00, %10
%12 = fmul float %8, %11
%13 = fptosi float %12 to i32
%14 = call double @log1p(i32 %13)
%15 = fmul double %14, 0x3FDBCB7B1526E50D
%16 = fptrunc double %15 to float
ret float %16
}

LLVM IR (-O2):
define float @log10_chi2_k4_CDF(float %0) {
%2 = fmul float %0, -5.000000e-01
%3 = tail call i32 @exp(float %2)
%4 = sub nsw i32 0, %3
%5 = sitofp i32 %4 to float
%6 = fmul float %0, 5.000000e-01
%7 = fadd float %6, 1.000000e+00
%8 = fmul float %7, %5
%9 = fptosi float %8 to i32
%10 = tail call double @log1p(i32 %9)
%11 = fmul double %10, 0x3FDBCB7B1526E50D
%12 = fptrunc double %11 to float
ret float %12
}
/* Type definitions */
struct mdea_object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mdea_error(char **, char *);
int mdea_string_node_get_object(void *p, struct mdea_object **object,
                                char **error) {
  mdea_error(error, "Expected object, got string");
  return -1;
}


x86 assembly (clang, -O0):
<mdea_string_node_get_object>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <mdea_error@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdea_string_node_get_object>:
push   %rax
mov    %rdx,%rdi
lea    0xee5(%rip),%rsi
call   1030 <mdea_error@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mdea_object = type { i32 }
@.str = [28 x i8] c"Expected object, got string\00"
define i32 @mdea_string_node_get_object(i8* %0, %struct.mdea_object** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca %struct.mdea_object**
%6 = alloca i8**
store i8* %0, i8** %4
store %struct.mdea_object** %1, %struct.mdea_object*** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %6
%8 = call i32 @mdea_error(i8** %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
%struct.mdea_object = type { i32 }
@.str = [28 x i8] c"Expected object, got string\00"
define i32 @mdea_string_node_get_object(i8* nocapture readnone %0, %struct.mdea_object** nocapture readnone %1, i8** %2) {
%4 = tail call i32 @mdea_error(i8** %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
int test_imm_54uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x54 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_54uint64_highword_reg>:
movabs $0x5400000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_54uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 84
%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_54uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 360777252864
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ print_i2c_busses(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void help(void) {
  fprintf(stderr, "Syntax: i2cget [-y] I2CBUS CHIP-ADDRESS [DATA-ADDRESS "
                  "[MODE]]\n"
                  "        i2cget -V\n"
                  "  MODE can be: 'b' (read byte data, default)\n"
                  "               'w' (read word data)\n"
                  "               'c' (write byte/read byte)\n"
                  "  If DATA-ADDRESS is omitted, a single read byte command is "
                  "issued\n"
                  "  Append 'p' to MODE for PEC checking\n"
                  "  I2CBUS is an integer\n");
  print_i2c_busses(0);
  exit(1);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <print_i2c_busses@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <print_i2c_busses@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [332 x i8] c"Syntax: i2cget [-y] I2CBUS CHIP-ADDRESS [DATA-ADDRESS [MODE]]\0A i2cget -V\0A MODE can be: 'b' (read byte data, default)\0A 'w' (read word data)\0A 'c' (write byte/read byte)\0A If DATA-ADDRESS is omitted, a single read byte command is issued\0A Append 'p' to MODE for PEC checking\0A I2CBUS is an integer\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([332 x i8], [332 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @print_i2c_busses(i32 0)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [332 x i8] c"Syntax: i2cget [-y] I2CBUS CHIP-ADDRESS [DATA-ADDRESS [MODE]]\0A i2cget -V\0A MODE can be: 'b' (read byte data, default)\0A 'w' (read word data)\0A 'c' (write byte/read byte)\0A If DATA-ADDRESS is omitted, a single read byte command is issued\0A Append 'p' to MODE for PEC checking\0A I2CBUS is an integer\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([332 x i8], [332 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_i2c_busses(i32 0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int Day(double);
int DayFromYear(int /*<<< orphan*/);
int /*<<< orphan*/ YearFromTime(double);
int DayWithinYear(double t) { return Day(t) - DayFromYear(YearFromTime(t)); }


x86 assembly (clang, -O0):
<DayWithinYear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <Day@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <YearFromTime@plt>
mov    %eax,%edi
call   1040 <DayFromYear@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DayWithinYear>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <Day@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1050 <YearFromTime@plt>
mov    %eax,%edi
call   1040 <DayFromYear@plt>
sub    %eax,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @DayWithinYear(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @Day(double %3)
%5 = load double, double* %2
%6 = call i32 @YearFromTime(double %5)
%7 = call i32 @DayFromYear(i32 %6)
%8 = sub nsw i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @DayWithinYear(double %0) {
%2 = tail call i32 @Day(double %0)
%3 = tail call i32 @YearFromTime(double %0)
%4 = tail call i32 @DayFromYear(i32 %3)
%5 = sub nsw i32 %2, %4
ret i32 %5
}