xunge/DecIR huggingface dataset:
/* Variables and functions */
int board_get_revision();
int board_with_es8316(void) {
  return ((board_get_revision() == 0x1) || (board_get_revision() == 0x3) ||
          (board_get_revision() == 0x5) || (board_get_revision() == 0x6));
}


x86 assembly (clang, -O0):
<board_with_es8316>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <board_get_revision@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x1,%ecx
mov    %al,-0x1(%rbp)
je     116d <board_with_es8316+0x5d>
mov    $0x0,%al
call   1030 <board_get_revision@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x3,%ecx
mov    %al,-0x1(%rbp)
je     116d <board_with_es8316+0x5d>
mov    $0x0,%al
call   1030 <board_get_revision@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x5,%ecx
mov    %al,-0x1(%rbp)
je     116d <board_with_es8316+0x5d>
mov    $0x0,%al
call   1030 <board_get_revision@plt>
cmp    $0x6,%eax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_with_es8316>:
push   %rbx
xor    %eax,%eax
call   1030 <board_get_revision@plt>
mov    $0x1,%ebx
cmp    $0x1,%eax
je     1149 <board_with_es8316+0x39>
xor    %eax,%eax
call   1030 <board_get_revision@plt>
cmp    $0x3,%eax
je     1149 <board_with_es8316+0x39>
xor    %eax,%eax
call   1030 <board_get_revision@plt>
cmp    $0x5,%eax
je     1149 <board_with_es8316+0x39>
xor    %eax,%eax
call   1030 <board_get_revision@plt>
xor    %ebx,%ebx
cmp    $0x6,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @board_with_es8316() {
%1 = call i32 (...) @board_get_revision()
%2 = icmp eq i32 %1, 1
br i1 %2, label %12, label %3
3: ; preds = %0
%4 = call i32 (...) @board_get_revision()
%5 = icmp eq i32 %4, 3
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = call i32 (...) @board_get_revision()
%8 = icmp eq i32 %7, 5
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = call i32 (...) @board_get_revision()
%11 = icmp eq i32 %10, 6
br label %12
12: ; preds = %9, %6, %3, %0
%13 = phi i1 [ true, %6 ], [ true, %3 ], [ true, %0 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @board_with_es8316() {
%1 = tail call i32 (...) @board_get_revision()
%2 = icmp eq i32 %1, 1
br i1 %2, label %13, label %3
3: ; preds = %0
%4 = tail call i32 (...) @board_get_revision()
%5 = icmp eq i32 %4, 3
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = tail call i32 (...) @board_get_revision()
%8 = icmp eq i32 %7, 5
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = tail call i32 (...) @board_get_revision()
%11 = icmp eq i32 %10, 6
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %6, %3, %0
%14 = phi i32 [ 1, %6 ], [ 1, %3 ], [ 1, %0 ], [ %12, %9 ]
ret i32 %14
}
void ExttLogTypeAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttLogTypeAuxTable() {
ret void
}
/* Variables and functions */
size_t iabs(size_t value) { return value < 0 ? 0 - value : value; }


x86 assembly (clang, -O0):
<iabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jae    1122 <iabs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <iabs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @iabs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ult i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @iabs(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int);
void print_it(int size, int *b) {
  int i;
  for (i = 0; i < size; b++, i++) {
    printf("%p %d\n", b, *b);
  }
}


x86 assembly (clang, -O0):
<print_it>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1162 <print_it+0x52>
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print_it+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_it>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1146 <print_it+0x36>
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x4,%rbx
add    $0xffffffff,%ebp
jne    1130 <print_it+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%p %d\0A\00"
define void @print_it(i32 %0, i32* %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32* [ %9, %4 ], [ %1, %2 ]
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %6, i32 %7)
%9 = getelementptr inbounds i32, i32* %6, i64 1
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double seconds_read(void) {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return tv.tv_sec + 1e-6 * tv.tv_usec;
}


x86 assembly (clang, -O0):
<seconds_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xecb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seconds_read>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
define double @seconds_read() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %7, double %4)
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @seconds_read() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}
void pp_soft_wdt_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @pp_soft_wdt_stop() {
ret void
}
/* Type definitions */
typedef char const uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite_err(char const *, int, int, int /*<<< orphan*/ *);
int strlen(char const *);
void toasim_write_str(const char *fname, const char *str, FILE *file) {
  uint32_t sz = (uint32_t)strlen(str);
  fwrite_err(fname, 4, 1, file);
  fwrite_err(&sz, sizeof(uint32_t), 1, file);
  fwrite_err(str, 1, strlen(str), file);
}


