xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void ja_rj(unsigned char saut) {
  put8(0x77);
  put8(saut);
}


x86 assembly (clang, -O0):
<ja_rj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x77,%edi
call   1030 <put8@plt>
movzbl -0x1(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ja_rj>:
push   %rbx
mov    %edi,%ebx
mov    $0x77,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @ja_rj(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @put8(i8 zeroext 119)
%4 = load i8, i8* %2
%5 = call i32 @put8(i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @ja_rj(i8 zeroext %0) {
%2 = tail call i32 @put8(i8 zeroext 119)
%3 = tail call i32 @put8(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_char(unsigned char);
void __console_tx_nibble(unsigned nibble) {
  unsigned char digit;
  digit = nibble + '0';
  if (digit > '9') {
    digit += 39;
  }
  __console_tx_char(digit);
}


x86 assembly (clang, -O0):
<__console_tx_nibble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    113b <__console_tx_nibble+0x2b>
movzbl -0x5(%rbp),%eax
add    $0x27,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%edi
call   1030 <__console_tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__console_tx_nibble>:
lea    0x30(%rdi),%eax
add    $0x57,%dil
cmp    $0x3a,%al
movzbl %dil,%ecx
movzbl %al,%eax
cmovae %ecx,%eax
movzbl %al,%edi
jmp    1030 <__console_tx_char@plt>

LLVM IR (-O0):
define void @__console_tx_nibble(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 48
%6 = trunc i32 %5 to i8
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = icmp sgt i32 %8, 57
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = add nsw i32 %12, 39
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
br label %15
15: ; preds = %10, %1
%16 = load i8, i8* %3
%17 = call i32 @__console_tx_char(i8 zeroext %16)
ret void
}

LLVM IR (-O2):
define void @__console_tx_nibble(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 48
%4 = icmp ugt i8 %3, 57
%5 = add i8 %2, 87
%6 = select i1 %4, i8 %5, i8 %3
%7 = tail call i32 @__console_tx_char(i8 zeroext %6)
ret void
}
/* Variables and functions */
int rl_maybe_save_line();
int maybe_save_line() { return rl_maybe_save_line(); }


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

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

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

LLVM IR (-O2):
define i32 @maybe_save_line() {
%1 = tail call i32 (...) @rl_maybe_save_line()
ret i32 %1
}
void parse_all_samples(char *arg, void *out, struct callbacks *cb) {
  if (arg)
    *(const char **)out = arg;
  else
    *(const char **)out = "samples.csv";
}


x86 assembly (clang, -O0):
<parse_all_samples>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112b <parse_all_samples+0x2b>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    1139 <parse_all_samples+0x39>
mov    -0x10(%rbp),%rax
lea    0xeca(%rip),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_all_samples>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
%struct.callbacks = type opaque
@.str = [12 x i8] c"samples.csv\00"
define void @parse_all_samples(i8* %0, i8* %1, %struct.callbacks* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.callbacks*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.callbacks* %2, %struct.callbacks** %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i8**
store i8* %10, i8** %12
br label %16
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = bitcast i8* %14 to i8**
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %15
br label %16
16: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
%struct.callbacks = type opaque
@.str = [12 x i8] c"samples.csv\00"
define void @parse_all_samples(i8* %0, i8* nocapture writeonly %1, %struct.callbacks* nocapture readnone %2) {
%4 = icmp eq i8* %0, null
%5 = bitcast i8* %1 to i8**
%6 = select i1 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0
store i8* %6, i8** %5
ret void
}
void memFree(void *location) {}


x86 assembly (clang, -O0):
<memFree>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @memFree(i8* nocapture %0) {
ret void
}
int calc_derivate_sample_width(float sigma) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @calc_derivate_sample_width(float %0) {
ret i32 1
}
int is_digit(char c) { return (c >= '0' && c <= '9') ? 1 : 0; }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(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, 48
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, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EMFILE;
int /*<<< orphan*/ errno;
int dup(int fd) {
  errno = EMFILE;
  return -1;
}


x86 assembly (clang, -O0):
<dup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EMFILE = global i32 0
@errno = global i32 0
define i32 @dup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EMFILE
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EMFILE = global i32 0
@errno = global i32 0
define i32 @dup(i32 %0) {
%2 = load i32, i32* @EMFILE
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
void stub1(float, double);
void testClosureFDrV(void (*closure)(float, double), float a1, double a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureFDrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movsd  %xmm1,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1131 <testClosureFDrV+0x31>
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureFDrV>:
test   %rdi,%rdi
je     1107 <testClosureFDrV+0x7>
jmp    *%rdi
ret

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

LLVM IR (-O2):
define void @testClosureFDrV(void (float, double)* %0, float %1, double %2) {
%4 = icmp eq void (float, double)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(float %1, double %2)
br label %6
6: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int const, size_t const);
void Com_Memset(void *dest, const int val, const size_t count) {
  memset(dest, val, count);
}


x86 assembly (clang, -O0):
<Com_Memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_Memset>:
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @Com_Memset(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i64, i64* %6
%10 = call i32 @memset(i8* %7, i32 %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @Com_Memset(i8* %0, i32 %1, i64 %2) {
%4 = tail call i32 @memset(i8* %0, i32 %1, i64 %2)
ret void
}
vt52cup(l, c) int l, c;
{ printf("%cY%c%c", 27, l + 31, c + 31); }


x86 assembly (clang, -O0):
<vt52cup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edx
add    $0x1f,%edx
mov    -0xc(%rbp),%ecx
add    $0x1f,%ecx
lea    0xecf(%rip),%rdi
mov    $0x1b,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt52cup>:
lea    0x1f(%rdi),%edx
lea    0x1f(%rsi),%ecx
lea    0xee3(%rip),%rdi
mov    $0x1b,%esi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%cY%c%c\00"
define i32 @vt52cup(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 = add nsw i32 %6, 31
%8 = load i32, i32* %5
%9 = add nsw i32 %8, 31
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 27, i32 %7, i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [8 x i8] c"%cY%c%c\00"
define i32 @vt52cup(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 31
%4 = add nsw i32 %1, 31
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 27, i32 %3, i32 %4)
ret i32 undef
}
/* Type definitions */
struct stemmer {
  int dummy;
};

/* Variables and functions */
scalar_t__ m(struct stemmer *);
int /*<<< orphan*/ setto(struct stemmer *, char *);
void r(struct stemmer *z, char *s) {
  if (m(z) > 0) {
    setto(z, s);
  }
}


x86 assembly (clang, -O0):
<r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <m@plt>
cmp    $0x0,%rax
jle    1150 <r+0x30>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <setto@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <m@plt>
test   %rax,%rax
jle    1146 <r+0x26>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <setto@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.stemmer = type { i32 }
define void @r(%struct.stemmer* %0, i8* %1) {
%3 = alloca %struct.stemmer*
%4 = alloca i8*
store %struct.stemmer* %0, %struct.stemmer** %3
store i8* %1, i8** %4
%5 = load %struct.stemmer*, %struct.stemmer** %3
%6 = call i64 @m(%struct.stemmer* %5)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load %struct.stemmer*, %struct.stemmer** %3
%10 = load i8*, i8** %4
%11 = call i32 @setto(%struct.stemmer* %9, i8* %10)
br label %12
12: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
%struct.stemmer = type { i32 }
define void @r(%struct.stemmer* %0, i8* %1) {
%3 = tail call i64 @m(%struct.stemmer* %0)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @setto(%struct.stemmer* %0, i8* %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int m_strcpy(char *, int, char const *);
int m_strnlen(char *, int);
ssize_t m_strcat(char *dst, ssize_t n, const char *src) {
  ssize_t dlen = m_strnlen(dst, n - 1);
  return dlen + m_strcpy(dst + dlen, n - dlen, src);
}


x86 assembly (clang, -O0):
<m_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <m_strnlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
sub    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <m_strcpy@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_strcat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
lea    -0x1(%r15),%esi
call   1030 <m_strnlen@plt>
movslq %eax,%r12
add    %r12,%rbx
sub    %r12d,%r15d
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r14,%rdx
call   1040 <m_strcpy@plt>
add    %r12d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @m_strcat(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = call i32 @m_strnlen(i8* %8, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i8*, i8** %4
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %17, %18
%20 = load i8*, i8** %6
%21 = call i32 @m_strcpy(i8* %16, i32 %19, i8* %20)
%22 = add nsw i32 %12, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @m_strcat(i8* %0, i32 %1, i8* %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @m_strnlen(i8* %0, i32 %4)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = sub nsw i32 %1, %5
%9 = tail call i32 @m_strcpy(i8* %7, i32 %8, i8* %2)
%10 = add nsw i32 %9, %5
ret i32 %10
}
filltype(fill) {
  switch (fill) {
  default:
    return (0x32);
  case 002:
    return (0x33);
  case 003:
    return (0x34);
  case 004:
    return (0x35);
  case 005:
    return (0x36);
  case 011:
    return (0x22);
  case 012:
    return (0x23);
  case 013:
    return (0x24);
  case 014:
    return (0x25);
  case 015:
    return (0x26);
  case 016:
    return (0x27);
  case 017:
    return (0x28);
  }
}


x86 assembly (clang, -O0):
<filltype>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xd,%eax
ja     1130 <filltype+0x30>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x32,-0x4(%rbp)
jmp    11bb <filltype+0xbb>
movl   $0x33,-0x4(%rbp)
jmp    11bb <filltype+0xbb>
movl   $0x34,-0x4(%rbp)
jmp    11bb <filltype+0xbb>
movl   $0x35,-0x4(%rbp)
jmp    11bb <filltype+0xbb>
movl   $0x36,-0x4(%rbp)
jmp    11bb <filltype+0xbb>
movl   $0x22,-0x4(%rbp)
jmp    11bb <filltype+0xbb>
movl   $0x23,-0x4(%rbp)
jmp    11bb <filltype+0xbb>
movl   $0x24,-0x4(%rbp)
jmp    11bb <filltype+0xbb>
movl   $0x25,-0x4(%rbp)
jmp    11bb <filltype+0xbb>
movl   $0x26,-0x4(%rbp)
jmp    11bb <filltype+0xbb>
movl   $0x27,-0x4(%rbp)
jmp    11bb <filltype+0xbb>
movl   $0x28,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filltype>:
add    $0xfffffffe,%edi
mov    $0x32,%eax
cmp    $0xd,%edi
ja     111a <filltype+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @filltype(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %5 [
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
i32 9, label %10
i32 10, label %11
i32 11, label %12
i32 12, label %13
i32 13, label %14
i32 14, label %15
i32 15, label %16
]
5: ; preds = %1
store i32 50, i32* %2
br label %17
6: ; preds = %1
store i32 51, i32* %2
br label %17
7: ; preds = %1
store i32 52, i32* %2
br label %17
8: ; preds = %1
store i32 53, i32* %2
br label %17
9: ; preds = %1
store i32 54, i32* %2
br label %17
10: ; preds = %1
store i32 34, i32* %2
br label %17
11: ; preds = %1
store i32 35, i32* %2
br label %17
12: ; preds = %1
store i32 36, i32* %2
br label %17
13: ; preds = %1
store i32 37, i32* %2
br label %17
14: ; preds = %1
store i32 38, i32* %2
br label %17
15: ; preds = %1
store i32 39, i32* %2
br label %17
16: ; preds = %1
store i32 40, i32* %2
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@switch.table.filltype = [14 x i32] [i32 51, i32 52, i32 53, i32 54, i32 50, i32 50, i32 50, i32 34, i32 35, i32 36, i32 37, i32 38, i32 39, i32 40]
define i32 @filltype(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 14
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [14 x i32], [14 x i32]* @switch.table.filltype, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 50, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void nsgenbind_free(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<nsgenbind_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @nsgenbind_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int arpListenDefaultNetcardNumberGet(void) { return 9; }


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

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

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

LLVM IR (-O2):
define i32 @arpListenDefaultNetcardNumberGet() {
ret i32 9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void jtag_instruction_pause_ir(volatile uint32_t *host, uint32_t inst) {
  host[0] = 0x80000000 | (3 << 16) | 0x03;
  host[0] = 0x40000000 | (9 << 16) | inst;
  host[0] = 0x80000000 | (0 << 16) | 0x00;
}


x86 assembly (clang, -O0):
<jtag_instruction_pause_ir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x80030003,(%rax)
mov    -0xc(%rbp),%ecx
or     $0x40090000,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x80000000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<jtag_instruction_pause_ir>:
movl   $0x80030003,(%rdi)
or     $0x40090000,%esi
mov    %esi,(%rdi)
movl   $0x80000000,(%rdi)
ret

LLVM IR (-O0):
define void @jtag_instruction_pause_ir(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 = getelementptr inbounds i32, i32* %5, i64 0
store volatile i32 -2147287037, i32* %6
%7 = load i32, i32* %4
%8 = or i32 1074331648, %7
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 0
store volatile i32 %8, i32* %10
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 0
store volatile i32 -2147483648, i32* %12
ret void
}

LLVM IR (-O2):
define void @jtag_instruction_pause_ir(i32* %0, i32 %1) {
store volatile i32 -2147287037, i32* %0
%3 = or i32 %1, 1074331648
store volatile i32 %3, i32* %0
store volatile i32 -2147483648, i32* %0
ret void
}
char *getFilename(const char *path) {
  char *filestart = (char *)path;
  while (*path) {
    if (*(path++) == '/')
      filestart = (char *)path;
  }
  return filestart;
}


x86 assembly (clang, -O0):
<getFilename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <getFilename+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1140 <getFilename+0x40>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <getFilename+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFilename>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <getFilename+0x22>
lea    0x1(%rax),%rdx
nopl   (%rax)
cmp    $0x2f,%cl
cmove  %rdx,%rax
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <getFilename+0x10>
ret

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

LLVM IR (-O2):
define i8* @getFilename(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 47
%10 = select i1 %9, i8* %8, i8* %6
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i8* [ %0, %1 ], [ %10, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void work(const char *mess) { printf("WORKING: %s", mess); }


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

x86 assembly (clang, -O2):
<work>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"WORKING: %s\00"
define void @work(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"WORKING: %s\00"
define void @work(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argv, char **argc) {
  int a, b, c;
  c = 0;
  a = 5;
  b = 2;
  c += a;
  c += b;
  printf("%c", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x5,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 7)
ret i32 0
}
void ext_exp2bol_exp_eol() {}


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

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

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

LLVM IR (-O2):
define void @ext_exp2bol_exp_eol() {
ret void
}
/* Variables and functions */
char toupper(char);
char *QC_strupr(char *start) {
  char *in;
  in = start;
  while (*in) {
    *in = toupper(*in);
    in++;
  }
  return start;
}


x86 assembly (clang, -O0):
<QC_strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <QC_strupr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <QC_strupr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QC_strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <QC_strupr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <QC_strupr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @QC_strupr(i8* returned %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 i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%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
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello 5");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"Hello 5\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf("Press a key. ENTER would be nice :-)\n\n");
  printf("The expression getchar() != EOF evaluates to %d\n", getchar() != EOF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2e9d(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e9d(%rip),%rcx
xor    %esi,%esi
cmp    (%rcx),%rax
setne  %sil
lea    0xea5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Press a key. ENTER would be nice :-)\0A\0A\00"
@.str.1 = [49 x i8] c"The expression getchar() != EOF evaluates to %d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp ne i64 %3, %4
%6 = zext i1 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [49 x i8] c"The expression getchar() != EOF evaluates to %d\0A\00"
@EOF = global i64 0
@str = [38 x i8] c"Press a key. ENTER would be nice :-)\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 (...) @getchar()
%3 = load i64, i64* @EOF
%4 = icmp ne i64 %2, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
unsigned long long merge_sort(int *, int /*<<< orphan*/, int);
unsigned long long getMoves(int *a, int len) {
  unsigned long long ret = 0;
  ret = merge_sort(a, 0, len - 1);
  return ret;
}


x86 assembly (clang, -O0):
<getMoves>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <merge_sort@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMoves>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <merge_sort@plt>

LLVM IR (-O0):
define i64 @getMoves(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i64
store i32* %0, i32** %3
store i32 %1, i32* %4
store i64 0, i64* %5
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = call i64 @merge_sort(i32* %6, i32 0, i32 %8)
store i64 %9, i64* %5
%10 = load i64, i64* %5
ret i64 %10
}

LLVM IR (-O2):
define i64 @getMoves(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i64 @merge_sort(i32* %0, i32 0, i32 %3)
ret i64 %4
}
void testSeed() {
  unsigned long result = Random_seed();
  UnitTest_expect_true((result != 0), __func__, 93);
  ;
}


x86 assembly (clang, -O0):
<testSeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Random_seed@plt>
cltq
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeb7(%rip),%rsi
mov    $0x5d,%edx
mov    $0x0,%al
call   1040 <UnitTest_expect_true@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testSeed>:
push   %rax
xor    %eax,%eax
call   1030 <Random_seed@plt>
xor    %edi,%edi
test   %eax,%eax
setne  %dil
lea    0xec9(%rip),%rsi
mov    $0x5d,%edx
xor    %eax,%eax
pop    %rcx
jmp    1040 <UnitTest_expect_true@plt>

LLVM IR (-O0):
@__func__.testSeed = [9 x i8] c"testSeed\00"
define void @testSeed() {
%1 = alloca i64
%2 = call i32 (...) @Random_seed()
%3 = sext i32 %2 to i64
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @UnitTest_expect_true to i32 (i32, i8*, i32, ...)*)(i32 %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.testSeed, i64 0, i64 0), i32 93)
ret void
}

LLVM IR (-O2):
@__func__.testSeed = [9 x i8] c"testSeed\00"
define void @testSeed() {
%1 = tail call i32 (...) @Random_seed()
%2 = icmp ne i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @UnitTest_expect_true to i32 (i32, i8*, i32, ...)*)(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.testSeed, i64 0, i64 0), i32 93)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printHello();
int main(void) {
  printHello();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <printHello@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printHello()
ret i32 0
}
void get_player_coordinates(int plnum, int *y, int *x) {
  *x = 5 + (plnum % 5) * 30;
  *y = plnum < 5 ? 2 : 20;
}


x86 assembly (clang, -O0):
<get_player_coordinates>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
imul   $0x1e,%edx,%ecx
add    $0x5,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edx
mov    $0x14,%ecx
mov    $0x2,%eax
cmp    $0x5,%edx
cmovl  %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_player_coordinates>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdi
shr    $0x3f,%rdi
sar    $0x21,%rcx
add    %edi,%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %eax,%edi
sub    %ecx,%edi
mov    %edi,%ecx
shl    $0x5,%ecx
sub    %edi,%ecx
sub    %edi,%ecx
add    $0x5,%ecx
mov    %ecx,(%rdx)
cmp    $0x5,%eax
mov    $0x2,%eax
mov    $0x14,%ecx
cmovl  %eax,%ecx
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
define void @get_player_coordinates(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = srem i32 %7, 5
%9 = mul nsw i32 %8, 30
%10 = add nsw i32 5, %9
%11 = load i32*, i32** %6
store i32 %10, i32* %11
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 5
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 2, i32 20
%16 = load i32*, i32** %5
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @get_player_coordinates(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = srem i32 %0, 5
%5 = mul nsw i32 %4, 30
%6 = add nsw i32 %5, 5
store i32 %6, i32* %2
%7 = icmp slt i32 %0, 5
%8 = select i1 %7, i32 2, i32 20
store i32 %8, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void swf5free(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<swf5free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @swf5free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
long double tan(double);
__attribute__((weak)) long double tanl(long double x) { return tan((double)x); }


x86 assembly (clang, -O0):
<tanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <tan@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <tan@plt>

LLVM IR (-O0):
define weak x86_fp80 @tanl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @tan(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define weak x86_fp80 @tanl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @tan(double %2)
ret x86_fp80 %3
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int read_file_size(const char *file_path) {
  struct stat stat_buffer;
  if (stat(file_path, &stat_buffer) == 0) {
    return stat_buffer.st_size;
  }
  return 0;
}


x86 assembly (clang, -O0):
<read_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    113e <read_file_size+0x2e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <read_file_size+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1126 <read_file_size+0x16>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @read_file_size(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @read_file_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ euca_strncpy(char *, char const *, size_t);
size_t strlen(char *);
char *euca_strncat(char *restrict dest, const char *restrict src, size_t size) {
  char *sTo = NULL;
  size_t len = 0;
  if (dest) {
    len = strlen(dest);
    sTo = dest + len;
    euca_strncpy(sTo, src, (size - len));
  }
  return (dest);
}


x86 assembly (clang, -O0):
<euca_strncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117d <euca_strncat+0x5d>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    -0x28(%rbp),%rdx
call   1040 <euca_strncpy@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euca_strncat>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     114d <euca_strncat+0x2d>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    (%rbx,%rax,1),%rdi
sub    %rax,%r14
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <euca_strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @euca_strncat(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i8* null, i8** %7
store i64 0, i64* %8
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %23
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = call i64 @strlen(i8* %12)
store i64 %13, i64* %8
%14 = load i8*, i8** %4
%15 = load i64, i64* %8
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8* %16, i8** %7
%17 = load i8*, i8** %7
%18 = load i8*, i8** %5
%19 = load i64, i64* %6
%20 = load i64, i64* %8
%21 = sub i64 %19, %20
%22 = call i32 @euca_strncpy(i8* %17, i8* %18, i64 %21)
br label %23
23: ; preds = %11, %3
%24 = load i8*, i8** %4
ret i8* %24
}

LLVM IR (-O2):
define i8* @euca_strncat(i8* noalias returned %0, i8* noalias %1, i64 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i64 @strlen(i8* %0)
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = sub i64 %2, %6
%9 = tail call i32 @euca_strncpy(i8* %7, i8* %1, i64 %8)
br label %10
10: ; preds = %5, %3
ret i8* %0
}
/* Variables and functions */
long __builtin_darn();
int __builtin_darn_32();
long __builtin_darn_raw();
void test_builtin_ppc_darn() {
  volatile long res;
  volatile int x;
  res = __builtin_darn();
  res = __builtin_darn_raw();
  x = __builtin_darn_32();
}


x86 assembly (clang, -O0):
<test_builtin_ppc_darn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__builtin_darn@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__builtin_darn_raw@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <__builtin_darn_32@plt>
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_ppc_darn>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <__builtin_darn@plt>
mov    %rax,0x8(%rsp)
xor    %eax,%eax
call   1040 <__builtin_darn_raw@plt>
mov    %rax,0x8(%rsp)
xor    %eax,%eax
call   1050 <__builtin_darn_32@plt>
mov    %eax,0x14(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @test_builtin_ppc_darn() {
%1 = alloca i64
%2 = alloca i32
%3 = call i64 (...) @__builtin_darn()
store volatile i64 %3, i64* %1
%4 = call i64 (...) @__builtin_darn_raw()
store volatile i64 %4, i64* %1
%5 = call i32 (...) @__builtin_darn_32()
store volatile i32 %5, i32* %2
ret void
}

LLVM IR (-O2):
define void @test_builtin_ppc_darn() {
%1 = alloca i64
%2 = alloca i32
%3 = bitcast i64* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i64 (...) @__builtin_darn()
store volatile i64 %5, i64* %1
%6 = tail call i64 (...) @__builtin_darn_raw()
store volatile i64 %6, i64* %1
%7 = tail call i32 (...) @__builtin_darn_32()
store volatile i32 %7, i32* %2
ret void
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
char *path_remove_device(char *Base) {
  if (strncmp((char *)Base + 1, ":\\", 2) == 0) {
    return Base + 3;
  }
  return Base;
}


x86 assembly (clang, -O0):
<path_remove_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
lea    0xed5(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1150 <path_remove_device+0x40>
mov    -0x10(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x8(%rbp)
jmp    1158 <path_remove_device+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_remove_device>:
push   %rbx
mov    %rdi,%rbx
add    $0x1,%rdi
lea    0xee1(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
lea    (%rcx,%rcx,2),%rax
add    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c":\\\00"
define i8* @path_remove_device(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i64 @strncmp(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i64 3, i64 0
%6 = getelementptr i8, i8* %0, i64 %5
ret i8* %6
}
int test_imm_13int8_mem(signed char *val) {
  return ((*val) & (0x13 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_13int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 19
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_13int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 19
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *getenv(char *);
void begin_performance_test(void) {
  if (getenv("INCLUDE_PERF_TESTS") == NULL)
    exit(0);
}


x86 assembly (clang, -O0):
<begin_performance_test>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
jne    1141 <begin_performance_test+0x21>
xor    %edi,%edi
call   1040 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<begin_performance_test>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1134 <begin_performance_test+0x14>
pop    %rax
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"INCLUDE_PERF_TESTS\00"
define void @begin_performance_test() {
%1 = call i32* @getenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @exit(i32 0)
unreachable
5: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"INCLUDE_PERF_TESTS\00"
define void @begin_performance_test() {
%1 = tail call i32* @getenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %0
ret void
}