xunge/DecIR huggingface dataset:
/* Variables and functions */
int M_PI;
int sin(int);
double f(double x, double y) {
  return 2 * M_PI * M_PI * sin(M_PI * x) * sin(M_PI * y);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
mov    0x2eb3(%rip),%rcx
imul   (%rcx),%eax
mov    %eax,-0x18(%rbp)
mov    0x2ea6(%rip),%rax
cvtsi2sdl (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    0x2e82(%rip),%rax
cvtsi2sdl (%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
mov    0x2ec3(%rip),%r14
mov    (%r14),%ebp
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
imul   %ebp,%ebp
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sin@plt>
mov    %eax,%ebx
xorps  %xmm0,%xmm0
cvtsi2sdl (%r14),%xmm0
imul   %ebp,%ebx
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
imul   %ebx,%eax
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @f(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load i32, i32* @M_PI
%6 = mul nsw i32 2, %5
%7 = load i32, i32* @M_PI
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* @M_PI
%10 = sitofp i32 %9 to double
%11 = load double, double* %3
%12 = fmul double %10, %11
%13 = fptosi double %12 to i32
%14 = call i32 @sin(i32 %13)
%15 = mul nsw i32 %8, %14
%16 = load i32, i32* @M_PI
%17 = sitofp i32 %16 to double
%18 = load double, double* %4
%19 = fmul double %17, %18
%20 = fptosi double %19 to i32
%21 = call i32 @sin(i32 %20)
%22 = mul nsw i32 %15, %21
%23 = sitofp i32 %22 to double
ret double %23
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @f(double %0, double %1) {
%3 = load i32, i32* @M_PI
%4 = shl nsw i32 %3, 1
%5 = mul nsw i32 %4, %3
%6 = sitofp i32 %3 to double
%7 = fmul double %6, %0
%8 = fptosi double %7 to i32
%9 = tail call i32 @sin(i32 %8)
%10 = mul nsw i32 %5, %9
%11 = load i32, i32* @M_PI
%12 = sitofp i32 %11 to double
%13 = fmul double %12, %1
%14 = fptosi double %13 to i32
%15 = tail call i32 @sin(i32 %14)
%16 = mul nsw i32 %10, %15
%17 = sitofp i32 %16 to double
ret double %17
}
/* Variables and functions */
int /*<<< orphan*/ CE(int /*<<< orphan*/);
void CE_Low() { CE(0); }


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

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

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

LLVM IR (-O2):
define void @CE_Low() {
%1 = tail call i32 @CE(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ empty_log(char *);
void *d_io_new() {
  empty_log("io_new\n");
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"io_new\0A\00"
define i8* @d_io_new() {
%1 = call i32 @empty_log(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [8 x i8] c"io_new\0A\00"
define noalias i8* @d_io_new() {
%1 = tail call i32 @empty_log(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
void __attribute__((weak)) default_handler(void) {
  while (1u)
    ;
}


x86 assembly (clang, -O0):
<default_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <default_handler+0x9>
jmp    1109 <default_handler+0x9>

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

LLVM IR (-O0):
define weak void @default_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @default_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void show_help(void) {
  printf(
      "Usage: polld [params]\n"
      "Parameters\n"
      " -h --help             show this help\n"
      " -v --version          show version information\n"
      " -c --config file      configuration file to use\n"
      " -p --pid file         lock file for storing pid, empty for no locking\n"
      " -s --sleep seconds    number of seconds to sleep in sleep cycle\n"
      "\n");
  exit(0);
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [306 x i8] c"Usage: polld [params]\0AParameters\0A -h --help show this help\0A -v --version show version information\0A -c --config file configuration file to use\0A -p --pid file lock file for storing pid, empty for no locking\0A -s --sleep seconds number of seconds to sleep in sleep cycle\0A\0A\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([306 x i8], [306 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [305 x i8] c"Usage: polld [params]\0AParameters\0A -h --help show this help\0A -v --version show version information\0A -c --config file configuration file to use\0A -p --pid file lock file for storing pid, empty for no locking\0A -s --sleep seconds number of seconds to sleep in sleep cycle\0A\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([305 x i8], [305 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int myEqualInt(void *a, void *b) {
  int *aa = (int *)a;
  int *bb = (int *)b;
  return *aa == *bb;
}


x86 assembly (clang, -O0):
<myEqualInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myEqualInt>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @myEqualInt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp eq i32 %12, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @myEqualInt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, long, double);
void print_adapt_lr(FILE *fp, long epoch, double adapt_lr) {
  fprintf(fp, "%ld\t%f\n", epoch, adapt_lr);
}


x86 assembly (clang, -O0):
<print_adapt_lr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
movsd  -0x18(%rbp),%xmm0
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_adapt_lr>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%ld\09%f\0A\00"
define void @print_adapt_lr(i32* %0, i64 %1, double %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca double
store i32* %0, i32** %4
store i64 %1, i64* %5
store double %2, double* %6
%7 = load i32*, i32** %4
%8 = load i64, i64* %5
%9 = load double, double* %6
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %8, double %9)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%ld\09%f\0A\00"
define void @print_adapt_lr(i32* nocapture %0, i64 %1, double %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %1, double %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
usage() {
  printf("Usage: forth [-d] [files...]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Usage: forth [-d] [files...]\0A\00"
define i32 @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [29 x i8] c"Usage: forth [-d] [files...]\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
size_t strnlen(const char *s, size_t maxlen) {
  for (size_t len = 0; len != maxlen; len++) {
    if (s[len] == '\0')
      return len;
  }
  return maxlen;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     115a <strnlen+0x5a>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1144 <strnlen+0x44>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1162 <strnlen+0x62>
jmp    1149 <strnlen+0x49>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %9, %4, %2
%13 = phi i64 [ 0, %2 ], [ %5, %4 ], [ %1, %9 ]
ret i64 %13
}
void nohz_balance_enter_idle(int cpu) {}


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

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

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

LLVM IR (-O2):
define void @nohz_balance_enter_idle(i32 %0) {
ret void
}
void dealloc2d(int **p, int rows, int cols) {
  int i;
  if (!p)
    return;
  for (i = 0; i < rows; ++i)
    free(p[i]);
  free(p);
  p = (int **)0;
}


x86 assembly (clang, -O0):
<dealloc2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1132 <dealloc2d+0x22>
jmp    1175 <dealloc2d+0x65>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1164 <dealloc2d+0x54>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <dealloc2d+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dealloc2d>:
test   %rdi,%rdi
je     114f <dealloc2d+0x3f>
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <dealloc2d+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <dealloc2d+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @dealloc2d(i32** %0, i32 %1, i32 %2) {
%4 = icmp eq i32** %0, null
br i1 %4, label %18, label %5
5: ; preds = %3
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %16
7: ; preds = %5
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %14, %9 ]
%11 = getelementptr inbounds i32*, i32** %0, i64 %10
%12 = bitcast i32** %11 to i8**
%13 = load i8*, i8** %12
tail call void @free(i8* %13)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %8
br i1 %15, label %16, label %9
16: ; preds = %9, %5
%17 = bitcast i32** %0 to i8*
tail call void @free(i8* %17)
br label %18
18: ; preds = %3, %16
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void setup_for_challenge() {
  setvbuf(stdout, NULL, _IONBF, 0);
  setvbuf(stdin, NULL, _IONBF, 0);
  setvbuf(stderr, NULL, _IONBF, 0);
}


x86 assembly (clang, -O0):
<setup_for_challenge>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    0x2e82(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_for_challenge>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2ebf(%rip),%rbx
mov    (%rbx),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%edx
xor    %esi,%esi
xor    %ecx,%ecx
pop    %rbx
jmp    1030 <setvbuf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@_IONBF = global i32 0
@stdin = global i32 0
@stderr = global i32 0
define void @setup_for_challenge() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @_IONBF
%3 = call i32 @setvbuf(i32 %1, i32* null, i32 %2, i32 0)
%4 = load i32, i32* @stdin
%5 = load i32, i32* @_IONBF
%6 = call i32 @setvbuf(i32 %4, i32* null, i32 %5, i32 0)
%7 = load i32, i32* @stderr
%8 = load i32, i32* @_IONBF
%9 = call i32 @setvbuf(i32 %7, i32* null, i32 %8, i32 0)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@_IONBF = global i32 0
@stdin = global i32 0
@stderr = global i32 0
define void @setup_for_challenge() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @_IONBF
%3 = tail call i32 @setvbuf(i32 %1, i32* null, i32 %2, i32 0)
%4 = load i32, i32* @stdin
%5 = load i32, i32* @_IONBF
%6 = tail call i32 @setvbuf(i32 %4, i32* null, i32 %5, i32 0)
%7 = load i32, i32* @stderr
%8 = load i32, i32* @_IONBF
%9 = tail call i32 @setvbuf(i32 %7, i32* null, i32 %8, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RTC_Seconds_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void
RTC_Seconds_IRQHandler(void) {
  RTC_Seconds_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @RTC_Seconds_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @RTC_Seconds_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @RTC_Seconds_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @RTC_Seconds_DriverIRQHandler()
ret void
}
int test8(int x) { return x / 10 <= 0; }


x86 assembly (clang, -O0):
<test8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test8>:
xor    %eax,%eax
cmp    $0xa,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @test8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 10
%5 = icmp sle i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test8(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct bt431_regs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bt431_write_reg(struct bt431_regs *, int, int);
void bt431_enable_cursor(struct bt431_regs *regs) {
  bt431_write_reg(regs, 0x0000, 0x40 | 0x10 | 0x04 | 0x00);
}


x86 assembly (clang, -O0):
<bt431_enable_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x54,%edx
call   1030 <bt431_write_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bt431_enable_cursor>:
xor    %esi,%esi
mov    $0x54,%edx
jmp    1030 <bt431_write_reg@plt>

LLVM IR (-O0):
%struct.bt431_regs = type { i32 }
define void @bt431_enable_cursor(%struct.bt431_regs* %0) {
%2 = alloca %struct.bt431_regs*
store %struct.bt431_regs* %0, %struct.bt431_regs** %2
%3 = load %struct.bt431_regs*, %struct.bt431_regs** %2
%4 = call i32 @bt431_write_reg(%struct.bt431_regs* %3, i32 0, i32 84)
ret void
}

LLVM IR (-O2):
%struct.bt431_regs = type { i32 }
define void @bt431_enable_cursor(%struct.bt431_regs* %0) {
%2 = tail call i32 @bt431_write_reg(%struct.bt431_regs* %0, i32 0, i32 84)
ret void
}
void INT_Excep_PDC_PCFEI(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PDC_PCFEI() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ height;
};
typedef TYPE_1__ XWindowChanges;

/* Variables and functions */
int get_XWindowChanges_height(void *_p) {
  return (int)((XWindowChanges *)_p)->height;
}


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

x86 assembly (clang, -O2):
<get_XWindowChanges_height>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XWindowChanges_height(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XWindowChanges_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ merge_Sort(int *, int /*<<< orphan*/, int);
void mergeSort(int *Array, int size) { merge_Sort(Array, 0, size - 1); }


x86 assembly (clang, -O0):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <merge_Sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeSort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <merge_Sort@plt>

LLVM IR (-O0):
define void @mergeSort(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 = sub nsw i32 %6, 1
%8 = call i32 @merge_Sort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @mergeSort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @merge_Sort(i32* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_int(unsigned int volatile);
int /*<<< orphan*/ puts(char *);
void print_timer(void) {
  puts("TIMER VALUE = ");
  print_int((*(volatile unsigned int *)(0x20000060)));
  puts("\n");
}


x86 assembly (clang, -O0):
<print_timer>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x20000060,%eax
mov    (%rax),%edi
call   1040 <print_int@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_timer>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x20000060,%edi
call   1040 <print_int@plt>
lea    0xecf(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"TIMER VALUE = \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_timer() {
%1 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = load volatile i32, i32* inttoptr (i64 536871008 to i32*)
%3 = call i32 @print_int(i32 %2)
%4 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"TIMER VALUE = \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_timer() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = load volatile i32, i32* inttoptr (i64 536871008 to i32*)
%3 = tail call i32 @print_int(i32 %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void __attribute__((weak)) serial_fixups(void) {}


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

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

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

LLVM IR (-O2):
define weak void @serial_fixups() {
ret void
}
int cmp_int(const void *val1, const void *val2) {
  int *x, *y;
  x = (int *)val1;
  y = (int *)val2;
  if (*x < *y)
    return -1;
  if (*x > *y)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    113a <cmp_int+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <cmp_int+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    1158 <cmp_int+0x58>
movl   $0x1,-0x4(%rbp)
jmp    115f <cmp_int+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_int(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %7
%12 = load i32*, i32** %6
%13 = load i32, i32* %12
%14 = load i32*, i32** %7
%15 = load i32, i32* %14
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %26
18: ; preds = %2
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
%21 = load i32*, i32** %7
%22 = load i32, i32* %21
%23 = icmp sgt i32 %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 1, i32* %3
br label %26
25: ; preds = %18
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @cmp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = icmp sgt i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int test11(void) {
  char tab[10];
  memset(tab, 0, 11);
  return 0;
}


x86 assembly (clang, -O0):
<test11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xa(%rbp),%rdi
xor    %esi,%esi
mov    $0xb,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test11>:
sub    $0x18,%rsp
lea    0xe(%rsp),%rdi
xor    %esi,%esi
mov    $0xb,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @test11() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 11)
ret i32 0
}

LLVM IR (-O2):
define i32 @test11() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 11)
ret i32 0
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/);
int randomNum(int min, int max) {
  static int seeded = 0;
  if (!seeded) {
    seeded = 1;
    srand((unsigned int)time(0));
  }
  return (rand() % (max - min + 1)) + min;
}


x86 assembly (clang, -O0):
<randomNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,0x2ef7(%rip)
jne    1163 <randomNum+0x33>
movl   $0x1,0x2ee7(%rip)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomNum>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
cmpb   $0x0,0x2efe(%rip)
jne    1155 <randomNum+0x25>
movb   $0x1,0x2ef5(%rip)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
sub    %ebx,%ebp
add    $0x1,%ebp
cltd
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@randomNum.seeded = internal global i32 0
define i32 @randomNum(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @randomNum.seeded
%6 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
store i32 1, i32* @randomNum.seeded
%8 = call i64 @time(i32 0)
%9 = trunc i64 %8 to i32
%10 = call i32 @srand(i32 %9)
br label %11
11: ; preds = %7, %2
%12 = call i32 (...) @rand()
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = sub nsw i32 %13, %14
%16 = add nsw i32 %15, 1
%17 = srem i32 %12, %16
%18 = load i32, i32* %3
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
@randomNum.seeded = internal unnamed_addr global i1 false
define i32 @randomNum(i32 %0, i32 %1) {
%3 = load i1, i1* @randomNum.seeded
br i1 %3, label %8, label %4
4: ; preds = %2
store i1 true, i1* @randomNum.seeded
%5 = tail call i64 @time(i32 0)
%6 = trunc i64 %5 to i32
%7 = tail call i32 @srand(i32 %6)
br label %8
8: ; preds = %4, %2
%9 = tail call i32 (...) @rand()
%10 = sub i32 1, %0
%11 = add i32 %10, %1
%12 = srem i32 %9, %11
%13 = add nsw i32 %12, %0
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
void *default_alloc(void *ctx, void *p, int n) {
  if (n == 0) {
    free(p);
    return NULL;
  }
  return realloc(p, (size_t)n);
}


x86 assembly (clang, -O0):
<default_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1153 <default_alloc+0x33>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    1164 <default_alloc+0x44>
mov    -0x18(%rbp),%rdi
movslq -0x1c(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_alloc>:
mov    %rsi,%rdi
test   %edx,%edx
je     112f <default_alloc+0xf>
movslq %edx,%rsi
jmp    1040 <realloc@plt>
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @default_alloc(i8* nocapture readnone %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @free(i8* %1)
br label %10
7: ; preds = %3
%8 = sext i32 %2 to i64
%9 = tail call i8* @realloc(i8* %1, i64 %8)
br label %10
10: ; preds = %7, %5
%11 = phi i8* [ null, %5 ], [ %9, %7 ]
ret i8* %11
}
int test_imm_4Dint16_reg(short val) {
  return ((val) & (0x4D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Dint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x4d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Dint16_reg>:
test   $0x4d,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Dint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 77
%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_4Dint16_reg(i16 signext %0) {
%2 = and i16 %0, 77
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int fits(int a, int b) {
  while (b != 0 && a % 10 == b % 10) {
    a = a / 10;
    b = b / 10;
  }
  if (b == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<fits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     113f <fits+0x3f>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0x14(%rbp),%edx
cmp    %eax,%edx
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114f <fits+0x4f>
jmp    1170 <fits+0x70>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    110a <fits+0xa>
cmpl   $0x0,-0xc(%rbp)
jne    1186 <fits+0x86>
movl   $0x1,-0x4(%rbp)
jmp    118d <fits+0x8d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fits>:
mov    $0x1,%eax
test   %esi,%esi
je     115f <fits+0x5f>
nopl   0x0(%rax)
movslq %edi,%r8
imul   $0x66666667,%r8,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%r8d
movslq %esi,%r9
imul   $0x66666667,%r9,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rdx
add    %ecx,%edx
lea    (%rdx,%rdx,1),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%r9d
cmp    %r9d,%r8d
jne    1160 <fits+0x60>
add    $0x9,%esi
cmp    $0x12,%esi
mov    %edx,%esi
ja     1110 <fits+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @fits(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %4
%11 = srem i32 %10, 10
%12 = load i32, i32* %5
%13 = srem i32 %12, 10
%14 = icmp eq i32 %11, %13
br label %15
15: ; preds = %9, %6
%16 = phi i1 [ false, %6 ], [ %14, %9 ]
br i1 %16, label %17, label %22
17: ; preds = %15
%18 = load i32, i32* %4
%19 = sdiv i32 %18, 10
store i32 %19, i32* %4
%20 = load i32, i32* %5
%21 = sdiv i32 %20, 10
store i32 %21, i32* %5
br label %6
22: ; preds = %15
%23 = load i32, i32* %5
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %22
store i32 1, i32* %3
br label %27
26: ; preds = %22
store i32 0, i32* %3
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @fits(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %12
%5 = phi i32 [ %10, %12 ], [ %1, %2 ]
%6 = phi i32 [ %8, %12 ], [ %0, %2 ]
%7 = srem i32 %6, 10
%8 = sdiv i32 %6, 10
%9 = srem i32 %5, 10
%10 = sdiv i32 %5, 10
%11 = icmp eq i32 %7, %9
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = add i32 %5, 9
%14 = icmp ult i32 %13, 19
br i1 %14, label %15, label %4
15: ; preds = %12, %4, %2
%16 = phi i32 [ 1, %2 ], [ 0, %4 ], [ 1, %12 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/, int,
                          int /*<<< orphan*/);
int main(void) {
  int i = 0;
  printf("%d %d %d %d\n", i, i++, i, i++);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"%d %d %d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 1, i32 1)
ret i32 0
}
long double empil(void) { return 3.141592653989793238462643383279502884L; }


x86 assembly (clang, -O0):
<empil>:
push   %rbp
mov    %rsp,%rbp
fldt   0xef6(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<empil>:
fldt   0xefa(%rip)
ret

LLVM IR (-O0):
define x86_fp80 @empil() {
ret x86_fp80 0xK4000C90FDAA28F5C419C
}

LLVM IR (-O2):
define x86_fp80 @empil() {
ret x86_fp80 0xK4000C90FDAA28F5C419C
}
int int_len(int n) {
  int l = 0;
  if (n < 0) {
    n = -n;
    l = 1;
  }
  while (n != 0) {
    l++;
    n = n / 10;
  }
  return l;
}


x86 assembly (clang, -O0):
<int_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1127 <int_len+0x27>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
jmp    112c <int_len+0x2c>
cmpl   $0x0,-0x4(%rbp)
je     1152 <int_len+0x52>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    112c <int_len+0x2c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_len>:
test   %edi,%edi
je     1133 <int_len+0x33>
mov    %edi,%eax
shr    $0x1f,%eax
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
add    $0x1,%eax
movslq %ecx,%rdx
imul   $0x66666667,%rdx,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
add    $0x9,%edx
cmp    $0x12,%edx
ja     1110 <int_len+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @int_len(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = lshr i32 %0, 31
%5 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
br label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ %4, %3 ]
%8 = phi i32 [ %10, %6 ], [ %5, %3 ]
%9 = add nuw nsw i32 %7, 1
%10 = sdiv i32 %8, 10
%11 = add i32 %8, 9
%12 = icmp ult i32 %11, 19
br i1 %12, label %13, label %6
13: ; preds = %6, %1
%14 = phi i32 [ 0, %1 ], [ %9, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ dtoi(float);
int /*<<< orphan*/ g2_set_background(int /*<<< orphan*/, float);
void g2_set_background_(float *dev, float *color) {
  g2_set_background(dtoi(*dev), *color);
}


x86 assembly (clang, -O0):
<g2_set_background_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <dtoi@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1040 <g2_set_background@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2_set_background_>:
push   %rbx
mov    %rsi,%rbx
movss  (%rdi),%xmm0
call   1030 <dtoi@plt>
movss  (%rbx),%xmm0
mov    %eax,%edi
pop    %rbx
jmp    1040 <g2_set_background@plt>

LLVM IR (-O0):
define void @g2_set_background_(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* %5
%7 = call i32 @dtoi(float %6)
%8 = load float*, float** %4
%9 = load float, float* %8
%10 = call i32 @g2_set_background(i32 %7, float %9)
ret void
}

LLVM IR (-O2):
define void @g2_set_background_(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = tail call i32 @dtoi(float %3)
%5 = load float, float* %1
%6 = tail call i32 @g2_set_background(i32 %4, float %5)
ret void
}
int test_imm_3Bint16_reg(short val) {
  return ((val) & (-0x3B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Bint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffc5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_3Bint16_reg>:
test   $0xffc5,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_3Bint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -59
%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_3Bint16_reg(i16 signext %0) {
%2 = and i16 %0, -59
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fsl_type_free(void *);
void fsl_free(void *value) { fsl_type_free(value); }


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

x86 assembly (clang, -O2):
<fsl_free>:
jmp    1030 <fsl_type_free@plt>

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

LLVM IR (-O2):
define void @fsl_free(i8* %0) {
%2 = tail call i32 @fsl_type_free(i8* %0)
ret void
}
/* Variables and functions */
size_t ft_strlen(const char *str) {
  size_t s;
  s = 0;
  while (str[s])
    s++;
  return (s);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <ft_strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ft_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <ft_strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @ft_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void nhr_request_handle_sigpipe(int signal_number) {
  printf("\nlibnhr handle sigpipe %i", signal_number);
  return;
}


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

x86 assembly (clang, -O2):
<nhr_request_handle_sigpipe>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\0Alibnhr handle sigpipe %i\00"
define void @nhr_request_handle_sigpipe(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0Alibnhr handle sigpipe %i\00"
define void @nhr_request_handle_sigpipe(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ strspn(char const *, char *);
void skip_whitespace(const char *line, size_t *line_offset) {
  *line_offset += strspn(line + *line_offset, " \t");
}


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

x86 assembly (clang, -O2):
<skip_whitespace>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    (%rsi),%rbx
add    %rbx,%rdi
lea    0xedc(%rip),%rsi
call   1030 <strspn@plt>
add    %rbx,%rax
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
define void @skip_whitespace(i8* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i64 @strspn(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = add i64 %5, %3
store i64 %6, i64* %1
ret void
}
/* Variables and functions */
int VP8ClipUV(int const);
int VP8RGBToU(int r, int g, int b) {
  const int u = -9719 * r - 19081 * g + 28800 * b;
  return VP8ClipUV(u);
}


x86 assembly (clang, -O0):
<VP8RGBToU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0xffffda09,-0x4(%rbp),%eax
imul   $0x4a89,-0x8(%rbp),%ecx
sub    %ecx,%eax
imul   $0x7080,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <VP8ClipUV@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VP8RGBToU>:
imul   $0xffffda09,%edi,%eax
imul   $0xffffb577,%esi,%ecx
add    %eax,%ecx
imul   $0x7080,%edx,%edi
add    %ecx,%edi
jmp    1030 <VP8ClipUV@plt>

LLVM IR (-O0):
define i32 @VP8RGBToU(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = mul nsw i32 -9719, %8
%10 = load i32, i32* %5
%11 = mul nsw i32 19081, %10
%12 = sub nsw i32 %9, %11
%13 = load i32, i32* %6
%14 = mul nsw i32 28800, %13
%15 = add nsw i32 %12, %14
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = call i32 @VP8ClipUV(i32 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @VP8RGBToU(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, -9719
%5 = mul i32 %1, -19081
%6 = add i32 %5, %4
%7 = mul nsw i32 %2, 28800
%8 = add nsw i32 %6, %7
%9 = tail call i32 @VP8ClipUV(i32 %8)
ret i32 %9
}