xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned long INT_MAX;
int CLIP_TO_INT(unsigned long size) {
  return size >= INT_MAX ? INT_MAX : (int)size;
}


x86 assembly (clang, -O0):
<CLIP_TO_INT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ed5(%rip),%rcx
cmp    (%rcx),%rax
jb     112f <CLIP_TO_INT+0x2f>
mov    0x2ec5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    1139 <CLIP_TO_INT+0x39>
mov    -0x8(%rbp),%rax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CLIP_TO_INT>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
cmp    %rdi,%rax
cmova  %edi,%eax
ret

LLVM IR (-O0):
@INT_MAX = global i64 0
define i32 @CLIP_TO_INT(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @INT_MAX
%5 = icmp uge i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i64, i64* @INT_MAX
br label %12
8: ; preds = %1
%9 = load i64, i64* %2
%10 = trunc i64 %9 to i32
%11 = sext i32 %10 to i64
br label %12
12: ; preds = %8, %6
%13 = phi i64 [ %7, %6 ], [ %11, %8 ]
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@INT_MAX = global i64 0
define i32 @CLIP_TO_INT(i64 %0) {
%2 = load i64, i64* @INT_MAX
%3 = icmp ugt i64 %2, %0
%4 = select i1 %3, i64 %0, i64 %2
%5 = trunc i64 %4 to i32
ret i32 %5
}
int Root(int Child) { return (Child - 1) / 2; }


x86 assembly (clang, -O0):
<Root>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<Root>:
mov    %edi,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xffffffff,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @Root(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sdiv i32 %2, 2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ *newwin(unsigned int const, unsigned int const,
                           unsigned int const, unsigned int const);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
WINDOW *create_win(const unsigned int h, const unsigned int w,
                   const unsigned int y, const unsigned int x) {
  WINDOW *win = newwin(h, w, y, x);
  box(win, 0, 0);
  refresh();
  wrefresh(win);
  return win;
}


x86 assembly (clang, -O0):
<create_win>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <newwin@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <box@plt>
mov    $0x0,%al
call   1060 <refresh@plt>
mov    -0x18(%rbp),%rdi
call   1030 <wrefresh@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_win>:
push   %rbx
call   1040 <newwin@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <box@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    %rbx,%rdi
call   1030 <wrefresh@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @create_win(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32* @newwin(i32 %10, i32 %11, i32 %12, i32 %13)
store i32* %14, i32** %9
%15 = load i32*, i32** %9
%16 = call i32 @box(i32* %15, i32 0, i32 0)
%17 = call i32 (...) @refresh()
%18 = load i32*, i32** %9
%19 = call i32 @wrefresh(i32* %18)
%20 = load i32*, i32** %9
ret i32* %20
}

LLVM IR (-O2):
define i32* @create_win(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32* @newwin(i32 %0, i32 %1, i32 %2, i32 %3)
%6 = tail call i32 @box(i32* %5, i32 0, i32 0)
%7 = tail call i32 (...) @refresh()
%8 = tail call i32 @wrefresh(i32* %5)
ret i32* %5
}
/* Variables and functions */
int toupper(char);
int ahtoi(char ch) {
  int tmp;
  tmp = toupper(ch);
  tmp = (ch - '0');
  if (tmp > 9)
    tmp = (tmp - 7);
  return tmp;
}


x86 assembly (clang, -O0):
<ahtoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jle    1147 <ahtoi+0x37>
mov    -0x8(%rbp),%eax
sub    $0x7,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ahtoi>:
push   %rbx
mov    %edi,%ebx
call   1030 <toupper@plt>
lea    -0x30(%rbx),%ecx
mov    %ebx,%eax
add    $0xffffffc9,%eax
cmp    $0x3a,%bl
cmovl  %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ahtoi(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i32 @toupper(i8 signext %4)
store i32 %5, i32* %3
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = sub nsw i32 %7, 48
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 9
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 7
store i32 %13, i32* %3
br label %14
14: ; preds = %11, %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @ahtoi(i8 signext %0) {
%2 = tail call i32 @toupper(i8 signext %0)
%3 = sext i8 %0 to i32
%4 = icmp sgt i8 %0, 57
%5 = select i1 %4, i32 -55, i32 -48
%6 = add nsw i32 %5, %3
ret i32 %6
}
int main(void) {
  typedef int boolean;
  const boolean false = 0;
  const boolean true = 1;
  boolean b = 5 > 7;
  printf("b = %s\n", b ? "true" : "false");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
lea    0xed6(%rip),%rsi
lea    0xeca(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"b = %s\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"b = %s\0A\00"
@.str.2 = [6 x i8] c"false\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t write_FP_BE(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, int);
size_t uint32WriteToFP(FILE *fp, const uint32_t *data) {
  return write_FP_BE(fp, data, sizeof(uint32_t));
}


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

x86 assembly (clang, -O2):
<uint32WriteToFP>:
mov    $0x4,%edx
jmp    1030 <write_FP_BE@plt>

LLVM IR (-O0):
define i64 @uint32WriteToFP(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 i64 @write_FP_BE(i32* %5, i32* %6, i32 4)
ret i64 %7
}

LLVM IR (-O2):
define i64 @uint32WriteToFP(i32* %0, i32* %1) {
%3 = tail call i64 @write_FP_BE(i32* %0, i32* %1, i32 4)
ret i64 %3
}
/* Variables and functions */
int foo();
int firstuse(void) {
  int tmp;
  {
    tmp = foo();
    return (tmp);
  }
}


x86 assembly (clang, -O0):
<firstuse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <foo@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @firstuse() {
%1 = alloca i32
%2 = call i32 (...) @foo()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @firstuse() {
%1 = tail call i32 (...) @foo()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int get_amount_of_rows(FILE *_fp) {
  int ch = 0;
  int lines = 0;
  if (_fp == NULL)
    ;
  return 0;
  lines++;
  while (!feof(_fp)) {
    ch = fgetc(_fp);
    if (ch == '\n') {
      lines++;
    }
  }
  return lines;
}


x86 assembly (clang, -O0):
<get_amount_of_rows>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1126 <get_amount_of_rows+0x26>
jmp    1126 <get_amount_of_rows+0x26>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @get_amount_of_rows(i32* nocapture readnone %0) {
ret i32 0
}
int ls_cost_nm4_n_in(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @ls_cost_nm4_n_in() {
ret i32 2
}

LLVM IR (-O2):
define i32 @ls_cost_nm4_n_in() {
ret i32 2
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ in;

/* Variables and functions */
uint64_t FROM_BE64(uint64_t in) {
  unsigned char *pin = (unsigned char *)&in;
  uint64_t out;
  int i;
  for (i = 0, out = 0; i < sizeof(in); ++i)
    out = (out << 8) + pin[i];
  return out;
}


x86 assembly (clang, -O0):
<FROM_BE64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x18(%rbp),%rax
cmp    $0x4,%rax
jae    1150 <FROM_BE64+0x50>
mov    -0x14(%rbp),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111d <FROM_BE64+0x1d>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @FROM_BE64(i32 %0) {
%2 = call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
double erfinv(double);
double sqrt(double);
double phiinv(double x) {
  double val, tmp;
  int ind;
  ind = 1;
  tmp = 2.0 * x - 1.0;
  val = sqrt(2.0) * erfinv(tmp);
  return val;
}


x86 assembly (clang, -O0):
<phiinv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movl   $0x1,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xec3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeaa(%rip),%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <erfinv@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phiinv>:
push   %rax
addsd  %xmm0,%xmm0
addsd  0xee3(%rip),%xmm0
call   1030 <erfinv@plt>
mulsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @phiinv(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %2
store i32 1, i32* %5
%6 = load double, double* %2
%7 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %6, double -1.000000e+00)
store double %7, double* %4
%8 = call double @sqrt(double 2.000000e+00)
%9 = load double, double* %4
%10 = call double @erfinv(double %9)
%11 = fmul double %8, %10
store double %11, double* %3
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
define double @phiinv(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double -1.000000e+00)
%3 = tail call double @erfinv(double %2)
%4 = fmul double %3, 0x3FF6A09E667F3BCD
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int dbg_cpu1_read_ctrl(uint32_t adr, unsigned char *data) { return 0; }


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

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

LLVM IR (-O0):
define i32 @dbg_cpu1_read_ctrl(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @dbg_cpu1_read_ctrl(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int main() { f(0xffffff01); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffff01,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 -255)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 -255)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void shutdownHaskellAndExit(int exitCode, int fastExit) {
  __coverity_panic__();
}


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

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

LLVM IR (-O0):
define void @shutdownHaskellAndExit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @__coverity_panic__()
ret void
}

LLVM IR (-O2):
define void @shutdownHaskellAndExit(i32 %0, i32 %1) {
%3 = tail call i32 (...) @__coverity_panic__()
ret void
}
int dayOfWeek(unsigned day, unsigned month, unsigned year) {
  if (month < 3) {
    month += 12;
    year -= 1;
  }
  return (((((13 * month) + 3) / 5) + day + year + (year / 4) - (year / 100) +
           (year / 400)) %
          7);
}


x86 assembly (clang, -O0):
<dayOfWeek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x3,-0x8(%rbp)
jae    1129 <dayOfWeek+0x29>
mov    -0x8(%rbp),%eax
add    $0xc,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
imul   $0xd,-0x8(%rbp),%eax
add    $0x3,%eax
mov    $0x5,%ecx
xor    %edx,%edx
div    %ecx
add    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    $0x7,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dayOfWeek>:
lea    0xc(%rsi),%eax
cmp    $0x3,%esi
cmovae %esi,%eax
sbb    $0x0,%edx
lea    (%rax,%rax,2),%ecx
lea    (%rax,%rcx,4),%eax
add    $0x3,%eax
mov    $0xcccccccd,%ecx
imul   %rax,%rcx
shr    $0x22,%rcx
imul   $0x51eb851f,%rdx,%rax
lea    (%rdx,%rdi,1),%esi
shr    $0x2,%edx
mov    %rax,%rdi
shr    $0x25,%rdi
shr    $0x27,%rax
add    %esi,%edx
sub    %edi,%edx
add    %eax,%edx
add    %ecx,%edx
imul   $0x24924925,%rdx,%rcx
shr    $0x20,%rcx
mov    %edx,%eax
sub    %ecx,%eax
shr    %eax
add    %ecx,%eax
shr    $0x2,%eax
lea    0x0(,%rax,8),%ecx
sub    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @dayOfWeek(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* %5
%8 = icmp ult i32 %7, 3
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i32, i32* %5
%11 = add i32 %10, 12
store i32 %11, i32* %5
%12 = load i32, i32* %6
%13 = sub i32 %12, 1
store i32 %13, i32* %6
br label %14
14: ; preds = %9, %3
%15 = load i32, i32* %5
%16 = mul i32 13, %15
%17 = add i32 %16, 3
%18 = udiv i32 %17, 5
%19 = load i32, i32* %4
%20 = add i32 %18, %19
%21 = load i32, i32* %6
%22 = add i32 %20, %21
%23 = load i32, i32* %6
%24 = udiv i32 %23, 4
%25 = add i32 %22, %24
%26 = load i32, i32* %6
%27 = udiv i32 %26, 100
%28 = sub i32 %25, %27
%29 = load i32, i32* %6
%30 = udiv i32 %29, 400
%31 = add i32 %28, %30
%32 = urem i32 %31, 7
ret i32 %32
}

LLVM IR (-O2):
define i32 @dayOfWeek(i32 %0, i32 %1, i32 %2) {
%4 = icmp ult i32 %1, 3
%5 = add i32 %1, 12
%6 = select i1 %4, i32 %5, i32 %1
%7 = sext i1 %4 to i32
%8 = add i32 %7, %2
%9 = mul i32 %6, 13
%10 = add i32 %9, 3
%11 = udiv i32 %10, 5
%12 = lshr i32 %8, 2
%13 = udiv i32 %8, 100
%14 = udiv i32 %8, 400
%15 = add i32 %8, %0
%16 = add i32 %15, %12
%17 = sub i32 %16, %13
%18 = add i32 %17, %14
%19 = add i32 %18, %11
%20 = urem i32 %19, 7
ret i32 %20
}
/* Variables and functions */
double __nv_dmul_rd(double, double);
double __dmul_rd(double __a, double __b) { return __nv_dmul_rd(__a, __b); }


x86 assembly (clang, -O0):
<__dmul_rd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__nv_dmul_rd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dmul_rd>:
jmp    1030 <__nv_dmul_rd@plt>

LLVM IR (-O0):
define double @__dmul_rd(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @__nv_dmul_rd(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @__dmul_rd(double %0, double %1) {
%3 = tail call double @__nv_dmul_rd(double %0, double %1)
ret double %3
}
/* Variables and functions */
size_t CountBitsInInt(void) {
  size_t count = 0;
  unsigned int bits = (unsigned int)-1;
  while (bits > 0) {
    bits >>= 1;
    ++count;
  }
  return count;
}


x86 assembly (clang, -O0):
<CountBitsInInt>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    1137 <CountBitsInInt+0x37>
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <CountBitsInInt+0x13>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @CountBitsInInt() {
ret i64 32
}
void imx6q_pm_init(void) {}


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

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

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

LLVM IR (-O2):
define void @imx6q_pm_init() {
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ usleep(int);
void wait(int max_delay) { usleep(rand() % max_delay); }


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%edi
pop    %rbx
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @wait(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
%6 = call i32 @usleep(i32 %5)
ret void
}

LLVM IR (-O2):
define void @wait(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
%4 = tail call i32 @usleep(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void reclaim(void *space_to_reclaim) {
  if (space_to_reclaim != NULL)
    free(space_to_reclaim);
  return;
}


x86 assembly (clang, -O0):
<reclaim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <reclaim+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @reclaim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @reclaim(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *argv0) {
  printf("usage: %s [-p socket]\n", argv0);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"usage: %s [-p socket]\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 ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"usage: %s [-p socket]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int hugo_getkey();
int hugo_waitforkey(void) { return hugo_getkey(); }


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

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

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

LLVM IR (-O2):
define i32 @hugo_waitforkey() {
%1 = tail call i32 (...) @hugo_getkey()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  int i;
  printf("%ld\n", (long)getpid());
  fflush(stdout);
  for (i = 0; i < 60; i++)
    sleep(10);
  return 0;
}


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    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,%rsi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x3c,-0x14(%rbp)
jge    11a3 <main+0x63>
mov    $0xa,%edi
call   1060 <sleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1181 <main+0x41>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x3c,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1060 <sleep@plt>
add    $0xffffffff,%ebx
jne    1170 <main+0x30>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
@stdout = global i32 0
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 = call i64 (...) @getpid()
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = load i32, i32* @stdout
%10 = call i32 @fflush(i32 %9)
store i32 0, i32* %6
br label %11
11: ; preds = %16, %2
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 60
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = call i32 @sleep(i32 10)
br label %16
16: ; preds = %14
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %11
19: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
br label %7
7: ; preds = %2, %7
%8 = phi i32 [ 0, %2 ], [ %10, %7 ]
%9 = tail call i32 @sleep(i32 10)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, 60
br i1 %11, label %12, label %7
12: ; preds = %7
ret i32 0
}
/* Variables and functions */
float __rsign(float, float);
float intr_wrap_458(float p1, float p2) { return __rsign(p1, p2); }


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

x86 assembly (clang, -O2):
<intr_wrap_458>:
jmp    1030 <__rsign@plt>

LLVM IR (-O0):
define float @intr_wrap_458(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @__rsign(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @intr_wrap_458(float %0, float %1) {
%3 = tail call float @__rsign(float %0, float %1)
ret float %3
}
/* Variables and functions */
scalar_t__ strcasecmp(char const *, char const *);
int eq_case_insensitive(const char *k1, const char *k2) {
  return strcasecmp(k1, k2) == 0;
}


x86 assembly (clang, -O0):
<eq_case_insensitive>:
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 <strcasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq_case_insensitive>:
push   %rax
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @eq_case_insensitive(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 i64 @strcasecmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @eq_case_insensitive(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strcasecmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
void *m(size_t);
void *n1(size_t n) { return m(n); }


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

x86 assembly (clang, -O2):
<n1>:
jmp    1030 <m@plt>

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

LLVM IR (-O2):
define i8* @n1(i64 %0) {
%2 = tail call i8* @m(i64 %0)
ret i8* %2
}
void outnstr(s) char *s;
{
  outstr(s);
  outnl();
}


x86 assembly (clang, -O0):
<outnstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <outstr@plt>
mov    $0x0,%al
call   1040 <outnl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outnstr>:
push   %rax
xor    %eax,%eax
call   1030 <outstr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <outnl@plt>

LLVM IR (-O0):
define void @outnstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %3)
%5 = call i32 (...) @outnl()
ret void
}

LLVM IR (-O2):
define void @outnstr(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (...) @outnl()
ret void
}
int nand_onchip_read_oob_ecc(struct mtd_info *mtd, struct nand_chip *chip,
                             int page, int sndcmd) {
  return -1;
}


x86 assembly (clang, -O0):
<nand_onchip_read_oob_ecc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mtd_info = type opaque
%struct.nand_chip = type opaque
define i32 @nand_onchip_read_oob_ecc(%struct.mtd_info* %0, %struct.nand_chip* %1, i32 %2, i32 %3) {
%5 = alloca %struct.mtd_info*
%6 = alloca %struct.nand_chip*
%7 = alloca i32
%8 = alloca i32
store %struct.mtd_info* %0, %struct.mtd_info** %5
store %struct.nand_chip* %1, %struct.nand_chip** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 -1
}

LLVM IR (-O2):
%struct.mtd_info = type opaque
%struct.nand_chip = type opaque
define i32 @nand_onchip_read_oob_ecc(%struct.mtd_info* nocapture readnone %0, %struct.nand_chip* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 -1
}
void XcmsScreenNumberOfCCC() {}


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

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

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

LLVM IR (-O2):
define void @XcmsScreenNumberOfCCC() {
ret void
}
/* Variables and functions */
size_t strnlen(const char *str, size_t count) {
  size_t ret;
  for (ret = 0; *str != '\0' && ret < count; ret++, str++)
    ;
  return ret;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1137 <strnlen+0x37>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1147 <strnlen+0x47>
jmp    1169 <strnlen+0x69>
jmp    114c <strnlen+0x4c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
je     1136 <strnlen+0x36>
test   %rsi,%rsi
je     1136 <strnlen+0x36>
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,(%rdi,%rcx,1)
je     1132 <strnlen+0x32>
cmp    %rsi,%rcx
mov    %rax,%rcx
jb     1120 <strnlen+0x20>
add    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp ne i8 %3, 0
%5 = icmp ne i64 %1, 0
%6 = and i1 %4, %5
br i1 %6, label %7, label %16
7: ; preds = %2, %7
%8 = phi i64 [ %10, %7 ], [ 0, %2 ]
%9 = phi i8* [ %11, %7 ], [ %0, %2 ]
%10 = add nuw i64 %8, 1
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
%14 = icmp ult i64 %10, %1
%15 = select i1 %13, i1 %14, i1 false
br i1 %15, label %7, label %16
16: ; preds = %7, %2
%17 = phi i64 [ 0, %2 ], [ %10, %7 ]
ret i64 %17
}
/* Variables and functions */
int /*<<< orphan*/ pic32_erase_device();
int /*<<< orphan*/ pic32_program_verify();
int /*<<< orphan*/ pic32_standby();
void pic32_bulk_erase(void) {
  pic32_program_verify();
  pic32_erase_device();
  pic32_standby();
}


x86 assembly (clang, -O0):
<pic32_bulk_erase>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <pic32_program_verify@plt>
mov    $0x0,%al
call   1050 <pic32_erase_device@plt>
mov    $0x0,%al
call   1030 <pic32_standby@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic32_bulk_erase>:
push   %rax
xor    %eax,%eax
call   1040 <pic32_program_verify@plt>
xor    %eax,%eax
call   1050 <pic32_erase_device@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <pic32_standby@plt>

LLVM IR (-O0):
define void @pic32_bulk_erase() {
%1 = call i32 (...) @pic32_program_verify()
%2 = call i32 (...) @pic32_erase_device()
%3 = call i32 (...) @pic32_standby()
ret void
}

LLVM IR (-O2):
define void @pic32_bulk_erase() {
%1 = tail call i32 (...) @pic32_program_verify()
%2 = tail call i32 (...) @pic32_erase_device()
%3 = tail call i32 (...) @pic32_standby()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MicroDelay(int);
int NicPhyInit();
int /*<<< orphan*/ nic_outb(int, int);
int NicReset(void) {
  nic_outb(0x00, 0x01 | 0x02);
  MicroDelay(10000);
  return NicPhyInit();
}


x86 assembly (clang, -O0):
<NicReset>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x3,%esi
call   1050 <nic_outb@plt>
mov    $0x2710,%edi
call   1030 <MicroDelay@plt>
mov    $0x0,%al
call   1040 <NicPhyInit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NicReset>:
push   %rax
xor    %edi,%edi
mov    $0x3,%esi
call   1050 <nic_outb@plt>
mov    $0x2710,%edi
call   1030 <MicroDelay@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <NicPhyInit@plt>

LLVM IR (-O0):
define i32 @NicReset() {
%1 = call i32 @nic_outb(i32 0, i32 3)
%2 = call i32 @MicroDelay(i32 10000)
%3 = call i32 (...) @NicPhyInit()
ret i32 %3
}

LLVM IR (-O2):
define i32 @NicReset() {
%1 = tail call i32 @nic_outb(i32 0, i32 3)
%2 = tail call i32 @MicroDelay(i32 10000)
%3 = tail call i32 (...) @NicPhyInit()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void dev_cleanup() { endwin(); }


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

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

LLVM IR (-O0):
define void @dev_cleanup() {
%1 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @dev_cleanup() {
%1 = tail call i32 (...) @endwin()
ret void
}
void taktik7(int sagSensorDeger, int solSensorDeger, int ortaSensorDeger,
             int sagKenarDeger, int solKenarDeger, int motorHizi) {}


x86 assembly (clang, -O0):
<taktik7>:
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)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @taktik7(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
ret void
}

LLVM IR (-O2):
define void @taktik7(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret void
}
/* Type definitions */
typedef int zl;
typedef int uint32_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
unsigned char *zmalloc(unsigned int);
unsigned char *ziplistNew(void) {
  unsigned int bytes = (sizeof(uint32_t) * 2 + sizeof(uint16_t)) + 1;
  unsigned char *zl = zmalloc(bytes);
  (*((uint32_t *)(zl))) = bytes;
  (*((uint32_t *)((zl) + sizeof(uint32_t)))) =
      (sizeof(uint32_t) * 2 + sizeof(uint16_t));
  (*((uint16_t *)((zl) + sizeof(uint32_t) * 2))) = 0;
  zl[bytes - 1] = 255;
  return zl;
}


x86 assembly (clang, -O0):
<ziplistNew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x11,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <zmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x10,0x4(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
movb   $0xff,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ziplistNew>:
push   %rax
mov    $0x11,%edi
call   1030 <zmalloc@plt>
movabs $0x1000000011,%rcx
mov    %rcx,(%rax)
movq   $0x0,0x8(%rax)
movb   $0xff,0x10(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @ziplistNew() {
%1 = alloca i32
%2 = alloca i8*
store i32 17, i32* %1
%3 = load i32, i32* %1
%4 = call i8* @zmalloc(i32 %3)
store i8* %4, i8** %2
%5 = load i32, i32* %1
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 4
%10 = bitcast i8* %9 to i32*
store i32 16, i32* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 8
%13 = bitcast i8* %12 to i64*
store i64 0, i64* %13
%14 = load i8*, i8** %2
%15 = load i32, i32* %1
%16 = sub i32 %15, 1
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
store i8 -1, i8* %18
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @ziplistNew() {
%1 = tail call i8* @zmalloc(i32 17)
%2 = bitcast i8* %1 to i32*
store i32 17, i32* %2
%3 = getelementptr inbounds i8, i8* %1, i64 4
%4 = bitcast i8* %3 to i32*
store i32 16, i32* %4
%5 = getelementptr inbounds i8, i8* %1, i64 8
%6 = bitcast i8* %5 to i64*
store i64 0, i64* %6
%7 = getelementptr inbounds i8, i8* %1, i64 16
store i8 -1, i8* %7
ret i8* %1
}
void gtk_about_dialog_set_documenters() {}


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

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

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

LLVM IR (-O2):
define void @gtk_about_dialog_set_documenters() {
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *match(char *);
struct node *C() {
  return match("NUMBER");
}


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

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

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [7 x i8] c"NUMBER\00"
define %struct.node* @C() {
%1 = call %struct.node* @match(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret %struct.node* %1
}

LLVM IR (-O2):
%struct.node = type { i32 }
@.str = [7 x i8] c"NUMBER\00"
define %struct.node* @C() {
%1 = tail call %struct.node* @match(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret %struct.node* %1
}
int hash_notes(char a, char b, char c, char d, char e) {
  return (e - 'A') +
         7 * ((d - 'A') + 7 * ((c - 'A') + 7 * ((b - 'A') + 7 * (a - 'A'))));
}


x86 assembly (clang, -O0):
<hash_notes>:
push   %rbp
mov    %rsp,%rbp
mov    %r8b,%al
mov    %dil,-0x1(%rbp)
mov    %sil,-0x2(%rbp)
mov    %dl,-0x3(%rbp)
mov    %cl,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
movsbl -0x4(%rbp),%ecx
sub    $0x41,%ecx
movsbl -0x3(%rbp),%edx
sub    $0x41,%edx
movsbl -0x2(%rbp),%esi
sub    $0x41,%esi
movsbl -0x1(%rbp),%edi
sub    $0x41,%edi
imul   $0x7,%edi,%edi
add    %edi,%esi
imul   $0x7,%esi,%esi
add    %esi,%edx
imul   $0x7,%edx,%edx
add    %edx,%ecx
imul   $0x7,%ecx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_notes>:
lea    0x0(,%rdi,8),%eax
sub    %edi,%eax
add    %esi,%eax
lea    0x0(,%rax,8),%esi
sub    %eax,%esi
add    %edx,%esi
lea    0x0(,%rsi,8),%eax
sub    %esi,%eax
add    %ecx,%eax
lea    0x0(,%rax,8),%ecx
sub    %eax,%ecx
lea    (%r8,%rcx,1),%eax
add    $0xfffd38cf,%eax
ret

LLVM IR (-O0):
define i32 @hash_notes(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4) {
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8 %0, i8* %6
store i8 %1, i8* %7
store i8 %2, i8* %8
store i8 %3, i8* %9
store i8 %4, i8* %10
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 65
%14 = load i8, i8* %9
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %15, 65
%17 = load i8, i8* %8
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %18, 65
%20 = load i8, i8* %7
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %21, 65
%23 = load i8, i8* %6
%24 = sext i8 %23 to i32
%25 = sub nsw i32 %24, 65
%26 = mul nsw i32 7, %25
%27 = add nsw i32 %22, %26
%28 = mul nsw i32 7, %27
%29 = add nsw i32 %19, %28
%30 = mul nsw i32 7, %29
%31 = add nsw i32 %16, %30
%32 = mul nsw i32 7, %31
%33 = add nsw i32 %13, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @hash_notes(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4) {
%6 = sext i8 %4 to i32
%7 = sext i8 %3 to i32
%8 = sext i8 %2 to i32
%9 = sext i8 %1 to i32
%10 = sext i8 %0 to i32
%11 = mul nsw i32 %10, 7
%12 = add nsw i32 %11, %9
%13 = mul nsw i32 %12, 7
%14 = add nsw i32 %13, %8
%15 = mul nsw i32 %14, 7
%16 = add nsw i32 %15, %7
%17 = mul nsw i32 %16, 7
%18 = add nsw i32 %6, -182065
%19 = add nsw i32 %18, %17
ret i32 %19
}
void rwlock_destroy(struct rwlock *lock) { (void)lock; }


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

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

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

LLVM IR (-O2):
%struct.rwlock = type opaque
define void @rwlock_destroy(%struct.rwlock* nocapture %0) {
ret void
}
float Q_powf(float x, int y) {
  float r = x;
  for (y--; y > 0; y--)
    r *= x;
  return r;
}


x86 assembly (clang, -O0):
<Q_powf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1146 <Q_powf+0x46>
movss  -0x4(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    111f <Q_powf+0x1f>
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_powf>:
cmp    $0x2,%edi
jl     111f <Q_powf+0x1f>
add    $0x1,%edi
movaps %xmm0,%xmm1
nopl   0x0(%rax,%rax,1)
mulss  %xmm0,%xmm1
add    $0xffffffff,%edi
cmp    $0x2,%edi
ja     1110 <Q_powf+0x10>
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @Q_powf(float %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi float [ %8, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = fmul float %5, %0
%9 = icmp ugt i32 %6, 2
br i1 %9, label %4, label %10
10: ; preds = %4, %2
%11 = phi float [ %0, %2 ], [ %8, %4 ]
ret float %11
}