xunge/DecIR huggingface dataset:
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int answer;
  int number;
  scanf("%d", &number);
  answer = exact_square(number);
  printf("%d", answer);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <exact_square@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @exact_square(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lprintf(int *, int);
int partition(int *, int, int);
void qsort(int array[], int lo, int hi) {
  if (lo < hi) {
    int p = partition(array, lo, hi);
    lprintf(array, 8);
    qsort(array, lo, p - 1);
    qsort(array, p + 1, hi);
  }
}


x86 assembly (clang, -O0):
<qsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1192 <qsort+0x62>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
call   1050 <lprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <qsort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <qsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1183 <qsort+0x53>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    $0x8,%esi
call   1050 <lprintf@plt>
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <qsort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1150 <qsort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @qsort(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* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %26
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @partition(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = call i32 @lprintf(i32* %16, i32 8)
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = load i32, i32* %7
%21 = sub nsw i32 %20, 1
%22 = load i32*, i32** %4
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
%25 = load i32, i32* %6
br label %26
26: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @qsort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = tail call i32 @lprintf(i32* %0, i32 8)
%9 = add nsw i32 %7, -1
tail call void @qsort(i32* %0, i32 %6, i32 %9)
%10 = add nsw i32 %7, 1
%11 = icmp slt i32 %10, %2
br i1 %11, label %5, label %12
12: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ E(int);
void foo2(int n, int a[30][n]) {
  if (a[29][0] != 0)
    E(4);
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
imul   $0x1d,%rcx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1140 <foo2+0x30>
mov    $0x4,%edi
call   1030 <E@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
mov    %edi,%eax
imul   $0x74,%rax,%rax
cmpl   $0x0,(%rsi,%rax,1)
je     1126 <foo2+0x16>
mov    $0x4,%edi
jmp    1030 <E@plt>
ret

LLVM IR (-O0):
define void @foo2(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 = zext i32 %5 to i64
%7 = load i32*, i32** %4
%8 = mul nsw i64 29, %6
%9 = getelementptr inbounds i32, i32* %7, i64 %8
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @E(i32 4)
br label %15
15: ; preds = %13, %2
ret void
}

LLVM IR (-O2):
define void @foo2(i32 %0, i32* nocapture %1) {
%3 = zext i32 %0 to i64
%4 = mul nuw nsw i64 %3, 29
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @E(i32 4)
br label %10
10: ; preds = %8, %2
ret void
}
int ftp_i_char_is_number(char chr) { return chr >= '0' && chr <= '9'; }


x86 assembly (clang, -O0):
<ftp_i_char_is_number>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <ftp_i_char_is_number+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftp_i_char_is_number>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @ftp_i_char_is_number(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @ftp_i_char_is_number(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _SC_AVPHYS_PAGES;
int /*<<< orphan*/ _SC_PAGE_SIZE;
long sysconf(int /*<<< orphan*/);
long getAvailMem(void) {
  long mem = sysconf(_SC_AVPHYS_PAGES) * sysconf(_SC_PAGE_SIZE);
  return mem;
}


x86 assembly (clang, -O0):
<getAvailMem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,-0x10(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAvailMem>:
push   %rbx
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,%rbx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
imul   %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@_SC_AVPHYS_PAGES = global i32 0
@_SC_PAGE_SIZE = global i32 0
define i64 @getAvailMem() {
%1 = alloca i64
%2 = load i32, i32* @_SC_AVPHYS_PAGES
%3 = call i64 @sysconf(i32 %2)
%4 = load i32, i32* @_SC_PAGE_SIZE
%5 = call i64 @sysconf(i32 %4)
%6 = mul nsw i64 %3, %5
store i64 %6, i64* %1
%7 = load i64, i64* %1
ret i64 %7
}

LLVM IR (-O2):
@_SC_AVPHYS_PAGES = global i32 0
@_SC_PAGE_SIZE = global i32 0
define i64 @getAvailMem() {
%1 = load i32, i32* @_SC_AVPHYS_PAGES
%2 = tail call i64 @sysconf(i32 %1)
%3 = load i32, i32* @_SC_PAGE_SIZE
%4 = tail call i64 @sysconf(i32 %3)
%5 = mul nsw i64 %4, %2
ret i64 %5
}
void _libcoreservices_fork_child(void) {}


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

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

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

LLVM IR (-O2):
define void @_libcoreservices_fork_child() {
ret void
}
void gdk_drawable_get_image() {}


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

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

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

LLVM IR (-O2):
define void @gdk_drawable_get_image() {
ret void
}
void yydestruct(const char *yymsg, int yytype, double *yyvaluep) {
  ((void)(yyvaluep));
  if (!yymsg)
    yymsg = "Deleting";
  ;

#pragma GCC diagnostic push

#pragma GCC diagnostic ignored "-Wuninitialized"

#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"

  ((void)(yytype));

#pragma GCC diagnostic pop
}


x86 assembly (clang, -O0):
<yydestruct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1125 <yydestruct+0x25>
lea    0xedf(%rip),%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @yydestruct(i8* nocapture %0, i32 %1, double* nocapture %2) {
ret void
}
void XSecurityGenerateAuthorization() {}


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

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

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

LLVM IR (-O2):
define void @XSecurityGenerateAuthorization() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
int bot_fileutils_fread32(FILE *f, int32_t *v32) {
  int32_t v;
  if (fread(&v, 4, 1, f) != 1)
    return -1;
  *v32 = ntohl(v);
  return 0;
}


x86 assembly (clang, -O0):
<bot_fileutils_fread32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x1c(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     115c <bot_fileutils_fread32+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <bot_fileutils_fread32+0x53>
mov    -0x1c(%rbp),%edi
call   1040 <ntohl@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_fileutils_fread32>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rcx
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x1,%ecx
jne    1158 <bot_fileutils_fread32+0x38>
mov    0xc(%rsp),%edi
call   1040 <ntohl@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bot_fileutils_fread32(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
%7 = load i32*, i32** %4
%8 = call i32 @fread(i32* %6, i32 4, i32 1, i32* %7)
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %15
11: ; preds = %2
%12 = load i32, i32* %6
%13 = call i32 @ntohl(i32 %12)
%14 = load i32*, i32** %5
store i32 %13, i32* %14
store i32 0, i32* %3
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @bot_fileutils_fread32(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @fread(i32* %3, i32 4, i32 1, i32* %0)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = tail call i32 @ntohl(i32 %8)
store i32 %9, i32* %1
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ api_putchar(char);
void HariMain(void) {
  for (;;) {
    api_putchar('a');
  }
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <HariMain+0x9>
mov    $0x61,%edi
call   1030 <api_putchar@plt>
jmp    1119 <HariMain+0x9>

x86 assembly (clang, -O2):
<HariMain>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x61,%edi
call   1030 <api_putchar@plt>
jmp    1120 <HariMain+0x10>

LLVM IR (-O0):
define void @HariMain() {
br label %1
1: ; preds = %1, %0
%2 = call i32 @api_putchar(i8 signext 97)
br label %1
}

LLVM IR (-O2):
define void @HariMain() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @api_putchar(i8 signext 97)
br label %1
}
__attribute__((always_)) int min(int a, int b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @min(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int encode_vert_rate(int rate) {
  int sign;
  if (rate < 0) {
    sign = 0x200;
    rate = -rate;
  } else {
    sign = 0;
  }
  rate = (rate / 64) + 1;
  if (rate > 511)
    rate = 511;
  return rate | sign;
}


x86 assembly (clang, -O0):
<encode_vert_rate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1125 <encode_vert_rate+0x25>
movl   $0x200,-0x8(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112c <encode_vert_rate+0x2c>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x1ff,-0x4(%rbp)
jle    1151 <encode_vert_rate+0x51>
movl   $0x1ff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_vert_rate>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
shr    $0x16,%edi
and    $0x200,%edi
shr    $0x6,%ecx
cmp    $0x1fe,%ecx
mov    $0x1fe,%eax
cmovb  %ecx,%eax
add    $0x1,%eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @encode_vert_rate(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = lshr i32 %0, 22
%4 = and i32 %3, 512
%5 = lshr i32 %2, 6
%6 = icmp ult i32 %5, 510
%7 = select i1 %6, i32 %5, i32 510
%8 = add nuw nsw i32 %7, 1
%9 = or i32 %8, %4
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ outop2str(char *);
void outcmp() { outop2str("CMP"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"CMP\00"
define void @outcmp() {
%1 = tail call i32 @outop2str(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
void _rtld_error(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @_rtld_error(i8* nocapture %0, ...) {
ret void
}
void restore_windowing() {}


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

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

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

LLVM IR (-O2):
define void @restore_windowing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void dagutil_free_aligned(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<dagutil_free_aligned>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @dagutil_free_aligned(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: [MODE] pid\n\n");
  printf("pid\t The operation specified in MODE will be executed when the "
         "process with pid 'pid' finished.\n\n");
  printf("MODE:\n\t-s Shutdown(default)\n\t-r Reboot\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Usage: [MODE] pid\0A\0A\00"
@.str.1 = [98 x i8] c"pid\09 The operation specified in MODE will be executed when the process with pid 'pid' finished.\0A\0A\00"
@.str.2 = [40 x i8] c"MODE:\0A\09-s Shutdown(default)\0A\09-r Reboot\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [19 x i8] c"Usage: [MODE] pid\0A\00"
@str.3 = [97 x i8] c"pid\09 The operation specified in MODE will be executed when the process with pid 'pid' finished.\0A\00"
@str.4 = [39 x i8] c"MODE:\0A\09-s Shutdown(default)\0A\09-r Reboot\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([97 x i8], [97 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%c", ((int)'a') - 32);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 65)
ret i32 0
}
void TestLabelsAndGoto(void) {
label1:;
  goto label2;
label2:
  0;
  void *ptr = &&label1;
  goto *ptr;
}


x86 assembly (clang, -O0):
<TestLabelsAndGoto>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <TestLabelsAndGoto+0x9>
lea    -0xc(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
jmp    *%rax

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

LLVM IR (-O0):
define void @TestLabelsAndGoto() {
%1 = alloca i8*
br label %2
2: ; preds = %5, %0
br label %3
3: ; preds = %2
store i8* blockaddress(@TestLabelsAndGoto, %2), i8** %1
%4 = load i8*, i8** %1
br label %5
5: ; preds = %3
%6 = phi i8* [ %4, %3 ]
indirectbr i8* %6, [label %2]
}

LLVM IR (-O2):
define void @TestLabelsAndGoto() {
br label %1
1: ; preds = %1, %0
br label %1
}
int test_imm_7Dint8_mem(signed char *val) {
  return ((*val) & (-0x7D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Dint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -125
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__attribute__((always_)) void copy_page(void *to, void *from) {
  __builtin_memcpy(to, from, ((1UL) << 12));
}


x86 assembly (clang, -O0):
<copy_page>:
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    $0x1000,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_page>:
mov    $0x1000,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @copy_page(i8* nocapture writeonly %0, i8* nocapture %1) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(4096) %0, i8* align 1 dereferenceable(4096) %1, i64 4096, i1 false)
ret void
}
unsigned int f81(unsigned int x, unsigned int y) {
  return (x << ((-y) & (8 * 4 - 1))) + (x >> y);
}


x86 assembly (clang, -O0):
<f81>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x1f,%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f81>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f81(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 i32 0, %6
%8 = and i32 %7, 31
%9 = shl i32 %5, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = lshr i32 %10, %11
%13 = add i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @f81(i32 %0, i32 %1) {
%3 = sub i32 0, %1
%4 = and i32 %3, 31
%5 = shl i32 %0, %4
%6 = lshr i32 %0, %1
%7 = add i32 %5, %6
ret i32 %7
}
int f4(int x, int y) {
  if (y < 0)
    __builtin_unreachable();
  return x % -y;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1114 <f4+0x14>
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
mov    %edi,%eax
neg    %esi
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f4(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 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
unreachable
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 0, %10
%12 = srem i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @f4(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
tail call void @llvm.assume(i1 %3)
%4 = sub nsw i32 0, %1
%5 = srem i32 %0, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("area = %f\n", 3.1415926 * 5.3 * 5.3);
  printf("circumference = %f\n", 2 * 3.1415926 * 5.3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x58,%esi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x21,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"area = %f\0A\00"
@.str.1 = [20 x i8] c"circumference = %f\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 88)
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 33)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"area = %f\0A\00"
@.str.1 = [20 x i8] c"circumference = %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 88)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 33)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int read(int /*<<< orphan*/, char *, int);
int read_bytes(void *buffer, int size) {
  char *p = (char *)buffer;
  if (p == NULL) {
    return -1;
  }
  int readed = read(STDIN_FILENO, p, size);
  return readed;
}


x86 assembly (clang, -O0):
<read_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    113e <read_bytes+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <read_bytes+0x4c>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_bytes>:
test   %rdi,%rdi
je     1128 <read_bytes+0x18>
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
jmp    1030 <read@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define i32 @read_bytes(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @STDIN_FILENO
%6 = tail call i32 @read(i32 %5, i8* %0, i32 %1)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ __builtin_lfloorl(long double);
int /*<<< orphan*/ link_failure_builtin_lfloorl();
void test_builtin_lfloorl(long double ld) {
  if (__builtin_lfloorl(ld) != __builtin_lfloorl(ld))
    link_failure_builtin_lfloorl();
}


x86 assembly (clang, -O0):
<test_builtin_lfloorl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__builtin_lfloorl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__builtin_lfloorl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_builtin_lfloorl+0x43>
mov    $0x0,%al
call   1040 <link_failure_builtin_lfloorl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_lfloorl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <__builtin_lfloorl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <__builtin_lfloorl@plt>
cmp    %rax,%rbx
jne    1151 <test_builtin_lfloorl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <link_failure_builtin_lfloorl@plt>

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

LLVM IR (-O2):
define void @test_builtin_lfloorl(x86_fp80 %0) {
%2 = tail call i64 @__builtin_lfloorl(x86_fp80 %0)
%3 = tail call i64 @__builtin_lfloorl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_lfloorl()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int object_refcount_down(void *);
int ary_reap_check(void *ptr) { return object_refcount_down(ptr); }


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

x86 assembly (clang, -O2):
<ary_reap_check>:
jmp    1030 <object_refcount_down@plt>

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

LLVM IR (-O2):
define i32 @ary_reap_check(i8* %0) {
%2 = tail call i32 @object_refcount_down(i8* %0)
ret i32 %2
}
void debug_log_puts(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @debug_log_puts(i8* nocapture %0, ...) {
ret void
}
void _vDispAtX(unsigned int uiLine, unsigned int uiCol,
               const unsigned char *puszTxt, unsigned char ucAttr) {}


x86 assembly (clang, -O0):
<_vDispAtX>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %al,-0x11(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @_vDispAtX(i32 %0, i32 %1, i8* nocapture %2, i8 zeroext %3) {
ret void
}
unsigned long unsignedlong_ignoring_longlong(unsigned long x, long long y) {
  return x;
}


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

x86 assembly (clang, -O2):
<unsignedlong_ignoring_longlong>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @unsignedlong_ignoring_longlong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlong_ignoring_longlong(i64 returned %0, i64 %1) {
ret i64 %0
}
void SPI_MAX7221_RX_ISR(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI_MAX7221_RX_ISR() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ increment(int *, int);
int /*<<< orphan*/ isPalindrome(int *, int);
int findNext(int seq[], int length) {
  int i = 0;
  while (!isPalindrome(seq, length) && ++i)
    increment(seq, length);
  return i;
}


x86 assembly (clang, -O0):
<findNext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <isPalindrome@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jne    1164 <findNext+0x44>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1174 <findNext+0x54>
jmp    1185 <findNext+0x65>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <increment@plt>
jmp    1136 <findNext+0x16>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findNext>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1040 <isPalindrome@plt>
xor    %ebp,%ebp
test   %eax,%eax
jne    115d <findNext+0x3d>
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <increment@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <isPalindrome@plt>
test   %eax,%eax
je     1140 <findNext+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @findNext(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = call i32 @isPalindrome(i32* %7, i32 %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %11, %6
%16 = phi i1 [ false, %6 ], [ %14, %11 ]
br i1 %16, label %17, label %21
17: ; preds = %15
%18 = load i32*, i32** %3
%19 = load i32, i32* %4
%20 = call i32 @increment(i32* %18, i32 %19)
br label %6
21: ; preds = %15
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @findNext(i32* %0, i32 %1) {
%3 = tail call i32 @isPalindrome(i32* %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %2, %5
%6 = phi i32 [ %7, %5 ], [ 0, %2 ]
%7 = add nuw nsw i32 %6, 1
%8 = tail call i32 @increment(i32* %0, i32 %1)
%9 = tail call i32 @isPalindrome(i32* %0, i32 %1)
%10 = icmp eq i32 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %2
%12 = phi i32 [ 0, %2 ], [ %7, %5 ]
ret i32 %12
}
double EstimatePi(int iterations) {
  double pi = 1;
  for (int i = 3; i < iterations * 2; i = i + 4) {
    pi = pi - (1.0 / i) + (1.0 / (i + 2.0));
  }
  return pi * 4;
}


x86 assembly (clang, -O0):
<EstimatePi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    117a <EstimatePi+0x7a>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm2
movsd  0xec2(%rip),%xmm1
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm2
movsd  0xebd(%rip),%xmm1
addsd  %xmm1,%xmm2
movsd  0xea1(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <EstimatePi+0x1b>
movsd  0xe86(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<EstimatePi>:
cmp    $0x2,%edi
jl     1168 <EstimatePi+0x68>
add    %edi,%edi
movsd  0xef9(%rip),%xmm1
mov    $0x3,%eax
movsd  0xef4(%rip),%xmm2
movsd  0xef4(%rip),%xmm3
movsd  0xed4(%rip),%xmm4
movapd %xmm1,%xmm0
movapd %xmm1,%xmm5
divsd  %xmm2,%xmm5
movapd %xmm0,%xmm6
subsd  %xmm5,%xmm6
movapd %xmm2,%xmm5
addsd  %xmm3,%xmm5
movapd %xmm1,%xmm0
divsd  %xmm5,%xmm0
addsd  %xmm6,%xmm0
addsd  %xmm4,%xmm2
add    $0x4,%eax
cmp    %edi,%eax
jl     1130 <EstimatePi+0x30>
mulsd  0xe99(%rip),%xmm0
ret
movsd  0xe90(%rip),%xmm0
ret

LLVM IR (-O0):
define double @EstimatePi(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
store i32 %0, i32* %2
store double 1.000000e+00, double* %3
store i32 3, i32* %4
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, 2
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %24
10: ; preds = %5
%11 = load double, double* %3
%12 = load i32, i32* %4
%13 = sitofp i32 %12 to double
%14 = fdiv double 1.000000e+00, %13
%15 = fsub double %11, %14
%16 = load i32, i32* %4
%17 = sitofp i32 %16 to double
%18 = fadd double %17, 2.000000e+00
%19 = fdiv double 1.000000e+00, %18
%20 = fadd double %15, %19
store double %20, double* %3
br label %21
21: ; preds = %10
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 4
store i32 %23, i32* %4
br label %5
24: ; preds = %5
%25 = load double, double* %3
%26 = fmul double %25, 4.000000e+00
ret double %26
}

LLVM IR (-O2):
define double @EstimatePi(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = icmp sgt i32 %0, 1
br i1 %3, label %8, label %6
4: ; preds = %8
%5 = fmul double %16, 4.000000e+00
br label %6
6: ; preds = %4, %1
%7 = phi double [ 4.000000e+00, %1 ], [ %5, %4 ]
ret double %7
8: ; preds = %1, %8
%9 = phi i32 [ %17, %8 ], [ 3, %1 ]
%10 = phi double [ %16, %8 ], [ 1.000000e+00, %1 ]
%11 = sitofp i32 %9 to double
%12 = fdiv double 1.000000e+00, %11
%13 = fsub double %10, %12
%14 = fadd double %11, 2.000000e+00
%15 = fdiv double 1.000000e+00, %14
%16 = fadd double %13, %15
%17 = add nuw nsw i32 %9, 4
%18 = icmp slt i32 %17, %2
br i1 %18, label %8, label %4
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  if (y >= 5) {
    while (x >= 0) {
      y = y - 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jl     115f <main+0x4f>
jmp    1142 <main+0x32>
cmpl   $0x0,-0x8(%rbp)
jl     115a <main+0x4a>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <main+0x32>
jmp    115f <main+0x4f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x5,%eax
jl     1132 <main+0x22>
test   %ebx,%ebx
js     1132 <main+0x22>
nopw   0x0(%rax,%rax,1)
jmp    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 5
br i1 %7, label %8, label %16
8: ; preds = %0
br label %9
9: ; preds = %12, %8
%10 = load i32, i32* %2
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %3
br label %9
15: ; preds = %9
br label %16
16: ; preds = %15, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp sgt i32 %2, 4
%4 = icmp sgt i32 %1, -1
%5 = select i1 %3, i1 %4, i1 false
br i1 %5, label %6, label %7
6: ; preds = %0, %6
br label %6
7: ; preds = %0
ret i32 0
}
/* Variables and functions */
int sprintf(char *, char *, unsigned long);
char *u_long2s(char buffer[], unsigned long value) {
  if (sprintf(buffer, "%lu", value) < 1)
    return ((char *)NULL);
  return (buffer);
}


x86 assembly (clang, -O0):
<u_long2s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <sprintf@plt>
cmp    $0x1,%eax
jge    114a <u_long2s+0x3a>
movq   $0x0,-0x8(%rbp)
jmp    1152 <u_long2s+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_long2s>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xee2(%rip),%rsi
call   1030 <sprintf@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmovg  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lu\00"
define i8* @u_long2s(i8* writeonly %0, i64 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %1)
%4 = icmp slt i32 %3, 1
%5 = select i1 %4, i8* null, i8* %0
ret i8* %5
}
void dev_remove_parameters(struct device_d *dev) {}


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

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

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

LLVM IR (-O2):
%struct.device_d = type opaque
define void @dev_remove_parameters(%struct.device_d* nocapture %0) {
ret void
}
void fn422E() { return; }


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

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

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

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

/* Variables and functions */
scalar_t__ otfcc_check_endian();
uint16_t otfcc_endian_convert16(uint16_t i) {
  if (otfcc_check_endian()) {
    union {
      uint8_t i1[2];
      uint16_t i2;
    } src, des;
    src.i2 = i;
    des.i1[0] = src.i1[1];
    des.i1[1] = src.i1[0];
    return des.i2;
  } else {
    return i;
  }
}


x86 assembly (clang, -O0):
<otfcc_endian_convert16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <otfcc_check_endian@plt>
cmp    $0x0,%rax
je     1149 <otfcc_endian_convert16+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114f <otfcc_endian_convert16+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<otfcc_endian_convert16>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <otfcc_check_endian@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%union.anon = type { [2 x i32] }
define i32 @otfcc_endian_convert16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %union.anon
%5 = alloca %union.anon
store i32 %0, i32* %3
%6 = call i64 (...) @otfcc_check_endian()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %1
%9 = load i32, i32* %3
%10 = bitcast %union.anon* %4 to i32*
store i32 %9, i32* %10
%11 = bitcast %union.anon* %4 to [2 x i32]*
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%13 = load i32, i32* %12
%14 = bitcast %union.anon* %5 to [2 x i32]*
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %14, i64 0, i64 0
store i32 %13, i32* %15
%16 = bitcast %union.anon* %4 to [2 x i32]*
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 0, i64 0
%18 = load i32, i32* %17
%19 = bitcast %union.anon* %5 to [2 x i32]*
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0, i64 1
store i32 %18, i32* %20
%21 = bitcast %union.anon* %5 to i32*
%22 = load i32, i32* %21
store i32 %22, i32* %2
br label %25
23: ; preds = %1
%24 = load i32, i32* %3
store i32 %24, i32* %2
br label %25
25: ; preds = %23, %8
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @otfcc_endian_convert16(i32 returned %0) {
%2 = tail call i64 (...) @otfcc_check_endian()
ret i32 %0
}