xunge/DecIR huggingface dataset:
void DumpIseg(int first, int last) {
  printf("\nContents of Instruction Segment\n");
  for (; first <= last; first++)
    PrintIns(first), printf("\n");
  printf("\n");
}


x86 assembly (clang, -O0):
<DumpIseg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     116e <DumpIseg+0x4e>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <PrintIns@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113c <DumpIseg+0x1c>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DumpIseg>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xec2(%rip),%rdi
call   1040 <puts@plt>
cmp    %ebx,%ebp
jg     116a <DumpIseg+0x3a>
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
xor    %eax,%eax
call   1050 <PrintIns@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1150 <DumpIseg+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"\0AContents of Instruction Segment\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @DumpIseg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %14, %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i32, i32* %3
%12 = call i32 (i32, ...) bitcast (i32 (...)* @PrintIns to i32 (i32, ...)*)(i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %10
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %6
17: ; preds = %6
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"\0AContents of Instruction Segment\00"
define void @DumpIseg(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%4 = icmp sgt i32 %0, %1
br i1 %4, label %11, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %9, %5 ], [ %0, %2 ]
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @PrintIns to i32 (i32, ...)*)(i32 %6)
%8 = tail call i32 @putchar(i32 10)
%9 = add i32 %6, 1
%10 = icmp eq i32 %6, %1
br i1 %10, label %11, label %5
11: ; preds = %5, %2
%12 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
double sqrt(int);
double Tween_CircularInEasing(double k) { return 1 - sqrt(1 - k * k); }