x86 assembly (clang, -O0):
<toasim_write_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite_err@plt>
mov    -0x18(%rbp),%rcx
lea    -0x19(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <fwrite_err@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite_err@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toasim_write_str>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %al,0xf(%rsp)
mov    %r15,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1040 <fwrite_err@plt>
lea    0xf(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1040 <fwrite_err@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   1040 <fwrite_err@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @toasim_write_str(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %5
%9 = call i32 @strlen(i8* %8)
%10 = trunc i32 %9 to i8
store i8 %10, i8* %7
%11 = load i8*, i8** %4
%12 = load i32*, i32** %6
%13 = call i32 @fwrite_err(i8* %11, i32 4, i32 1, i32* %12)
%14 = load i32*, i32** %6
%15 = call i32 @fwrite_err(i8* %7, i32 1, i32 1, i32* %14)
%16 = load i8*, i8** %5
%17 = load i8*, i8** %5
%18 = call i32 @strlen(i8* %17)
%19 = load i32*, i32** %6
%20 = call i32 @fwrite_err(i8* %16, i32 1, i32 %18, i32* %19)
ret void
}

LLVM IR (-O2):
define void @toasim_write_str(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8
%5 = tail call i32 @strlen(i8* %1)
%6 = trunc i32 %5 to i8
store i8 %6, i8* %4
%7 = tail call i32 @fwrite_err(i8* %0, i32 4, i32 1, i32* %2)
%8 = call i32 @fwrite_err(i8* %4, i32 1, i32 1, i32* %2)
%9 = call i32 @strlen(i8* %1)
%10 = call i32 @fwrite_err(i8* %1, i32 1, i32 %9, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fun_adiw(int);
scalar_t__ fun_inc(int);
scalar_t__ fun_neg(int);
int main() {
  if (fun_inc(0x7f) != 0)
    abort();
  if (fun_neg(0x80) != 0)
    abort();
  if (fun_adiw(0x7ffe) != 0)
    abort();
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7f,%edi
call   1040 <fun_inc@plt>
cmp    $0x0,%rax
je     117a <main+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x80,%edi
call   1050 <fun_neg@plt>
cmp    $0x0,%rax
je     1195 <main+0x45>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x7ffe,%edi
call   1070 <fun_adiw@plt>
cmp    $0x0,%rax
je     11b0 <main+0x60>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7f,%edi
call   1040 <fun_inc@plt>
test   %rax,%rax
jne    1185 <main+0x35>
mov    $0x80,%edi
call   1050 <fun_neg@plt>
test   %rax,%rax
jne    1185 <main+0x35>
mov    $0x7ffe,%edi
call   1070 <fun_adiw@plt>
test   %rax,%rax
jne    1185 <main+0x35>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @fun_inc(i32 127)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i64 @fun_neg(i32 128)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %6
%12 = call i64 @fun_adiw(i32 32766)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %11
%17 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @fun_inc(i32 127)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i64 @fun_neg(i32 128)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i64 @fun_adiw(i32 32766)
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @abort()
unreachable
15: ; preds = %10
%16 = tail call i32 @exit(i32 0)
unreachable
}
extern __attribute__((gnu_)) int isdigit(int __c) {
  return ((unsigned)__c - '0') <= 9;
}


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
cmp    $0x9,%eax
setbe  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 48
%5 = icmp ule i32 %4, 9
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void strength_test2(int *data) {
  int k = data[0];
  int i = 0;
  do {
    data[data[2]] = 2;
    i = i + 1;
  } while (k * i < data[1]);
}


x86 assembly (clang, -O0):
<strength_test2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0x4(%rcx),%eax
jl     1118 <strength_test2+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_test2>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    %eax,%ecx
movslq 0x8(%rdi),%rdx
movl   $0x2,(%rdi,%rdx,4)
cmp    0x4(%rdi),%ecx
jl     1110 <strength_test2+0x10>
ret

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

LLVM IR (-O2):
define void @strength_test2(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 2
%4 = getelementptr inbounds i32, i32* %0, i64 1
br label %5
5: ; preds = %5, %1
%6 = phi i32 [ 0, %1 ], [ %10, %5 ]
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 2, i32* %9
%10 = add nuw nsw i32 %6, 1
%11 = mul nsw i32 %10, %2
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %5, label %14
14: ; preds = %5
ret void
}
float gt_float(float a, float b) { return a > b; }


x86 assembly (clang, -O0):
<gt_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_float>:
cmpltss %xmm0,%xmm1
movss  0xef3(%rip),%xmm0
andps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @gt_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @gt_float(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = uitofp i1 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, int);
void ptst(char a, int i) { printf("\t%c Group has %d contact(s).\n", a, i); }


x86 assembly (clang, -O0):
<ptst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%edx
lea    0xed2(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"\09%c Group has %d contact(s).\0A\00"
define void @ptst(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8 signext %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"\09%c Group has %d contact(s).\0A\00"
define void @ptst(i8 signext %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8 signext %0, i32 %1)
ret void
}
/* Variables and functions */
int strncmp(const char *s1, const char *s2, size_t n) {
__ESBMC_HIDE:
  if (s1 != 0 && s1 == s2)
    return 0;
  return 0;
}


x86 assembly (clang, -O0):
<strncmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1135 <strncmp+0x35>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1135 <strncmp+0x35>
movl   $0x0,-0x4(%rbp)
jmp    113c <strncmp+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strncmp(i8* readnone %0, i8* readnone %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ChristmasTree(int);
int /*<<< orphan*/ printf(char *);
int main() {
  ChristmasTree(4);
  printf("\n");
  ChristmasTree(7);
  printf("\n");
  ChristmasTree(11);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <ChristmasTree@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x7,%edi
call   1040 <ChristmasTree@plt>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    $0xb,%edi
call   1040 <ChristmasTree@plt>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ChristmasTree(i32 4)
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @ChristmasTree(i32 7)
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @ChristmasTree(i32 11)
%6 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ft_putendl(char *);
int /*<<< orphan*/ ft_putstr(char *);
void pid_error(char *tab) {
  ft_putstr("msh: '");
  ft_putstr(tab);
  ft_putendl("' is not a valid pid");
}


x86 assembly (clang, -O0):
<pid_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <ft_putstr@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ft_putstr@plt>
lea    0xebf(%rip),%rdi
call   1030 <ft_putendl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pid_error>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <ft_putstr@plt>
mov    %rbx,%rdi
call   1040 <ft_putstr@plt>
lea    0xec8(%rip),%rdi
pop    %rbx
jmp    1030 <ft_putendl@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"msh: '\00"
@.str.1 = [21 x i8] c"' is not a valid pid\00"
define void @pid_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @ft_putstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @ft_putstr(i8* %4)
%6 = call i32 @ft_putendl(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"msh: '\00"
@.str.1 = [21 x i8] c"' is not a valid pid\00"
define void @pid_error(i8* %0) {
%2 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @ft_putstr(i8* %0)
%4 = tail call i32 @ft_putendl(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
char *getenv(char const *);
int /*<<< orphan*/ stderr;
char *getenv_fail_on_error(const char *name) {
  char *value = getenv(name);
  if (!value) {
    fprintf(stderr, "[libfakefile] failed to initialize, %s is not set.\n",
            name);
    exit(EXIT_FAILURE);
  }
  return value;
}


x86 assembly (clang, -O0):
<getenv_fail_on_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117b <getenv_fail_on_error+0x4b>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getenv_fail_on_error>:
push   %rbx
mov    %rdi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
je     1140 <getenv_fail_on_error+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"[libfakefile] failed to initialize, %s is not set.\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @getenv_fail_on_error(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @getenv(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"[libfakefile] failed to initialize, %s is not set.\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @getenv_fail_on_error(i8* %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
int call(int (*function)(void *), void *data) {
  return function ? function(data) : 0;
}


x86 assembly (clang, -O0):
<call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112d <call+0x2d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
mov    %eax,-0x14(%rbp)
jmp    1137 <call+0x37>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <call+0x37>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call>:
test   %rdi,%rdi
je     110d <call+0xd>
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @call(i32 (i8*)* %0, i8* %1) {
%3 = icmp eq i32 (i8*)* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 %0(i8* %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
int *test_func_04(int *p, int *x) {
  int r = 0;
  r += *p++;
  r += *p++;
  *x = r;
  return p;
}


x86 assembly (clang, -O0):
<test_func_04>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func_04>:
lea    0x8(%rdi),%rax
mov    0x4(%rdi),%ecx
add    (%rdi),%ecx
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
define i32* @test_func_04(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %3
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = add nsw i32 %9, %8
store i32 %10, i32* %5
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i32 1
store i32* %12, i32** %3
%13 = load i32, i32* %11
%14 = load i32, i32* %5
%15 = add nsw i32 %14, %13
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = load i32*, i32** %4
store i32 %16, i32* %17
%18 = load i32*, i32** %3
ret i32* %18
}

LLVM IR (-O2):
define i32* @test_func_04(i32* %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %0
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, %4
store i32 %7, i32* %1
ret i32* %5
}
int sequence_w(unsigned char **signal) {
  int v = (*signal)[0] | ((*signal)[1] << 8);
  *signal += 2;
  return v;
}


x86 assembly (clang, -O0):
<sequence_w>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sequence_w>:
mov    (%rdi),%rcx
movzwl (%rcx),%eax
add    $0x2,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i32 @sequence_w(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = load i8**, i8*** %2
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = or i32 %8, %14
store i32 %15, i32* %3
%16 = load i8**, i8*** %2
%17 = load i8*, i8** %16
%18 = getelementptr inbounds i8, i8* %17, i64 2
store i8* %18, i8** %16
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @sequence_w(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %2, i64 2
store i8* %10, i8** %0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
char tyi(void) {
  char c;
  read(0, &c, 1);
  return c;
}


x86 assembly (clang, -O0):
<tyi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tyi>:
push   %rax
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

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

LLVM IR (-O2):
define signext i8 @tyi() {
%1 = alloca i8
%2 = call i32 @read(i32 0, i8* %1, i32 1)
%3 = load i8, i8* %1
ret i8 %3
}
int init_sync(void) {
  ;
  ;
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @init_sync() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ T2DLP_errormsg();
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int T2DLP_clear(long myDLP) {
  T2DLP_errormsg();
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<T2DLP_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <T2DLP_errormsg@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<T2DLP_clear>:
push   %rax
xor    %eax,%eax
call   1040 <T2DLP_errormsg@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @T2DLP_clear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @T2DLP_errormsg()
%4 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @T2DLP_clear(i64 %0) {
%2 = tail call i32 (...) @T2DLP_errormsg()
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
char *strrchr(char const *, char);
__attribute__((__unused__)) const char *basename_c(const char *path) {
  const char *slash = strrchr(path, '/');
  if (slash)
    return (++slash);
  return (path);
}


x86 assembly (clang, -O0):
<basename_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114e <basename_c+0x3e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x8(%rbp)
jmp    1156 <basename_c+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename_c>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @basename_c(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int ArgNum();
int GetFlag(int);
int Cnd_NotEq(void) {
  int v = ArgNum();
  return (GetFlag(v) != ArgNum());
}


x86 assembly (clang, -O0):
<Cnd_NotEq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ArgNum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <GetFlag@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <ArgNum@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cnd_NotEq>:
push   %rbx
xor    %eax,%eax
call   1040 <ArgNum@plt>
mov    %eax,%edi
call   1030 <GetFlag@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <ArgNum@plt>
xor    %ecx,%ecx
cmp    %eax,%ebx
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Cnd_NotEq() {
%1 = alloca i32
%2 = call i32 (...) @ArgNum()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @GetFlag(i32 %3)
%5 = call i32 (...) @ArgNum()
%6 = icmp ne i32 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @Cnd_NotEq() {
%1 = tail call i32 (...) @ArgNum()
%2 = tail call i32 @GetFlag(i32 %1)
%3 = tail call i32 (...) @ArgNum()
%4 = icmp ne i32 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ u_long;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_UDP;
int /*<<< orphan*/ SOCK_DGRAM;
int svc_socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
               int /*<<< orphan*/);
int svcudp_socket(u_long number, int reuse) {
  return svc_socket(number, SOCK_DGRAM, IPPROTO_UDP, 0);
}


x86 assembly (clang, -O0):
<svcudp_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1030 <svc_socket@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svcudp_socket>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
jmp    1030 <svc_socket@plt>

LLVM IR (-O0):
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
define i32 @svcudp_socket(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* @SOCK_DGRAM
%7 = load i32, i32* @IPPROTO_UDP
%8 = call i32 @svc_socket(i32 %5, i32 %6, i32 %7, i32 0)
ret i32 %8
}

LLVM IR (-O2):
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
define i32 @svcudp_socket(i32 %0, i32 %1) {
%3 = load i32, i32* @SOCK_DGRAM
%4 = load i32, i32* @IPPROTO_UDP
%5 = tail call i32 @svc_socket(i32 %0, i32 %3, i32 %4, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ overflow(int *, int);
void add(int total[], int head) {
  int j;
  for (j = 0; j <= head; j++)
    if (total[j] > 9)
      overflow(total, j);
}


x86 assembly (clang, -O0):
<add>:
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
jg     1163 <add+0x53>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x9,(%rax,%rcx,4)
jle    1150 <add+0x40>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <overflow@plt>
jmp    1155 <add+0x45>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <add+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
js     114c <add+0x3c>
mov    %esi,%r14d
mov    %rdi,%r15
add    $0x1,%r14d
xor    %ebx,%ebx
jmp    1139 <add+0x29>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%r14
je     114c <add+0x3c>
cmpl   $0xa,(%r15,%rbx,4)
jl     1130 <add+0x20>
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <overflow@plt>
jmp    1130 <add+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @add(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %18, label %4
4: ; preds = %2
%5 = add nuw i32 %1, 1
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %15
%8 = phi i64 [ 0, %4 ], [ %16, %15 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp sgt i32 %10, 9
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = trunc i64 %8 to i32
%14 = tail call i32 @overflow(i32* %0, i32 %13)
br label %15
15: ; preds = %7, %12
%16 = add nuw nsw i64 %8, 1
%17 = icmp eq i64 %16, %6
br i1 %17, label %18, label %7
18: ; preds = %15, %2
ret void
}
void RTLockValidatorWriteLockDec(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorWriteLockDec() {
ret void
}
/* Type definitions */
struct pattern {
  int dummy;
};

/* Variables and functions */
int offset(int /*<<< orphan*/, int, int, int);
int /*<<< orphan*/ play_attack_defend_n(int, int, int, int, int, int);
int autohelperowl_attackpat35(struct pattern *patt, int transformation,
                              int move, int color, int action) {
  int a;
  (void)patt;
  (void)color;
  (void)action;
  a = offset(0, -1, move, transformation);
  return !play_attack_defend_n(color, 1, 2, move, a, move);
}


x86 assembly (clang, -O0):
<autohelperowl_attackpat35>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1040 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x10(%rbp),%r9d
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <play_attack_defend_n@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):
<autohelperowl_attackpat35>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %esi,%ecx
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1040 <offset@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
mov    %ebp,%r9d
call   1030 <play_attack_defend_n@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat35(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load %struct.pattern*, %struct.pattern** %6
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = call i32 @offset(i32 0, i32 -1, i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %9
%19 = load i32, i32* %8
%20 = load i32, i32* %11
%21 = load i32, i32* %8
%22 = call i32 @play_attack_defend_n(i32 %18, i32 1, i32 2, i32 %19, i32 %20, i32 %21)
%23 = icmp ne i32 %22, 0
%24 = xor i1 %23, true
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat35(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 0, i32 -1, i32 %2, i32 %1)
%7 = tail call i32 @play_attack_defend_n(i32 %3, i32 1, i32 2, i32 %2, i32 %6, i32 %2)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf(
      "Tool:    ga_deltaG\n\nSummary: makes the wiggle file of the free "
      "energy(delta-G) difference between the duplex and single-strand "
      "states.\n\nUsage:   ga_deltaG -fa <fasta file> -gt <genome table file> "
      "-lib <library name: SantaLucia_1996 | Breslauer_1986> -win <window "
      "size(int)> -step <step size(int)>\n\nOptions:\n         -v: output "
      "version information and exit.\n         -h, --help: display this help "
      "and exit.\n         --gradient: coefficients are used for the energy "
      "calculation. The middle of the window is coeffient of 1, and it "
      "linearly decreases to 0 for both left and right side (default:off).\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [597 x i8] c"Tool: ga_deltaG\0A\0ASummary: makes the wiggle file of the free energy(delta-G) difference between the duplex and single-strand states.\0A\0AUsage: ga_deltaG -fa <fasta file> -gt <genome table file> -lib <library name: SantaLucia_1996 | Breslauer_1986> -win <window size(int)> -step <step size(int)>\0A\0AOptions:\0A -v: output version information and exit.\0A -h, --help: display this help and exit.\0A --gradient: coefficients are used for the energy calculation. The middle of the window is coeffient of 1, and it linearly decreases to 0 for both left and right side (default:off).\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([597 x i8], [597 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [596 x i8] c"Tool: ga_deltaG\0A\0ASummary: makes the wiggle file of the free energy(delta-G) difference between the duplex and single-strand states.\0A\0AUsage: ga_deltaG -fa <fasta file> -gt <genome table file> -lib <library name: SantaLucia_1996 | Breslauer_1986> -win <window size(int)> -step <step size(int)>\0A\0AOptions:\0A -v: output version information and exit.\0A -h, --help: display this help and exit.\0A --gradient: coefficients are used for the energy calculation. The middle of the window is coeffient of 1, and it linearly decreases to 0 for both left and right side (default:off).\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([596 x i8], [596 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int between(unsigned int lev) {
  return ((14 - lev / 3) > (10) ? (14 - lev / 3) : (10));
}


x86 assembly (clang, -O0):
<between>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    $0xe,%eax
sub    %ecx,%eax
cmp    $0xa,%eax
jbe    1142 <between+0x42>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    $0xe,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    114f <between+0x4f>
mov    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    114f <between+0x4f>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<between>:
mov    %edi,%eax
mov    $0xaaaaaaab,%ecx
imul   %rax,%rcx
shr    $0x21,%rcx
mov    $0xe,%edx
sub    %ecx,%edx
cmp    $0xb,%edx
mov    $0xa,%eax
cmovae %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @between(i32 %0) {
%2 = udiv i32 %0, 3
%3 = sub nsw i32 14, %2
%4 = icmp ugt i32 %3, 10
%5 = select i1 %4, i32 %3, i32 10
ret i32 %5
}
void bla_update_orig_address(struct bat_priv *bat_priv,
                             struct hard_iface *primary_if,
                             struct hard_iface *oldif) {}


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

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

LLVM IR (-O0):
%struct.bat_priv = type opaque
%struct.hard_iface = type opaque
define void @bla_update_orig_address(%struct.bat_priv* %0, %struct.hard_iface* %1, %struct.hard_iface* %2) {
%4 = alloca %struct.bat_priv*
%5 = alloca %struct.hard_iface*
%6 = alloca %struct.hard_iface*
store %struct.bat_priv* %0, %struct.bat_priv** %4
store %struct.hard_iface* %1, %struct.hard_iface** %5
store %struct.hard_iface* %2, %struct.hard_iface** %6
ret void
}

LLVM IR (-O2):
%struct.bat_priv = type opaque
%struct.hard_iface = type opaque
define void @bla_update_orig_address(%struct.bat_priv* nocapture %0, %struct.hard_iface* nocapture %1, %struct.hard_iface* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ protected_memory_load();
void native_init(void) { protected_memory_load(); }


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

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

LLVM IR (-O0):
define void @native_init() {
%1 = call i32 (...) @protected_memory_load()
ret void
}

LLVM IR (-O2):
define void @native_init() {
%1 = tail call i32 (...) @protected_memory_load()
ret void
}