xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x87() {
  Assert_real((isdigit(135) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              680, ("isdigit should be 0 for 0x87"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x87>:
push   %rbp
mov    %rsp,%rbp
mov    $0x87,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2a8,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x87>:
push   %rax
mov    $0x87,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2a8,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x87\00"
define void @t_isdigit_0x87() {
%1 = call i64 @isdigit(i32 135)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 680, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x87\00"
define void @t_isdigit_0x87() {
%1 = tail call i64 @isdigit(i32 135)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 680, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ make_expression(int);
void make(int n, int max) {
  int i = 0;
  for (i = 1; i <= n; i++) {
    make_expression(max);
    if (0 != i % 3) {
    } else {
    }
  }
}


x86 assembly (clang, -O0):
<make>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1172 <make+0x62>
mov    -0x8(%rbp),%edi
call   1030 <make_expression@plt>
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
je     115a <make+0x4a>
jmp    115f <make+0x4f>
jmp    115f <make+0x4f>
jmp    1164 <make+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <make+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    112c <make+0x1c>
mov    %esi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <make_expression@plt>
add    $0xffffffff,%ebp
jne    1120 <make+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @make(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 1, %2 ]
%6 = tail call i32 @make_expression(i32 %1)
%7 = add nuw i32 %5, 1
%8 = icmp eq i32 %5, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
int clamp(int min, int n, int max) {
  return (min < n) ? (n < max ? n : max) : min;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1141 <clamp+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1130 <clamp+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <clamp+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <clamp+0x47>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @clamp(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 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i32, i32* %5
br label %18
16: ; preds = %10
%17 = load i32, i32* %6
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ %15, %14 ], [ %17, %16 ]
br label %22
20: ; preds = %3
%21 = load i32, i32* %4
br label %22
22: ; preds = %20, %18
%23 = phi i32 [ %19, %18 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp slt i32 %1, %2
%6 = select i1 %5, i32 %1, i32 %2
%7 = select i1 %4, i32 %6, i32 %0
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t lfsrandom32(uint32_t *r) {
  return *r = ((*r) >> 1) ^ (-((*r) & 1u) & (0x80200003u));
}


x86 assembly (clang, -O0):
<lfsrandom32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0x1,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
and    $0x80200003,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    %eax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lfsrandom32>:
mov    (%rdi),%eax
mov    %eax,%ecx
sar    %ecx
and    $0x1,%eax
neg    %eax
and    $0x80200003,%eax
xor    %ecx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @lfsrandom32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = ashr i32 %4, 1
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = and i32 %7, 1
%9 = sub i32 0, %8
%10 = and i32 %9, -2145386493
%11 = xor i32 %5, %10
%12 = load i32*, i32** %2
store i32 %11, i32* %12
ret i32 %11
}

LLVM IR (-O2):
define i32 @lfsrandom32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = ashr i32 %2, 1
%4 = and i32 %2, 1
%5 = sub nsw i32 0, %4
%6 = and i32 %5, -2145386493
%7 = xor i32 %6, %3
store i32 %7, i32* %0
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int strncmp(char const *, char const *, int /*<<< orphan*/);
int a_strncmp(const char *a, const char *b, ssize_t n) {
  return strncmp((a ? a : ""), (b ? b : ""), n);
}


x86 assembly (clang, -O0):
<a_strncmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113b <a_strncmp+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    114b <a_strncmp+0x3b>
lea    0xebe(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    114b <a_strncmp+0x3b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116b <a_strncmp+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    117b <a_strncmp+0x6b>
lea    0xe8e(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    117b <a_strncmp+0x6b>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncmp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_strncmp>:
test   %rdi,%rdi
lea    0xee6(%rip),%rax
cmove  %rax,%rdi
test   %rsi,%rsi
cmove  %rax,%rsi
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @a_strncmp(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = load i8*, i8** %4
br label %12
11: ; preds = %3
br label %12
12: ; preds = %11, %9
%13 = phi i8* [ %10, %9 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %11 ]
%14 = load i8*, i8** %5
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i8*, i8** %5
br label %19
18: ; preds = %12
br label %19
19: ; preds = %18, %16
%20 = phi i8* [ %17, %16 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %18 ]
%21 = load i32, i32* %6
%22 = call i32 @strncmp(i8* %13, i8* %20, i32 %21)
ret i32 %22
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @a_strncmp(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %0, null
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%6 = icmp eq i8* %1, null
%7 = select i1 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1
%8 = tail call i32 @strncmp(i8* %5, i8* %7, i32 %2)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ clrbline();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ flush();
int /*<<< orphan*/ resettty();
int quit() {
  clrbline();
  resettty();
  flush();
  exit(0);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <clrbline@plt>
mov    $0x0,%al
call   1040 <resettty@plt>
mov    $0x0,%al
call   1030 <flush@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
xor    %eax,%eax
call   1050 <clrbline@plt>
xor    %eax,%eax
call   1040 <resettty@plt>
xor    %eax,%eax
call   1030 <flush@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define i32 @quit() {
%1 = call i32 (...) @clrbline()
%2 = call i32 (...) @resettty()
%3 = call i32 (...) @flush()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @quit() {
%1 = tail call i32 (...) @clrbline()
%2 = tail call i32 (...) @resettty()
%3 = tail call i32 (...) @flush()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(
      stderr,
      "usage: ping [-LRdfnqrv] [-c count] [-i wait] [-l preload]\n\t[-p "
      "pattern] [-s packetsize] [-t ttl] [-I interface address] host\n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [126 x i8] c"usage: ping [-LRdfnqrv] [-c count] [-i wait] [-l preload]\0A\09[-p pattern] [-s packetsize] [-t ttl] [-I interface address] host\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [126 x i8] c"usage: ping [-LRdfnqrv] [-c count] [-i wait] [-l preload]\0A\09[-p pattern] [-s packetsize] [-t ttl] [-I interface address] host\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
double sqrt(double);
__attribute__((transaction_pure)) double tm_sqrt(double x) { return sqrt(x); }


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

x86 assembly (clang, -O2):
<tm_sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <tm_sqrt+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @tm_sqrt(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
char *mp_store_u64(char *, int /*<<< orphan*/);
char *mp_store_u8(char *, int);
char *mp_encode_uint64(char *data, uint64_t num) {
  data = mp_store_u8(data, 0xcf);
  return mp_store_u64(data, num);
}


x86 assembly (clang, -O0):
<mp_encode_uint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xcf,%esi
call   1030 <mp_store_u8@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <mp_store_u64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_encode_uint64>:
push   %rbx
mov    %esi,%ebx
mov    $0xcf,%esi
call   1030 <mp_store_u8@plt>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <mp_store_u64@plt>

LLVM IR (-O0):
define i8* @mp_encode_uint64(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i8* @mp_store_u8(i8* %5, i32 207)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i8* @mp_store_u64(i8* %7, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @mp_encode_uint64(i8* %0, i32 %1) {
%3 = tail call i8* @mp_store_u8(i8* %0, i32 207)
%4 = tail call i8* @mp_store_u64(i8* %3, i32 %1)
ret i8* %4
}
int klp_check_compiler_support(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @klp_check_compiler_support() {
ret i32 0
}
int namematch(const char *end, const char *start, const char *match) {
  int len = strlen(match);
  return ((end - len >= start) && (strncmp(end - len, match, len) == 0));
}


x86 assembly (clang, -O0):
<namematch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
xor    %eax,%eax
sub    %rdx,%rax
add    %rax,%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x1d(%rbp)
jb     1185 <namematch+0x65>
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
movslq -0x1c(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
sete   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<namematch>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1040 <strlen@plt>
movslq %eax,%rdx
sub    %rdx,%rbx
xor    %eax,%eax
cmp    %r15,%rbx
jb     1157 <namematch+0x37>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strncmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @namematch(i8* %0, i8* readnone %1, i8* nocapture %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%5 = shl i64 %4, 32
%6 = ashr exact i64 %5, 32
%7 = sub nsw i64 0, %6
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = icmp ult i8* %8, %1
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = tail call i32 @strncmp(i8* %8, i8* %2, i64 %6)
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %10, %3
%15 = phi i32 [ 0, %3 ], [ %13, %10 ]
ret i32 %15
}
void swap(int s[], int n) {
  int i, j, temp;
  for (i = 0, j = n; i < j; i++, j--)
    temp = s[i], s[i] = s[j], s[j] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116d <swap+0x6d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <swap+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
test   %esi,%esi
jle    112e <swap+0x2e>
mov    %esi,%eax
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rdi,%rcx,4),%edx
mov    (%rdi,%rax,4),%esi
mov    %esi,-0x4(%rdi,%rcx,4)
mov    %edx,(%rdi,%rax,4)
add    $0xffffffffffffffff,%rax
lea    0x1(%rcx),%rdx
cmp    %rax,%rcx
mov    %rdx,%rcx
jl     1110 <swap+0x10>
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%8 = load i32, i32* %4
store i32 %8, i32* %6
br label %9
9: ; preds = %33, %2
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %38
13: ; preds = %9
%14 = load i32*, i32** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
store i32 %18, i32* %7
%19 = load i32*, i32** %3
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = load i32*, i32** %3
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
store i32 %23, i32* %27
%28 = load i32, i32* %7
%29 = load i32*, i32** %3
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i32, i32* %29, i64 %31
store i32 %28, i32* %32
br label %33
33: ; preds = %13
%34 = load i32, i32* %5
%35 = add nsw i32 %34, 1
store i32 %35, i32* %5
%36 = load i32, i32* %6
%37 = add nsw i32 %36, -1
store i32 %37, i32* %6
br label %9
38: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %14, %6 ]
%8 = phi i64 [ 0, %4 ], [ %13, %6 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %0, i64 %7
%12 = load i32, i32* %11
store i32 %12, i32* %9
store i32 %10, i32* %11
%13 = add nuw nsw i64 %8, 1
%14 = add nsw i64 %7, -1
%15 = icmp slt i64 %13, %14
br i1 %15, label %6, label %16
16: ; preds = %6, %2
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ auth_attr;
};
typedef TYPE_1__ PKCS7_SIGNER_INFO;

/* Variables and functions */
int add_attribute(int /*<<< orphan*/ *, int, int, void *);
int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,
                               void *value) {
  return (add_attribute(&(p7si->auth_attr), nid, atrtype, value));
}


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

x86 assembly (clang, -O2):
<PKCS7_add_signed_attribute>:
jmp    1030 <add_attribute@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @PKCS7_add_signed_attribute(%struct.TYPE_3__* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca %struct.TYPE_3__*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = call i32 @add_attribute(i32* %10, i32 %11, i32 %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @PKCS7_add_signed_attribute(%struct.TYPE_3__* %0, i32 %1, i32 %2, i8* %3) {
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%6 = tail call i32 @add_attribute(i32* %5, i32 %1, i32 %2, i8* %3)
ret i32 %6
}
/* Variables and functions */
double exp(double);
double math_exp(double x) { return exp(x); }


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

x86 assembly (clang, -O2):
<math_exp>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define double @math_exp(double %0) {
%2 = tail call double @exp(double %0)
ret double %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t endian32_swap(uint32_t val) {
  uint32_t temp;
  temp = (val >> 24) | ((val & 0x00FF0000) >> 8) | ((val & 0x0000FF00) << 8) |
         ((val & 0x000000FF) << 24);
  return temp;
}


x86 assembly (clang, -O0):
<endian32_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian32_swap>:
mov    %edi,%eax
sar    $0x18,%eax
mov    %edi,%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
mov    %edi,%edx
shl    $0x8,%edx
and    $0xff0000,%edx
shl    $0x18,%edi
or     %edi,%eax
or     %ecx,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @endian32_swap(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 16711680
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 65280
%12 = shl i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, 255
%16 = shl i32 %15, 24
%17 = or i32 %13, %16
store i32 %17, i32* %3
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @endian32_swap(i32 %0) {
%2 = ashr i32 %0, 24
%3 = lshr i32 %0, 8
%4 = and i32 %3, 65280
%5 = shl i32 %0, 8
%6 = and i32 %5, 16711680
%7 = shl i32 %0, 24
%8 = or i32 %7, %2
%9 = or i32 %8, %4
%10 = or i32 %9, %6
ret i32 %10
}
OP(dd, d3) {
  illegal_1();
  op_d3();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <illegal_1@plt>
mov    $0x0,%al
call   1030 <op_d3@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1040 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <op_d3@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_d3()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_d3()
ret i32 undef
}
double getDC() { return (double)((1L << 8) - 16L); }


x86 assembly (clang, -O0):
<getDC>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDC>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @getDC() {
ret double 2.400000e+02
}

LLVM IR (-O2):
define double @getDC() {
ret double 2.400000e+02
}
digit(c) { return (c <= '9' && c >= '0'); }


x86 assembly (clang, -O0):
<digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     1120 <digit+0x20>
cmpl   $0x30,-0x4(%rbp)
setge  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned long GPIOPinLockStatus(unsigned long ulPort, unsigned char ucPins) {
  ;
  return ((~((*((volatile unsigned long *)(ulPort + 0x00000524))))) & ucPins);
}


x86 assembly (clang, -O0):
<GPIOPinLockStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x524(%rax),%rax
xor    $0xffffffffffffffff,%rax
movzbl -0x9(%rbp),%ecx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinLockStatus>:
mov    0x524(%rdi),%rax
not    %eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i64 @GPIOPinLockStatus(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 1316
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = xor i64 %8, -1
%10 = load i8, i8* %4
%11 = zext i8 %10 to i64
%12 = and i64 %9, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @GPIOPinLockStatus(i64 %0, i8 zeroext %1) {
%3 = add i64 %0, 1316
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = zext i8 %1 to i64
%8 = and i64 %6, %7
ret i64 %8
}
void sleep(unsigned long long ticks) {
  unsigned long long end;
  end = get_tb_ticks() + ticks;
  while (get_tb_ticks() < end)
    __asm__ __volatile__("nop");
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_tb_ticks@plt>
cltq
add    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <get_tb_ticks@plt>
cltq
cmp    -0x10(%rbp),%rax
jae    1146 <sleep+0x36>
nop
jmp    112d <sleep+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <get_tb_ticks@plt>
movslq %eax,%rbx
add    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <get_tb_ticks@plt>
cltq
cmp    %rax,%rbx
jbe    1141 <sleep+0x31>
nop
jmp    1130 <sleep+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sleep(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = call i32 (...) @get_tb_ticks()
%5 = sext i32 %4 to i64
%6 = load i64, i64* %2
%7 = add i64 %5, %6
store i64 %7, i64* %3
br label %8
8: ; preds = %13, %1
%9 = call i32 (...) @get_tb_ticks()
%10 = sext i32 %9 to i64
%11 = load i64, i64* %3
%12 = icmp ult i64 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %8
br label %8
14: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @sleep(i64 %0) {
%2 = tail call i32 (...) @get_tb_ticks()
%3 = sext i32 %2 to i64
%4 = add i64 %3, %0
%5 = tail call i32 (...) @get_tb_ticks()
%6 = sext i32 %5 to i64
%7 = icmp ugt i64 %4, %6
br i1 %7, label %8, label %12
8: ; preds = %1, %8
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%9 = tail call i32 (...) @get_tb_ticks()
%10 = sext i32 %9 to i64
%11 = icmp ugt i64 %4, %10
br i1 %11, label %8, label %12
12: ; preds = %8, %1
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int nd_int(void) {
  srand(time(NULL));
  return rand();
}


x86 assembly (clang, -O0):
<nd_int>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nd_int>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <rand@plt>

LLVM IR (-O0):
define i32 @nd_int() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
%3 = call i32 (...) @rand()
ret i32 %3
}

LLVM IR (-O2):
define i32 @nd_int() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
ret i32 %3
}
int hash_func(int value) { return value % 15000; }


x86 assembly (clang, -O0):
<hash_func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3a98,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_func>:
movslq %edi,%rax
imul   $0x45e7b273,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2c,%rcx
add    %edx,%ecx
imul   $0x3a98,%ecx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_func(i32 %0) {
%2 = srem i32 %0, 15000
ret i32 %2
}
/* Variables and functions */
scalar_t__ floor(int /*<<< orphan*/);
int /*<<< orphan*/ labs(long);
int /*<<< orphan*/ log10(int /*<<< orphan*/);
size_t ldigits(long number) { return (size_t)(floor(log10(labs(number))) + 1); }


x86 assembly (clang, -O0):
<ldigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <labs@plt>
mov    %eax,%edi
call   1040 <log10@plt>
mov    %eax,%edi
call   1050 <floor@plt>
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldigits>:
push   %rax
call   1030 <labs@plt>
mov    %eax,%edi
call   1040 <log10@plt>
mov    %eax,%edi
call   1050 <floor@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @ldigits(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @labs(i64 %3)
%5 = call i32 @log10(i32 %4)
%6 = call i64 @floor(i32 %5)
%7 = add nsw i64 %6, 1
ret i64 %7
}

LLVM IR (-O2):
define i64 @ldigits(i64 %0) {
%2 = tail call i32 @labs(i64 %0)
%3 = tail call i32 @log10(i32 %2)
%4 = tail call i64 @floor(i32 %3)
%5 = add nsw i64 %4, 1
ret i64 %5
}
void delay_nms(short ms) {
  unsigned char i;
  while ((--ms) >= 0) {
    for (i = 0; i < 115; i++)
      ;
  }
}


x86 assembly (clang, -O0):
<delay_nms>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
add    $0xffff,%ax
mov    %ax,-0x2(%rbp)
cwtl
cmp    $0x0,%eax
jl     1149 <delay_nms+0x49>
movb   $0x0,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x73,%eax
jge    1144 <delay_nms+0x44>
jmp    1137 <delay_nms+0x37>
mov    -0x3(%rbp),%al
add    $0x1,%al
mov    %al,-0x3(%rbp)
jmp    1125 <delay_nms+0x25>
jmp    110b <delay_nms+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay_nms(i16 signext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
br label %4
4: ; preds = %18, %1
%5 = load i16, i16* %2
%6 = add i16 %5, -1
store i16 %6, i16* %2
%7 = sext i16 %6 to i32
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %4
store i8 0, i8* %3
br label %10
10: ; preds = %15, %9
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = icmp slt i32 %12, 115
br i1 %13, label %14, label %18
14: ; preds = %10
br label %15
15: ; preds = %14
%16 = load i8, i8* %3
%17 = add i8 %16, 1
store i8 %17, i8* %3
br label %10
18: ; preds = %10
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @delay_nms(i16 signext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parloop(int);
int main(void) {
  parloop(500);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1f4,%edi
call   1030 <parloop@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @parloop(i32 500)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void swap(int data[], int from, int to) {
  assert(from != to);
  int temporary = data[from];
  data[from] = data[to];
  data[to] = temporary;
}


x86 assembly (clang, -O0):
<swap>:
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
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
cmp    %edx,%esi
setne  %dil
call   1030 <assert@plt>
movslq %ebp,%rax
mov    (%rbx,%rax,4),%ecx
movslq %r14d,%rdx
mov    (%rbx,%rdx,4),%esi
mov    %esi,(%rbx,%rax,4)
mov    %ecx,(%rbx,%rdx,4)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @swap(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 ne i32 %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
store i32 %17, i32* %7
%18 = load i32*, i32** %4
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
%27 = load i32, i32* %7
%28 = load i32*, i32** %4
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
store i32 %27, i32* %31
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp ne i32 %1, %2
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %8
store i32 %9, i32* %11
ret void
}
unsigned short unsignedshort_ignoring_unsignedchar(unsigned short x,
                                                   unsigned char y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshort_ignoring_unsignedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @unsignedshort_ignoring_unsignedchar(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @unsignedshort_ignoring_unsignedchar(i16 returned zeroext %0, i8 zeroext %1) {
ret i16 %0
}
void bubble_sort(double x[], int n) {
  double y[n];
  return;
}


x86 assembly (clang, -O0):
<bubble_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @bubble_sort(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store double* %0, double** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca double, i64 %8
store i64 %8, i64* %6
%11 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
define void @bubble_sort(double* nocapture %0, i32 %1) {
ret void
}
char *getwd(char *buf) { return "dummy"; }


x86 assembly (clang, -O0):
<getwd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getwd>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"dummy\00"
define i8* @getwd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"dummy\00"
define i8* @getwd(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int gadget3(int a, int b) {
  int i, j;
  i = a + b / 33;
  for (j = 0; j < 10; j++)
    ;
  asm("nop");
  asm("int $0x80");
  return 42;
}


x86 assembly (clang, -O0):
<gadget3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x21,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1149 <gadget3+0x49>
jmp    113b <gadget3+0x3b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112c <gadget3+0x2c>
nop
int    $0x80
mov    $0x2a,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gadget3>:
nop
int    $0x80
mov    $0x2a,%eax
ret

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

LLVM IR (-O2):
define i32 @gadget3(i32 %0, i32 %1) {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "int $$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret i32 42
}
int min(int a, int b) {
  int i;
  for (i = (a > b ? a : b);; i++) {
    if ((i % a == 0) && (i % b == 0)) {
      return i;
      break;
    }
  }
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x4(%rbp)
cmp    $0x0,%edx
jne    1152 <min+0x52>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1152 <min+0x52>
mov    -0xc(%rbp),%eax
pop    %rbp
ret
jmp    1157 <min+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <min+0x2d>

x86 assembly (clang, -O2):
<min>:
cmp    %esi,%edi
mov    %esi,%ecx
cmovg  %edi,%ecx
jmp    1113 <min+0x13>
nopl   0x0(%rax)
add    $0x1,%ecx
mov    %ecx,%eax
cltd
idiv   %edi
test   %edx,%edx
jne    1110 <min+0x10>
mov    %ecx,%eax
cltd
idiv   %esi
test   %edx,%edx
jne    1110 <min+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @min(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* %3
%7 = load i32, i32* %4
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %4
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
store i32 %14, i32* %5
br label %15
15: ; preds = %28, %13
%16 = load i32, i32* %5
%17 = load i32, i32* %3
%18 = srem i32 %16, %17
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %27
20: ; preds = %15
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = srem i32 %21, %22
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %20
%26 = load i32, i32* %5
ret i32 %26
27: ; preds = %20, %15
br label %28
28: ; preds = %27
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %15
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
br label %5
5: ; preds = %13, %2
%6 = phi i32 [ %4, %2 ], [ %14, %13 ]
%7 = srem i32 %6, %0
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = srem i32 %6, %1
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
ret i32 %6
13: ; preds = %5, %9
%14 = add nsw i32 %6, 1
br label %5
}
void CRL_DIST_POINTS_new(void) {}


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

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

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

LLVM IR (-O2):
define void @CRL_DIST_POINTS_new() {
ret void
}
/* Variables and functions */
int pow(float, int);
float f(float x) { return (pow(x, 3) - (4 * x) + 1); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
cvtsi2ss %eax,%xmm1
movss  -0x4(%rbp),%xmm0
movss  0xec7(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xeb3(%rip),%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    $0x3,%edi
call   1030 <pow@plt>
cvtsi2ss %eax,%xmm1
movss  0x4(%rsp),%xmm0
mulss  0xecd(%rip),%xmm0
addss  %xmm1,%xmm0
addss  0xec5(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @pow(float %3, i32 3)
%5 = sitofp i32 %4 to float
%6 = load float, float* %2
%7 = call float @llvm.fmuladd.f32(float -4.000000e+00, float %6, float %5)
%8 = fadd float %7, 1.000000e+00
ret float %8
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = tail call i32 @pow(float %0, i32 3)
%3 = sitofp i32 %2 to float
%4 = tail call float @llvm.fmuladd.f32(float %0, float -4.000000e+00, float %3)
%5 = fadd float %4, 1.000000e+00
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void Usage(char prog_name[]) {
  fprintf(stderr, "usage:  %s <thread count> <number of Fibonacci numbers>\n",
          prog_name);
  exit(0);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"usage: %s <thread count> <number of Fibonacci numbers>\0A\00"
define void @Usage(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 ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"usage: %s <thread count> <number of Fibonacci numbers>\0A\00"
define void @Usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_INT3_PIN() { return 0x01 & (inp_emulate(0x44) >> 3); }


x86 assembly (clang, -O0):
<TOSH_READ_INT3_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44,%edi
call   1030 <inp_emulate@plt>
sar    $0x3,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_INT3_PIN>:
push   %rax
mov    $0x44,%edi
call   1030 <inp_emulate@plt>
shr    $0x3,%al
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_INT3_PIN() {
%1 = call i32 @inp_emulate(i32 68)
%2 = ashr i32 %1, 3
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_INT3_PIN() {
%1 = tail call i32 @inp_emulate(i32 68)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 3
%4 = and i8 %3, 1
ret i8 %4
}