xunge/DecIR huggingface dataset:
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t nmemb, size_t size) {
  void *ptr;
  size *= nmemb;
  ptr = malloc(size);
  if (ptr)
    memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1164 <calloc+0x44>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %7, %6
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = load i64, i64* %4
%16 = call i32 @memset(i8* %14, i32 0, i64 %15)
br label %17
17: ; preds = %13, %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
char *mp_store_double(char *, double);
char *mp_store_u8(char *, int);
char *mp_encode_double(char *data, double num) {
  data = mp_store_u8(data, 0xcb);
  return mp_store_double(data, num);
}


x86 assembly (clang, -O0):
<mp_encode_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xcb,%esi
call   1040 <mp_store_u8@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
call   1030 <mp_store_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_encode_double>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0xcb,%esi
call   1040 <mp_store_u8@plt>
mov    %rax,%rdi
movsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <mp_store_double@plt>

LLVM IR (-O0):
define i8* @mp_encode_double(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load i8*, i8** %3
%6 = call i8* @mp_store_u8(i8* %5, i32 203)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load double, double* %4
%9 = call i8* @mp_store_double(i8* %7, double %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @mp_encode_double(i8* %0, double %1) {
%3 = tail call i8* @mp_store_u8(i8* %0, i32 203)
%4 = tail call i8* @mp_store_double(i8* %3, double %1)
ret i8* %4
}
int fegetround(void) {
  unsigned short cw;
  __asm__ volatile("fnstcw %0" : "=m"(cw) :);
  return (cw & (0x0c00)) >> (10);
}


x86 assembly (clang, -O0):
<fegetround>:
push   %rbp
mov    %rsp,%rbp
fnstcw -0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xc00,%eax
sar    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fegetround>:
fnstcw -0x2(%rsp)
movzwl -0x2(%rsp),%eax
shr    $0xa,%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @fegetround() {
%1 = alloca i16
%2 = load i16, i16* %1
%3 = zext i16 %2 to i32
%4 = and i32 %3, 3072
%5 = ashr i32 %4, 10
ret i32 %5
}

LLVM IR (-O2):
define i32 @fegetround() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
%3 = load i16, i16* %1
%4 = lshr i16 %3, 10
%5 = and i16 %4, 3
%6 = zext i16 %5 to i32
ret i32 %6
}
void buttons(void) {}


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

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

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

LLVM IR (-O2):
define void @buttons() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(unsigned long);
void foo(unsigned long aul, unsigned m, unsigned i) {
  while (1) {
    aul += i;
    i = aul % m;
    bar(aul);
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bar@plt>
jmp    1122 <foo+0x12>

x86 assembly (clang, -O2):
<foo>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rdi,%rbx
mov    %esi,%r15d
jmp    1133 <foo+0x23>
mov    %rbx,%rax
xor    %edx,%edx
div    %r15
mov    %rdx,%r14
mov    %rbx,%rdi
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14d,%ebx
add    %rax,%rbx
mov    %rbx,%rax
shr    $0x20,%rax
jne    1120 <foo+0x10>
mov    %ebx,%eax
xor    %edx,%edx
div    %r15d
mov    %edx,%r14d
jmp    112b <foo+0x1b>

LLVM IR (-O0):
define void @foo(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
br label %7
7: ; preds = %3, %7
%8 = load i32, i32* %6
%9 = zext i32 %8 to i64
%10 = load i64, i64* %4
%11 = add i64 %10, %9
store i64 %11, i64* %4
%12 = load i64, i64* %4
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = urem i64 %12, %14
%16 = trunc i64 %15 to i32
store i32 %16, i32* %6
%17 = load i64, i64* %4
%18 = call i32 @bar(i64 %17)
br label %7
}

LLVM IR (-O2):
define void @foo(i64 %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
br label %5
5: ; preds = %3, %5
%6 = phi i64 [ %0, %3 ], [ %9, %5 ]
%7 = phi i32 [ %2, %3 ], [ %11, %5 ]
%8 = zext i32 %7 to i64
%9 = add i64 %6, %8
%10 = urem i64 %9, %4
%11 = trunc i64 %10 to i32
%12 = tail call i32 @bar(i64 %9)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char);
int show_selection_c(void) {
  printf("%s%c\n", "Select menu item ", 'C');
  return (0);
}


x86 assembly (clang, -O0):
<show_selection_c>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee4(%rip),%rsi
mov    $0x43,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_selection_c>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee7(%rip),%rsi
mov    $0x43,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s%c\0A\00"
@.str.1 = [18 x i8] c"Select menu item \00"
define i32 @show_selection_c() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8 signext 67)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s%c\0A\00"
@.str.1 = [18 x i8] c"Select menu item \00"
define i32 @show_selection_c() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8 signext 67)
ret i32 0
}
const char *rcsid(const char *p) {
  return rcsid(
      p = "@(#)$Id: print.c,v 1.50 2006/03/02 22:07:53 christos Exp $");
}


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

x86 assembly (clang, -O2):
<rcsid>:
jmp    1100 <rcsid>

LLVM IR (-O0):
@.str = [59 x i8] c"@(#)$Id: print.c,v 1.50 2006/03/02 22:07:53 christos Exp $\00"
define i8* @rcsid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i8* @rcsid(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @rcsid(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int func(int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int i = 4;
  printf("\n%d", func(i));
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = tail call i32 @func(i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
bool nrf53_errata_12(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_12() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void bar(void) { puts("PASS"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"PASS\00"
define void @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
int move_to_wthor(int x) { return 10 * (x / 8) + (x % 8) + 11; }


x86 assembly (clang, -O0):
<move_to_wthor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
imul   $0xa,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
add    %edx,%eax
add    $0xb,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_to_wthor>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    %eax,%ecx
sar    $0x3,%ecx
lea    (%rcx,%rcx,4),%ecx
and    $0xfffffff8,%eax
sub    %eax,%edi
lea    (%rdi,%rcx,2),%eax
add    $0xb,%eax
ret

LLVM IR (-O0):
define i32 @move_to_wthor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 8
%5 = mul nsw i32 10, %4
%6 = load i32, i32* %2
%7 = srem i32 %6, 8
%8 = add nsw i32 %5, %7
%9 = add nsw i32 %8, 11
ret i32 %9
}

LLVM IR (-O2):
define i32 @move_to_wthor(i32 %0) {
%2 = sdiv i32 %0, 8
%3 = mul nsw i32 %2, 10
%4 = srem i32 %0, 8
%5 = add nsw i32 %4, 11
%6 = add i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ GL_LINE_LOOP;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex2f(float, float);
void draw_triangle(void) {
  glBegin(GL_LINE_LOOP);
  glVertex2f(0.0f, 25.0f);
  glVertex2f(25.0f, -25.0f);
  glVertex2f(-25.0f, -25.0f);
  glEnd();
}


x86 assembly (clang, -O0):
<draw_triangle>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
xorps  %xmm0,%xmm0
movss  0xeb7(%rip),%xmm1
call   1040 <glVertex2f@plt>
movss  0xeaa(%rip),%xmm0
movss  0xe9e(%rip),%xmm1
call   1040 <glVertex2f@plt>
movss  0xe91(%rip),%xmm1
movaps %xmm1,%xmm0
call   1040 <glVertex2f@plt>
mov    $0x0,%al
call   1030 <glEnd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_triangle>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
movss  0xeb9(%rip),%xmm1
xorps  %xmm0,%xmm0
call   1040 <glVertex2f@plt>
movss  0xead(%rip),%xmm1
movss  0xea1(%rip),%xmm0
call   1040 <glVertex2f@plt>
movss  0xe98(%rip),%xmm0
movaps %xmm0,%xmm1
call   1040 <glVertex2f@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <glEnd@plt>

LLVM IR (-O0):
@GL_LINE_LOOP = global i32 0
define void @draw_triangle() {
%1 = load i32, i32* @GL_LINE_LOOP
%2 = call i32 @glBegin(i32 %1)
%3 = call i32 @glVertex2f(float 0.000000e+00, float 2.500000e+01)
%4 = call i32 @glVertex2f(float 2.500000e+01, float -2.500000e+01)
%5 = call i32 @glVertex2f(float -2.500000e+01, float -2.500000e+01)
%6 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_LINE_LOOP = global i32 0
define void @draw_triangle() {
%1 = load i32, i32* @GL_LINE_LOOP
%2 = tail call i32 @glBegin(i32 %1)
%3 = tail call i32 @glVertex2f(float 0.000000e+00, float 2.500000e+01)
%4 = tail call i32 @glVertex2f(float 2.500000e+01, float -2.500000e+01)
%5 = tail call i32 @glVertex2f(float -2.500000e+01, float -2.500000e+01)
%6 = tail call i32 (...) @glEnd()
ret void
}
int _swapl(int l) {
  int r[2];
  register char *p, *q;
  p = (char *)&r[1];
  q = (char *)&l;
  *--p = *q++;
  *--p = *q++;
  *--p = *q++;
  *--p = *q++;
  return r[0];
}


x86 assembly (clang, -O0):
<_swapl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0xc(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,-0x1(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_swapl(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i32]
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %2
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%7 = bitcast i32* %6 to i8*
store i8* %7, i8** %4
%8 = bitcast i32* %2 to i8*
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %5
%11 = load i8, i8* %9
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 -1
store i8* %13, i8** %4
store i8 %11, i8* %13
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %5
%16 = load i8, i8* %14
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i32 -1
store i8* %18, i8** %4
store i8 %16, i8* %18
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %5
%21 = load i8, i8* %19
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i32 -1
store i8* %23, i8** %4
store i8 %21, i8* %23
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %5
%26 = load i8, i8* %24
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i32 -1
store i8* %28, i8** %4
store i8 %26, i8* %28
%29 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%30 = load i32, i32* %29
ret i32 %30
}

LLVM IR (-O2):
define i32 @_swapl(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int lengthOfLongestSubstring(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", lengthOfLongestSubstring(argv[1]));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @lengthOfLongestSubstring(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
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 @lengthOfLongestSubstring(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ doReset();
int /*<<< orphan*/ usleep(int);
int /*<<< orphan*/ writeByte(int);
void copyscratchPad(void) {
  doReset();
  usleep(1000);
  writeByte(0xCC);
  writeByte(0x48);
  usleep(100000);
}


x86 assembly (clang, -O0):
<copyscratchPad>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <doReset@plt>
mov    $0x3e8,%edi
call   1050 <usleep@plt>
mov    $0xcc,%edi
call   1040 <writeByte@plt>
mov    $0x48,%edi
call   1040 <writeByte@plt>
mov    $0x186a0,%edi
call   1050 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyscratchPad>:
push   %rax
xor    %eax,%eax
call   1030 <doReset@plt>
mov    $0x3e8,%edi
call   1050 <usleep@plt>
mov    $0xcc,%edi
call   1040 <writeByte@plt>
mov    $0x48,%edi
call   1040 <writeByte@plt>
mov    $0x186a0,%edi
pop    %rax
jmp    1050 <usleep@plt>

LLVM IR (-O0):
define void @copyscratchPad() {
%1 = call i32 (...) @doReset()
%2 = call i32 @usleep(i32 1000)
%3 = call i32 @writeByte(i32 204)
%4 = call i32 @writeByte(i32 72)
%5 = call i32 @usleep(i32 100000)
ret void
}

LLVM IR (-O2):
define void @copyscratchPad() {
%1 = tail call i32 (...) @doReset()
%2 = tail call i32 @usleep(i32 1000)
%3 = tail call i32 @writeByte(i32 204)
%4 = tail call i32 @writeByte(i32 72)
%5 = tail call i32 @usleep(i32 100000)
ret void
}
int fun1116() { return 1116; }


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

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

LLVM IR (-O0):
define i32 @fun1116() {
ret i32 1116
}

LLVM IR (-O2):
define i32 @fun1116() {
ret i32 1116
}
/* Variables and functions */
double __infer_nondet_double();
double remainder(double x, double y) { return __infer_nondet_double(); }


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

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

LLVM IR (-O0):
define double @remainder(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @__infer_nondet_double()
ret double %5
}

LLVM IR (-O2):
define double @remainder(double %0, double %1) {
%3 = tail call double (...) @__infer_nondet_double()
ret double %3
}
float Relu(float x) { return x > 0.0f ? x : 0.0f; }


x86 assembly (clang, -O0):
<Relu>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1129 <Relu+0x29>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1136 <Relu+0x36>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1136 <Relu+0x36>
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Relu>:
xorps  %xmm1,%xmm1
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Relu(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load float, float* %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi float [ %6, %5 ], [ 0.000000e+00, %7 ]
ret float %9
}

LLVM IR (-O2):
define float @Relu(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = select i1 %2, float %0, float 0.000000e+00
ret float %3
}
unsigned char left_rotation(unsigned char val, int n) {
  return (val << n) | (val >> 8 - n);
}


x86 assembly (clang, -O0):
<left_rotation>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<left_rotation>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @left_rotation(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = load i32, i32* %4
%12 = sub nsw i32 8, %11
%13 = ashr i32 %10, %12
%14 = or i32 %8, %13
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @left_rotation(i8 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}
/* Variables and functions */
scalar_t__ isPrime(long);
int /*<<< orphan*/ printf(char *, long);
int problem010() {
  long i = 2000000;
  long sum = 0;
  while (i--) {
    if (isPrime(i)) {
      sum += i;
    }
  }
  printf("%ld\n", --sum);
  return 0;
}


x86 assembly (clang, -O0):
<problem010>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x1e8480,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
cmp    $0x0,%rax
je     1175 <problem010+0x55>
mov    -0x8(%rbp),%rdi
call   1040 <isPrime@plt>
cmp    $0x0,%rax
je     1170 <problem010+0x50>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1138 <problem010+0x18>
mov    -0x10(%rbp),%rsi
add    $0xffffffffffffffff,%rsi
mov    %rsi,-0x10(%rbp)
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<problem010>:
push   %r14
push   %rbx
push   %rax
mov    $0x1e847f,%ebx
xor    %r14d,%r14d
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <isPrime@plt>
test   %rax,%rax
cmovne %rbx,%rax
add    %rax,%r14
add    $0xffffffffffffffff,%rbx
jb     1130 <problem010+0x10>
add    $0xffffffffffffffff,%r14
lea    0xead(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @problem010() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 1999999, %0 ], [ %8, %1 ]
%3 = phi i64 [ 0, %0 ], [ %7, %1 ]
%4 = tail call i64 @isPrime(i64 %2)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i64 0, i64 %2
%7 = add nsw i64 %6, %3
%8 = add nsw i64 %2, -1
%9 = icmp eq i64 %2, 0
br i1 %9, label %10, label %1
10: ; preds = %1
%11 = add nsw i64 %7, -1
%12 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %11)
ret i32 0
}
int AddrLibrary() { return 1; }


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

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

LLVM IR (-O0):
define i32 @AddrLibrary() {
ret i32 1
}

LLVM IR (-O2):
define i32 @AddrLibrary() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ aio_close(int /*<<< orphan*/);
void wf_client_auth_failed(void) { aio_close(0); }


x86 assembly (clang, -O0):
<wf_client_auth_failed>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <aio_close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wf_client_auth_failed>:
xor    %edi,%edi
jmp    1030 <aio_close@plt>

LLVM IR (-O0):
define void @wf_client_auth_failed() {
%1 = call i32 @aio_close(i32 0)
ret void
}

LLVM IR (-O2):
define void @wf_client_auth_failed() {
%1 = tail call i32 @aio_close(i32 0)
ret void
}
/* Variables and functions */
int clamp_pixel(int, int, int);
int dither(void *, int, int, int);
int downsample(void *context, int pixel, int row, int column, int pixel_min,
               int pixel_max, int output_depth) {
  pixel = dither(context, pixel, row, column);
  return clamp_pixel(pixel, pixel_min, pixel_max) >> (16 - output_depth);
}


x86 assembly (clang, -O0):
<downsample>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <dither@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1040 <clamp_pixel@plt>
mov    $0x10,%ecx
sub    0x10(%rbp),%ecx
sar    %cl,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<downsample>:
push   %rbp
push   %rbx
push   %rax
mov    %r9d,%ebx
mov    %r8d,%ebp
call   1030 <dither@plt>
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1040 <clamp_pixel@plt>
mov    $0x10,%cl
sub    0x20(%rsp),%cl
sar    %cl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @downsample(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i8* %0, i8** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = call i32 @dither(i8* %15, i32 %16, i32 %17, i32 %18)
store i32 %19, i32* %9
%20 = load i32, i32* %9
%21 = load i32, i32* %12
%22 = load i32, i32* %13
%23 = call i32 @clamp_pixel(i32 %20, i32 %21, i32 %22)
%24 = load i32, i32* %14
%25 = sub nsw i32 16, %24
%26 = ashr i32 %23, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @downsample(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @dither(i8* %0, i32 %1, i32 %2, i32 %3)
%9 = tail call i32 @clamp_pixel(i32 %8, i32 %4, i32 %5)
%10 = sub nsw i32 16, %6
%11 = ashr i32 %9, %10
ret i32 %11
}
/* Variables and functions */
int try_parse_int_imp(char *, void *, int, int);
bool try_parse_int(char *str, int *value_ptr) {
  return try_parse_int_imp(str, (void *)value_ptr, sizeof(int), true);
}


x86 assembly (clang, -O0):
<try_parse_int>:
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
mov    $0x1,%ecx
call   1030 <try_parse_int_imp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_parse_int>:
mov    $0x4,%edx
mov    $0x1,%ecx
jmp    1030 <try_parse_int_imp@plt>

LLVM IR (-O0):
define i32 @try_parse_int(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 = bitcast i32* %6 to i8*
%8 = call i32 @try_parse_int_imp(i8* %5, i8* %7, i32 4, i32 1)
ret i32 %8
}

LLVM IR (-O2):
define i32 @try_parse_int(i8* %0, i32* %1) {
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @try_parse_int_imp(i8* %0, i8* %3, i32 4, i32 1)
ret i32 %4
}
/* Type definitions */
struct Cyc_Absyn_Stmt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Absyn_skip_stmt(unsigned int);
struct Cyc_Absyn_Stmt *Cyc_Toc_skip_stmt_dl() {
  return ({ Cyc_Absyn_skip_stmt(0U); });
}


x86 assembly (clang, -O0):
<Cyc_Toc_skip_stmt_dl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <Cyc_Absyn_skip_stmt@plt>
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Toc_skip_stmt_dl>:
push   %rax
xor    %edi,%edi
call   1030 <Cyc_Absyn_skip_stmt@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.Cyc_Absyn_Stmt = type { i32 }
define %struct.Cyc_Absyn_Stmt* @Cyc_Toc_skip_stmt_dl() {
%1 = alloca i32
%2 = call i32 @Cyc_Absyn_skip_stmt(i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to %struct.Cyc_Absyn_Stmt*
ret %struct.Cyc_Absyn_Stmt* %5
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Stmt = type { i32 }
define %struct.Cyc_Absyn_Stmt* @Cyc_Toc_skip_stmt_dl() {
%1 = tail call i32 @Cyc_Absyn_skip_stmt(i32 0)
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to %struct.Cyc_Absyn_Stmt*
ret %struct.Cyc_Absyn_Stmt* %3
}
void set_biton(unsigned char *bitarray, int item) {
  bitarray[item / 8] |= (1 << (item % 8));
}


x86 assembly (clang, -O0):
<set_biton>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_biton>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
or     %al,(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define void @set_biton(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = srem i32 %5, 8
%7 = shl i32 1, %6
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 8
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = or i32 %14, %7
%16 = trunc i32 %15 to i8
store i8 %16, i8* %12
ret void
}

LLVM IR (-O2):
define void @set_biton(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 7
%4 = shl nuw nsw i32 1, %3
%5 = sdiv i32 %1, 8
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i32 %4 to i8
%10 = or i8 %8, %9
store i8 %10, i8* %7
ret void
}
void __DELETE_java_net_ConnectException(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_net_ConnectException(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int shim_enosys(int /*<<< orphan*/, int);
int shim_mlockall(int flags) { return shim_enosys(0, flags); }


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

x86 assembly (clang, -O2):
<shim_mlockall>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

LLVM IR (-O2):
define i32 @shim_mlockall(i32 %0) {
%2 = tail call i32 @shim_enosys(i32 0, i32 %0)
ret i32 %2
}
double rover(y2, y)
double y2, y;
{
  double temp, xrover;
  int m;
  temp = y / y2;
  m = (int)temp;
  xrover = (fabs((m * y2) - y)) / y2;
  return (xrover);
}


x86 assembly (clang, -O0):
<rover>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
cvtsi2sdl -0x24(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movaps 0xea6(%rip),%xmm1
pand   %xmm1,%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rover>:
movapd %xmm1,%xmm2
divsd  %xmm0,%xmm2
cvttpd2dq %xmm2,%xmm2
cvtdq2pd %xmm2,%xmm2
mulsd  %xmm0,%xmm2
subsd  %xmm1,%xmm2
andpd  0xee0(%rip),%xmm2
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @rover(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
store double %0, double* %3
store double %1, double* %4
%8 = load double, double* %4
%9 = load double, double* %3
%10 = fdiv double %8, %9
store double %10, double* %5
%11 = load double, double* %5
%12 = fptosi double %11 to i32
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = sitofp i32 %13 to double
%15 = load double, double* %3
%16 = load double, double* %4
%17 = fneg double %16
%18 = call double @llvm.fmuladd.f64(double %14, double %15, double %17)
%19 = call double @llvm.fabs.f64(double %18)
%20 = load double, double* %3
%21 = fdiv double %19, %20
store double %21, double* %6
%22 = load double, double* %6
ret double %22
}

LLVM IR (-O2):
define double @rover(double %0, double %1) {
%3 = fdiv double %1, %0
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
%6 = fneg double %1
%7 = tail call double @llvm.fmuladd.f64(double %5, double %0, double %6)
%8 = tail call double @llvm.fabs.f64(double %7)
%9 = fdiv double %8, %0
ret double %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ IsLedOutOfBounds(int /*<<< orphan*/);
int /*<<< orphan*/ clearLedImageBit(int /*<<< orphan*/);
int /*<<< orphan*/ updateHardware();
void LedDriver_TurnOff_ALed(uint8_t NLed) {
  if (IsLedOutOfBounds(NLed)) {
    return;
  }
  clearLedImageBit(NLed);
  updateHardware();
  return;
}


x86 assembly (clang, -O0):
<LedDriver_TurnOff_ALed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <IsLedOutOfBounds@plt>
cmp    $0x0,%rax
je     1152 <LedDriver_TurnOff_ALed+0x22>
jmp    1161 <LedDriver_TurnOff_ALed+0x31>
mov    -0x4(%rbp),%edi
call   1040 <clearLedImageBit@plt>
mov    $0x0,%al
call   1050 <updateHardware@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LedDriver_TurnOff_ALed>:
push   %rbx
mov    %edi,%ebx
call   1030 <IsLedOutOfBounds@plt>
test   %rax,%rax
je     113f <LedDriver_TurnOff_ALed+0xf>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <clearLedImageBit@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <updateHardware@plt>

LLVM IR (-O0):
define void @LedDriver_TurnOff_ALed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @IsLedOutOfBounds(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %11
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @clearLedImageBit(i32 %8)
%10 = call i32 (...) @updateHardware()
br label %11
11: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @LedDriver_TurnOff_ALed(i32 %0) {
%2 = tail call i64 @IsLedOutOfBounds(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @clearLedImageBit(i32 %0)
%6 = tail call i32 (...) @updateHardware()
br label %7
7: ; preds = %1, %4
ret void
}
void foo723(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo723(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int square(int);
int main(void) {
  printf("Hi, everybody!\n");
  printf("Five squared is: %i\n", square(5));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1040 <square@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Hi, everybody!\0A\00"
@.str.1 = [21 x i8] c"Five squared is: %i\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @square(i32 5)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"Five squared is: %i\0A\00"
@str = [15 x i8] c"Hi, everybody!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @square(i32 5)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ALWAYS_ASSERT(int);
int abs(int);
void C67_Adjust_ADDK(int *inst, int n) {
  ALWAYS_ASSERT(abs(n) < 32767);
  *inst = (*inst & (~(0xffff << 7))) | ((n & 0xffff) << 7);
}


x86 assembly (clang, -O0):
<C67_Adjust_ADDK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <abs@plt>
cmp    $0x7fff,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <ALWAYS_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xff80007f,%ecx
mov    -0xc(%rbp),%eax
and    $0xffff,%eax
shl    $0x7,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_Adjust_ADDK>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x7fff,%eax
setb   %dil
call   1030 <ALWAYS_ASSERT@plt>
mov    $0xff80007f,%eax
and    (%r14),%eax
movzwl %bx,%ecx
shl    $0x7,%ecx
or     %eax,%ecx
mov    %ecx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @C67_Adjust_ADDK(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @abs(i32 %5)
%7 = icmp slt i32 %6, 32767
%8 = zext i1 %7 to i32
%9 = call i32 @ALWAYS_ASSERT(i32 %8)
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = and i32 %11, -8388481
%13 = load i32, i32* %4
%14 = and i32 %13, 65535
%15 = shl i32 %14, 7
%16 = or i32 %12, %15
%17 = load i32*, i32** %3
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
define void @C67_Adjust_ADDK(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%4 = icmp ult i32 %3, 32767
%5 = zext i1 %4 to i32
%6 = tail call i32 @ALWAYS_ASSERT(i32 %5)
%7 = load i32, i32* %0
%8 = and i32 %7, -8388481
%9 = shl i32 %1, 7
%10 = and i32 %9, 8388480
%11 = or i32 %8, %10
store i32 %11, i32* %0
ret void
}
void g_param_value_convert() {}


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

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

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

LLVM IR (-O2):
define void @g_param_value_convert() {
ret void
}
void stop_timer_for_1wire(void) {
  (*((volatile unsigned long *)((0xE2500000) + 0x08))) &= ~(1 << 16);
}


x86 assembly (clang, -O0):
<stop_timer_for_1wire>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe2500008,%eax
mov    (%rax),%rcx
and    $0xfffffffffffeffff,%rcx
mov    $0xe2500008,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_timer_for_1wire>:
mov    $0xe2500008,%eax
andq   $0xfffffffffffeffff,(%rax)
ret

LLVM IR (-O0):
define void @stop_timer_for_1wire() {
%1 = load volatile i64, i64* inttoptr (i64 3796893704 to i64*)
%2 = and i64 %1, -65537
store volatile i64 %2, i64* inttoptr (i64 3796893704 to i64*)
ret void
}

LLVM IR (-O2):
define void @stop_timer_for_1wire() {
%1 = load volatile i64, i64* inttoptr (i64 3796893704 to i64*)
%2 = and i64 %1, -65537
store volatile i64 %2, i64* inttoptr (i64 3796893704 to i64*)
ret void
}
yyerror(s) char *s;
{ printf("%s, This is not a valid AnBm\n\n", s); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"%s, This is not a valid AnBm\0A\0A\00"
define i32 @yyerror(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [31 x i8] c"%s, This is not a valid AnBm\0A\0A\00"
define i32 @yyerror(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
int test_imm_D6int32_mem(int *val) {
  return ((*val) & (0xD6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D6int32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xd6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D6int32_mem>:
testb  $0xd6,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D6int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 214
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_D6int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 214
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main(void) {
  int x = 0;
  { int x = 5; }
  x;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%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
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 5, i32* %3
%4 = load i32, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage() {
  fprintf(stderr,
          "usage: bf [-e eof_value] [-t tape_size] [-"
          "bcf"
          "hpv] file\n"
          "    -e eof_value: integer value of EOF (omit option to leave cell "
          "unchanged)\n"
          "    -t tape_size: length of tape (default: 30000)\n"
          "    -b: enable bounds checking\n"
          "    -c: enable circular tape (implies -b)\n"
          "    -f: enable infinite tape (implies -b)\n"
          "    -h: print this help\n"
          "    -p: print minified code to stdout instead of running it\n"
          "    -v: show verbose messages\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [412 x i8] c"usage: bf [-e eof_value] [-t tape_size] [-bcfhpv] file\0A -e eof_value: integer value of EOF (omit option to leave cell unchanged)\0A -t tape_size: length of tape (default: 30000)\0A -b: enable bounds checking\0A -c: enable circular tape (implies -b)\0A -f: enable infinite tape (implies -b)\0A -h: print this help\0A -p: print minified code to stdout instead of running it\0A -v: show verbose messages\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([412 x i8], [412 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [412 x i8] c"usage: bf [-e eof_value] [-t tape_size] [-bcfhpv] file\0A -e eof_value: integer value of EOF (omit option to leave cell unchanged)\0A -t tape_size: length of tape (default: 30000)\0A -b: enable bounds checking\0A -c: enable circular tape (implies -b)\0A -f: enable infinite tape (implies -b)\0A -h: print this help\0A -p: print minified code to stdout instead of running it\0A -v: show verbose messages\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([412 x i8], [412 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ gdb_pid();
int kill(int /*<<< orphan*/, int /*<<< orphan*/);
int term_child() {
  pid_t pid = gdb_pid();
  int rc = kill(pid, SIGTERM);
  return rc;
}


x86 assembly (clang, -O0):
<term_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <gdb_pid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_child>:
push   %rax
xor    %eax,%eax
call   1030 <gdb_pid@plt>
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1040 <kill@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
define i32 @term_child() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @gdb_pid()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = load i32, i32* @SIGTERM
%6 = call i32 @kill(i32 %4, i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@SIGTERM = global i32 0
define i32 @term_child() {
%1 = tail call i32 (...) @gdb_pid()
%2 = load i32, i32* @SIGTERM
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret i32 %3
}