xunge/DecIR huggingface dataset:
char *string_copy(char *dest, const char *src) {
  int i;
  i = 0;
  while (src[i] != '\0') {
    dest[i] = src[i];
    i++;
  }
  return (dest);
}


x86 assembly (clang, -O0):
<string_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <string_copy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <string_copy+0x13>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_copy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1120 <string_copy+0x20>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <string_copy+0x10>
ret

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

LLVM IR (-O2):
define i8* @string_copy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f3(void) { printf("f3 is calling...\n"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"f3 is calling...\0A\00"
define void @f3() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"f3 is calling...\00"
define void @f3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_26uint16_reg(unsigned short val) {
  return ((val) & (0x26 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_26uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x26,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_26uint16_reg>:
test   $0x26,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_26uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 38
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int buzzlex_isarith(char c) {
  return (c == '+') || (c == '-') || (c == '*') || (c == '/') || (c == '%') ||
         (c == '^');
}


x86 assembly (clang, -O0):
<buzzlex_isarith>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0x2(%rbp)
je     1171 <buzzlex_isarith+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     1171 <buzzlex_isarith+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2a,%ecx
mov    %al,-0x2(%rbp)
je     1171 <buzzlex_isarith+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0x2(%rbp)
je     1171 <buzzlex_isarith+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x25,%ecx
mov    %al,-0x2(%rbp)
je     1171 <buzzlex_isarith+0x71>
movsbl -0x1(%rbp),%eax
cmp    $0x5e,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buzzlex_isarith>:
lea    -0x25(%rdi),%eax
cmp    $0xb,%al
jae    1119 <buzzlex_isarith+0x19>
movzbl %al,%ecx
mov    $0x1,%eax
mov    $0x561,%edx
bt     %ecx,%edx
jb     1122 <buzzlex_isarith+0x22>
xor    %eax,%eax
cmp    $0x5e,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @buzzlex_isarith(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 43
br i1 %5, label %26, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br i1 %9, label %26, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 42
br i1 %13, label %26, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 47
br i1 %17, label %26, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 37
br i1 %21, label %26, label %22
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 94
br label %26
26: ; preds = %22, %18, %14, %10, %6, %1
%27 = phi i1 [ true, %18 ], [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %25, %22 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @buzzlex_isarith(i8 signext %0) {
%2 = add i8 %0, -37
%3 = icmp ult i8 %2, 11
br i1 %3, label %7, label %4
4: ; preds = %7, %1
%5 = icmp eq i8 %0, 94
%6 = zext i1 %5 to i32
br label %12
7: ; preds = %1
%8 = zext i8 %2 to i16
%9 = lshr i16 1377, %8
%10 = and i16 %9, 1
%11 = icmp eq i16 %10, 0
br i1 %11, label %4, label %12
12: ; preds = %7, %4
%13 = phi i32 [ %6, %4 ], [ 1, %7 ]
ret i32 %13
}
/* Variables and functions */
int step_out_of_me();
int main() { return step_out_of_me(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @step_out_of_me()
ret i32 %1
}
/* Variables and functions */
int Partition(int *, int, int);
void QSort(int a[], int low, int high) {
  int pivotkey;
  if (low < high) {
    pivotkey = Partition(a, low, high);
    QSort(a, low, pivotkey - 1);
    QSort(a, pivotkey + 1, high);
  }
}


x86 assembly (clang, -O0):
<QSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <QSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <Partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <QSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <QSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <QSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <Partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <QSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <QSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @QSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @Partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @QSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
scalar_t__ sbrk(int /*<<< orphan*/);
int main(int argc, char const *argv[]) {
  if (sbrk(0) > 0) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <sbrk@plt>
cmp    $0x0,%rax
jle    1143 <main+0x33>
movl   $0x0,-0x4(%rbp)
jmp    114a <main+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <sbrk@plt>
xor    %ecx,%ecx
test   %rax,%rax
setle  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @sbrk(i32 0)
%4 = icmp slt i64 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ circularMeanLength(int, int, int, double *, double *);
void circularVariance(int n, int p, int j, double *data, double *var) {
  circularMeanLength(n, p, j, data, var);
  *var = 1 - *var;
}


x86 assembly (clang, -O0):
<circularVariance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <circularMeanLength@plt>
mov    -0x20(%rbp),%rax
movsd  0xeb5(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circularVariance>:
push   %rbx
mov    %r8,%rbx
call   1030 <circularMeanLength@plt>
movsd  0xedf(%rip),%xmm0
subsd  (%rbx),%xmm0
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @circularVariance(i32 %0, i32 %1, i32 %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double*
%10 = alloca double*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load double*, double** %9
%15 = load double*, double** %10
%16 = call i32 @circularMeanLength(i32 %11, i32 %12, i32 %13, double* %14, double* %15)
%17 = load double*, double** %10
%18 = load double, double* %17
%19 = fsub double 1.000000e+00, %18
%20 = load double*, double** %10
store double %19, double* %20
ret void
}

LLVM IR (-O2):
define void @circularVariance(i32 %0, i32 %1, i32 %2, double* %3, double* %4) {
%6 = tail call i32 @circularMeanLength(i32 %0, i32 %1, i32 %2, double* %3, double* %4)
%7 = load double, double* %4
%8 = fsub double 1.000000e+00, %7
store double %8, double* %4
ret void
}
/* Variables and functions */
int putc(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int putchar(int ch) { return putc(ch, stdin); }


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <putc@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @stdin
%5 = call i32 @putc(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @putchar(i32 %0) {
%2 = load i32, i32* @stdin
%3 = tail call i32 @putc(i32 %0, i32 %2)
ret i32 %3
}
void pathconN_nm6_incref(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ Write(int, struct ship *, long, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
void send_col(struct ship *ship, long a) { Write(21, ship, a, 0, 0, 0); }


x86 assembly (clang, -O0):
<send_col>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x15,%edi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <Write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_col>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x15,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <Write@plt>

LLVM IR (-O0):
%struct.ship = type { i32 }
define void @send_col(%struct.ship* %0, i64 %1) {
%3 = alloca %struct.ship*
%4 = alloca i64
store %struct.ship* %0, %struct.ship** %3
store i64 %1, i64* %4
%5 = load %struct.ship*, %struct.ship** %3
%6 = load i64, i64* %4
%7 = call i32 @Write(i32 21, %struct.ship* %5, i64 %6, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.ship = type { i32 }
define void @send_col(%struct.ship* %0, i64 %1) {
%3 = tail call i32 @Write(i32 21, %struct.ship* %0, i64 %1, i32 0, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;

/* Variables and functions */
int uspe_match_pack(char *argv[], int argc, u_int8_t *data, size_t data_len) {
  return 0;
}


x86 assembly (clang, -O0):
<uspe_match_pack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @uspe_match_pack(i8** %0, i32 %1, i32* %2, i64 %3) {
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i64
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i64 %3, i64* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @uspe_match_pack(i8** nocapture readnone %0, i32 %1, i32* nocapture readnone %2, i64 %3) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t stun_adjust_allocate_lifetime(uint32_t lifetime) {
  if (!lifetime)
    return (600);
  else if (lifetime < (600))
    return (600);
  else if (lifetime > (3600))
    return (3600);
  return lifetime;
}


x86 assembly (clang, -O0):
<stun_adjust_allocate_lifetime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <stun_adjust_allocate_lifetime+0x1d>
movl   $0x258,-0x4(%rbp)
jmp    115f <stun_adjust_allocate_lifetime+0x5f>
cmpl   $0x258,-0x8(%rbp)
jge    1136 <stun_adjust_allocate_lifetime+0x36>
movl   $0x258,-0x4(%rbp)
jmp    115f <stun_adjust_allocate_lifetime+0x5f>
cmpl   $0xe10,-0x8(%rbp)
jle    114f <stun_adjust_allocate_lifetime+0x4f>
movl   $0xe10,-0x4(%rbp)
jmp    115f <stun_adjust_allocate_lifetime+0x5f>
jmp    1154 <stun_adjust_allocate_lifetime+0x54>
jmp    1159 <stun_adjust_allocate_lifetime+0x59>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stun_adjust_allocate_lifetime>:
cmp    $0xe10,%edi
mov    $0xe10,%ecx
cmovl  %edi,%ecx
cmp    $0x259,%ecx
mov    $0x258,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @stun_adjust_allocate_lifetime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 600, i32* %2
br label %19
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 600
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 600, i32* %2
br label %19
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 3600
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 3600, i32* %2
br label %19
15: ; preds = %11
br label %16
16: ; preds = %15
br label %17
17: ; preds = %16
%18 = load i32, i32* %3
store i32 %18, i32* %2
br label %19
19: ; preds = %17, %14, %10, %6
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @stun_adjust_allocate_lifetime(i32 %0) {
%2 = icmp slt i32 %0, 3600
%3 = select i1 %2, i32 %0, i32 3600
%4 = icmp sgt i32 %3, 600
%5 = select i1 %4, i32 %3, i32 600
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int mystrlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void _fail(char *reason) {
  char s[] = "\nfailed: ";
  int len = mystrlen(reason);
  write(1, s, sizeof(s) - 1);
  write(1, reason, len);
  write(1, "\n", 1);
  exit(1);
}


x86 assembly (clang, -O0):
<_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xeba(%rip),%ax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mystrlen@plt>
mov    %eax,-0x18(%rbp)
lea    -0x12(%rbp),%rsi
mov    $0x1,%edi
mov    $0x9,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    $0x1,%edx
lea    0xe7c(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<_fail>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
movabs $0x3a64656c6961660a,%rax
65 64 3a
mov    %rax,0x8(%rsp)
movw   $0x20,0x10(%rsp)
call   1040 <mystrlen@plt>
mov    %eax,%ebp
lea    0x8(%rsp),%rsi
mov    $0x1,%edi
mov    $0x9,%edx
call   1030 <write@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <write@plt>
lea    0xe8a(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@__const._fail.s = [10 x i8] c"\0Afailed: \00"
@.str = [2 x i8] c"\0A\00"
define void @_fail(i8* %0) {
%2 = alloca i8*
%3 = alloca [10 x i8]
%4 = alloca i32
store i8* %0, i8** %2
%5 = bitcast [10 x i8]* %3 to i8*
%6 = load i8*, i8** %2
%7 = call i32 @mystrlen(i8* %6)
store i32 %7, i32* %4
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i32 @write(i32 1, i8* %8, i32 9)
%10 = load i8*, i8** %2
%11 = load i32, i32* %4
%12 = call i32 @write(i32 1, i8* %10, i32 %11)
%13 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@__const._fail.s = [10 x i8] c"\0Afailed: \00"
@.str = [2 x i8] c"\0A\00"
define void @_fail(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @mystrlen(i8* %0)
%5 = call i32 @write(i32 1, i8* %3, i32 9)
%6 = tail call i32 @write(i32 1, i8* %0, i32 %4)
%7 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double sqrt(scalar_t__);
scalar_t__ square(double);
double distance(double x1, double y1, double x2, double y2) {
  return sqrt(square(x2 - x1) + square(y2 - y1));
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
call   1030 <square@plt>
mov    %rax,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <square@plt>
mov    -0x28(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm3,0x8(%rsp)
movsd  %xmm1,(%rsp)
subsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
call   1030 <square@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
subsd  (%rsp),%xmm0
call   1030 <square@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @distance(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %5
%11 = fsub double %9, %10
%12 = call i64 @square(double %11)
%13 = load double, double* %8
%14 = load double, double* %6
%15 = fsub double %13, %14
%16 = call i64 @square(double %15)
%17 = add nsw i64 %12, %16
%18 = call double @sqrt(i64 %17)
ret double %18
}

LLVM IR (-O2):
define double @distance(double %0, double %1, double %2, double %3) {
%5 = fsub double %2, %0
%6 = tail call i64 @square(double %5)
%7 = fsub double %3, %1
%8 = tail call i64 @square(double %7)
%9 = add nsw i64 %8, %6
%10 = tail call double @sqrt(i64 %9)
ret double %10
}
/* Variables and functions */
scalar_t__ ft_isupper(int);
int ft_tolower(int c) {
  if (ft_isupper(c))
    return (c + 32);
  else
    return (c);
}


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ft_isupper@plt>
cmp    $0x0,%rax
je     113b <ft_tolower+0x2b>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <ft_tolower+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <ft_isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @ft_isupper(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 32
store i32 %9, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = tail call i64 @ft_isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int are_equal(int *, int *, int);
int /*<<< orphan*/ pancake_sort(int *, int);
int test_pancake_sort_all_equal() {
  int input[] = {3, 3, 3, 3, 3, 3, 3, 3, 3, 3};
  int expected[] = {3, 3, 3, 3, 3, 3, 3, 3, 3, 3};
  pancake_sort(input, 10);
  return are_equal(input, expected, 10);
}


x86 assembly (clang, -O0):
<test_pancake_sort_all_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xed8(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <pancake_sort@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0xa,%edx
call   1050 <are_equal@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_pancake_sort_all_equal>:
push   %rbx
sub    $0x60,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xebc(%rip),%xmm1
movaps %xmm1,0x30(%rsp)
mov    %rax,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm1,(%rsp)
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <pancake_sort@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0xa,%edx
call   1040 <are_equal@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_pancake_sort_all_equal.input = [10 x i32] [i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3]
@__const.test_pancake_sort_all_equal.expected = [10 x i32] [i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3]
define i32 @test_pancake_sort_all_equal() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @pancake_sort(i32* %5, i32 10)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%9 = call i32 @are_equal(i32* %7, i32* %8, i32 10)
ret i32 %9
}

LLVM IR (-O2):
@__const.test_pancake_sort_all_equal.expected = [10 x i32] [i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3]
define i32 @test_pancake_sort_all_equal() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @pancake_sort(i32* %5, i32 10)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = call i32 @are_equal(i32* %5, i32* %7, i32 10)
ret i32 %8
}
void foo271() {}


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

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

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

LLVM IR (-O2):
define void @foo271() {
ret void
}
/* Variables and functions */
int _plat__TimerWasReset();
bool _plat__TimerWasStopped() { return _plat__TimerWasReset(); }


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

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

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

LLVM IR (-O2):
define i32 @_plat__TimerWasStopped() {
%1 = tail call i32 (...) @_plat__TimerWasReset()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ error(char *, char *);
int /*<<< orphan*/ *fopen(char *, char *);
FILE *open_file(char *fn, char *mode) {
  FILE *fp = fopen(fn, mode);
  if (fp == NULL) {
    error("Could not open file `%s'.", fn);
  }
  return fp;
}


x86 assembly (clang, -O0):
<open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115c <open_file+0x3c>
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <open_file+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Could not open file `%s'.\00"
define i32* @open_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %2
%15 = load i32*, i32** %5
ret i32* %15
}

LLVM IR (-O2):
@.str = [26 x i8] c"Could not open file `%s'.\00"
define noalias i32* @open_file(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
ret i32* %3
}
void VMR3ReqCallWaitU(void) {}


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

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

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

LLVM IR (-O2):
define void @VMR3ReqCallWaitU() {
ret void
}
int max3(int a, int b, int c) {
  int m = a;
  if (m < b)
    m = b;
  if (m < c)
    m = c;
  return m;
}


x86 assembly (clang, -O0):
<max3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1125 <max3+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1137 <max3+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max3>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
cmp    %edx,%eax
cmovl  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @max3(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
unsigned short ReadShort(const unsigned char *bytes) {
  return (unsigned short)(((unsigned short)(bytes[0] & 0xFF) << 8) |
                          ((unsigned short)(bytes[1] & 0xFF)));
}


x86 assembly (clang, -O0):
<ReadShort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xff,%eax
movzwl %ax,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
and    $0xff,%ecx
movzwl %cx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadShort>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

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

LLVM IR (-O2):
define zeroext i16 @ReadShort(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
/* Variables and functions */
int constanttime_isequal(unsigned char const *, int, unsigned char *);
int /*<<< orphan*/ poly1305aes_test_authenticate(unsigned char *,
                                                 unsigned char const *,
                                                 unsigned char const *,
                                                 unsigned char const *,
                                                 unsigned int);
int poly1305aes_test_verify(const unsigned char a[16],
                            const unsigned char kr[32],
                            const unsigned char n[16], const unsigned char m[],
                            unsigned int l) {
  unsigned char valid[16];
  poly1305aes_test_authenticate(valid, kr, n, m, l);
  return constanttime_isequal(a, 16, valid);
}


x86 assembly (clang, -O0):
<poly1305aes_test_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <poly1305aes_test_authenticate@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rdx
mov    $0x10,%esi
call   1040 <constanttime_isequal@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poly1305aes_test_verify>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <poly1305aes_test_authenticate@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
mov    %r14,%rdx
call   1040 <constanttime_isequal@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @poly1305aes_test_verify(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca [16 x i8]
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load i32, i32* %10
%17 = call i32 @poly1305aes_test_authenticate(i8* %12, i8* %13, i8* %14, i8* %15, i32 %16)
%18 = load i8*, i8** %6
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
%20 = call i32 @constanttime_isequal(i8* %18, i32 16, i8* %19)
ret i32 %20
}

LLVM IR (-O2):
define i32 @poly1305aes_test_verify(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca [16 x i8]
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%8 = call i32 @poly1305aes_test_authenticate(i8* %7, i8* %1, i8* %2, i8* %3, i32 %4)
%9 = call i32 @constanttime_isequal(i8* %0, i32 16, i8* %7)
ret i32 %9
}
void c_pomp_section_end_(struct ompregdescr *r) { (void)0; }


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

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

LLVM IR (-O0):
%struct.ompregdescr = type opaque
define void @c_pomp_section_end_(%struct.ompregdescr* %0) {
%2 = alloca %struct.ompregdescr*
store %struct.ompregdescr* %0, %struct.ompregdescr** %2
ret void
}

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_section_end_(%struct.ompregdescr* nocapture %0) {
ret void
}
int test_imm_C2uint8_mem(unsigned char *val) {
  return ((*val) & (0xC2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C2uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 194
%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_C2uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -62
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int used(int a, int b) {
  for (a = 0; a < b; b++) {
    a += b;
  }
  while (a) {
    foo(b);
  }
  return b;
}


x86 assembly (clang, -O0):
<used>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1148 <used+0x38>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <used+0x15>
jmp    114d <used+0x3d>
cmpl   $0x0,-0x4(%rbp)
je     1164 <used+0x54>
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
jmp    114d <used+0x3d>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<used>:
push   %rbx
mov    %esi,%ebx
test   %esi,%esi
jle    1149 <used+0x39>
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%ecx
lea    (%rbx,%rcx,1),%eax
add    $0x1,%ebx
test   %ecx,%ecx
jle    1120 <used+0x10>
test   %eax,%eax
je     1149 <used+0x39>
mov    %ebx,%edi
call   1030 <foo@plt>
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <foo@plt>
jmp    1140 <used+0x30>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @used(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %8, label %16
4: ; preds = %8
%5 = icmp eq i32 %11, 0
br i1 %5, label %16, label %6
6: ; preds = %4
%7 = tail call i32 @foo(i32 %12)
br label %14
8: ; preds = %2, %8
%9 = phi i32 [ %12, %8 ], [ %1, %2 ]
%10 = phi i32 [ %11, %8 ], [ 0, %2 ]
%11 = add nsw i32 %9, %10
%12 = add nsw i32 %9, 1
%13 = icmp slt i32 %10, 1
br i1 %13, label %8, label %4
14: ; preds = %14, %6
%15 = tail call i32 @foo(i32 %12)
br label %14
16: ; preds = %2, %4
%17 = phi i32 [ %12, %4 ], [ %1, %2 ]
ret i32 %17
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
__attribute__((always_)) uint64_t detexPixel64GetG16(uint64_t pixel) {
  return (pixel & 0xFFFF0000) >> 16;
}


x86 assembly (clang, -O0):
<detexPixel64GetG16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff0000,%eax
shr    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<detexPixel64GetG16>:
mov    %edi,%eax
shr    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @detexPixel64GetG16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -65536
%5 = lshr i32 %4, 16
ret i32 %5
}

LLVM IR (-O2):
define i32 @detexPixel64GetG16(i32 %0) {
%2 = lshr i32 %0, 16
ret i32 %2
}
/* Variables and functions */
short ShortNoSwap(short l) { return l; }


x86 assembly (clang, -O0):
<ShortNoSwap>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i16 @ShortNoSwap(i16 returned signext %0) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void lv_warning(const char *message) {
  fprintf(stderr, "WARNING: %s", message);
}


x86 assembly (clang, -O0):
<lv_warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lv_warning>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"WARNING: %s\00"
define void @lv_warning(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int f(int a, int b) {
  int c = b;
  if (a != b)
    c = a;
  return c;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1122 <f+0x22>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
ret i32 %0
}
/* Variables and functions */
int errno;
int xmms_socket_errno() { return errno; }


x86 assembly (clang, -O0):
<xmms_socket_errno>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmms_socket_errno>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @xmms_socket_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @xmms_socket_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}
int foo(int i, int j, int b) {
  int res = 0;
  if (b)
    res = i / j;
  res += i / j;
  return res;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1128 <foo+0x28>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edx,%ecx
mov    %edi,%eax
cltd
idiv   %esi
test   %ecx,%ecx
cmovne %eax,%ecx
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = sdiv i32 %0, %1
%6 = select i1 %4, i32 0, i32 %5
%7 = add nsw i32 %5, %6
ret i32 %7
}
/* Type definitions */
struct ish_shell_t {
  int dummy;
};
struct ish_job_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ish_eval_job(struct ish_shell_t *, struct ish_job_t *);
struct ish_job_t *ish_job_create();
int /*<<< orphan*/ ish_shlex(char *, struct ish_job_t *);
void ish_eval_line(struct ish_shell_t *shell, char *line) {
  struct ish_job_t *job = ish_job_create();
  ish_shlex(line, job);
  ish_eval_job(shell, job);
}


x86 assembly (clang, -O0):
<ish_eval_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <ish_job_create@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <ish_shlex@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <ish_eval_job@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ish_eval_line>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
xor    %eax,%eax
call   1050 <ish_job_create@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <ish_shlex@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <ish_eval_job@plt>

LLVM IR (-O0):
%struct.ish_shell_t = type { i32 }
%struct.ish_job_t = type { i32 }
define void @ish_eval_line(%struct.ish_shell_t* %0, i8* %1) {
%3 = alloca %struct.ish_shell_t*
%4 = alloca i8*
%5 = alloca %struct.ish_job_t*
store %struct.ish_shell_t* %0, %struct.ish_shell_t** %3
store i8* %1, i8** %4
%6 = call %struct.ish_job_t* (...) @ish_job_create()
store %struct.ish_job_t* %6, %struct.ish_job_t** %5
%7 = load i8*, i8** %4
%8 = load %struct.ish_job_t*, %struct.ish_job_t** %5
%9 = call i32 @ish_shlex(i8* %7, %struct.ish_job_t* %8)
%10 = load %struct.ish_shell_t*, %struct.ish_shell_t** %3
%11 = load %struct.ish_job_t*, %struct.ish_job_t** %5
%12 = call i32 @ish_eval_job(%struct.ish_shell_t* %10, %struct.ish_job_t* %11)
ret void
}

LLVM IR (-O2):
%struct.ish_shell_t = type { i32 }
%struct.ish_job_t = type { i32 }
define void @ish_eval_line(%struct.ish_shell_t* %0, i8* %1) {
%3 = tail call %struct.ish_job_t* (...) @ish_job_create()
%4 = tail call i32 @ish_shlex(i8* %1, %struct.ish_job_t* %3)
%5 = tail call i32 @ish_eval_job(%struct.ish_shell_t* %0, %struct.ish_job_t* %3)
ret void
}