xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int i, j;
  for (i = 1; i < 100; i++) {
    printf("%d+%d=%d\n", i, i + 1, (i + (i + 1)));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    115e <main+0x4e>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
add    $0x1,%edx
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%eax
add    $0x1,%eax
add    %eax,%ecx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x2,%ebx
mov    $0x3,%ebp
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x1(%rbx),%esi
mov    %r14,%rdi
mov    %ebx,%edx
mov    %ebp,%ecx
call   1030 <printf@plt>
add    $0x1,%ebx
add    $0x2,%ebp
cmp    $0x65,%ebx
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d+%d=%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = add nuw nsw i32 %3, %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3, i32 %4)
%6 = icmp eq i32 %3, 100
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void QEIVelocityDisable(unsigned long ulBase) {
  DEBUG_ASSERT((ulBase == 0x4002C000) || (ulBase == 0x4002D000));
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~(0x00000020);
}


x86 assembly (clang, -O0):
<QEIVelocityDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x4002c000,-0x8(%rbp)
40
mov    %al,-0x9(%rbp)
je     113d <QEIVelocityDisable+0x2d>
cmpq   $0x4002d000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xffffffffffffffdf,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIVelocityDisable>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x4002c000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
andq   $0xffffffffffffffdf,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @QEIVelocityDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1073922048
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 1073926144
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %2
%13 = add i64 %12, 0
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
%16 = and i64 %15, -33
store volatile i64 %16, i64* %14
ret void
}

LLVM IR (-O2):
define void @QEIVelocityDisable(i64 %0) {
%2 = and i64 %0, -4097
%3 = icmp eq i64 %2, 1073922048
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = inttoptr i64 %0 to i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, -33
store volatile i64 %8, i64* %6
ret void
}
void foo485() {}


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

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

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

