xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SIGTSTP;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void suspend() { kill(getpid(), SIGTSTP); }


x86 assembly (clang, -O0):
<suspend>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<suspend>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1040 <kill@plt>

LLVM IR (-O0):
@SIGTSTP = global i32 0
define void @suspend() {
%1 = call i32 (...) @getpid()
%2 = load i32, i32* @SIGTSTP
%3 = call i32 @kill(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@SIGTSTP = global i32 0
define void @suspend() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGTSTP
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ uni();
int get_rand_int(const int imin, const int imax) {
  return (imin +
          (int)((double)uni() * (double)(imax - imin + 1) / (double)1.0));
}


x86 assembly (clang, -O0):
<get_rand_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <uni@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
cvtsi2sd %rcx,%xmm0
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cvtsi2sd %ecx,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <uni@plt>
cvtsi2sd %rax,%xmm0
sub    %ebp,%ebx
add    $0x1,%ebx
cvtsi2sd %ebx,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_rand_int(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 = call i64 (...) @uni()
%7 = sitofp i64 %6 to double
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = sitofp i32 %11 to double
%13 = fmul double %7, %12
%14 = fdiv double %13, 1.000000e+00
%15 = fptosi double %14 to i32
%16 = add nsw i32 %5, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_rand_int(i32 %0, i32 %1) {
%3 = tail call i64 (...) @uni()
%4 = sitofp i64 %3 to double
%5 = sub i32 1, %0
%6 = add i32 %5, %1
%7 = sitofp i32 %6 to double
%8 = fmul double %7, %4
%9 = fptosi double %8 to i32
%10 = add nsw i32 %9, %0
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int);
void _assertTrue(int actual, char *file, int line) {
  if (actual) {
    printf("%s:%d:\033[0;32m %d OK\033[0m\n", file, line, actual);
  } else {
    printf("%s:%d:\033[0;31m got %d\033[0m\n", file, line, actual);
  }
}


x86 assembly (clang, -O0):
<_assertTrue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1147 <_assertTrue+0x37>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
jmp    115d <_assertTrue+0x4d>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assertTrue>:
test   %edi,%edi
je     1122 <_assertTrue+0x12>
mov    %edi,%ecx
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xef0(%rip),%rdi
xor    %ecx,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"%s:%d:\1B[0;32m %d OK\1B[0m\0A\00"
@.str.1 = [26 x i8] c"%s:%d:\1B[0;31m got %d\1B[0m\0A\00"
define void @_assertTrue(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i32 %12)
br label %19
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = load i32, i32* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %15, i32 %16, i32 %17)
br label %19
19: ; preds = %14, %9
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"%s:%d:\1B[0;32m %d OK\1B[0m\0A\00"
@.str.1 = [26 x i8] c"%s:%d:\1B[0;31m got %d\1B[0m\0A\00"
define void @_assertTrue(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i32 %0)
br label %9
7: ; preds = %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %1, i32 %2, i32 0)
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DMA5_DriverIRQHandler();
__attribute__((weak)) void DMA5_IRQHandler(void) { DMA5_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @DMA5_IRQHandler() {
%1 = call i32 (...) @DMA5_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA5_IRQHandler() {
%1 = tail call i32 (...) @DMA5_DriverIRQHandler()
ret void
}
void RTLockValidatorRecExclInitV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorRecExclInitV() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("Hola Mundo.\n");
  printf("Bienvenido a mi primer prgrama en C.\n");
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hola Mundo.\0A\00"
@.str.1 = [38 x i8] c"Bienvenido a mi primer prgrama en C.\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hola Mundo.\00"
@str.2 = [37 x i8] c"Bienvenido a mi primer prgrama en C.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
char *_ultoa(unsigned long val) {
  char *p;
  static char buf[12];
  p = buf + sizeof(buf);
  *--p = '\0';
  do {
    *--p = '0' + val % 10;
    val /= 10;
  } while (val);
  return p;
}


x86 assembly (clang, -O0):
<_ultoa>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0x2f12(%rip),%rax
add    $0xc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,-0x1(%rax)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
add    $0x30,%rdx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112a <_ultoa+0x2a>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ultoa>:
movb   $0x0,0x2f25(%rip)
lea    0x2f1e(%rip),%rcx
movabs $0xcccccccccccccccd,%r8
cc cc cc
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rax
mul    %r8
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%eax
lea    (%rax,%rax,4),%eax
mov    %edi,%esi
sub    %eax,%esi
or     $0x30,%sil
mov    %sil,-0x1(%rcx)
add    $0xffffffffffffffff,%rcx
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1120 <_ultoa+0x20>
mov    %rcx,%rax
ret

LLVM IR (-O0):
@_ultoa.buf = internal global [12 x i8] zeroinitializer
define i8* @_ultoa(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @_ultoa.buf, i64 1, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i32 -1
store i8* %5, i8** %3
store i8 0, i8* %5
br label %6
6: ; preds = %15, %1
%7 = load i64, i64* %2
%8 = urem i64 %7, 10
%9 = add i64 48, %8
%10 = trunc i64 %9 to i8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 -1
store i8* %12, i8** %3
store i8 %10, i8* %12
%13 = load i64, i64* %2
%14 = udiv i64 %13, 10
store i64 %14, i64* %2
br label %15
15: ; preds = %6
%16 = load i64, i64* %2
%17 = icmp ne i64 %16, 0
br i1 %17, label %6, label %18
18: ; preds = %15
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@_ultoa.buf = internal global [12 x i8] zeroinitializer
define i8* @_ultoa(i64 %0) {
store i8 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @_ultoa.buf, i64 0, i64 11)
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %9, %2 ]
%4 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @_ultoa.buf, i64 0, i64 11), %1 ], [ %8, %2 ]
%5 = urem i64 %3, 10
%6 = trunc i64 %5 to i8
%7 = or i8 %6, 48
%8 = getelementptr inbounds i8, i8* %4, i64 -1
store i8 %7, i8* %8
%9 = udiv i64 %3, 10
%10 = icmp ult i64 %3, 10
br i1 %10, label %11, label %2
11: ; preds = %2
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ le_write_double(unsigned char *, double);
int /*<<< orphan*/ memcpy(void *, unsigned char *, int);
void WriteDouble(void *ptr, double d) {
  unsigned char result[8] = "\0\0\0\0\0\0\0\0";
  le_write_double(result, d);
  memcpy(ptr, result, 8);
}


x86 assembly (clang, -O0):
<WriteDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    -0x18(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
call   1030 <le_write_double@plt>
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1050 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteDouble>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movq   $0x0,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <le_write_double@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @WriteDouble(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca [8 x i8]
store i8* %0, i8** %3
store double %1, double* %4
%6 = bitcast [8 x i8]* %5 to i8*
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%8 = load double, double* %4
%9 = call i32 @le_write_double(i8* %7, double %8)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%12 = call i32 @memcpy(i8* %10, i8* %11, i32 8)
ret void
}

LLVM IR (-O2):
define void @WriteDouble(i8* %0, double %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%5 = call i32 @le_write_double(i8* %4, double %1)
%6 = call i32 @memcpy(i8* %0, i8* %4, i32 8)
ret void
}
void NV21ToRGB24Row_AVX2() {}


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

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

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

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

/* Variables and functions */
void lfsr_calculate(uint16_t *reg) {
  uint16_t bit = 0;
  uint16_t lfsr = *reg;
  bit = ((lfsr >> 15) ^ (lfsr >> 13) ^ (lfsr >> 12) ^ (lfsr >> 10)) & 1;
  lfsr = (lfsr << 1) | bit;
  *reg = lfsr;
}


x86 assembly (clang, -O0):
<lfsr_calculate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sar    $0xf,%eax
mov    -0x10(%rbp),%ecx
sar    $0xd,%ecx
xor    %ecx,%eax
mov    -0x10(%rbp),%ecx
sar    $0xc,%ecx
xor    %ecx,%eax
mov    -0x10(%rbp),%ecx
sar    $0xa,%ecx
xor    %ecx,%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lfsr_calculate>:
mov    (%rdi),%eax
mov    %eax,%ecx
shr    $0xf,%ecx
mov    %eax,%edx
shr    $0xd,%edx
xor    %ecx,%edx
mov    %eax,%ecx
shr    $0xc,%ecx
mov    %eax,%esi
shr    $0xa,%esi
xor    %ecx,%esi
xor    %edx,%esi
and    $0x1,%esi
lea    (%rsi,%rax,2),%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @lfsr_calculate(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 15
%9 = load i32, i32* %4
%10 = ashr i32 %9, 13
%11 = xor i32 %8, %10
%12 = load i32, i32* %4
%13 = ashr i32 %12, 12
%14 = xor i32 %11, %13
%15 = load i32, i32* %4
%16 = ashr i32 %15, 10
%17 = xor i32 %14, %16
%18 = and i32 %17, 1
store i32 %18, i32* %3
%19 = load i32, i32* %4
%20 = shl i32 %19, 1
%21 = load i32, i32* %3
%22 = or i32 %20, %21
store i32 %22, i32* %4
%23 = load i32, i32* %4
%24 = load i32*, i32** %2
store i32 %23, i32* %24
ret void
}

LLVM IR (-O2):
define void @lfsr_calculate(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = lshr i32 %2, 15
%4 = lshr i32 %2, 13
%5 = xor i32 %3, %4
%6 = lshr i32 %2, 12
%7 = xor i32 %5, %6
%8 = lshr i32 %2, 10
%9 = xor i32 %7, %8
%10 = and i32 %9, 1
%11 = shl i32 %2, 1
%12 = or i32 %10, %11
store i32 %12, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fibonacci_series(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int limit;
  printf("Enter the limit to generate the Fibonacci Series \n");
  scanf("%d", &limit);
  printf("Fibonacci Series is ...\n");
  fibonacci_series(limit);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%edi
call   1040 <fibonacci_series@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"Enter the limit to generate the Fibonacci Series \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"Fibonacci Series is ...\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @fibonacci_series(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [50 x i8] c"Enter the limit to generate the Fibonacci Series \00"
@str.3 = [24 x i8] c"Fibonacci Series is ...\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.3, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = call i32 @fibonacci_series(i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(int /*<<< orphan*/);
void exit(int status) { __ESBMC_assume(0); }


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <__ESBMC_assume@plt>

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

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @__ESBMC_assume(i32 0)
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 @__ESBMC_assume(i32 0)
unreachable
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number, digit;
  scanf("%d", &number);
  digit = is_prime(number);
  printf("%d", digit);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @is_prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int strcmp(void const *, void const *);
int comparef(const void *key1, const void *key2) { return strcmp(key1, key2); }


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

x86 assembly (clang, -O2):
<comparef>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @comparef(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 = call i32 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @comparef(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_default_user(void **ret) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_default_user>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_default_user>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_default_user(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_default_user(i8** nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void progress(float complete, void *data) {
  fprintf(stderr, "\rrsurface2kdt: %3.0f%% complete    ",
          (complete > 1. ? 1. : complete) * 100.);
}


x86 assembly (clang, -O0):
<progress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    115a <progress+0x4a>
movsd  0xeb0(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1168 <progress+0x58>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%edi
movsd  -0x20(%rbp),%xmm0
movsd  0xe90(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edx
lea    0xe89(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<progress>:
mov    0x2ec9(%rip),%rax
cvtss2sd %xmm0,%xmm0
movsd  0xedd(%rip),%xmm1
minsd  %xmm0,%xmm1
mulsd  0xed9(%rip),%xmm1
mov    (%rax),%edi
cvttsd2si %xmm1,%edx
lea    0xed4(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"\0Drsurface2kdt: %3.0f%% complete \00"
define void @progress(float %0, i8* %1) {
%3 = alloca float
%4 = alloca i8*
store float %0, float* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load float, float* %3
%7 = fpext float %6 to double
%8 = fcmp ogt double %7, 1.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %2
br label %13
10: ; preds = %2
%11 = load float, float* %3
%12 = fpext float %11 to double
br label %13
13: ; preds = %10, %9
%14 = phi double [ 1.000000e+00, %9 ], [ %12, %10 ]
%15 = fmul double %14, 1.000000e+02
%16 = fptosi double %15 to i32
%17 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %16)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"\0Drsurface2kdt: %3.0f%% complete \00"
define void @progress(float %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = fpext float %0 to double
%5 = fcmp ogt double %4, 1.000000e+00
%6 = select i1 %5, double 1.000000e+00, double %4
%7 = fmul double %6, 1.000000e+02
%8 = fptosi double %7 to i32
%9 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}
/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main() {
  int n = 5;
  if (fork() == 0)
    n++;
  n += 10;
  if (fork() > 0)
    n++;
  printf("n=%d\n", n);
  sleep(15);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
cmp    $0x0,%rax
jne    1160 <main+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
cmp    $0x0,%rax
jle    1183 <main+0x53>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
mov    $0xf,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <fork@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
xor    %eax,%eax
call   1050 <fork@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
lea    (%rbx,%rcx,1),%esi
add    $0xf,%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    $0xf,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"n=%d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i32 16, i32 15
%4 = tail call i64 (...) @fork()
%5 = icmp sgt i64 %4, 0
%6 = zext i1 %5 to i32
%7 = add nuw nsw i32 %3, %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 @sleep(i32 15)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_hour;
  int tm_min;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int nowtod(void) {
  struct tm tm;
  time_t t;
  time(&t);
  tm = *localtime(&t);
  return tm.tm_hour * 60 + tm.tm_min;
}


x86 assembly (clang, -O0):
<nowtod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
imul   $0x3c,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nowtod>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
imul   $0x3c,(%rax),%ecx
add    0x4(%rax),%ecx
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32 }
define i32 @nowtod() {
%1 = alloca %struct.tm
%2 = alloca i32
%3 = call i32 @time(i32* %2)
%4 = call %struct.tm* @localtime(i32* %2)
%5 = bitcast %struct.tm* %1 to i8*
%6 = bitcast %struct.tm* %4 to i8*
%7 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 60
%10 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 1
%11 = load i32, i32* %10
%12 = add nsw i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
%struct.tm = type { i32, i32 }
define i32 @nowtod() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 1
%8 = load i32, i32* %7
%9 = mul nsw i32 %6, 60
%10 = add nsw i32 %9, %8
ret i32 %10
}
/* Variables and functions */
int yices_main(int, char **);
int main(int argc, char *argv[]) { return yices_main(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <yices_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <yices_main@plt>

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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @yices_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @yices_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ps1(void) { printf("this a test!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"this a test!\0A\00"
define void @ps1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"this a test!\00"
define void @ps1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
int mapping_set() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mapping_set() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
scalar_t__ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void sqImageFileSeek(int f, off_t pos) {
  if (lseek(f, pos, SEEK_SET) < 0)
    perror("sqImageFileSeek lseek");
}


x86 assembly (clang, -O0):
<sqImageFileSeek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
cmp    $0x0,%rax
jge    1158 <sqImageFileSeek+0x38>
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqImageFileSeek>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
test   %rax,%rax
js     1136 <sqImageFileSeek+0x16>
pop    %rax
ret
lea    0xec3(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
@.str = [22 x i8] c"sqImageFileSeek lseek\00"
define void @sqImageFileSeek(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 = load i32, i32* @SEEK_SET
%8 = call i64 @lseek(i32 %5, i32 %6, i32 %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@.str = [22 x i8] c"sqImageFileSeek lseek\00"
define void @sqImageFileSeek(i32 %0, i32 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i64 @lseek(i32 %0, i32 %1, i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ __infer_nondet_int();
wint_t fgetwc(FILE *stream) { return __infer_nondet_int(); }


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

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

LLVM IR (-O0):
define i32 @fgetwc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @__infer_nondet_int()
ret i32 %3
}

LLVM IR (-O2):
define i32 @fgetwc(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rec(int x) {
  if (x == 0)
    return x;
  printf(">>>>> x = %d\n", x);
  return rec(x - 1) + 1;
}


x86 assembly (clang, -O0):
<rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1140 <rec+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <rec+0x40>
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <rec@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
test   %edi,%edi
je     113f <rec+0x2f>
lea    0xede(%rip),%rbx
mov    %r14d,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1130 <rec+0x20>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c">>>>> x = %d\0A\00"
define i32 @rec(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nsw i32 %4, -1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret i32 %0
}
int fun1058() { return 1058; }


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

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

LLVM IR (-O0):
define i32 @fun1058() {
ret i32 1058
}

LLVM IR (-O2):
define i32 @fun1058() {
ret i32 1058
}
/* Variables and functions */
int /*<<< orphan*/ GenPrintInstr2Operands(int, int /*<<< orphan*/, int,
                                          int /*<<< orphan*/, int, int);
int /*<<< orphan*/ GenPrintInstr3Operands(int, int /*<<< orphan*/, int,
                                          int /*<<< orphan*/, int,
                                          int /*<<< orphan*/, int, int);
void GenJumpIfNotEqual(int val, int label) {
  GenPrintInstr2Operands(0x07, 0, 0x09, 0, 0x80, val);
  GenPrintInstr3Operands(0x22, 0, 0x02, 0, 0x09, 0, 0x82, label);
}


x86 assembly (clang, -O0):
<GenJumpIfNotEqual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%r9d
mov    $0x7,%edi
xor    %ecx,%ecx
mov    $0x9,%edx
mov    $0x80,%r8d
mov    %ecx,%esi
call   1040 <GenPrintInstr2Operands@plt>
mov    -0x8(%rbp),%eax
mov    $0x22,%edi
xor    %r9d,%r9d
mov    $0x2,%edx
mov    $0x9,%r8d
mov    %r9d,%esi
mov    %r9d,%ecx
movl   $0x82,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <GenPrintInstr3Operands@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenJumpIfNotEqual>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%r9d
mov    $0x7,%edi
xor    %esi,%esi
mov    $0x9,%edx
xor    %ecx,%ecx
mov    $0x80,%r8d
call   1040 <GenPrintInstr2Operands@plt>
mov    $0x22,%edi
xor    %esi,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
mov    $0x9,%r8d
xor    %r9d,%r9d
push   %rbx
push   $0x82
call   1030 <GenPrintInstr3Operands@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @GenJumpIfNotEqual(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 = call i32 @GenPrintInstr2Operands(i32 7, i32 0, i32 9, i32 0, i32 128, i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @GenPrintInstr3Operands(i32 34, i32 0, i32 2, i32 0, i32 9, i32 0, i32 130, i32 %7)
ret void
}

LLVM IR (-O2):
define void @GenJumpIfNotEqual(i32 %0, i32 %1) {
%3 = tail call i32 @GenPrintInstr2Operands(i32 7, i32 0, i32 9, i32 0, i32 128, i32 %0)
%4 = tail call i32 @GenPrintInstr3Operands(i32 34, i32 0, i32 2, i32 0, i32 9, i32 0, i32 130, i32 %1)
ret void
}
int strcmp(char const *str1, char const *str2) {
  while (*str1 && *str1 == *str2)
    str1++, str2++;
  return (unsigned char)*str1 - (unsigned char)*str2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movzbl %al,%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %20, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %13, %16
br label %18
18: ; preds = %10, %5
%19 = phi i1 [ false, %5 ], [ %17, %10 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %5
25: ; preds = %18
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = sub nsw i32 %28, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = zext i8 %18 to i32
%20 = load i8, i8* %17
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
int secure_storage_nand_read(char *buf, unsigned int len) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @secure_storage_nand_read(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
float max(float a, float b) {
  if (b > a)
    return b;
  return a;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <max+0x2c>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <max+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @max(float %0, float %1) {
%3 = fcmp ogt float %1, %0
%4 = select i1 %3, float %1, float %0
ret float %4
}
long long fib(int x) {
  long long f;
  if (x == 1) {
    f = 0;
  } else if (x == 2) {
    f = 1;
  } else {
    f = fib(x - 1) + fib(x - 2);
  }
  return f;
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1132 <fib+0x22>
movq   $0x0,-0x10(%rbp)
jmp    1176 <fib+0x66>
cmpl   $0x2,-0x4(%rbp)
jne    1149 <fib+0x39>
movq   $0x1,-0x10(%rbp)
jmp    1171 <fib+0x61>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1176 <fib+0x66>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %r14d,%r14d
cmp    $0x1,%ebx
je     1138 <fib+0x28>
xchg   %ax,%ax
cmp    $0x2,%ebx
je     113c <fib+0x2c>
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    %rax,%r14
add    $0xfffffffe,%ebx
cmp    $0x1,%ebx
jne    1120 <fib+0x10>
xor    %eax,%eax
jmp    1141 <fib+0x31>
mov    $0x1,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fib(i32 %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i64 [ 0, %1 ], [ %9, %5 ]
%4 = phi i32 [ %0, %1 ], [ %8, %5 ]
switch i32 %4, label %5 [
i32 1, label %10
i32 2, label %11
]
5: ; preds = %2
%6 = add nsw i32 %4, -1
%7 = tail call i64 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i64 %7, %3
br label %2
10: ; preds = %2
br label %11
11: ; preds = %2, %10
%12 = phi i64 [ 0, %10 ], [ 1, %2 ]
%13 = add nsw i64 %12, %3
ret i64 %13
}
/* Variables and functions */
double M_PI;
double mod2pi_positive(double);
double mod2pi(double vin) { return mod2pi_positive(vin + M_PI) - M_PI; }


x86 assembly (clang, -O0):
<mod2pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
addsd  (%rax),%xmm0
call   1030 <mod2pi_positive@plt>
mov    0x2eaf(%rip),%rax
subsd  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod2pi>:
push   %rbx
mov    0x2ed0(%rip),%rbx
addsd  (%rbx),%xmm0
call   1030 <mod2pi_positive@plt>
subsd  (%rbx),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @mod2pi(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fadd double %3, %4
%6 = call double @mod2pi_positive(double %5)
%7 = load double, double* @M_PI
%8 = fsub double %6, %7
ret double %8
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @mod2pi(double %0) {
%2 = load double, double* @M_PI
%3 = fadd double %2, %0
%4 = tail call double @mod2pi_positive(double %3)
%5 = load double, double* @M_PI
%6 = fsub double %4, %5
ret double %6
}
void fd133(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
p0B:
  goto p0B;
  goto a;
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
a:;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd133>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd133+0x7>

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

LLVM IR (-O0):
define void @fd133(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; preds = %23
br label %23
24: ; No predecessors!
%25 = load i32, i32* %2
%26 = zext i32 %25 to i64
br label %27
27: ; preds = %27, %24
br label %27
28: ; No predecessors!
%29 = load i32, i32* %2
%30 = zext i32 %29 to i64
br label %31
31: ; preds = %31, %28
br label %31
32: ; preds = %32
br label %32
33: ; No predecessors!
%34 = load i32, i32* %2
%35 = zext i32 %34 to i64
br label %36
36: ; preds = %36, %33
br label %36
37: ; preds = %37
br label %37
38: ; No predecessors!
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
br label %41
41: ; preds = %41, %38
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd133(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
char *rindex(a, b)
register char *a, b;
{ return 0; }


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

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

LLVM IR (-O0):
define i8* @rindex(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @rindex(i8* nocapture readnone %0, i8 signext %1) {
ret i8* null
}