xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcmp(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int Match(char *Pointer, const char *MatchWith) {
  return !memcmp(Pointer, MatchWith, strlen(MatchWith));
}


x86 assembly (clang, -O0):
<Match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Match>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @Match(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @memcmp(i8* %5, i8* %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @Match(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @memcmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
char lhs(char x) { return x; }


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

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

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

LLVM IR (-O2):
define signext i8 @lhs(i8 returned signext %0) {
ret i8 %0
}
void I422ToARGB4444Row_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @I422ToARGB4444Row_Any_SSSE3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, long);
size_t strlen(char *);
size_t calclen(long x) {
  char s[80];
  sprintf(s, "%ld", x);
  return strlen(s);
}


x86 assembly (clang, -O0):
<calclen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xec5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calclen>:
push   %rbx
sub    $0x50,%rsp
mov    %rdi,%rdx
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define i64 @calclen(i64 %0) {
%2 = alloca i64
%3 = alloca [80 x i8]
store i64 %0, i64* %2
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = load i64, i64* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%8 = call i64 @strlen(i8* %7)
ret i64 %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i64 @calclen(i64 %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
%5 = call i64 @strlen(i8* %3)
ret i64 %5
}
void BN_BLINDING_set_thread_id(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_BLINDING_set_thread_id() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void op_halt(void) { exit(0); }


x86 assembly (clang, -O0):
<op_halt>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<op_halt>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @op_halt() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @op_halt() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printw(char *);
int cmd_status(int argc, char *argv[]) {
  printw("Status cmd\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Status cmd\0A\00"
define i32 @cmd_status(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printw(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Status cmd\0A\00"
define i32 @cmd_status(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printw(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char const *tcerrmsg(int);
const char *tctdberrmsg(int ecode) { return tcerrmsg(ecode); }


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

x86 assembly (clang, -O2):
<tctdberrmsg>:
jmp    1030 <tcerrmsg@plt>

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

LLVM IR (-O2):
define i8* @tctdberrmsg(i32 %0) {
%2 = tail call i8* @tcerrmsg(i32 %0)
ret i8* %2
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ fdrffti(int, float *, int *);
void fft_i(int n, float **trigcache, int **splitcache) {
  *trigcache = calloc(3 * n, sizeof(float));
  *splitcache = calloc(32, sizeof(int));
  fdrffti(n, *trigcache, *splitcache);
}


x86 assembly (clang, -O0):
<fft_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
imul   $0x3,-0x4(%rbp),%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x20,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
call   1040 <fdrffti@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fft_i>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%r15d
lea    (%r15,%r15,2),%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,(%rbx)
mov    $0x20,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,(%r14)
mov    (%rbx),%rsi
mov    %r15d,%edi
mov    %rax,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <fdrffti@plt>

LLVM IR (-O0):
define void @fft_i(i32 %0, float** %1, i32** %2) {
%4 = alloca i32
%5 = alloca float**
%6 = alloca i32**
store i32 %0, i32* %4
store float** %1, float*** %5
store i32** %2, i32*** %6
%7 = load i32, i32* %4
%8 = mul nsw i32 3, %7
%9 = call i8* @calloc(i32 %8, i32 4)
%10 = bitcast i8* %9 to float*
%11 = load float**, float*** %5
store float* %10, float** %11
%12 = call i8* @calloc(i32 32, i32 4)
%13 = bitcast i8* %12 to i32*
%14 = load i32**, i32*** %6
store i32* %13, i32** %14
%15 = load i32, i32* %4
%16 = load float**, float*** %5
%17 = load float*, float** %16
%18 = load i32**, i32*** %6
%19 = load i32*, i32** %18
%20 = call i32 @fdrffti(i32 %15, float* %17, i32* %19)
ret void
}

LLVM IR (-O2):
define void @fft_i(i32 %0, float** nocapture %1, i32** nocapture writeonly %2) {
%4 = mul nsw i32 %0, 3
%5 = tail call i8* @calloc(i32 %4, i32 4)
%6 = bitcast float** %1 to i8**
store i8* %5, i8** %6
%7 = tail call dereferenceable_or_null(128) i8* @calloc(i32 32, i32 4)
%8 = bitcast i8* %7 to i32*
%9 = bitcast i32** %2 to i8**
store i8* %7, i8** %9
%10 = load float*, float** %1
%11 = tail call i32 @fdrffti(i32 %0, float* %10, i32* %8)
ret void
}
int fooey(int f) { return (f * 2 + 1); }


x86 assembly (clang, -O0):
<fooey>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fooey>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @fooey(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @fooey(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
void print_header() {}


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

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

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

LLVM IR (-O2):
define void @print_header() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void br_str_free(void *str) {
  if (str)
    free(str);
}


x86 assembly (clang, -O0):
<br_str_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <br_str_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<br_str_free>:
test   %rdi,%rdi
je     111a <br_str_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @br_str_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @br_str_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void CycleLevel(int *x, const int max) { (*x) = ((*x) + 1) % max; }


x86 assembly (clang, -O0):
<CycleLevel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
cltd
idivl  -0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CycleLevel>:
mov    (%rdi),%eax
add    $0x1,%eax
cltd
idiv   %esi
mov    %edx,(%rdi)
ret

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

LLVM IR (-O2):
define void @CycleLevel(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, 1
%5 = srem i32 %4, %1
store i32 %5, i32* %0
ret void
}
void I422AlphaToARGBRow_C() {}


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

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

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

LLVM IR (-O2):
define void @I422AlphaToARGBRow_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void bar(void) { usleep(2000); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7d0,%edi
call   1030 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    $0x7d0,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @bar() {
%1 = call i32 @usleep(i32 2000)
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 @usleep(i32 2000)
ret void
}
int __bthread_threading(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @__bthread_threading() {
ret i32 1
}
/* Variables and functions */
double sum_omp_tasks(double *, int, int);
double sum_omp(double *v, int low, int high) {
  double s = 0;
#pragma omp parallel
  {
#pragma omp single nowait
    s = sum_omp_tasks(v, low, high);
  }
  return s;
}


x86 assembly (clang, -O0):
<sum_omp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <sum_omp_tasks@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_omp>:
jmp    1030 <sum_omp_tasks@plt>

LLVM IR (-O0):
define double @sum_omp(double* %0, i32 %1, i32 %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store double* %0, double** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store double 0.000000e+00, double* %7
%8 = load double*, double** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call double @sum_omp_tasks(double* %8, i32 %9, i32 %10)
store double %11, double* %7
%12 = load double, double* %7
ret double %12
}

LLVM IR (-O2):
define double @sum_omp(double* %0, i32 %1, i32 %2) {
%4 = tail call double @sum_omp_tasks(double* %0, i32 %1, i32 %2)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ serial_putc(char const);
int platform_puts(const char *buf, int n) {
  int i;
  for (i = 0; i < n; i++)
    serial_putc(buf[i]);
  return n;
}


x86 assembly (clang, -O0):
<platform_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <platform_puts+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <serial_putc@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <platform_puts+0x16>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_puts>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
test   %esi,%esi
jle    1143 <platform_puts+0x33>
mov    %rdi,%r15
mov    %r14d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <serial_putc@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <platform_puts+0x20>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @platform_puts(i8* nocapture %0, i32 returned %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @serial_putc(i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
scalar_t__ strncmp(char *, char *, int);
void isdn_iface_check(int *fd, char *ifname) {
  if (*fd == -1) {
    if (strncmp(ifname, "isdn", 4) == 0)
      *fd = open("/dev/isdnctrl", O_RDWR);
  }
}


x86 assembly (clang, -O0):
<isdn_iface_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    117e <isdn_iface_check+0x5e>
mov    -0x10(%rbp),%rdi
lea    0xeb8(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1179 <isdn_iface_check+0x59>
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
lea    0xe99(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    117e <isdn_iface_check+0x5e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdn_iface_check>:
push   %rbx
cmpl   $0xffffffff,(%rdi)
je     1128 <isdn_iface_check+0x8>
pop    %rbx
ret
mov    %rdi,%rbx
lea    0xece(%rip),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1126 <isdn_iface_check+0x6>
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
lea    0xeae(%rip),%rdi
call   1040 <open@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"isdn\00"
@.str.1 = [14 x i8] c"/dev/isdnctrl\00"
@O_RDWR = global i32 0
define void @isdn_iface_check(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 = load i32, i32* %5
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32, i32* @O_RDWR
%14 = call i32 @open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i32*, i32** %3
store i32 %14, i32* %15
br label %16
16: ; preds = %12, %8
br label %17
17: ; preds = %16, %2
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"isdn\00"
@.str.1 = [14 x i8] c"/dev/isdnctrl\00"
@O_RDWR = global i32 0
define void @isdn_iface_check(i32* nocapture %0, i8* %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = tail call i64 @strncmp(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* @O_RDWR
%10 = tail call i32 @open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %9)
store i32 %10, i32* %0
br label %11
11: ; preds = %5, %8, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ config_status(int /*<<< orphan*/, char *);
void primary_session_down(void) { config_status(0, "0"); }


x86 assembly (clang, -O0):
<primary_session_down>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
call   1030 <config_status@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primary_session_down>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
jmp    1030 <config_status@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
define void @primary_session_down() {
%1 = tail call i32 @config_status(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
int *xmalloc(int);
int main() {
  int *p;
  p = xmalloc(sizeof(int));
  foo(p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <xmalloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @xmalloc(i32 4)
%2 = tail call i32 @foo(i32* %1)
ret i32 0
}
unsigned int SwapBB(unsigned int i) {
  unsigned short result = (i >> 8) & 0xff;
  result |= (i << 8) & 0xff00;
  return (result);
}


x86 assembly (clang, -O0):
<SwapBB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff00,%ecx
movzwl -0x6(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapBB>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @SwapBB(i32 %0) {
%2 = alloca i32
%3 = alloca i16
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = lshr i32 %4, 8
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i16
store i16 %7, i16* %3
%8 = load i32, i32* %2
%9 = shl i32 %8, 8
%10 = and i32 %9, 65280
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = or i32 %12, %10
%14 = trunc i32 %13 to i16
store i16 %14, i16* %3
%15 = load i16, i16* %3
%16 = zext i16 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @SwapBB(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
void busy_wait(int wait_count) {
  volatile unsigned int i;
  for (i = 0; i < wait_count; i++)
    ;
}


x86 assembly (clang, -O0):
<busy_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    112d <busy_wait+0x2d>
jmp    111f <busy_wait+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <busy_wait+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<busy_wait>:
movl   $0x0,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rsp),%eax
cmp    %edi,%eax
jae    111f <busy_wait+0x1f>
addl   $0x1,-0x4(%rsp)
jmp    1110 <busy_wait+0x10>
ret

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

LLVM IR (-O2):
define void @busy_wait(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%4 = load volatile i32, i32* %2
%5 = icmp ult i32 %4, %0
br i1 %5, label %6, label %11
6: ; preds = %1, %6
%7 = load volatile i32, i32* %2
%8 = add i32 %7, 1
store volatile i32 %8, i32* %2
%9 = load volatile i32, i32* %2
%10 = icmp ult i32 %9, %0
br i1 %10, label %6, label %11
11: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ss2sca(float);
void ss2sca_(float *aperture) { ss2sca(*aperture); }


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

x86 assembly (clang, -O2):
<ss2sca_>:
movss  (%rdi),%xmm0
jmp    1030 <ss2sca@plt>

LLVM IR (-O0):
define void @ss2sca_(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = call i32 @ss2sca(float %4)
ret void
}

LLVM IR (-O2):
define void @ss2sca_(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call i32 @ss2sca(float %2)
ret void
}
int libA_func_impl(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @libA_func_impl() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mips_print_char(char);
int /*<<< orphan*/ mips_print_string(char const *);
void print(const char **a, unsigned long n) {
  long i;
  for (i = 0; i < n; i++) {
    mips_print_string(a[i]);
    mips_print_char(' ');
  }
  mips_print_char('\n');
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1172 <print+0x52>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <mips_print_string@plt>
mov    $0x20,%edi
call   1030 <mips_print_char@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <print+0x18>
mov    $0xa,%edi
call   1030 <mips_print_char@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     115c <print+0x3c>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1040 <mips_print_string@plt>
mov    $0x20,%edi
call   1030 <mips_print_char@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <print+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <mips_print_char@plt>

LLVM IR (-O0):
define void @print(i8** %0, i64 %1) {
%3 = alloca i8**
%4 = alloca i64
%5 = alloca i64
store i8** %0, i8*** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %17, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8**, i8*** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8*, i8** %11, i64 %12
%14 = load i8*, i8** %13
%15 = call i32 @mips_print_string(i8* %14)
%16 = call i32 @mips_print_char(i8 signext 32)
br label %17
17: ; preds = %10
%18 = load i64, i64* %5
%19 = add nsw i64 %18, 1
store i64 %19, i64* %5
br label %6
20: ; preds = %6
%21 = call i32 @mips_print_char(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @print(i8** nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = load i8*, i8** %6
%8 = tail call i32 @mips_print_string(i8* %7)
%9 = tail call i32 @mips_print_char(i8 signext 32)
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = tail call i32 @mips_print_char(i8 signext 10)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int rand_int();
float rand_float(void) {
  union {
    uint32_t u;
    float f;
  } r;
  uint32_t u = rand_int();
  int e = 112 + ((u ^ (u >> 8)) & 15);
  r.u = u & 0x007fffffUL;
  r.u |= (u & 0x00800000UL) << 8;
  r.u |= (e & 0xffUL) << 23;
  return r.f;
}


x86 assembly (clang, -O0):
<rand_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
xor    %ecx,%eax
and    $0xf,%eax
add    $0x70,%eax
mov    %eax,-0x10(%rbp)
movslq -0xc(%rbp),%rax
and    $0x7fffff,%rax
mov    %eax,-0x8(%rbp)
movslq -0xc(%rbp),%rcx
and    $0x800000,%rcx
shl    $0x8,%rcx
movslq -0x8(%rbp),%rax
or     %rcx,%rax
mov    %eax,-0x8(%rbp)
movslq -0x10(%rbp),%rcx
and    $0xff,%rcx
shl    $0x17,%rcx
movslq -0x8(%rbp),%rax
or     %rcx,%rax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_float>:
push   %rax
xor    %eax,%eax
call   1030 <rand_int@plt>
mov    %eax,%ecx
shr    $0x8,%ecx
xor    %eax,%ecx
mov    %eax,%edx
and    $0x7fffff,%edx
shl    $0x8,%eax
and    $0x80000000,%eax
or     %edx,%eax
and    $0xf,%ecx
shl    $0x17,%ecx
add    %ecx,%eax
add    $0x38000000,%eax
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @rand_float() {
%1 = alloca %union.anon
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @rand_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = xor i32 %5, %7
%9 = and i32 %8, 15
%10 = add nsw i32 112, %9
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = and i64 %12, 8388607
%14 = trunc i64 %13 to i32
%15 = bitcast %union.anon* %1 to i32*
store i32 %14, i32* %15
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = and i64 %17, 8388608
%19 = shl i64 %18, 8
%20 = bitcast %union.anon* %1 to i32*
%21 = load i32, i32* %20
%22 = sext i32 %21 to i64
%23 = or i64 %22, %19
%24 = trunc i64 %23 to i32
store i32 %24, i32* %20
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = and i64 %26, 255
%28 = shl i64 %27, 23
%29 = bitcast %union.anon* %1 to i32*
%30 = load i32, i32* %29
%31 = sext i32 %30 to i64
%32 = or i64 %31, %28
%33 = trunc i64 %32 to i32
store i32 %33, i32* %29
%34 = bitcast %union.anon* %1 to float*
%35 = load float, float* %34
ret float %35
}

LLVM IR (-O2):
define float @rand_float() {
%1 = tail call i32 (...) @rand_int()
%2 = lshr i32 %1, 8
%3 = xor i32 %2, %1
%4 = and i32 %1, 8388607
%5 = shl i32 %1, 8
%6 = and i32 %5, -2147483648
%7 = shl i32 %3, 23
%8 = and i32 %7, 125829120
%9 = or i32 %4, %6
%10 = or i32 %9, %8
%11 = or i32 %10, 939524096
%12 = bitcast i32 %11 to float
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void exibirMenu() {
  printf("Digite o numero da opcao que deseja\n");
  printf("1 Arvore Binaria\n2 Arvore AVL\n0 Encerra\n\n");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Digite o numero da opcao que deseja\0A\00"
@.str.1 = [42 x i8] c"1 Arvore Binaria\0A2 Arvore AVL\0A0 Encerra\0A\0A\00"
define void @exibirMenu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"Digite o numero da opcao que deseja\00"
@str.2 = [41 x i8] c"1 Arvore Binaria\0A2 Arvore AVL\0A0 Encerra\0A\00"
define void @exibirMenu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.2, i64 0, i64 0))
ret void
}
void f(void) {
  int x = 3 / 0;
  double d = 3.0 / 0.0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %eax,-0x4(%rbp)
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i32
%2 = alloca double
store i32 poison, i32* %1
store double 0x7FF0000000000000, double* %2
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char const *argv[]) {
  int front = 0, back = 0;
  while (back < 5) {
    back++;
    ++front;
    printf("back = %d ,front = %d \n", back, front);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x5,-0x18(%rbp)
jge    1167 <main+0x57>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"back = %d ,front = %d \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1, i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 2, i32 2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 3, i32 3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 4, i32 4)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 5, i32 5)
ret i32 0
}
/* Variables and functions */
float find_array_max(float const *, int, int *);
float array_max(const float *array, int length) {
  int i;
  float max = find_array_max(array, length, &i);
  (void)i;
  return max;
}


x86 assembly (clang, -O0):
<array_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
call   1030 <find_array_max@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_max>:
push   %rax
lea    0x4(%rsp),%rdx
call   1030 <find_array_max@plt>
pop    %rax
ret

LLVM IR (-O0):
define float @array_max(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store float* %0, float** %3
store i32 %1, i32* %4
%7 = load float*, float** %3
%8 = load i32, i32* %4
%9 = call float @find_array_max(float* %7, i32 %8, i32* %5)
store float %9, float* %6
%10 = load i32, i32* %5
%11 = load float, float* %6
ret float %11
}

LLVM IR (-O2):
define float @array_max(float* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call float @find_array_max(float* %0, i32 %1, i32* %3)
ret float %5
}
/* Variables and functions */
char *srv_strerror(int);
char const *strerror(int);
char const *srv_xstrerror(int err) {
  char const *str;
  if ((str = srv_strerror(err)) != NULL)
    return str;
  return strerror(err);
}


x86 assembly (clang, -O0):
<srv_xstrerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <srv_strerror@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     114e <srv_xstrerror+0x2e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115a <srv_xstrerror+0x3a>
mov    -0xc(%rbp),%edi
call   1040 <strerror@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srv_xstrerror>:
push   %rbx
mov    %edi,%ebx
call   1030 <srv_strerror@plt>
test   %rax,%rax
je     112f <srv_xstrerror+0xf>
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1040 <strerror@plt>

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

LLVM IR (-O2):
define i8* @srv_xstrerror(i32 %0) {
%2 = tail call i8* @srv_strerror(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @strerror(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ %2, %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int yyparse();
main() {
  printf("\n--------------------------- AnBm PARSER "
         "---------------------------\n");
  printf("\nPlease enter a AnBm : \n");
  return (yyparse());
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf11(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <yyparse@plt>

LLVM IR (-O0):
@.str = [70 x i8] c"\0A--------------------------- AnBm PARSER ---------------------------\0A\00"
@.str.1 = [25 x i8] c"\0APlease enter a AnBm : \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @yyparse()
ret i32 %4
}

LLVM IR (-O2):
@str = [69 x i8] c"\0A--------------------------- AnBm PARSER ---------------------------\00"
@str.2 = [24 x i8] c"\0APlease enter a AnBm : \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 (...) @yyparse()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: mmap_sanity -d dir [-m dir2]\n");
  printf("       dir      lustre mount point\n");
  printf("       dir2     another mount point\n");
  exit(127);
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Usage: mmap_sanity -d dir [-m dir2]\0A\00"
@.str.1 = [36 x i8] c" dir lustre mount point\0A\00"
@.str.2 = [37 x i8] c" dir2 another mount point\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 127)
unreachable
}

LLVM IR (-O2):
@str = [36 x i8] c"Usage: mmap_sanity -d dir [-m dir2]\00"
@str.3 = [35 x i8] c" dir lustre mount point\00"
@str.4 = [36 x i8] c" dir2 another mount point\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @exit(i32 127)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ stop();
void signalhandler(int sig) {
  (void)sig;
  stop();
}


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

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

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

LLVM IR (-O2):
define void @signalhandler(i32 %0) {
%2 = tail call i32 (...) @stop()
ret void
}
int main() {
  int shu_zi_1 = 1, shu_zi_2 = 4;
  shu_zi_1 *shu_zi_2;
  shu_zi_1 = shu_zi_1 + 1;
  shu_zi_1 *shu_zi_2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void wakeup(void *pp) {
  int *p = (int *)pp;
  write(p[1], "a", 1);
}


x86 assembly (clang, -O0):
<wakeup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edi
lea    0xece(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wakeup>:
mov    0x4(%rdi),%edi
lea    0xee6(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
define void @wakeup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = call i32 @write(i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define void @wakeup(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @write(i32 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int f366(int *);
int f367(int *p) { return f366(p); }


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

x86 assembly (clang, -O2):
<f367>:
jmp    1030 <f366@plt>

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

LLVM IR (-O2):
define i32 @f367(i32* %0) {
%2 = tail call i32 @f366(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int __m256;

/* Variables and functions */
__m256 _avx_mul(__m256 a, __m256 b) { return a * b; }


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

x86 assembly (clang, -O2):
<_avx_mul>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @_avx_mul(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @_avx_mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int main() {
  int a = 1, b = 0, c;
  c = a || b;
  if (!c) {
    __VERIFIER_error();
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jne    1146 <main+0x36>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    116e <main+0x5e>
mov    $0x0,%al
call   1030 <__VERIFIER_error@plt>
movl   $0x1,-0x4(%rbp)
jmp    1175 <main+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %7, %0
%11 = phi i1 [ true, %0 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %10
%16 = call i32 (...) @__VERIFIER_error()
store i32 1, i32* %1
br label %18
17: ; preds = %10
store i32 0, i32* %1
br label %18
18: ; preds = %17, %15
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int iscntrl(int c) { return ((c >= 0x00 && c <= 0x1F) && c == 0x7F); }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     112f <iscntrl+0x2f>
xor    %eax,%eax
cmpl   $0x1f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     112f <iscntrl+0x2f>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
ret i32 0
}