LLVM IR (-O2):
define void @foo485() {
ret void
}
/* Variables and functions */
int SIGALRM;
int /*<<< orphan*/ comment(char *);
int /*<<< orphan*/ exit(int);
void handler(int sig) {
  if (sig == SIGALRM) {
    comment("==>   in handler for SIGALRM");
  } else {
    comment("==>   in handler: unexpected signal");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%eax
jne    114e <handler+0x2e>
lea    0xebc(%rip),%rdi
call   1030 <comment@plt>
jmp    1164 <handler+0x44>
lea    0xec8(%rip),%rdi
call   1030 <comment@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    0x2ec0(%rip),%rax
cmp    %edi,(%rax)
jne    1139 <handler+0x19>
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <comment@plt>
lea    0xedd(%rip),%rdi
call   1030 <comment@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
@.str = [29 x i8] c"==> in handler for SIGALRM\00"
@.str.1 = [36 x i8] c"==> in handler: unexpected signal\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGALRM
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @comment(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = call i32 @comment(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %6
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
@.str = [29 x i8] c"==> in handler for SIGALRM\00"
@.str.1 = [36 x i8] c"==> in handler: unexpected signal\00"
define void @handler(i32 %0) {
%2 = load i32, i32* @SIGALRM
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @comment(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
6: ; preds = %1
%7 = tail call i32 @comment(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int __ctype_isdigit(int);
int isdigit(int c) { return __ctype_isdigit(c); }


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

x86 assembly (clang, -O2):
<isdigit>:
jmp    1030 <__ctype_isdigit@plt>

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

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = tail call i32 @__ctype_isdigit(i32 %0)
ret i32 %2
}
int main() {
  int a = 0;
  a = 1 + 1;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int fun536() { return 536; }


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

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

LLVM IR (-O0):
define i32 @fun536() {
ret i32 536
}

LLVM IR (-O2):
define i32 @fun536() {
ret i32 536
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t uint32max(uint32_t a, uint32_t b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<uint32max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <uint32max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <uint32max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @uint32max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int mp_isupper(char c) { return c >= 'A' && c <= 'Z'; }


x86 assembly (clang, -O0):
<mp_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <mp_isupper+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_isupper>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @mp_isupper(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_puts() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_puts"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_tagstruct_puts\00"
define i32 @pa_tagstruct_puts() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int genrand();
int rand(void) { return genrand(); }


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

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

LLVM IR (-O0):
define i32 @rand() {
%1 = call i32 (...) @genrand()
ret i32 %1
}

LLVM IR (-O2):
define i32 @rand() {
%1 = tail call i32 (...) @genrand()
ret i32 %1
}
void swap_bytes_2(unsigned char *buffer) {
  unsigned char temp;
  temp = buffer[0];
  buffer[0] = buffer[1];
  buffer[1] = temp;
}


x86 assembly (clang, -O0):
<swap_bytes_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_bytes_2>:
rolw   $0x8,(%rdi)
ret

LLVM IR (-O0):
define void @swap_bytes_2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8, i8* %3
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
ret void
}

LLVM IR (-O2):
define void @swap_bytes_2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
ret void
}
/* Variables and functions */
float vec4f_dot(float const *, float const *);
float vec4f_normSq(const float A[4]) { return vec4f_dot(A, A); }


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

x86 assembly (clang, -O2):
<vec4f_normSq>:
mov    %rdi,%rsi
jmp    1030 <vec4f_dot@plt>

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

LLVM IR (-O2):
define float @vec4f_normSq(float* %0) {
%2 = tail call float @vec4f_dot(float* %0, float* %0)
ret float %2
}
const char *filename(const char *file) {
  const char *f = file;
  for (const char *p = file; 0 != *p; ++p) {
    if ('/' == *p || '\\' == *p) {
      f = p + 1;
    }
  }
  return f;
}


x86 assembly (clang, -O0):
<filename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1173 <filename+0x73>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x2f,%eax
cmp    %ecx,%eax
je     1151 <filename+0x51>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x5c,%eax
cmp    %ecx,%eax
jne    115d <filename+0x5d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1162 <filename+0x62>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <filename+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filename>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    1117 <filename+0x17>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2f,%dl
je     1110 <filename+0x10>
cmp    $0x5c,%dl
je     1110 <filename+0x10>
test   %dl,%dl
jne    1113 <filename+0x13>
ret

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

LLVM IR (-O2):
define i8* @filename(i8* %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i8* [ %0, %1 ], [ %10, %9 ]
%4 = phi i8* [ %0, %1 ], [ %11, %9 ]
%5 = load i8, i8* %4
switch i8 %5, label %9 [
i8 0, label %6
i8 47, label %7
i8 92, label %7
]
6: ; preds = %2
ret i8* %3
7: ; preds = %2, %2
%8 = getelementptr inbounds i8, i8* %4, i64 1
br label %9
9: ; preds = %2, %7
%10 = phi i8* [ %8, %7 ], [ %3, %2 ]
%11 = getelementptr inbounds i8, i8* %4, i64 1
br label %2
}
long intval(vp)
register struct tbl *vp;
{
  long num;
  int base;
  base = getint(vp, &num);
  if (base == -1)
    errorf("%s: bad number", str_val(vp));
  return num;
}


x86 assembly (clang, -O0):
<intval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <getint@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1173 <intval+0x43>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <str_val@plt>
mov    %eax,%esi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1050 <errorf@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intval>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <getint@plt>
cmp    $0xffffffff,%eax
jne    1163 <intval+0x33>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <str_val@plt>
lea    0xea6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <errorf@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tbl = type opaque
@.str = [15 x i8] c"%s: bad number\00"
define i64 @intval(%struct.tbl* %0) {
%2 = alloca %struct.tbl*
%3 = alloca i64
%4 = alloca i32
store %struct.tbl* %0, %struct.tbl** %2
%5 = load %struct.tbl*, %struct.tbl** %2
%6 = call i32 (%struct.tbl*, i64*, ...) bitcast (i32 (...)* @getint to i32 (%struct.tbl*, i64*, ...)*)(%struct.tbl* %5, i64* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load %struct.tbl*, %struct.tbl** %2
%11 = call i32 (%struct.tbl*, ...) bitcast (i32 (...)* @str_val to i32 (%struct.tbl*, ...)*)(%struct.tbl* %10)
%12 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @errorf to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %1
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
%struct.tbl = type opaque
@.str = [15 x i8] c"%s: bad number\00"
define i64 @intval(%struct.tbl* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 (%struct.tbl*, i64*, ...) bitcast (i32 (...)* @getint to i32 (%struct.tbl*, i64*, ...)*)(%struct.tbl* %0, i64* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 (%struct.tbl*, ...) bitcast (i32 (...)* @str_val to i32 (%struct.tbl*, ...)*)(%struct.tbl* %0)
%8 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @errorf to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %1
%10 = load i64, i64* %2
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ foo1();
int foo2() { foo1(); }


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

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

LLVM IR (-O0):
define i32 @foo2() {
%1 = alloca i32
%2 = call i32 (...) @foo1()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @foo2() {
%1 = tail call i32 (...) @foo1()
ret i32 undef
}
void debugpins_radio_clr() {}


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

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

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

LLVM IR (-O2):
define void @debugpins_radio_clr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putnchar(char c, int n) {
  while (n--)
    write(1, &c, 1);
}


x86 assembly (clang, -O0):
<ft_putnchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     114a <ft_putnchar+0x3a>
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
jmp    1121 <ft_putnchar+0x11>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnchar>:
push   %r14
push   %rbx
push   %rax
mov    %dil,0x7(%rsp)
test   %esi,%esi
je     1147 <ft_putnchar+0x37>
mov    %esi,%ebx
lea    0x7(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x1,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0xffffffff,%ebx
jne    1130 <ft_putnchar+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ft_putnchar(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = call i32 @write(i32 1, i8* %3, i32 1)
br label %5
11: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @ft_putnchar(i8 signext %0, i32 %1) {
%3 = alloca i8
store i8 %0, i8* %3
%4 = icmp eq i32 %1, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %7, %5 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = call i32 @write(i32 1, i8* %3, i32 1)
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret void
}
/* Variables and functions */
double pow(double, int);
double otu_const(double time, double o2_ratio) {
  double otu = 0.0;
  if (o2_ratio > 0.5)
    otu = time * pow((0.5 / (o2_ratio - 0.5)), (-5 / 6));
  return (otu);
}


x86 assembly (clang, -O0):
<otu_const>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1180 <otu_const+0x70>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xea8(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe9c(%rip),%xmm0
divsd  %xmm1,%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<otu_const>:
push   %rax
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd 0xedf(%rip),%xmm1
jbe    1148 <otu_const+0x38>
addsd  0xedd(%rip),%xmm1
movsd  0xecd(%rip),%xmm0
divsd  %xmm1,%xmm0
xor    %edi,%edi
movsd  %xmm2,(%rsp)
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @otu_const(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 0.000000e+00, double* %5
%6 = load double, double* %4
%7 = fcmp ogt double %6, 5.000000e-01
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load double, double* %3
%10 = load double, double* %4
%11 = fsub double %10, 5.000000e-01
%12 = fdiv double 5.000000e-01, %11
%13 = call double @pow(double %12, i32 0)
%14 = fmul double %9, %13
store double %14, double* %5
br label %15
15: ; preds = %8, %2
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @otu_const(double %0, double %1) {
%3 = fcmp ogt double %1, 5.000000e-01
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = fadd double %1, -5.000000e-01
%6 = fdiv double 5.000000e-01, %5
%7 = tail call double @pow(double %6, i32 0)
%8 = fmul double %7, %0
br label %9
9: ; preds = %4, %2
%10 = phi double [ %8, %4 ], [ 0.000000e+00, %2 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ PIN_INT6_DriverIRQHandler();
__attribute__((weak)) void PIN_INT6_IRQHandler(void) {
  PIN_INT6_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @PIN_INT6_IRQHandler() {
%1 = tail call i32 (...) @PIN_INT6_DriverIRQHandler()
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int connect(int, struct sockaddr const *, int /*<<< orphan*/);
int /*<<< orphan*/ perr_exit(char *);
int Connect(int fd, const struct sockaddr *sa, socklen_t salen) {
  int n;
  if ((n = connect(fd, sa, salen)) < 0)
    perr_exit("connect error");
  return n;
}


x86 assembly (clang, -O0):
<Connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <connect@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1159 <Connect+0x39>
lea    0xeac(%rip),%rdi
call   1040 <perr_exit@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Connect>:
push   %rbx
call   1030 <connect@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Connect+0x18>
lea    0xecd(%rip),%rdi
call   1040 <perr_exit@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [14 x i8] c"connect error\00"
define i32 @Connect(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load %struct.sockaddr*, %struct.sockaddr** %5
%10 = load i32, i32* %6
%11 = call i32 @connect(i32 %8, %struct.sockaddr* %9, i32 %10)
store i32 %11, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @perr_exit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [14 x i8] c"connect error\00"
define i32 @Connect(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i32 @connect(i32 %0, %struct.sockaddr* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @perr_exit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
int maximum(int x, int y) {
  if (x > y)
    return x;
  else
    return y;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @debugpins_frame_clr() {
ret void
}
int readInt(unsigned char **pptr) {
  unsigned char *ptr = *pptr;
  int len = 256 * (*ptr) + (*(ptr + 1));
  *pptr += 2;
  return len;
}


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

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

LLVM IR (-O0):
define i32 @readInt(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca i32
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = mul nsw i32 256, %9
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = add nsw i32 %10, %14
store i32 %15, i32* %4
%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* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @readInt(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = or i32 %5, %8
%10 = getelementptr inbounds i8, i8* %2, i64 2
store i8* %10, i8** %0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int hndl_fatal_error(const char *func) {
  perror(func);
  exit(1);
}


x86 assembly (clang, -O0):
<hndl_fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<hndl_fatal_error>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @hndl_fatal_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @hndl_fatal_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(void const *, void const *, size_t);
bool cutils_cdar_DynamicArray_char_ptr_compare(const void *p1, const void *p2,
                                               size_t s) {
  return !memcmp(p1, p2, s);
}


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

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

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

LLVM IR (-O2):
define i32 @cutils_cdar_DynamicArray_char_ptr_compare(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @bcmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int SLib_checkLength(char *buf) {
  int length = 0;
  while (*buf != 0) {
    length++;
    buf++;
  }
  return length;
}


x86 assembly (clang, -O0):
<SLib_checkLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <SLib_checkLength+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <SLib_checkLength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SLib_checkLength>:
cmpb   $0x0,(%rdi)
je     111c <SLib_checkLength+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <SLib_checkLength+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @SLib_checkLength(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
void GetParamsForHashChainFindCopy(int quality, int low_effort, int *iter_max,
                                   int *len_for_unit_dist) {
  *iter_max = 8 + (quality * quality) / 40;
  *len_for_unit_dist = 32 + (96 * quality) / 100;
  if (low_effort) {
    *iter_max -= 2;
    *len_for_unit_dist /= 4;
  }
}


x86 assembly (clang, -O0):
<GetParamsForHashChainFindCopy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    $0x28,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
add    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
imul   $0x60,-0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
add    $0x20,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x0,-0x8(%rbp)
je     1172 <GetParamsForHashChainFindCopy+0x72>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    $0x2,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    (%rax),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetParamsForHashChainFindCopy>:
mov    %edi,%r8d
imul   %r8d,%r8d
mov    $0xcccccccd,%eax
imul   %r8,%rax
shr    $0x25,%rax
add    $0x8,%eax
mov    %eax,(%rdx)
shl    $0x5,%edi
lea    (%rdi,%rdi,2),%eax
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rdi
sar    $0x25,%rdi
shr    $0x3f,%rax
add    %edi,%eax
add    $0x20,%eax
mov    %eax,(%rcx)
test   %esi,%esi
je     1150 <GetParamsForHashChainFindCopy+0x50>
addl   $0xfffffffe,(%rdx)
mov    (%rcx),%eax
lea    0x3(%rax),%edx
test   %eax,%eax
cmovns %eax,%edx
sar    $0x2,%edx
mov    %edx,(%rcx)
ret

LLVM IR (-O0):
define void @GetParamsForHashChainFindCopy(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %5
%11 = mul nsw i32 %9, %10
%12 = sdiv i32 %11, 40
%13 = add nsw i32 8, %12
%14 = load i32*, i32** %7
store i32 %13, i32* %14
%15 = load i32, i32* %5
%16 = mul nsw i32 96, %15
%17 = sdiv i32 %16, 100
%18 = add nsw i32 32, %17
%19 = load i32*, i32** %8
store i32 %18, i32* %19
%20 = load i32, i32* %6
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %29
22: ; preds = %4
%23 = load i32*, i32** %7
%24 = load i32, i32* %23
%25 = sub nsw i32 %24, 2
store i32 %25, i32* %23
%26 = load i32*, i32** %8
%27 = load i32, i32* %26
%28 = sdiv i32 %27, 4
store i32 %28, i32* %26
br label %29
29: ; preds = %22, %4
ret void
}

LLVM IR (-O2):
define void @GetParamsForHashChainFindCopy(i32 %0, i32 %1, i32* nocapture %2, i32* nocapture %3) {
%5 = mul nsw i32 %0, %0
%6 = udiv i32 %5, 40
%7 = add nuw nsw i32 %6, 8
store i32 %7, i32* %2
%8 = mul nsw i32 %0, 96
%9 = sdiv i32 %8, 100
%10 = add nsw i32 %9, 32
store i32 %10, i32* %3
%11 = icmp eq i32 %1, 0
br i1 %11, label %17, label %12
12: ; preds = %4
%13 = load i32, i32* %2
%14 = add nsw i32 %13, -2
store i32 %14, i32* %2
%15 = load i32, i32* %3
%16 = sdiv i32 %15, 4
store i32 %16, i32* %3
br label %17
17: ; preds = %12, %4
ret void
}
/* Variables and functions */
int int_swap(int);
int /*<<< orphan*/ is_le();
int int_to_be(int i) {
  if (!is_le())
    return i;
  else
    return int_swap(i);
}


x86 assembly (clang, -O0):
<int_to_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <is_le@plt>
cmp    $0x0,%eax
jne    1146 <int_to_be+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <int_to_be+0x31>
mov    -0x8(%rbp),%edi
call   1040 <int_swap@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_be>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <is_le@plt>
test   %eax,%eax
je     1136 <int_to_be+0x16>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <int_swap@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @int_to_be(i32 %0) {
%2 = tail call i32 (...) @is_le()
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @int_swap(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
void av_rescale_delta() {}


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

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

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

LLVM IR (-O2):
define void @av_rescale_delta() {
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
char *CiString_Substring(const char *str, int len) {
  char *p = malloc(len + 1);
  memcpy(p, str, len);
  p[len] = '\0';
  return p;
}


x86 assembly (clang, -O0):
<CiString_Substring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CiString_Substring>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <memcpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @CiString_Substring(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %1)
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 0, i8* %7
ret i8* %4
}
int getVal() { return 9; }


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

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

LLVM IR (-O0):
define i32 @getVal() {
ret i32 9
}

LLVM IR (-O2):
define i32 @getVal() {
ret i32 9
}
/* Variables and functions */
int /*<<< orphan*/ fini_helper(int /*<<< orphan*/);
__attribute__((destructor)) void lm_fini2(void) { fini_helper(0); }


x86 assembly (clang, -O0):
<lm_fini2>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <fini_helper@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lm_fini2>:
xor    %edi,%edi
jmp    1030 <fini_helper@plt>

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @lm_fini2, i8* null }]
define void @lm_fini2() {
%1 = call i32 @fini_helper(i32 0)
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @lm_fini2, i8* null }]
define void @lm_fini2() {
%1 = tail call i32 @fini_helper(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ adc16(int /*<<< orphan*/);
int /*<<< orphan*/ indirecty();
int /*<<< orphan*/ readmemw65816(int /*<<< orphan*/);
void adcIndirecty16(void) { adc16(readmemw65816(indirecty())); }


x86 assembly (clang, -O0):
<adcIndirecty16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <indirecty@plt>
mov    %eax,%edi
call   1040 <readmemw65816@plt>
mov    %eax,%edi
call   1050 <adc16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcIndirecty16>:
push   %rax
xor    %eax,%eax
call   1030 <indirecty@plt>
mov    %eax,%edi
call   1040 <readmemw65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <adc16@plt>

LLVM IR (-O0):
define void @adcIndirecty16() {
%1 = call i32 (...) @indirecty()
%2 = call i32 @readmemw65816(i32 %1)
%3 = call i32 @adc16(i32 %2)
ret void
}

LLVM IR (-O2):
define void @adcIndirecty16() {
%1 = tail call i32 (...) @indirecty()
%2 = tail call i32 @readmemw65816(i32 %1)
%3 = tail call i32 @adc16(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, char, unsigned int);
void *tmalloc(unsigned int);
void *tcalloc(unsigned nelem, unsigned elsize) {
  void *vp;
  unsigned nbytes;
  nbytes = nelem * elsize;
  if ((vp = tmalloc(nbytes)) == 0)
    return 0;
  memset(vp, '\0', nbytes);
  return vp;
}


x86 assembly (clang, -O0):
<tcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <tmalloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115b <tcalloc+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    1171 <tcalloc+0x51>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
imul   %esi,%ebx
mov    %ebx,%edi
call   1040 <tmalloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1144 <tcalloc+0x24>
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @tcalloc(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = tail call i8* @tmalloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i8 signext 0, i32 %3)
br label %8
8: ; preds = %2, %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ Path_join(char **, char const *, char *);
void Path_dirname(char **pzResult, const char *zPath) {
  Path_join(pzResult, zPath, "..");
}


x86 assembly (clang, -O0):
<Path_dirname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
call   1030 <Path_join@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Path_dirname>:
lea    0xee9(%rip),%rdx
jmp    1030 <Path_join@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"..\00"
define void @Path_dirname(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 @Path_join(i8** %5, i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"..\00"
define void @Path_dirname(i8** %0, i8* %1) {
%3 = tail call i32 @Path_join(i8** %0, i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, int, int);
void IF_about(void) {
  char Lib[8];
  *Lib = '\0';
  printf("nife (Networking Industrial Forth-like Environment) - version "
         "%s%s-%ld/%ld\n\t (c) S.E.R.I.A.N.E. 2009-2015\n",
         Lib, "0.60", sizeof(long) * 8, sizeof(double) * 8);
}


x86 assembly (clang, -O0):
<IF_about>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
lea    0xf3d(%rip),%rdx
mov    $0x40,%r8d
mov    %r8d,%ecx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_about>:
push   %rax
movb   $0x0,(%rsp)
lea    0xee4(%rip),%rdi
lea    0xf48(%rip),%rdx
mov    %rsp,%rsi
mov    $0x40,%ecx
mov    $0x40,%r8d
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [107 x i8] c"nife (Networking Industrial Forth-like Environment) - version %s%s-%ld/%ld\0A\09 (c) S.E.R.I.A.N.E. 2009-2015\0A\00"
@.str.1 = [5 x i8] c"0.60\00"
define void @IF_about() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 64, i32 64)
ret void
}

LLVM IR (-O2):
@.str = [107 x i8] c"nife (Networking Industrial Forth-like Environment) - version %s%s-%ld/%ld\0A\09 (c) S.E.R.I.A.N.E. 2009-2015\0A\00"
@.str.1 = [5 x i8] c"0.60\00"
define void @IF_about() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 64, i32 64)
ret void
}