xunge/DecIR huggingface dataset:
int strcmp(const char *a, const char *b) {
  while (*a == *b) {
    if (*a == '\0') {
      break;
    }
    ++a, ++b;
  }
  return *a - *b;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1154 <strcmp+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1137 <strcmp+0x37>
jmp    1154 <strcmp+0x54>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
test   %al,%al
je     1134 <strcmp+0x34>
cmp    %cl,%al
jne    1134 <strcmp+0x34>
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
test   %al,%al
je     1134 <strcmp+0x34>
add    $0x1,%rdx
cmp    %cl,%al
je     1120 <strcmp+0x20>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ne i8 %3, %4
%6 = icmp eq i8 %3, 0
%7 = or i1 %6, %5
br i1 %7, label %18, label %8
8: ; preds = %2, %8
%9 = phi i8* [ %12, %8 ], [ %1, %2 ]
%10 = phi i8* [ %11, %8 ], [ %0, %2 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i8, i8* %11
%14 = load i8, i8* %12
%15 = icmp ne i8 %13, %14
%16 = icmp eq i8 %13, 0
%17 = or i1 %16, %15
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i8 [ %3, %2 ], [ %13, %8 ]
%20 = phi i8 [ %4, %2 ], [ %14, %8 ]
%21 = sext i8 %19 to i32
%22 = sext i8 %20 to i32
%23 = sub nsw i32 %21, %22
ret i32 %23
}
void mark_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @mark_exit() {
ret void
}
/* Variables and functions */
int isprint(int);
int isgraph(int ch) {
  if (ch == ' ')
    return 0;
  return isprint(ch);
}


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jne    1131 <isgraph+0x21>
movl   $0x0,-0x4(%rbp)
jmp    113c <isgraph+0x2c>
mov    -0x8(%rbp),%edi
call   1030 <isprint@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
cmp    $0x20,%edi
jne    1118 <isgraph+0x8>
xor    %eax,%eax
ret
jmp    1030 <isprint@plt>

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

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = icmp eq i32 %0, 32
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @isprint(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
int main() {
  *((int *)0) = 5;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
movl   $0x5,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
store i32 5, i32* null
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ eval_exp(int *);
int /*<<< orphan*/ printf(char *, int);
call_putch() {
  int value;
  eval_exp(&value);
  printf("%c", value);
  return value;
}


x86 assembly (clang, -O0):
<call_putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <eval_exp@plt>
mov    -0x4(%rbp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_putch>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <eval_exp@plt>
mov    0x4(%rsp),%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @call_putch() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @eval_exp(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}
/* Type definitions */
typedef unsigned long long uint64_t;
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
uint64_t clock_micro() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return (uint64_t)tv.tv_sec * 1000000ULL + (uint64_t)tv.tv_usec;
}


x86 assembly (clang, -O0):
<clock_micro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_micro>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @clock_micro() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = mul i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = add i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @clock_micro() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}
/* Variables and functions */
char *Safe_strndup(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ assert(char const *);
int /*<<< orphan*/ strlen(char const *);
char *Safe_strdup(const char *sz) {
  assert(sz);
  return Safe_strndup(sz, strlen(sz));
}


x86 assembly (clang, -O0):
<Safe_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <Safe_strndup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Safe_strdup>:
push   %rbx
mov    %rdi,%rbx
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <Safe_strndup@plt>

LLVM IR (-O0):
define i8* @Safe_strdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = call i8* @Safe_strndup(i8* %5, i32 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @Safe_strdup(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i8* @Safe_strndup(i8* %0, i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 0; i < 5; i++) {
    printf("num: %d\n", i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"num: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assertTrue(char *, int);
void test_double_array() {
  const static double gamcs[4] = {+.8571195590989331421920062399942e-2,
                                  +.4415381324841006757191315771652e-2,
                                  +.5685043681599363378632664588789e-1,
                                  -.4219835396418560501012500186624e-2};
  assertTrue("gamcs[3] != 0", gamcs[3] != 0);
}


x86 assembly (clang, -O0):
<test_double_array>:
push   %rbp
mov    %rsp,%rbp
movsd  0xefc(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xee9(%rip),%rdi
call   1030 <assertTrue@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_double_array>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <assertTrue@plt>

LLVM IR (-O0):
@test_double_array.gamcs = internal constant [4 x double] [double 0x3F818DC66601E198, double 0x3F7215DCE63BA49B, double 0x3FAD1B801DC6A8DB, double 0xBF7148D1705A9B75]
@.str = [14 x i8] c"gamcs[3] != 0\00"
define void @test_double_array() {
%1 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @test_double_array.gamcs, i64 0, i64 3)
%2 = fcmp une double %1, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"gamcs[3] != 0\00"
define void @test_double_array() {
%1 = tail call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
double params(int a, int b, int c, int d, int e, int f, float g, double h) {
  double x = a + b + c + d + e + f + g + h;
  return x;
}


x86 assembly (clang, -O0):
<params>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
cvtsi2ss %eax,%xmm0
addss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<params>:
add    %esi,%edi
add    %edx,%edi
add    %ecx,%edi
add    %r8d,%edi
add    %r9d,%edi
cvtsi2ss %edi,%xmm2
addss  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @params(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, float %6, double %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca float
%16 = alloca double
%17 = alloca double
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store float %6, float* %15
store double %7, double* %16
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = add nsw i32 %18, %19
%21 = load i32, i32* %11
%22 = add nsw i32 %20, %21
%23 = load i32, i32* %12
%24 = add nsw i32 %22, %23
%25 = load i32, i32* %13
%26 = add nsw i32 %24, %25
%27 = load i32, i32* %14
%28 = add nsw i32 %26, %27
%29 = sitofp i32 %28 to float
%30 = load float, float* %15
%31 = fadd float %29, %30
%32 = fpext float %31 to double
%33 = load double, double* %16
%34 = fadd double %32, %33
store double %34, double* %17
%35 = load double, double* %17
ret double %35
}

LLVM IR (-O2):
define double @params(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, float %6, double %7) {
%9 = add nsw i32 %1, %0
%10 = add nsw i32 %9, %2
%11 = add nsw i32 %10, %3
%12 = add nsw i32 %11, %4
%13 = add nsw i32 %12, %5
%14 = sitofp i32 %13 to float
%15 = fadd float %14, %6
%16 = fpext float %15 to double
%17 = fadd double %16, %7
ret double %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\aStartled by the sudden sound, Sally shouted,\n\"By the Great "
         "Pumpkin, what was that!\"\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [86 x i8] c"\07Startled by the sudden sound, Sally shouted,\0A\22By the Great Pumpkin, what was that!\22\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [85 x i8] c"\07Startled by the sudden sound, Sally shouted,\0A\22By the Great Pumpkin, what was that!\22\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
long abs(long);
void setseed(long *iseed) {
  long int ssecs(void);
  long iran1(long *idum);
  long ran1seed;
  *iseed = abs(314159 * ssecs());
  ran1seed = -(*iseed);
  *iseed = abs(*iseed * iran1(&ran1seed));
}


x86 assembly (clang, -O0):
<setseed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
call   1040 <ssecs@plt>
imul   $0x4cb2f,%rax,%rdi
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
sub    (%rcx),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
call   1050 <iran1@plt>
mov    -0x18(%rbp),%rdi
imul   %rax,%rdi
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setseed>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <ssecs@plt>
imul   $0x4cb2f,%rax,%rax
mov    %rax,%rbx
neg    %rbx
cmovs  %rax,%rbx
mov    %rbx,(%r14)
mov    %rbx,%rax
neg    %rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1040 <iran1@plt>
imul   %rbx,%rax
mov    %rax,%rcx
neg    %rcx
cmovs  %rax,%rcx
mov    %rcx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @setseed(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
%4 = call i64 @ssecs()
%5 = mul nsw i64 314159, %4
%6 = call i64 @abs(i64 %5)
%7 = load i64*, i64** %2
store i64 %6, i64* %7
%8 = load i64*, i64** %2
%9 = load i64, i64* %8
%10 = sub nsw i64 0, %9
store i64 %10, i64* %3
%11 = load i64*, i64** %2
%12 = load i64, i64* %11
%13 = call i64 @iran1(i64* %3)
%14 = mul nsw i64 %12, %13
%15 = call i64 @abs(i64 %14)
%16 = load i64*, i64** %2
store i64 %15, i64* %16
ret void
}

LLVM IR (-O2):
define void @setseed(i64* nocapture writeonly %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = tail call i64 @ssecs()
%5 = mul nsw i64 %4, 314159
%6 = tail call i64 @llvm.abs.i64(i64 %5, i1 true)
store i64 %6, i64* %0
%7 = sub nsw i64 0, %6
store i64 %7, i64* %2
%8 = call i64 @iran1(i64* %2)
%9 = mul nsw i64 %8, %6
%10 = call i64 @llvm.abs.i64(i64 %9, i1 true)
store i64 %10, i64* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ MYSQL_ROW;
typedef int /*<<< orphan*/ MYSQL_RES;

/* Variables and functions */
int /*<<< orphan*/ mysql_fetch_row(int /*<<< orphan*/ *);
MYSQL_ROW MysqlGetRow(MYSQL_RES *sqlResult) {
  if (sqlResult == NULL)
    return 0;
  return mysql_fetch_row(sqlResult);
}


x86 assembly (clang, -O0):
<MysqlGetRow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <MysqlGetRow+0x23>
movl   $0x0,-0x4(%rbp)
jmp    113f <MysqlGetRow+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <mysql_fetch_row@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MysqlGetRow>:
test   %rdi,%rdi
je     111a <MysqlGetRow+0xa>
jmp    1030 <mysql_fetch_row@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @MysqlGetRow(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @mysql_fetch_row(i32* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
int id3_getFlag(int byte, int bit) { return (byte & 1 << bit) ? 1 : 0; }


x86 assembly (clang, -O0):
<id3_getFlag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<id3_getFlag>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @id3_getFlag(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @id3_getFlag(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
void bar(void) { foo(80); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x50,%edi
call   1030 <foo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    $0x50,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @bar() {
%1 = call i32 @foo(i32 80)
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 @foo(i32 80)
ret void
}
/* Type definitions */
struct argparse_option {
  int dummy;
};
struct argparse {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ argparse_usage(struct argparse *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int argparse_help_cb(struct argparse *self,
                     const struct argparse_option *option) {
  (void)option;
  argparse_usage(self);
  exit(0);
}


x86 assembly (clang, -O0):
<argparse_help_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <argparse_usage@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
%struct.argparse = type { i32 }
%struct.argparse_option = type { i32 }
define i32 @argparse_help_cb(%struct.argparse* %0, %struct.argparse_option* %1) {
%3 = alloca %struct.argparse*
%4 = alloca %struct.argparse_option*
store %struct.argparse* %0, %struct.argparse** %3
store %struct.argparse_option* %1, %struct.argparse_option** %4
%5 = load %struct.argparse_option*, %struct.argparse_option** %4
%6 = load %struct.argparse*, %struct.argparse** %3
%7 = call i32 @argparse_usage(%struct.argparse* %6)
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.argparse = type { i32 }
%struct.argparse_option = type { i32 }
define i32 @argparse_help_cb(%struct.argparse* %0, %struct.argparse_option* nocapture readnone %1) {
%3 = tail call i32 @argparse_usage(%struct.argparse* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ int80(int, char *, char *, char *, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
char getMonth() {
  char y;
  char mo;
  char d;
  int80(7, &d, &mo, &y, 0, 0, 0);
  return mo;
}


x86 assembly (clang, -O0):
<getMonth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7,%edi
lea    -0x3(%rbp),%rsi
lea    -0x2(%rbp),%rdx
lea    -0x1(%rbp),%rcx
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <int80@plt>
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMonth>:
sub    $0x18,%rsp
movl   $0x0,(%rsp)
lea    0x16(%rsp),%rsi
lea    0x15(%rsp),%rdx
lea    0x17(%rsp),%rcx
mov    $0x7,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <int80@plt>
mov    0x15(%rsp),%al
add    $0x18,%rsp
ret

LLVM IR (-O0):
define signext i8 @getMonth() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = call i32 @int80(i32 7, i8* %3, i8* %2, i8* %1, i32 0, i32 0, i32 0)
%5 = load i8, i8* %2
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @getMonth() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = call i32 @int80(i32 7, i8* %3, i8* %2, i8* %1, i32 0, i32 0, i32 0)
%5 = load i8, i8* %2
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ aloneBubbleSort(int *, int);
int /*<<< orphan*/ printarray(int *, int);
int /*<<< orphan*/ printf(char *);
void test_aloneBubbleSort() {
  int array[5] = {5, 4, 3, 2, 1};
  int n = 5;
  printf("unsort before: ");
  printarray(array, n);
  aloneBubbleSort(array, n);
}


x86 assembly (clang, -O0):
<test_aloneBubbleSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebc(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x5,-0x24(%rbp)
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <printarray@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1050 <aloneBubbleSort@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_aloneBubbleSort>:
push   %rbx
sub    $0x20,%rsp
mov    0xed5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeba(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <printarray@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <aloneBubbleSort@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_aloneBubbleSort.array = [5 x i32] [i32 5, i32 4, i32 3, i32 2, i32 1]
@.str = [16 x i8] c"unsort before: \00"
define void @test_aloneBubbleSort() {
%1 = alloca [5 x i32]
%2 = alloca i32
%3 = bitcast [5 x i32]* %1 to i8*
store i32 5, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @printarray(i32* %5, i32 %6)
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%9 = load i32, i32* %2
%10 = call i32 @aloneBubbleSort(i32* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@__const.test_aloneBubbleSort.array = [5 x i32] [i32 5, i32 4, i32 3, i32 2, i32 1]
@.str = [16 x i8] c"unsort before: \00"
define void @test_aloneBubbleSort() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = call i32 @printarray(i32* %4, i32 5)
%6 = call i32 @aloneBubbleSort(i32* %4, i32 5)
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_network_link_get_network_file(int ifindex, char **filename) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_network_link_get_network_file>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_network_link_get_network_file>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_network_link_get_network_file(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_network_link_get_network_file(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
void SIO1writeData32(unsigned long val) {}


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

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

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

LLVM IR (-O2):
define void @SIO1writeData32(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_src(char *);
void mod_handler(void) {
  write_src("{\n");
  write_src("imm_t b = POP();\n");
  write_src("imm_t a = POP();\n");
  write_src("PUSH(a%%b);\n");
  write_src("}\n");
}


x86 assembly (clang, -O0):
<mod_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedc(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee2(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee9(%rip),%rdi
call   1030 <write_src@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_handler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedf(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeeb(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeec(%rip),%rdi
pop    %rax
jmp    1030 <write_src@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [13 x i8] c"PUSH(a%%b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @mod_handler() {
%1 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @write_src(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [13 x i8] c"PUSH(a%%b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @mod_handler() {
%1 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @write_src(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}
int HelpItem89(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem89() {
ret i32 0
}
/* Variables and functions */
double mt_genrand_int32();
double mt_genrand_real2(void) {
  return mt_genrand_int32() * (1.0 / 4294967296.0);
}


x86 assembly (clang, -O0):
<mt_genrand_real2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mt_genrand_int32@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_genrand_real2>:
push   %rax
xor    %eax,%eax
call   1030 <mt_genrand_int32@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mt_genrand_real2() {
%1 = call double (...) @mt_genrand_int32()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}

LLVM IR (-O2):
define double @mt_genrand_real2() {
%1 = tail call double (...) @mt_genrand_int32()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int err = argc < 2 ? -1 : atoi(argv[1]);
  printf("returning %d\n", err);
  return err;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    114d <main+0x2d>
mov    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    115d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffff,%ebx
cmp    $0x2,%edi
jl     1136 <main+0x16>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebx
lea    0xec3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"returning %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ -1, %2 ]
%10 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 %9
}
void imx6q_cpuidle_fec_irqs_unused(void) {}


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

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

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

LLVM IR (-O2):
define void @imx6q_cpuidle_fec_irqs_unused() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ invalid_phase(char *);
void phase_2(char *input) { invalid_phase("2a"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"2a\00"
define void @phase_2(i8* nocapture readnone %0) {
%2 = tail call i32 @invalid_phase(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
void ff_hevc_put_hevc_uni_qpel_h48_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h48_12_sse4() {
ret void
}
unsigned xrop3_2_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | S;
  stk2 = ~stk2;
  stk1 = D & stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_2_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_2_1_0>:
not    %sil
or     %dil,%sil
movzbl %sil,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_2_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %5
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_2_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = xor i8 %1, -1
%4 = or i8 %3, %0
%5 = zext i8 %4 to i32
ret i32 %5
}
void history_store(const char *filename) {}


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

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

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

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


x86 assembly (clang, -O0):
<M360_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):
<M360_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"M360_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M360_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"M360_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M360_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
}
int ieee_finite(double d) {
  unsigned int *p = (unsigned int *)&d;
  return ((unsigned)((p[1] | 0x800fffff) + 1u)) >> 31u;
}


x86 assembly (clang, -O0):
<ieee_finite>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
or     $0x800fffff,%eax
add    $0x1,%eax
shr    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee_finite>:
movq   %xmm0,%rax
shr    $0x20,%rax
or     $0x800fffff,%eax
add    $0x1,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @ieee_finite(double %0) {
%2 = alloca double
%3 = alloca i32*
store double %0, double* %2
%4 = bitcast double* %2 to i32*
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = or i32 %7, -2146435073
%9 = add i32 %8, 1
%10 = lshr i32 %9, 31
ret i32 %10
}

LLVM IR (-O2):
define i32 @ieee_finite(double %0) {
%2 = bitcast double %0 to i64
%3 = lshr i64 %2, 32
%4 = trunc i64 %3 to i32
%5 = or i32 %4, -2146435073
%6 = add nsw i32 %5, 1
%7 = lshr i32 %6, 31
ret i32 %7
}
const char *str_or_nothing(const char *string) {
  if (string)
    return string;
  return "";
}


x86 assembly (clang, -O0):
<str_or_nothing>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1120 <str_or_nothing+0x20>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112b <str_or_nothing+0x2b>
lea    0xed9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @str_or_nothing(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i8*, i8** %3
store i8* %7, i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %6
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @str_or_nothing(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
double julian_ephemeris_millennium(double jce) { return (jce / 10.0); }


x86 assembly (clang, -O0):
<julian_ephemeris_millennium>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @julian_ephemeris_millennium(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+01
ret double %4
}

LLVM IR (-O2):
define double @julian_ephemeris_millennium(double %0) {
%2 = fdiv double %0, 1.000000e+01
ret double %2
}
float CG_OpFuncCompareEqual(const float a, const float b) { return (a == b); }


x86 assembly (clang, -O0):
<CG_OpFuncCompareEqual>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_OpFuncCompareEqual>:
cmpeqss %xmm1,%xmm0
movss  0xef3(%rip),%xmm1
andps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @CG_OpFuncCompareEqual(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp oeq float %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @CG_OpFuncCompareEqual(float %0, float %1) {
%3 = fcmp oeq float %0, %1
%4 = uitofp i1 %3 to float
ret float %4
}
int is_char_utf8(const char *src) {
  unsigned int ch = *(const unsigned char *)src;
  return (ch >= 0x80) && (ch <= 0xBF);
}


x86 assembly (clang, -O0):
<is_char_utf8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x80,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jb     1131 <is_char_utf8+0x31>
cmpl   $0xbf,-0xc(%rbp)
setbe  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_char_utf8>:
xor    %eax,%eax
cmpb   $0xc0,(%rdi)
setl   %al
ret

LLVM IR (-O0):
define i32 @is_char_utf8(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp uge i32 %7, 128
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp ule i32 %10, 191
br label %12
12: ; preds = %9, %1
%13 = phi i1 [ false, %1 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_char_utf8(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp slt i8 %2, -64
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int M_PI_2;
float pow(int, int);
float sin(int);
float elasticEaseInf(float p) {
  return sin(13 * M_PI_2 * p) * pow(2, 10 * (p - 1));
}


x86 assembly (clang, -O0):
<elasticEaseInf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    0x2eb4(%rip),%rax
imul   $0xd,(%rax),%eax
cvtsi2ss %eax,%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <sin@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xea9(%rip),%xmm0
subss  %xmm0,%xmm1
movss  0xe99(%rip),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elasticEaseInf>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
lea    (%rax,%rax,2),%ecx
lea    (%rax,%rcx,4),%eax
cvtsi2ss %eax,%xmm1
movss  %xmm0,(%rsp)
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
call   1030 <sin@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
addss  0xea7(%rip),%xmm0
mulss  0xea3(%rip),%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI_2 = global i32 0
define float @elasticEaseInf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load i32, i32* @M_PI_2
%4 = mul nsw i32 13, %3
%5 = sitofp i32 %4 to float
%6 = load float, float* %2
%7 = fmul float %5, %6
%8 = fptosi float %7 to i32
%9 = call float @sin(i32 %8)
%10 = load float, float* %2
%11 = fsub float %10, 1.000000e+00
%12 = fmul float 1.000000e+01, %11
%13 = fptosi float %12 to i32
%14 = call float @pow(i32 2, i32 %13)
%15 = fmul float %9, %14
ret float %15
}

LLVM IR (-O2):
@M_PI_2 = global i32 0
define float @elasticEaseInf(float %0) {
%2 = load i32, i32* @M_PI_2
%3 = mul nsw i32 %2, 13
%4 = sitofp i32 %3 to float
%5 = fmul float %4, %0
%6 = fptosi float %5 to i32
%7 = tail call float @sin(i32 %6)
%8 = fadd float %0, -1.000000e+00
%9 = fmul float %8, 1.000000e+01
%10 = fptosi float %9 to i32
%11 = tail call float @pow(i32 2, i32 %10)
%12 = fmul float %7, %11
ret float %12
}
int spaces(char a[]) {
  int count = 0;
  if (a == ' ') {
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<spaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x20,%eax
cmp    %rax,-0x8(%rbp)
jne    1127 <spaces+0x27>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spaces>:
xor    %eax,%eax
cmp    $0x20,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @spaces(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, inttoptr (i64 32 to i8*)
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
store i32 %8, i32* %3
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @spaces(i8* readnone %0) {
%2 = icmp eq i8* %0, inttoptr (i64 32 to i8*)
%3 = zext i1 %2 to i32
ret i32 %3
}