xunge/DecIR huggingface dataset:
unsigned int check_cs(unsigned int c, unsigned int s) {
  return (c < 1024 && s < 32);
}


x86 assembly (clang, -O0):
<check_cs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x400,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jae    1126 <check_cs+0x26>
cmpl   $0x20,-0x8(%rbp)
setb   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_cs>:
cmp    $0x400,%edi
setb   %al
cmp    $0x20,%esi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @check_cs(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 = icmp ult i32 %5, 1024
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ult i32 %8, 32
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @check_cs(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 1024
%4 = icmp ult i32 %1, 32
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void gtk_icon_theme_prepend_search_path() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_theme_prepend_search_path() {
ret void
}
TAG_CALLBACK(sh_default) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @TAG_CALLBACK(i32 %0) {
ret i32 0
}
void f2(unsigned int x) { return; }


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

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

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

LLVM IR (-O2):
define void @f2(i32 %0) {
ret void
}
/* Type definitions */
struct kref {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BUG();
void dy_bug(struct kref *kref) { BUG(); }


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

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

LLVM IR (-O0):
%struct.kref = type { i32 }
define void @dy_bug(%struct.kref* %0) {
%2 = alloca %struct.kref*
store %struct.kref* %0, %struct.kref** %2
%3 = call i32 (...) @BUG()
ret void
}

LLVM IR (-O2):
%struct.kref = type { i32 }
define void @dy_bug(%struct.kref* nocapture readnone %0) {
%2 = tail call i32 (...) @BUG()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
void Step(void) {
  char buffer[20];
  printf("Step\n");
  gets(buffer);
}


x86 assembly (clang, -O0):
<Step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <gets@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Step>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1040 <gets@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@str = [5 x i8] c"Step\00"
define void @Step() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
ret void
}
void one() {}


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

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

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

LLVM IR (-O2):
define void @one() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ block_or_unblock_signal(int /*<<< orphan*/,
                                           int /*<<< orphan*/);
void octave_block_interrupt_signal(void) {
  block_or_unblock_signal(SIG_BLOCK, SIGINT);
}


x86 assembly (clang, -O0):
<octave_block_interrupt_signal>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
call   1030 <block_or_unblock_signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_block_interrupt_signal>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
jmp    1030 <block_or_unblock_signal@plt>

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
@SIGINT = global i32 0
define void @octave_block_interrupt_signal() {
%1 = load i32, i32* @SIG_BLOCK
%2 = load i32, i32* @SIGINT
%3 = call i32 @block_or_unblock_signal(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
@SIGINT = global i32 0
define void @octave_block_interrupt_signal() {
%1 = load i32, i32* @SIG_BLOCK
%2 = load i32, i32* @SIGINT
%3 = tail call i32 @block_or_unblock_signal(i32 %1, i32 %2)
ret void
}
/* Type definitions */
struct tempfile {
  int dummy;
};

/* Variables and functions */
struct tempfile *xmks_tempfile_m(char const *, int);
struct tempfile *xmks_tempfile(const char *filename_template) {
  return xmks_tempfile_m(filename_template, 0600);
}


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

x86 assembly (clang, -O2):
<xmks_tempfile>:
mov    $0x180,%esi
jmp    1030 <xmks_tempfile_m@plt>

LLVM IR (-O0):
%struct.tempfile = type { i32 }
define %struct.tempfile* @xmks_tempfile(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.tempfile* @xmks_tempfile_m(i8* %3, i32 384)
ret %struct.tempfile* %4
}

LLVM IR (-O2):
%struct.tempfile = type { i32 }
define %struct.tempfile* @xmks_tempfile(i8* %0) {
%2 = tail call %struct.tempfile* @xmks_tempfile_m(i8* %0, i32 384)
ret %struct.tempfile* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void gotoXY(int _x, int _y) { printf("\x01B[%d;%dH", _y, _x); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @gotoXY(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 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @gotoXY(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
void main(void) {
  int pwmFactor = 0;
  int i;
  unsigned char *P7 = (unsigned char *)0x03ed;
  unsigned char *PD7 = (unsigned char *)0x03ef;
  *P7 = 0xff;
  *PD7 = 0xff;
  while (1) {
    if (++pwmFactor > 1000)
      pwmFactor = 0;
    for (i = 0; i < pwmFactor; i++) {
      *P7 = 0xdf;
    }
    for (i = 0; i < (1000 - pwmFactor); i++) {
      *P7 = 0xff;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x3ed,%eax
mov    %rax,-0x10(%rbp)
mov    $0x3ef,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movb   $0xff,(%rax)
mov    -0x18(%rbp),%rax
movb   $0xff,(%rax)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x3e8,%eax
jle    1146 <main+0x46>
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116e <main+0x6e>
mov    -0x10(%rbp),%rax
movb   $0xdf,(%rax)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x4d>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
sub    -0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    119d <main+0x9d>
mov    -0x10(%rbp),%rax
movb   $0xff,(%rax)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1175 <main+0x75>
jmp    112b <main+0x2b>

x86 assembly (clang, -O2):
<main>:
movb   $0xff,0x3ef
ff
xor    %eax,%eax
xor    %ecx,%ecx
nopl   0x0(%rax)
cmp    $0x3e8,%ecx
lea    0x1(%rcx),%ecx
cmovge %eax,%ecx
jmp    1110 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
store i8* inttoptr (i64 1005 to i8*), i8** %3
store i8* inttoptr (i64 1007 to i8*), i8** %4
%5 = load i8*, i8** %3
store i8 -1, i8* %5
%6 = load i8*, i8** %4
store i8 -1, i8* %6
br label %7
7: ; preds = %0, %33
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
%10 = icmp sgt i32 %9, 1000
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 0, i32* %1
br label %12
12: ; preds = %11, %7
store i32 0, i32* %2
br label %13
13: ; preds = %19, %12
%14 = load i32, i32* %2
%15 = load i32, i32* %1
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i8*, i8** %3
store i8 -33, i8* %18
br label %19
19: ; preds = %17
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %13
22: ; preds = %13
store i32 0, i32* %2
br label %23
23: ; preds = %30, %22
%24 = load i32, i32* %2
%25 = load i32, i32* %1
%26 = sub nsw i32 1000, %25
%27 = icmp slt i32 %24, %26
br i1 %27, label %28, label %33
28: ; preds = %23
%29 = load i8*, i8** %3
store i8 -1, i8* %29
br label %30
30: ; preds = %28
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %2
br label %23
33: ; preds = %23
br label %7
}

LLVM IR (-O2):
define void @main() {
store i8 -1, i8* inttoptr (i64 1007 to i8*)
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = add nsw i32 %2, 1
%4 = icmp sgt i32 %2, 999
%5 = select i1 %4, i32 0, i32 %3
br label %1
}
int mmr_diverse(int q_no, int number_of_preresults, int number_of_results) {
  return 0;
}


x86 assembly (clang, -O0):
<mmr_diverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mmr_diverse(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @mmr_diverse(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
int exact_square(int n) {
  int i = 1;
  for (; i <= n / 2; i++) {
    if (n == i * i) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     115d <exact_square+0x5d>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jne    114a <exact_square+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1164 <exact_square+0x64>
jmp    114f <exact_square+0x4f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <exact_square+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     1137 <exact_square+0x37>
mov    %edi,%ecx
shr    %ecx
neg    %ecx
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edx,%esi
imul   %edx,%esi
cmp    %edi,%esi
je     1138 <exact_square+0x38>
lea    (%rcx,%rdx,1),%esi
add    $0x1,%esi
add    $0x1,%edx
cmp    $0x1,%esi
jne    1120 <exact_square+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 1
br label %8
5: ; preds = %8
%6 = add nuw nsw i32 %9, 1
%7 = icmp eq i32 %9, %4
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ 1, %3 ]
%10 = mul nsw i32 %9, %9
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %5
12: ; preds = %8, %5, %1
%13 = phi i32 [ 0, %1 ], [ 0, %5 ], [ 1, %8 ]
ret i32 %13
}
/* Type definitions */
struct timespec {
  double tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
double wi_tstod(struct timespec ts) {
  return ts.tv_sec + ((double)ts.tv_nsec / 1000000000.0);
}


x86 assembly (clang, -O0):
<wi_tstod>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wi_tstod>:
cvtsi2sd %rdi,%xmm1
divsd  0xef3(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { double, i64 }
define double @wi_tstod(double %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to { double, i64 }*
%5 = getelementptr inbounds { double, i64 }, { double, i64 }* %4, i32 0, i32 0
store double %0, double* %5
%6 = getelementptr inbounds { double, i64 }, { double, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = fdiv double %11, 1.000000e+09
%13 = fadd double %8, %12
ret double %13
}

LLVM IR (-O2):
define double @wi_tstod(double %0, i64 %1) {
%3 = sitofp i64 %1 to double
%4 = fdiv double %3, 1.000000e+09
%5 = fadd double %4, %0
ret double %5
}
/* Variables and functions */
scalar_t__ strcasecmp(char *, char *);
int _os_strcmp(char *pattern, char *str, int str_len, int size) {
  if (strcasecmp(pattern, str) == 0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<_os_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1149 <_os_strcmp+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1150 <_os_strcmp+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_os_strcmp(i8* nocapture %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = tail call i64 @strcasecmp(i8* %0, i8* %1)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
int charToInt(const char c) { return c - '0'; }


x86 assembly (clang, -O0):
<charToInt>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charToInt>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @charToInt(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @charToInt(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
void free_fmatrix(float **m, int minx, int maxx, int miny, int maxy) {
  int i;
  float *p;
  m += minx;
  p = m[0] + miny;
  free(p);
  free(m);
}


x86 assembly (clang, -O0):
<free_fmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_fmatrix>:
push   %rbx
movslq %esi,%rdx
lea    (%rdi,%rdx,8),%rbx
movslq %ecx,%rax
shl    $0x2,%rax
add    (%rdi,%rdx,8),%rax
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_fmatrix(float** nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds float*, float** %0, i64 %6
%8 = load float*, float** %7
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds float, float* %8, i64 %9
%11 = bitcast float* %10 to i8*
tail call void @free(i8* %11)
%12 = bitcast float** %7 to i8*
tail call void @free(i8* %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_get_flags();
int /*<<< orphan*/ e_push(int /*<<< orphan*/);
void e_php() { e_push(e_get_flags()); }


x86 assembly (clang, -O0):
<e_php>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <e_get_flags@plt>
mov    %eax,%edi
call   1040 <e_push@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_php>:
push   %rax
xor    %eax,%eax
call   1030 <e_get_flags@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <e_push@plt>

LLVM IR (-O0):
define void @e_php() {
%1 = call i32 (...) @e_get_flags()
%2 = call i32 @e_push(i32 %1)
ret void
}

LLVM IR (-O2):
define void @e_php() {
%1 = tail call i32 (...) @e_get_flags()
%2 = tail call i32 @e_push(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_client_conf_load_cookie_from_file() {
  printf("NOT IMPLEMENTED:"
         "pa_client_conf_load_cookie_from_file"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [53 x i8] c"NOT IMPLEMENTED:pa_client_conf_load_cookie_from_file\00"
define i32 @pa_client_conf_load_cookie_from_file() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void actually_free(void *data) { free(data); }


x86 assembly (clang, -O0):
<actually_free>:
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):
<actually_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @actually_free(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 @actually_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int read_int() {
  int x;
  scanf("%i", &x);
  return x;
}


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

x86 assembly (clang, -O2):
<read_int>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @read_int() {
%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
ret i32 %4
}
int ab8500_fg_inst_curr_done(struct ab8500_fg *di) {}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
%struct.ab8500_fg = type opaque
define i32 @ab8500_fg_inst_curr_done(%struct.ab8500_fg* %0) {
%2 = alloca i32
%3 = alloca %struct.ab8500_fg*
store %struct.ab8500_fg* %0, %struct.ab8500_fg** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.ab8500_fg = type opaque
define i32 @ab8500_fg_inst_curr_done(%struct.ab8500_fg* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
unsigned long long _tzcnt_u64(unsigned long long);
unsigned long long func_tzcnt64_2(unsigned long long X) {
  return _tzcnt_u64(X);
}


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

x86 assembly (clang, -O2):
<func_tzcnt64_2>:
jmp    1030 <_tzcnt_u64@plt>

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

LLVM IR (-O2):
define i64 @func_tzcnt64_2(i64 %0) {
%2 = tail call i64 @_tzcnt_u64(i64 %0)
ret i64 %2
}
int test_imm_90int8_mem(signed char *val) {
  return ((*val) & (0x90 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_90int8_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, 144
%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_90int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -112
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ terminal_state(int);
int terminal_check(int code) { return terminal_state(code) > 0; }


x86 assembly (clang, -O0):
<terminal_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <terminal_state@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @terminal_check(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @terminal_state(i32 %3)
%5 = icmp sgt i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @terminal_check(i32 %0) {
%2 = tail call i64 @terminal_state(i32 %0)
%3 = icmp sgt i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int count_commas(char *s) {
  int n = 0;
  while (*s) {
    if (*s == ',')
      n++;
    s++;
  }
  return n;
}


x86 assembly (clang, -O0):
<count_commas>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <count_commas+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    1135 <count_commas+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <count_commas+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_commas>:
xor    %eax,%eax
jmp    1117 <count_commas+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x2c,%cl
je     1110 <count_commas+0x10>
test   %cl,%cl
jne    1113 <count_commas+0x13>
ret

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

LLVM IR (-O2):
define i32 @count_commas(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i32 [ 0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 44, label %6
]
6: ; preds = %2
%7 = add nsw i32 %4, 1
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i32 %4
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_charsetmap(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_charsetmap>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_charsetmap(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_charsetmap(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
int quick_hash(char *str, int seed, int mod) {
  unsigned int hash = 0;
  for (; *str; str++)
    hash = (hash * 37 + (*str ^ seed));
  return hash % mod;
}


x86 assembly (clang, -O0):
<quick_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <quick_hash+0x46>
imul   $0x25,-0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
xor    -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <quick_hash+0x15>
mov    -0x14(%rbp),%eax
xor    %edx,%edx
divl   -0x10(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_hash>:
mov    %edx,%r8d
mov    (%rdi),%dl
test   %dl,%dl
je     112a <quick_hash+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nop
lea    (%rax,%rax,8),%ecx
lea    (%rax,%rcx,4),%ecx
movsbl %dl,%eax
xor    %esi,%eax
add    %ecx,%eax
movzbl (%rdi),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1110 <quick_hash+0x10>
jmp    112c <quick_hash+0x2c>
xor    %eax,%eax
xor    %edx,%edx
div    %r8d
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @quick_hash(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %15, %6 ], [ %4, %3 ]
%8 = phi i32 [ %13, %6 ], [ 0, %3 ]
%9 = phi i8* [ %14, %6 ], [ %0, %3 ]
%10 = mul i32 %8, 37
%11 = sext i8 %7 to i32
%12 = xor i32 %11, %1
%13 = add i32 %12, %10
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %6, %3
%18 = phi i32 [ 0, %3 ], [ %13, %6 ]
%19 = urem i32 %18, %2
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int DOlshell(void) {
  (void)system("$SHELL");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"$SHELL\00"
define i32 @DOlshell() {
%1 = call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"$SHELL\00"
define i32 @DOlshell() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_imm_13(void) {
  static int val = 0;
  val = (val + 4) & 0x3ff;
  printf("0x%x", val);
}


x86 assembly (clang, -O0):
<print_imm_13>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f12(%rip),%eax
add    $0x4,%eax
and    $0x3ff,%eax
mov    %eax,0x2f04(%rip)
mov    0x2efe(%rip),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_imm_13>:
mov    0x2f16(%rip),%esi
add    $0x4,%esi
and    $0x3ff,%esi
mov    %esi,0x2f07(%rip)
lea    0xed4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@print_imm_13.val = internal global i32 0
@.str = [5 x i8] c"0x%x\00"
define void @print_imm_13() {
%1 = load i32, i32* @print_imm_13.val
%2 = add nsw i32 %1, 4
%3 = and i32 %2, 1023
store i32 %3, i32* @print_imm_13.val
%4 = load i32, i32* @print_imm_13.val
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@print_imm_13.val = internal unnamed_addr global i32 0
@.str = [5 x i8] c"0x%x\00"
define void @print_imm_13() {
%1 = load i32, i32* @print_imm_13.val
%2 = add nsw i32 %1, 4
%3 = and i32 %2, 1023
store i32 %3, i32* @print_imm_13.val
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
unsigned long GetFGColor80();
unsigned long getfgcolor() { return GetFGColor80(); }


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

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

LLVM IR (-O0):
define i64 @getfgcolor() {
%1 = call i64 (...) @GetFGColor80()
ret i64 %1
}

LLVM IR (-O2):
define i64 @getfgcolor() {
%1 = tail call i64 (...) @GetFGColor80()
ret i64 %1
}
long calc_taps_check(long dim_in, long dim_out) {
  long tmp_i;
  if (dim_in < dim_out) {
    return 4;
  }
  tmp_i = dim_in * 4 / dim_out;
  return tmp_i - (tmp_i % 2);
}


x86 assembly (clang, -O0):
<calc_taps_check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1127 <calc_taps_check+0x27>
movq   $0x4,-0x8(%rbp)
jmp    115a <calc_taps_check+0x5a>
mov    -0x10(%rbp),%rax
shl    $0x2,%rax
cqto
idivq  -0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0x28(%rbp),%rax
sub    %rdx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_taps_check>:
mov    $0x4,%eax
cmp    %rsi,%rdi
jl     113d <calc_taps_check+0x3d>
shl    $0x2,%rdi
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1127 <calc_taps_check+0x27>
mov    %rdi,%rax
cqto
idiv   %rsi
mov    %rax,%rcx
jmp    112f <calc_taps_check+0x2f>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
mov    %eax,%ecx
mov    %rcx,%rax
shr    $0x3f,%rax
add    %rcx,%rax
and    $0xfffffffffffffffe,%rax
ret

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

LLVM IR (-O2):
define i64 @calc_taps_check(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = shl nsw i64 %0, 2
%6 = sdiv i64 %5, %1
%7 = srem i64 %6, 2
%8 = sub nsw i64 %6, %7
br label %9
9: ; preds = %2, %4
%10 = phi i64 [ %8, %4 ], [ 4, %2 ]
ret i64 %10
}
void T32_INT2_IRQHandler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @T32_INT2_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
bool IsPrime(long int n) {
  for (long int i = 2; i < n; i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<IsPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1154 <IsPrime+0x54>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
cmp    $0x0,%rdx
jne    113e <IsPrime+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    115b <IsPrime+0x5b>
jmp    1143 <IsPrime+0x43>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <IsPrime+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsPrime>:
mov    $0x1,%eax
cmp    $0x3,%rdi
jl     1155 <IsPrime+0x55>
xor    %eax,%eax
test   $0x1,%dil
je     1155 <IsPrime+0x55>
mov    $0x3,%eax
jmp    112f <IsPrime+0x2f>
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
lea    0x1(%rcx),%rax
test   %rdx,%rdx
je     114d <IsPrime+0x4d>
mov    %rax,%rcx
cmp    %rax,%rdi
je     114d <IsPrime+0x4d>
mov    %rdi,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1120 <IsPrime+0x20>
mov    %rdi,%rax
cqto
idiv   %rcx
jmp    1126 <IsPrime+0x26>
xor    %eax,%eax
cmp    %rdi,%rcx
setge  %al
ret

LLVM IR (-O0):
define i32 @IsPrime(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 2, i64* %4
br label %5
5: ; preds = %16, %1
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = icmp slt i64 %6, %7
br i1 %8, label %9, label %19
9: ; preds = %5
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = srem i64 %10, %11
%13 = icmp eq i64 %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 i64, i64* %4
%18 = add nsw i64 %17, 1
store i64 %18, i64* %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 @IsPrime(i64 %0) {
%2 = icmp sgt i64 %0, 2
br i1 %2, label %3, label %16
3: ; preds = %1
%4 = and i64 %0, 1
%5 = icmp eq i64 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %9
%7 = phi i64 [ %12, %9 ], [ 3, %3 ]
%8 = icmp eq i64 %7, %0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = srem i64 %0, %7
%11 = icmp eq i64 %10, 0
%12 = add nuw nsw i64 %7, 1
br i1 %11, label %13, label %6
13: ; preds = %6, %9
%14 = icmp sge i64 %7, %0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %13, %3, %1
%17 = phi i32 [ 1, %1 ], [ 0, %3 ], [ %15, %13 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void version() {
  printf("V1.1.1\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"V1.1.1\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [7 x i8] c"V1.1.1\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int imax(int a, int b) {
  if (a > b)
    return a;
  else
    return b;
}


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

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

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

LLVM IR (-O2):
define i32 @imax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void RTTermRegisterCallback(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTermRegisterCallback() {
ret void
}
void foo_2_2_1_1_2_1_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_2_1_1_1_2() {
ret void
}
int f(int i) { return i == -600; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xfffffda8,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    $0xfffffda8,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -600
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, -600
%3 = zext i1 %2 to i32
ret i32 %3
}
int llen(unsigned long l) {
  int ret = 1;
  while (l != 0) {
    ret++;
    l /= 10;
  }
  return ret;
}


x86 assembly (clang, -O0):
<llen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113a <llen+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
jmp    110f <llen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llen>:
mov    $0x1,%ecx
test   %rdi,%rdi
je     1136 <llen+0x36>
movabs $0xcccccccccccccccd,%rsi
cc cc cc
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ecx
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1120 <llen+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @llen(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = udiv i64 %5, 10
%8 = icmp ult i64 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t HibernateBatCheckDone(void) {
  return ((*((volatile uint32_t *)(0x400FC010))) & 0x00000400);
}


x86 assembly (clang, -O0):
<HibernateBatCheckDone>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%eax
and    $0x400,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateBatCheckDone>:
mov    $0x400,%eax
and    0x400fc010,%eax
ret

LLVM IR (-O0):
define i32 @HibernateBatCheckDone() {
%1 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%2 = and i32 %1, 1024
ret i32 %2
}

LLVM IR (-O2):
define i32 @HibernateBatCheckDone() {
%1 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%2 = and i32 %1, 1024
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help04(void) {
  printf("  b                 reset break\n");
  printf("  b  <addr>         set break at <addr>\n");
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c" b reset break\0A\00"
@.str.1 = [41 x i8] c" b <addr> set break at <addr>\0A\00"
define void @help04() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c" b reset break\00"
@str.2 = [40 x i8] c" b <addr> set break at <addr>\00"
define void @help04() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
int main(int argc, char **argv) {
  test(10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xa,%edi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @test(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ skip(char *);
int main() {
  char *msg_from_amy = "Don't call me.";
  skip(msg_from_amy);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"Don't call me.\00"
define i32 @main() {
%1 = tail call i32 @skip(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void map_m5_mem() {}


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

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

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

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