xunge/DecIR huggingface dataset:
void b_midperm_unpack(mperm, array_out) int mperm, array_out[4];
{
  perm_n_unpack(4, mperm, array_out);
  return;
}


x86 assembly (clang, -O0):
<b_midperm_unpack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x4,%edi
mov    $0x0,%al
call   1030 <perm_n_unpack@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_midperm_unpack>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x4,%edi
xor    %eax,%eax
jmp    1030 <perm_n_unpack@plt>

LLVM IR (-O0):
define void @b_midperm_unpack(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 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @perm_n_unpack to i32 (i32, i32, i32*, ...)*)(i32 4, i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @b_midperm_unpack(i32 %0, i32* %1) {
%3 = tail call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @perm_n_unpack to i32 (i32, i32, i32*, ...)*)(i32 4, i32 %0, i32* %1)
ret void
}
void gluOrtho2D(int a, int b, int c, int d) {}


x86 assembly (clang, -O0):
<gluOrtho2D>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gluOrtho2D(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @gluOrtho2D(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_queue_of_lines();
int /*<<< orphan*/ init_queue_to_mud();
int /*<<< orphan*/ init_set_of_aliases();
int /*<<< orphan*/ init_set_of_gags();
int /*<<< orphan*/ init_set_of_robot_actions();
int /*<<< orphan*/ init_variables();
int /*<<< orphan*/ setup_signals();
initialize() {
  setup_signals();
  init_variables();
  init_queue_to_mud();
  init_queue_of_lines();
  init_set_of_aliases();
  init_set_of_robot_actions();
  init_set_of_gags();
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <setup_signals@plt>
mov    $0x0,%al
call   1040 <init_variables@plt>
mov    $0x0,%al
call   1080 <init_queue_to_mud@plt>
mov    $0x0,%al
call   1090 <init_queue_of_lines@plt>
mov    $0x0,%al
call   1030 <init_set_of_aliases@plt>
mov    $0x0,%al
call   1050 <init_set_of_robot_actions@plt>
mov    $0x0,%al
call   1070 <init_set_of_gags@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
push   %rax
xor    %eax,%eax
call   1060 <setup_signals@plt>
xor    %eax,%eax
call   1040 <init_variables@plt>
xor    %eax,%eax
call   1080 <init_queue_to_mud@plt>
xor    %eax,%eax
call   1090 <init_queue_of_lines@plt>
xor    %eax,%eax
call   1030 <init_set_of_aliases@plt>
xor    %eax,%eax
call   1050 <init_set_of_robot_actions@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <init_set_of_gags@plt>

LLVM IR (-O0):
define i32 @initialize() {
%1 = alloca i32
%2 = call i32 (...) @setup_signals()
%3 = call i32 (...) @init_variables()
%4 = call i32 (...) @init_queue_to_mud()
%5 = call i32 (...) @init_queue_of_lines()
%6 = call i32 (...) @init_set_of_aliases()
%7 = call i32 (...) @init_set_of_robot_actions()
%8 = call i32 (...) @init_set_of_gags()
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @initialize() {
%1 = tail call i32 (...) @setup_signals()
%2 = tail call i32 (...) @init_variables()
%3 = tail call i32 (...) @init_queue_to_mud()
%4 = tail call i32 (...) @init_queue_of_lines()
%5 = tail call i32 (...) @init_set_of_aliases()
%6 = tail call i32 (...) @init_set_of_robot_actions()
%7 = tail call i32 (...) @init_set_of_gags()
ret i32 undef
}
/* Variables and functions */
char *strstr(char const *, char const *);
int strpos(const char *haystack, const char *needle) {
  char *p = strstr(haystack, needle);
  if (p) {
    return p - haystack;
  }
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @strpos(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
int main() {
  int i;
  goto ERROR;
  return 0;
ERROR:;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
br label %2
2: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
double cos(double);
double root1(double E, double e) { return (1. - e * cos(E)); }


x86 assembly (clang, -O0):
<root1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe9f(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<root1>:
push   %rax
movsd  %xmm1,(%rsp)
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  0xed8(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @root1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = call double @cos(double %6)
%8 = fneg double %5
%9 = call double @llvm.fmuladd.f64(double %8, double %7, double 1.000000e+00)
ret double %9
}

LLVM IR (-O2):
define double @root1(double %0, double %1) {
%3 = tail call double @cos(double %0)
%4 = fneg double %1
%5 = tail call double @llvm.fmuladd.f64(double %4, double %3, double 1.000000e+00)
ret double %5
}
void reset_string(char instr[], int array_size) {
  int j = 0;
  while (j < array_size) {
    instr[j] = 0x00;
    j++;
  }
}


x86 assembly (clang, -O0):
<reset_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <reset_string+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <reset_string+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_string>:
test   %esi,%esi
jle    1122 <reset_string+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @reset_string(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @reset_string(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fons__tmpfree(unsigned char *, void *);
void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata) {
  fons__tmpfree(bitmap, userdata);
}


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

x86 assembly (clang, -O2):
<stbtt_FreeBitmap>:
jmp    1030 <fons__tmpfree@plt>

LLVM IR (-O0):
define void @stbtt_FreeBitmap(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 @fons__tmpfree(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @stbtt_FreeBitmap(i8* %0, i8* %1) {
%3 = tail call i32 @fons__tmpfree(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sysmsg(int, char *);
void v_yell(void) { sysmsg(150, "YAAAAEEEEEEEEOOOOOOUUUUUAAAAHHHHHH!!!!!"); }


x86 assembly (clang, -O0):
<v_yell>:
push   %rbp
mov    %rsp,%rbp
mov    $0x96,%edi
lea    0xee0(%rip),%rsi
call   1030 <sysmsg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_yell>:
lea    0xee9(%rip),%rsi
mov    $0x96,%edi
jmp    1030 <sysmsg@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"YAAAAEEEEEEEEOOOOOOUUUUUAAAAHHHHHH!!!!!\00"
define void @v_yell() {
%1 = call i32 @sysmsg(i32 150, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"YAAAAEEEEEEEEOOOOOOUUUUUAAAAHHHHHH!!!!!\00"
define void @v_yell() {
%1 = tail call i32 @sysmsg(i32 150, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISLNK(int /*<<< orphan*/);
scalar_t__ lstat(char *, struct stat *);
int unary_h(char *s) {
  struct stat buf;
  if (lstat(s, &buf))
    return 0;
  return S_ISLNK(buf.st_mode);
}


x86 assembly (clang, -O0):
<unary_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <lstat@plt>
cmp    $0x0,%rax
je     114f <unary_h+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115a <unary_h+0x3a>
mov    -0x18(%rbp),%edi
call   1030 <S_ISLNK@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unary_h>:
push   %rax
mov    %rsp,%rsi
call   1040 <lstat@plt>
test   %rax,%rax
je     1132 <unary_h+0x12>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISLNK@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @unary_h(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @lstat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISLNK(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @unary_h(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISLNK(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
void XtPopdown() {}


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

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

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

LLVM IR (-O2):
define void @XtPopdown() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int avg8bt(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  uint8_t arr[10] = {1, 5, 12, 31, 643, 1, 5, 123, 312, 65};
  printf("%d\r\n", avg8bt(arr, 10));
  return (1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <avg8bt@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <avg8bt@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [10 x i32] [i32 1, i32 5, i32 12, i32 31, i32 643, i32 1, i32 5, i32 123, i32 312, i32 65]
@.str = [5 x i8] c"%d\0D\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @avg8bt(i32* %4, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 1
}

LLVM IR (-O2):
@__const.main.arr = [10 x i32] [i32 1, i32 5, i32 12, i32 31, i32 643, i32 1, i32 5, i32 123, i32 312, i32 65]
@.str = [5 x i8] c"%d\0D\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @avg8bt(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 1
}
/* Variables and functions */
scalar_t__ atoi(char *);
scalar_t__ ifunc();
int main(int argc, char **argv) {
  if (argc != 2)
    return 1;
  return ifunc() != atoi(argv[1]);
}


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)
je     114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1179 <main+0x59>
mov    $0x0,%al
call   1030 <ifunc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x2,%edi
jne    1156 <main+0x36>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <ifunc@plt>
mov    %rax,%r14
mov    0x8(%rbx),%rdi
call   1040 <atoi@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%r14
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %17
9: ; preds = %2
%10 = call i64 (...) @ifunc()
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @atoi(i8* %13)
%15 = icmp ne i64 %10, %14
%16 = zext i1 %15 to i32
store i32 %16, i32* %3
br label %17
17: ; preds = %9, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = tail call i64 (...) @ifunc()
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i64 @atoi(i8* %7)
%9 = icmp ne i64 %5, %8
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %2, %4
%12 = phi i32 [ %10, %4 ], [ 1, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ strchr(char const *, char const);
size_t strspn(const char *str1, const char *str2) {
  size_t i = 0;
  for (; str1[i]; ++i) {
    if (!strchr(str2, str1[i]))
      break;
  }
  return i;
}


x86 assembly (clang, -O0):
<strspn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1173 <strspn+0x63>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
call   1030 <strchr@plt>
cmp    $0x0,%eax
jne    115d <strspn+0x4d>
jmp    1173 <strspn+0x63>
jmp    1162 <strspn+0x52>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <strspn+0x18>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strspn>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     114f <strspn+0x3f>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <strchr@plt>
test   %eax,%eax
je     1151 <strspn+0x41>
movzbl 0x1(%r15,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strspn+0x20>
jmp    1151 <strspn+0x41>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @strspn(i8* nocapture %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %13, %10 ], [ %3, %2 ]
%7 = phi i64 [ %11, %10 ], [ 0, %2 ]
%8 = tail call i32 @strchr(i8* %1, i8 signext %6)
%9 = icmp eq i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %5
%11 = add i64 %7, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %10, %5, %2
%16 = phi i64 [ 0, %2 ], [ %7, %5 ], [ %11, %10 ]
ret i64 %16
}
double f_prime(double x) {
  double y;
  y = 3 * (x - 1) * (x - 1);
  return y;
}


x86 assembly (clang, -O0):
<f_prime>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xeea(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xecd(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_prime>:
addsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f_prime(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double %4, 1.000000e+00
%6 = fmul double 3.000000e+00, %5
%7 = load double, double* %2
%8 = fsub double %7, 1.000000e+00
%9 = fmul double %6, %8
store double %9, double* %3
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
define double @f_prime(double %0) {
%2 = fadd double %0, -1.000000e+00
%3 = fmul double %2, 3.000000e+00
%4 = fmul double %2, %3
ret double %4
}
redmacwrap() {}


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

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

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

LLVM IR (-O2):
define i32 @redmacwrap() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ GPIO1_Combined_16_31_DriverIRQHandler();
__attribute__((weak)) void GPIO1_Combined_16_31_IRQHandler(void) {
  GPIO1_Combined_16_31_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @GPIO1_Combined_16_31_IRQHandler() {
%1 = call i32 (...) @GPIO1_Combined_16_31_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @GPIO1_Combined_16_31_IRQHandler() {
%1 = tail call i32 (...) @GPIO1_Combined_16_31_DriverIRQHandler()
ret void
}
unsigned long UARTModemStatusGet(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x00000018))) & (0x00000001));
}


x86 assembly (clang, -O0):
<UARTModemStatusGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemStatusGet>:
mov    0x18(%rdi),%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @UARTModemStatusGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 24
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 1
ret i64 %7
}

LLVM IR (-O2):
define i64 @UARTModemStatusGet(i64 %0) {
%2 = add i64 %0, 24
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, 1
ret i64 %5
}
/* Variables and functions */
char *kalloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *strdup(char const *str) {
  size_t len;
  char *out;
  len = strlen(str);
  out = kalloc(len + 1);
  memcpy(out, str, len);
  *(out + len) = '\0';
  return (out);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <kalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1040 <kalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i8* @kalloc(i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = load i64, i64* %3
%13 = call i32 @memcpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %4
%15 = load i64, i64* %3
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @kalloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %2)
%6 = getelementptr inbounds i8, i8* %4, i64 %2
store i8 0, i8* %6
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ crc64_jones_refl_base(int /*<<< orphan*/,
                                         int /*<<< orphan*/ const *,
                                         int /*<<< orphan*/);
uint64_t crc64_jones_refl(uint64_t seed, const uint8_t *buf, uint64_t len) {
  return crc64_jones_refl_base(seed, buf, len);
}


x86 assembly (clang, -O0):
<crc64_jones_refl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <crc64_jones_refl_base@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc64_jones_refl>:
jmp    1030 <crc64_jones_refl_base@plt>

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

LLVM IR (-O2):
define i32 @crc64_jones_refl(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @crc64_jones_refl_base(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int c(int);
int b(int val) { return c(val); }


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

x86 assembly (clang, -O2):
<b>:
jmp    1030 <c@plt>

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

LLVM IR (-O2):
define i32 @b(i32 %0) {
%2 = tail call i32 @c(i32 %0)
ret i32 %2
}
/* Variables and functions */
int f(unsigned int);
unsigned g(unsigned i) { return f(i) + 3; }


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

x86 assembly (clang, -O2):
<g>:
push   %rax
call   1030 <f@plt>
add    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @f(i32 %3)
%5 = add nsw i32 %4, 3
ret i32 %5
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = tail call i32 @f(i32 %0)
%3 = add nsw i32 %2, 3
ret i32 %3
}
/* Variables and functions */
scalar_t__ malloc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *v = (char *)malloc(0);
  printf("%p\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <malloc@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 0)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
unsigned long HibernateRTCGet(void) {
  return ((*((volatile unsigned long *)(0x400FC000))));
}


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

x86 assembly (clang, -O2):
<HibernateRTCGet>:
mov    0x400fc000,%rax
40
ret

LLVM IR (-O0):
define i64 @HibernateRTCGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074774016 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @HibernateRTCGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074774016 to i64*)
ret i64 %1
}
float cosf(float x) {
  float xsquare = x * x;
  return 1 - xsquare / 2 + xsquare * xsquare / 24 -
         xsquare * xsquare * xsquare / 720 +
         xsquare * xsquare * xsquare * xsquare / 40320;
}


x86 assembly (clang, -O0):
<cosf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  0xeeb(%rip),%xmm0
divss  %xmm0,%xmm1
movss  0xedb(%rip),%xmm0
subss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
movss  0xec1(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
movss  0xe9e(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
movss  0xe76(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosf>:
mulss  %xmm0,%xmm0
movss  0xef4(%rip),%xmm2
mulss  %xmm0,%xmm2
addss  0xeec(%rip),%xmm2
movaps %xmm0,%xmm3
mulss  %xmm0,%xmm3
movaps %xmm0,%xmm1
mulss  %xmm3,%xmm1
divss  0xeda(%rip),%xmm3
mulss  %xmm1,%xmm0
unpcklps %xmm0,%xmm1
divps  0xed4(%rip),%xmm1
addss  %xmm2,%xmm3
subss  %xmm1,%xmm3
shufps $0x55,%xmm1,%xmm1
addss  %xmm3,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @cosf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fmul float %4, %5
store float %6, float* %3
%7 = load float, float* %3
%8 = fdiv float %7, 2.000000e+00
%9 = fsub float 1.000000e+00, %8
%10 = load float, float* %3
%11 = load float, float* %3
%12 = fmul float %10, %11
%13 = fdiv float %12, 2.400000e+01
%14 = fadd float %9, %13
%15 = load float, float* %3
%16 = load float, float* %3
%17 = fmul float %15, %16
%18 = load float, float* %3
%19 = fmul float %17, %18
%20 = fdiv float %19, 7.200000e+02
%21 = fsub float %14, %20
%22 = load float, float* %3
%23 = load float, float* %3
%24 = fmul float %22, %23
%25 = load float, float* %3
%26 = fmul float %24, %25
%27 = load float, float* %3
%28 = fmul float %26, %27
%29 = fdiv float %28, 4.032000e+04
%30 = fadd float %21, %29
ret float %30
}

LLVM IR (-O2):
define float @cosf(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %2, 5.000000e-01
%4 = fsub float 1.000000e+00, %3
%5 = fmul float %2, %2
%6 = fdiv float %5, 2.400000e+01
%7 = fadd float %4, %6
%8 = fmul float %2, %5
%9 = fmul float %2, %8
%10 = insertelement <2 x float> poison, float %8, i64 0
%11 = insertelement <2 x float> %10, float %9, i64 1
%12 = fdiv <2 x float> %11, <float 7.200000e+02, float 4.032000e+04>
%13 = extractelement <2 x float> %12, i64 0
%14 = fsub float %7, %13
%15 = extractelement <2 x float> %12, i64 1
%16 = fadd float %14, %15
ret float %16
}
/* Variables and functions */
scalar_t__ isNumericOk(char *, int, int);
int /*<<< orphan*/ setConfigTextValue(char *, char *);
int updateRssFreq(char *value) {
  if (isNumericOk(value, 1, 2)) {
    setConfigTextValue("web.rss.freq", value);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<updateRssFreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1040 <isNumericOk@plt>
cmp    $0x0,%rax
je     1165 <updateRssFreq+0x45>
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1030 <setConfigTextValue@plt>
movl   $0x1,-0x4(%rbp)
jmp    116c <updateRssFreq+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateRssFreq>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x1,%ebp
mov    $0x1,%esi
mov    $0x2,%edx
call   1040 <isNumericOk@plt>
test   %rax,%rax
je     1150 <updateRssFreq+0x30>
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
call   1030 <setConfigTextValue@plt>
jmp    1152 <updateRssFreq+0x32>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"web.rss.freq\00"
define i32 @updateRssFreq(i8* %0) {
%2 = tail call i64 @isNumericOk(i8* %0, i32 1, i32 2)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @setConfigTextValue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *app_name) {
  printf("%s -i <input file> -n <number of words to show>\n", app_name);
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"%s -i <input file> -n <number of words to show>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"%s -i <input file> -n <number of words to show>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Teapot_LowLevel_DisableVertexAttributes(int, int);
int /*<<< orphan*/ Teapot_LowLevel_UnbindVertexBufferObject();
void Teapot_LowLevel_UnbindVertexBufferObjectAndDisableVertexAttributes(
    int disableVertexAttribArray, int disableNormalAttribArray) {
  Teapot_LowLevel_UnbindVertexBufferObject();
  Teapot_LowLevel_DisableVertexAttributes(disableVertexAttribArray,
                                          disableNormalAttribArray);
}


x86 assembly (clang, -O0):
<Teapot_LowLevel_UnbindVertexBufferObjectAndDisableVertexAttributes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <Teapot_LowLevel_UnbindVertexBufferObject@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <Teapot_LowLevel_DisableVertexAttributes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Teapot_LowLevel_UnbindVertexBufferObjectAndDisableVertexAttributes>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <Teapot_LowLevel_UnbindVertexBufferObject@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <Teapot_LowLevel_DisableVertexAttributes@plt>

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

LLVM IR (-O2):
define void @Teapot_LowLevel_UnbindVertexBufferObjectAndDisableVertexAttributes(i32 %0, i32 %1) {
%3 = tail call i32 (...) @Teapot_LowLevel_UnbindVertexBufferObject()
%4 = tail call i32 @Teapot_LowLevel_DisableVertexAttributes(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int __isascii_impl(int);
int isascii(int c) { return __isascii_impl(c); }


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

x86 assembly (clang, -O2):
<isascii>:
jmp    1030 <__isascii_impl@plt>

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

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = tail call i32 @__isascii_impl(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void printKingRectSize(char *sq, int32_t size) {
  printf("{\"square\": \"%s\", \"rectangleSize\": %d}\n", sq, size);
}


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

x86 assembly (clang, -O2):
<printKingRectSize>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"{\22square\22: \22%s\22, \22rectangleSize\22: %d}\0A\00"
define void @printKingRectSize(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"{\22square\22: \22%s\22, \22rectangleSize\22: %d}\0A\00"
define void @printKingRectSize(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
void kmap_local_fork(struct task_struct *tsk) {}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @kmap_local_fork(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @kmap_local_fork(%struct.task_struct* nocapture %0) {
ret void
}
int compare(const void *a, const void *b) {
  return (*(float *)b - *(float *)a);
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subss  (%rax),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
movss  (%rsi),%xmm0
subss  (%rdi),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to float*
%7 = load float, float* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
%11 = fsub float %7, %10
%12 = fptosi float %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to float*
%4 = load float, float* %3
%5 = bitcast i8* %0 to float*
%6 = load float, float* %5
%7 = fsub float %4, %6
%8 = fptosi float %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ srand48(int);
void bench_srand(int seed) { srand48(seed); }


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

x86 assembly (clang, -O2):
<bench_srand>:
jmp    1030 <srand48@plt>

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

LLVM IR (-O2):
define void @bench_srand(i32 %0) {
%2 = tail call i32 @srand48(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void set_current_tm(struct tm *ts) {
  time_t ltime = time(NULL);
  *ts = *localtime(&ltime);
}


x86 assembly (clang, -O0):
<set_current_tm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    (%rcx),%ecx
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_current_tm>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @set_current_tm(%struct.tm* %0) {
%2 = alloca %struct.tm*
%3 = alloca i32
store %struct.tm* %0, %struct.tm** %2
%4 = call i32 @time(i32* null)
store i32 %4, i32* %3
%5 = load %struct.tm*, %struct.tm** %2
%6 = call %struct.tm* @localtime(i32* %3)
%7 = bitcast %struct.tm* %5 to i8*
%8 = bitcast %struct.tm* %6 to i8*
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @set_current_tm(%struct.tm* nocapture writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = call %struct.tm* @localtime(i32* %2)
%6 = getelementptr %struct.tm, %struct.tm* %5, i64 0, i32 0
%7 = getelementptr %struct.tm, %struct.tm* %0, i64 0, i32 0
%8 = load i32, i32* %6
store i32 %8, i32* %7
ret void
}
void mlx5e_ipsec_cleanup(struct mlx5e_priv *priv) {}


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

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

LLVM IR (-O0):
%struct.mlx5e_priv = type opaque
define void @mlx5e_ipsec_cleanup(%struct.mlx5e_priv* %0) {
%2 = alloca %struct.mlx5e_priv*
store %struct.mlx5e_priv* %0, %struct.mlx5e_priv** %2
ret void
}

LLVM IR (-O2):
%struct.mlx5e_priv = type opaque
define void @mlx5e_ipsec_cleanup(%struct.mlx5e_priv* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_send(int, char *);
int /*<<< orphan*/ send_idlist(int, char *);
void japi_deactivate_grammar(int sd, char *idlist) {
  do_send(sd, "DEACTIVATEGRAM\n");
  send_idlist(sd, idlist);
}


x86 assembly (clang, -O0):
<japi_deactivate_grammar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    0xec7(%rip),%rsi
call   1040 <do_send@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <send_idlist@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<japi_deactivate_grammar>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed1(%rip),%rsi
call   1040 <do_send@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <send_idlist@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"DEACTIVATEGRAM\0A\00"
define void @japi_deactivate_grammar(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @do_send(i32 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @send_idlist(i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"DEACTIVATEGRAM\0A\00"
define void @japi_deactivate_grammar(i32 %0, i8* %1) {
%3 = tail call i32 @do_send(i32 %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @send_idlist(i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int testFile(char const *);
int main(int argc, const char *argv[]) {
  int resultCode = testFile(argv[1]);
  if (resultCode > 0)
    return 0;
  if (resultCode <= 0)
    return 1;
  return resultCode;
}


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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <testFile@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    114c <main+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1168 <main+0x58>
cmpl   $0x0,-0x14(%rbp)
jg     1162 <main+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1168 <main+0x58>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <testFile@plt>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @testFile(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 0, i32* %3
br label %20
14: ; preds = %2
%15 = load i32, i32* %6
%16 = icmp sle i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 1, i32* %3
br label %20
18: ; preds = %14
%19 = load i32, i32* %6
store i32 %19, i32* %3
br label %20
20: ; preds = %18, %17, %13
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @testFile(i8* %4)
%6 = icmp slt i32 %5, 1
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int mkstemp(char *);
int /*<<< orphan*/ perror(char *);
int gt_xmkstemp(char *temp) {
  int fd;
  if ((fd = mkstemp(temp)) == -1) {
    perror("cannot mkstemp");
    exit(EXIT_FAILURE);
  }
  return fd;
}


x86 assembly (clang, -O0):
<gt_xmkstemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mkstemp@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    116b <gt_xmkstemp+0x3b>
lea    0xea8(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_xmkstemp>:
push   %rax
call   1030 <mkstemp@plt>
cmp    $0xffffffff,%eax
je     113d <gt_xmkstemp+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"cannot mkstemp\00"
@EXIT_FAILURE = global i32 0
define i32 @gt_xmkstemp(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @mkstemp(i8* %4)
store i32 %5, i32* %3
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [15 x i8] c"cannot mkstemp\00"
@EXIT_FAILURE = global i32 0
define i32 @gt_xmkstemp(i8* %0) {
%2 = tail call i32 @mkstemp(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i32 %2
}