x86 assembly (clang, -O0):
<Tween_CircularInEasing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe9e(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tween_CircularInEasing>:
push   %rax
mulsd  %xmm0,%xmm0
movsd  0xee3(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sqrt@plt>
movsd  0xece(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Tween_CircularInEasing(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fneg double %3
%6 = call double @llvm.fmuladd.f64(double %5, double %4, double 1.000000e+00)
%7 = fptosi double %6 to i32
%8 = call double @sqrt(i32 %7)
%9 = fsub double 1.000000e+00, %8
ret double %9
}

LLVM IR (-O2):
define double @Tween_CircularInEasing(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.000000e+00)
%4 = fptosi double %3 to i32
%5 = tail call double @sqrt(i32 %4)
%6 = fsub double 1.000000e+00, %5
ret double %6
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_mvwadd_wchstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_mvwadd_wchstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_mvwadd_wchstr+0x2a>
jmp    1170 <cmd_mvwadd_wchstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_mvwadd_wchstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_mvwadd_wchstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvwadd_wchstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
int isascii(int c) { return !(c & ~0x7f); }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -128
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int f(int);
int g(int j) {
  if (j < 0)
    return 1;
  else
    return j * f(j - 1);
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <g+0x21>
movl   $0x1,-0x4(%rbp)
jmp    114d <g+0x3d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
test   %edi,%edi
js     1124 <g+0x14>
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1030 <f@plt>
imul   %ebx,%eax
pop    %rbx
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @f(i32 %4)
%6 = mul nsw i32 %5, %0
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ gotoxy(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ textbackground(int /*<<< orphan*/);
int /*<<< orphan*/ textcolor(int);
void about(void) {
  textbackground(0);
  gotoxy(25, 21);
  textcolor(12);
  printf("Por xx ww\xA4o w | pene");
  gotoxy(26, 23);
  textcolor(15);
  printf("http://www.blogsw.com.ar/");
}


x86 assembly (clang, -O0):
<about>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1060 <textbackground@plt>
mov    $0x19,%edi
mov    $0x15,%esi
call   1050 <gotoxy@plt>
mov    $0xc,%edi
call   1040 <textcolor@plt>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1a,%edi
mov    $0x17,%esi
call   1050 <gotoxy@plt>
mov    $0xf,%edi
call   1040 <textcolor@plt>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<about>:
push   %rax
xor    %edi,%edi
call   1060 <textbackground@plt>
mov    $0x19,%edi
mov    $0x15,%esi
call   1050 <gotoxy@plt>
mov    $0xc,%edi
call   1040 <textcolor@plt>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1a,%edi
mov    $0x17,%esi
call   1050 <gotoxy@plt>
mov    $0xf,%edi
call   1040 <textcolor@plt>
lea    0xe88(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Por xx ww\A4o w | pene\00"
@.str.1 = [26 x i8] c"http://www.blogsw.com.ar/\00"
define void @about() {
%1 = call i32 @textbackground(i32 0)
%2 = call i32 @gotoxy(i32 25, i32 21)
%3 = call i32 @textcolor(i32 12)
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @gotoxy(i32 26, i32 23)
%6 = call i32 @textcolor(i32 15)
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Por xx ww\A4o w | pene\00"
@.str.1 = [26 x i8] c"http://www.blogsw.com.ar/\00"
define void @about() {
%1 = tail call i32 @textbackground(i32 0)
%2 = tail call i32 @gotoxy(i32 25, i32 21)
%3 = tail call i32 @textcolor(i32 12)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @gotoxy(i32 26, i32 23)
%6 = tail call i32 @textcolor(i32 15)
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(char);
comment() { outbyte('|'); }


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

x86 assembly (clang, -O2):
<comment>:
mov    $0x7c,%edi
jmp    1030 <outbyte@plt>

LLVM IR (-O0):
define i32 @comment() {
%1 = alloca i32
%2 = call i32 @outbyte(i8 signext 124)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @comment() {
%1 = tail call i32 @outbyte(i8 signext 124)
ret i32 undef
}
void func11(s) int s;
{ e(38); }


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

x86 assembly (clang, -O2):
<func11>:
mov    $0x26,%edi
xor    %eax,%eax
jmp    1030 <e@plt>

LLVM IR (-O0):
define void @func11(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @e to i32 (i32, ...)*)(i32 38)
ret void
}

LLVM IR (-O2):
define void @func11(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @e to i32 (i32, ...)*)(i32 38)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printn(int x) { printf("%06o\n", x); }


x86 assembly (clang, -O0):
<printn>:
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):
<printn>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%06o\0A\00"
define void @printn(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int f(int n) {
  while (n > 99)
    n /= 10;
  if (n % 10 == 7)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x63,-0x8(%rbp)
jle    1124 <f+0x24>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1107 <f+0x7>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x7,%edx
jne    1144 <f+0x44>
movl   $0x1,-0x4(%rbp)
jmp    114b <f+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0x64,%edi
jl     1126 <f+0x26>
mov    $0xcccccccd,%eax
nopw   0x0(%rax,%rax,1)
mov    %edi,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
cmp    $0x3e7,%edi
mov    %ecx,%edi
ja     1110 <f+0x10>
jmp    1128 <f+0x28>
mov    %edi,%ecx
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ecx
xor    %eax,%eax
cmp    $0x7,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 99
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* %3
%9 = sdiv i32 %8, 10
store i32 %9, i32* %3
br label %4
10: ; preds = %4
%11 = load i32, i32* %3
%12 = srem i32 %11, 10
%13 = icmp eq i32 %12, 7
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %2
br label %16
15: ; preds = %10
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp sgt i32 %0, 99
br i1 %2, label %3, label %7
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = udiv i32 %4, 10
%6 = icmp ugt i32 %4, 999
br i1 %6, label %3, label %7
7: ; preds = %3, %1
%8 = phi i32 [ %0, %1 ], [ %5, %3 ]
%9 = srem i32 %8, 10
%10 = icmp eq i32 %9, 7
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ BiSearch(int *, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int array[] = {3, 5, 7, 9, 11, 23, 38, 45, 47, 57, 99};
  int s;
  int length = sizeof(array) / sizeof(int);
  printf("please input the search number: \n");
  scanf("%d", &s);
  BiSearch(array, s, length);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x2c,%edx
call   1050 <memcpy@plt>
movl   $0xb,-0x38(%rbp)
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1060 <scanf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
call   1040 <BiSearch@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
lea    0x10(%rsp),%rdi
mov    $0xb,%edx
call   1040 <BiSearch@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [11 x i32] [i32 3, i32 5, i32 7, i32 9, i32 11, i32 23, i32 38, i32 45, i32 47, i32 57, i32 99]
@.str = [34 x i8] c"please input the search number: \0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [11 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [11 x i32]* %1 to i8*
store i32 11, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @BiSearch(i32* %7, i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [11 x i32] [i32 3, i32 5, i32 7, i32 9, i32 11, i32 23, i32 38, i32 45, i32 47, i32 57, i32 99]
@.str.1 = [3 x i8] c"%d\00"
@str = [33 x i8] c"please input the search number: \00"
define i32 @main() {
%1 = alloca [11 x i32]
%2 = alloca i32
%3 = bitcast [11 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @BiSearch(i32* %7, i32 %8, i32 11)
ret i32 0
}
int is_prime(int n) {
  int i;
  for (i = 2; i < n; i++)
    if (n % i == 0)
      break;
  if (i == n)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1142 <is_prime+0x42>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    112f <is_prime+0x2f>
jmp    1142 <is_prime+0x42>
jmp    1134 <is_prime+0x34>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    115a <is_prime+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1161 <is_prime+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x2,%ecx
cmp    $0x3,%edi
jl     1122 <is_prime+0x22>
mov    $0x2,%ecx
nop
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1122 <is_prime+0x22>
add    $0x1,%ecx
cmp    %ecx,%edi
jne    1110 <is_prime+0x10>
mov    %edi,%ecx
xor    %eax,%eax
cmp    %edi,%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %10
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ 2, %1 ]
%5 = srem i32 %0, %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %7, %3, %1
%11 = phi i32 [ 2, %1 ], [ %4, %3 ], [ %0, %7 ]
%12 = icmp eq i32 %11, %0
%13 = zext i1 %12 to i32
ret i32 %13
}
int shm_unlink(const char *name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @shm_unlink(i8* nocapture readnone %0) {
ret i32 0
}
void draw() {}


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

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

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

LLVM IR (-O2):
define void @draw() {
ret void
}
/* Type definitions */
struct ip {
  int /*<<< orphan*/ ip_dst;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int inet_pton(int /*<<< orphan*/, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
void set_ip_dst_addr(struct ip *self, char *val) {
  if (inet_pton(AF_INET, val, &(self->ip_dst)) != 1) {
    perror("inet_pton()");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<set_ip_dst_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1030 <inet_pton@plt>
cmp    $0x1,%eax
je     1179 <set_ip_dst_addr+0x49>
lea    0xe9a(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_ip_dst_addr>:
push   %rax
mov    %rdi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1030 <inet_pton@plt>
cmp    $0x1,%eax
jne    1149 <set_ip_dst_addr+0x19>
pop    %rax
ret
lea    0xeb0(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
%struct.ip = type { i32 }
@AF_INET = global i32 0
@.str = [12 x i8] c"inet_pton()\00"
@EXIT_FAILURE = global i32 0
define void @set_ip_dst_addr(%struct.ip* %0, i8* %1) {
%3 = load i32, i32* @AF_INET
%4 = getelementptr inbounds %struct.ip, %struct.ip* %0, i64 0, i32 0
%5 = tail call i32 @inet_pton(i32 %3, i8* %1, i32* %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %2
ret void
}
/* Type definitions */
typedef long double int32_t;

/* Variables and functions */
__attribute__((noipa)) int32_t long_double_to_i32(long double x) { return x; }


x86 assembly (clang, -O0):
<long_double_to_i32>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_double_to_i32>:
fldt   0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @long_double_to_i32(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @long_double_to_i32(x86_fp80 returned %0) {
ret x86_fp80 %0
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
int Get_time_units(void *self, char *units) {
  strncpy(units, "-", (2048));
  return (0);
}


x86 assembly (clang, -O0):
<Get_time_units>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
mov    $0x800,%edx
call   1030 <strncpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_time_units>:
push   %rax
mov    %rsi,%rdi
lea    0xee5(%rip),%rsi
mov    $0x800,%edx
call   1030 <strncpy@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
define i32 @Get_time_units(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @strncpy(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 2048)
ret i32 0
}
void brokenpipe(signo) int signo;
{ printf("\nCannot communicate with child process -- Continuing\n"); }


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"\0ACannot communicate with child process -- Continuing\0A\00"
define void @brokenpipe(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [53 x i8] c"\0ACannot communicate with child process -- Continuing\00"
define void @brokenpipe(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
ret void
}
void root() { __asm__("movl %eax, %ebx"); }


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

x86 assembly (clang, -O2):
<root>:
mov    %eax,%ebx
ret

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

LLVM IR (-O2):
define void @root() {
tail call void asm sideeffect "movl %eax, %ebx", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, ...);
int main() {
  double a[10];
  double *b;
  printf("%d %d %d\n", sizeof(a), sizeof(*a), sizeof(a[0]));
  printf("%d %d\n", sizeof(b), sizeof(*b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0xee1(%rip),%rdi
mov    $0x50,%esi
mov    $0x8,%edx
mov    $0x8,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x8,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 80, i32 8, i64 8)
%2 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 8, i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void warning(char *error) { fprintf(stderr, "chroma: %s\n", error); }


x86 assembly (clang, -O0):
<warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warning>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"chroma: %s\0A\00"
define void @warning(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"chroma: %s\0A\00"
define void @warning(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int Reverse(int n) {
  int i = 0;
  while (n > 0) {
    i = 10 * i + n % 10;
    n /= 10;
  }
  return i;
}


x86 assembly (clang, -O0):
<Reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1145 <Reverse+0x45>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <Reverse+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Reverse>:
xor    %eax,%eax
test   %edi,%edi
jle    1131 <Reverse+0x31>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
lea    (%rcx,%rax,2),%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <Reverse+0x10>
ret

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

LLVM IR (-O2):
define i32 @Reverse(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = urem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = udiv i32 %5, 10
%10 = icmp ult i32 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
void test_promote(short *sp) {
  promote(1.0);
  promote(sp);
}


x86 assembly (clang, -O0):
<test_promote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xedc(%rip),%xmm0
mov    $0x1,%al
call   1030 <promote@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <promote@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_promote>:
push   %rbx
mov    %rdi,%rbx
movsd  0xee4(%rip),%xmm0
mov    $0x1,%al
call   1030 <promote@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <promote@plt>

LLVM IR (-O0):
define void @test_promote(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = call i32 (double, ...) bitcast (i32 (...)* @promote to i32 (double, ...)*)(double 1.000000e+00)
%4 = load i16*, i16** %2
%5 = call i32 (i16*, ...) bitcast (i32 (...)* @promote to i32 (i16*, ...)*)(i16* %4)
ret void
}

LLVM IR (-O2):
define void @test_promote(i16* %0) {
%2 = tail call i32 (double, ...) bitcast (i32 (...)* @promote to i32 (double, ...)*)(double 1.000000e+00)
%3 = tail call i32 (i16*, ...) bitcast (i32 (...)* @promote to i32 (i16*, ...)*)(i16* %0)
ret void
}
void ORWNeighbourTestC$Timer0$stop(void) { VirtualizeTimerC$0$Timer$stop(0U); }


x86 assembly (clang, -O0):
<ORWNeighbourTestC$Timer0$stop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x0,%al
call   1030 <VirtualizeTimerC$0$Timer$stop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ORWNeighbourTestC$Timer0$stop>:
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <VirtualizeTimerC$0$Timer$stop@plt>

LLVM IR (-O0):
define void @"ORWNeighbourTestC$Timer0$stop"() {
%1 = call i32 (i32, ...) bitcast (i32 (...)* @"VirtualizeTimerC$0$Timer$stop" to i32 (i32, ...)*)(i32 0)
ret void
}

LLVM IR (-O2):
define void @"ORWNeighbourTestC$Timer0$stop"() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @"VirtualizeTimerC$0$Timer$stop" to i32 (i32, ...)*)(i32 0)
ret void
}
const char *zje_get_workdir(void) { return "work"; }


x86 assembly (clang, -O0):
<zje_get_workdir>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zje_get_workdir>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"work\00"
define i8* @zje_get_workdir() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"work\00"
define i8* @zje_get_workdir() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage(void) {
  puts("usage: \n");
  puts("  drcomc { login | logout | passwd \"newpasswd\" }\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"usage: \0A\00"
@.str.1 = [50 x i8] c" drcomc { login | logout | passwd \22newpasswd\22 }\0A\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"usage: \0A\00"
@.str.1 = [50 x i8] c" drcomc { login | logout | passwd \22newpasswd\22 }\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void la_preinit(uintptr_t *cookie) { printf("preinit\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"preinit\00"
define void @la_preinit(i64* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exec_rol(int, int, int);
void test_rol(void) {
  int i;
  for (i = 0; i < 32; i++)
    exec_rol(0x21ad3d34, 0x12345678, i);
  for (i = 0; i < 32; i++)
    exec_rol(0x813f3421, 0x82345678, i);
}


x86 assembly (clang, -O0):
<test_rol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    1149 <test_rol+0x39>
mov    -0x4(%rbp),%edx
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
call   1030 <exec_rol@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test_rol+0xf>
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    117a <test_rol+0x6a>
mov    -0x4(%rbp),%edx
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
call   1030 <exec_rol@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <test_rol+0x40>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rol>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
mov    %ebx,%edx
call   1030 <exec_rol@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1120 <test_rol+0x10>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
mov    %ebx,%edx
call   1030 <exec_rol@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1140 <test_rol+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @test_rol() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 32
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @exec_rol(i32 565001524, i32 305419896, i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
store i32 0, i32* %1
br label %12
12: ; preds = %18, %11
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 32
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %1
%17 = call i32 @exec_rol(i32 -2126564319, i32 -2110499208, i32 %16)
br label %18
18: ; preds = %15
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %12
21: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @test_rol() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @exec_rol(i32 565001524, i32 305419896, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %1
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 0, %1 ]
%8 = tail call i32 @exec_rol(i32 -2126564319, i32 -2110499208, i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, 32
br i1 %10, label %11, label %6
11: ; preds = %6
ret void
}
/* Variables and functions */
int find(int *, int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int s[6] = {25, 26, 27, 28, 29, 30};
  int a[5] = {25, 26, 27, 28, 29};
  printf("%d\n", find(s, a, 0, 4));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec6(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xec4(%rip),%eax
mov    %eax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
xor    %edx,%edx
mov    $0x4,%ecx
call   1040 <find@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xed3(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
xor    %edx,%edx
mov    $0x4,%ecx
call   1040 <find@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [6 x i32] [i32 25, i32 26, i32 27, i32 28, i32 29, i32 30]
@__const.main.a = [5 x i32] [i32 25, i32 26, i32 27, i32 28, i32 29]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca [5 x i32]
store i32 0, i32* %1
%4 = bitcast [6 x i32]* %2 to i8*
%5 = bitcast [5 x i32]* %3 to i8*
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%8 = call i32 @find(i32* %6, i32* %7, i32 0, i32 4)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [6 x i32] [i32 25, i32 26, i32 27, i32 28, i32 29, i32 30]
@__const.main.a = [5 x i32] [i32 25, i32 26, i32 27, i32 28, i32 29]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%7 = call i32 @find(i32* %5, i32* %6, i32 0, i32 4)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
int test_imm_21int64_lowword_mem(long long *val) {
  return ((*val) & (0x21 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_21int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 33
%6 = icmp ne i64 %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_21int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 33
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void StackCreate(long int *stack) { stack[0] = 0; }


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

x86 assembly (clang, -O2):
<StackCreate>:
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @StackCreate(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
store i64 0, i64* %4
ret void
}

LLVM IR (-O2):
define void @StackCreate(i64* nocapture writeonly %0) {
store i64 0, i64* %0
ret void
}
/* Variables and functions */
long utf8_strlen(char const *);
long dstrlen(const char *str) { return utf8_strlen(str); }


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

x86 assembly (clang, -O2):
<dstrlen>:
jmp    1030 <utf8_strlen@plt>

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

LLVM IR (-O2):
define i64 @dstrlen(i8* %0) {
%2 = tail call i64 @utf8_strlen(i8* %0)
ret i64 %2
}
/* Variables and functions */
int EOF;
int getchar();
int lower(int);
int /*<<< orphan*/ putchar(int);
int main(void) {
  int c;
  while (c = getchar(), c != EOF) {
    c = lower(c);
    putchar(c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%eax
je     1173 <main+0x43>
mov    -0x8(%rbp),%edi
call   1050 <lower@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ea9(%rip),%rbx
cmp    (%rbx),%eax
je     1169 <main+0x39>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1050 <lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i32, i32* %2
%10 = call i32 @lower(i32 %9)
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @putchar(i32 %11)
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %8, %4 ], [ %1, %0 ]
%6 = tail call i32 @lower(i32 %5)
%7 = tail call i32 @putchar(i32 %6)
%8 = tail call i32 (...) @getchar()
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %4
11: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ot(char *);
defbyte() { ot(".byte "); }


x86 assembly (clang, -O0):
<defbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ot@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c".byte \00"
define i32 @defbyte() {
%1 = tail call i32 @ot(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void yy_2_LinkOptionResize(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_2_LinkOptionResize(i8* nocapture %0, i32 %1) {
ret void
}
int is_prime(int number) {
  int i;
  for (i = 2; i < number; i++) {
    if (number % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <is_prime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <is_prime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <is_prime+0x50>
jmp    113b <is_prime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <is_prime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <is_prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <is_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

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