xunge/DecIR huggingface dataset:
char is_whitespace(char c) {
  if (c == ' ' || c == '\n' || c == '\t' || c == '\r')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x20,%eax
je     113e <is_whitespace+0x3e>
movsbl -0x2(%rbp),%eax
cmp    $0xa,%eax
je     113e <is_whitespace+0x3e>
movsbl -0x2(%rbp),%eax
cmp    $0x9,%eax
je     113e <is_whitespace+0x3e>
movsbl -0x2(%rbp),%eax
cmp    $0xd,%eax
jne    1147 <is_whitespace+0x47>
movb   $0x1,-0x1(%rbp)
jmp    114b <is_whitespace+0x4b>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
cmp    $0x20,%dil
ja     111d <is_whitespace+0x1d>
mov    $0x1,%al
movzbl %dil,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    111d <is_whitespace+0x1d>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i8 @is_whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 13, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i8 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print() {
  printf("fp() is short of (*fp)()\n");
  printf("*fp()=*(fp()) is short of *((*fp)())\n\n");
}


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

x86 assembly (clang, -O2):
<print>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"fp() is short of (*fp)()\0A\00"
@.str.1 = [39 x i8] c"*fp()=*(fp()) is short of *((*fp)())\0A\0A\00"
define void @print() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"fp() is short of (*fp)()\00"
@str.2 = [38 x i8] c"*fp()=*(fp()) is short of *((*fp)())\0A\00"
define void @print() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int /*<<< orphan*/);
char *strstr(char *, char *);
void replace_substring(char *base, char *old_pattern, char *new_pattern) {
  char *p = strstr(base, old_pattern);
  strncpy(p, new_pattern, strlen(old_pattern));
}


x86 assembly (clang, -O0):
<replace_substring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_substring>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
call   1050 <strstr@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
define void @replace_substring(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i8* @strstr(i8* %8, i8* %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8*, i8** %6
%13 = load i8*, i8** %5
%14 = call i32 @strlen(i8* %13)
%15 = call i32 @strncpy(i8* %11, i8* %12, i32 %14)
ret void
}

LLVM IR (-O2):
define void @replace_substring(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i32 @strncpy(i8* %4, i8* %2, i32 %5)
ret void
}
void ble_evt_system_endpoint_watermark_tx(
    const struct ble_msg_system_endpoint_watermark_tx_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_system_endpoint_watermark_tx_evt_t = type opaque
define void @ble_evt_system_endpoint_watermark_tx(%struct.ble_msg_system_endpoint_watermark_tx_evt_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gethostname(char *, int);
scalar_t__ malloc(int);
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int, char *);
void main() {
#pragma omp parallel
  {
    int thread_id = omp_get_thread_num();
    char *hostname = (char *)malloc(256 * sizeof(char));
    gethostname(hostname, 256 * sizeof(char));
    printf("Hello world from thread %d on node %s\n", thread_id, hostname);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x4(%rbp)
mov    $0x100,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x100,%esi
call   1060 <gethostname@plt>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebp
mov    $0x100,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x100,%esi
call   1060 <gethostname@plt>
lea    0xe93(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Hello world from thread %d on node %s\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i32 (...) @omp_get_thread_num()
store i32 %3, i32* %1
%4 = call i64 @malloc(i32 256)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @gethostname(i8* %6, i32 256)
%8 = load i32, i32* %1
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Hello world from thread %d on node %s\0A\00"
define void @main() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i64 @malloc(i32 256)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @gethostname(i8* %3, i32 256)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %3)
ret void
}
/* Variables and functions */
int fecsum_correct(char const *, char const *, char *);
__attribute__((visibility("default"))) int fecsum_check(const char *file,
                                                        const char *fec) {
  return fecsum_correct(file, fec, "/dev/null");
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/null\00"
define i32 @fecsum_check(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @fecsum_correct(i8* %5, i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/null\00"
define i32 @fecsum_check(i8* %0, i8* %1) {
%3 = tail call i32 @fecsum_correct(i8* %0, i8* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
adrx0regx1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((((double *)10000000)[x0]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0regx1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movslq -0x1c(%rbp),%rcx
mov    $0x989680,%eax
movsd  (%rax,%rcx,8),%xmm1
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     114d <adrx0regx1+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1154 <adrx0regx1+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0regx1>:
movslq %edi,%rdx
movslq %esi,%rax
movsd  (%rcx,%rax,8),%xmm0
xor    %eax,%eax
ucomisd 0x989680(,%rdx,8),%xmm0
setae  %al
ret

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

LLVM IR (-O2):
define i32 @adrx0regx1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* inttoptr (i64 10000000 to double*), i64 %7
%9 = load double, double* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds double, double* %5, i64 %10
%12 = load double, double* %11
%13 = fcmp ole double %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t min_uint64(uint64_t a, uint64_t b) { return a < b ? a : b; }


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

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

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

LLVM IR (-O2):
define i64 @min_uint64(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void swap(int *a, int firstIndex, int secondIndex) {
  int temp;
  temp = a[firstIndex];
  a[firstIndex] = a[secondIndex];
  a[secondIndex] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
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)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
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** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
char *calloc(int, int);
char *make_char(char *str, int buff) {
  str = calloc(buff, sizeof(char));
  return (str);
}


x86 assembly (clang, -O0):
<make_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_char>:
mov    %esi,%edi
mov    $0x1,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @make_char(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i8* @calloc(i32 %5, i32 1)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @make_char(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %1, i32 1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ lseek(int, int, int /*<<< orphan*/);
int read(int, void *, int);
int myread(int fd, void *data, int datalen, int offset) {
  lseek(fd, offset, SEEK_SET);
  return read(fd, data, datalen);
}


x86 assembly (clang, -O0):
<myread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myread>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
mov    %ecx,%esi
call   1030 <lseek@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <read@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @myread(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %8
%11 = load i32, i32* @SEEK_SET
%12 = call i32 @lseek(i32 %9, i32 %10, i32 %11)
%13 = load i32, i32* %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = call i32 @read(i32 %13, i8* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @myread(i32 %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @lseek(i32 %0, i32 %3, i32 %5)
%7 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %7
}
int test_imm_79uint16_mem(unsigned short *val) {
  return ((*val) & (0x79 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_79uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 121
%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_79uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 121
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void checknum(char *p) {
  if (*p >= '0' && *p <= '9')
    return;
  else {
    printf("Error:Non numeric Line number supplied\n");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<checknum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1152 <checknum+0x32>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     1152 <checknum+0x32>
add    $0x10,%rsp
pop    %rbp
ret
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<checknum>:
push   %rax
mov    (%rdi),%al
add    $0xd0,%al
cmp    $0x9,%al
ja     112b <checknum+0xb>
pop    %rax
ret
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Error:Non numeric Line number supplied\0A\00"
define void @checknum(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 57
br i1 %11, label %12, label %13
12: ; preds = %7
ret void
13: ; preds = %7, %1
%14 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [39 x i8] c"Error:Non numeric Line number supplied\00"
define void @checknum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
ret void
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
long double __qtanh(long double);
long double __q_tanh(long double *arg) { return (__qtanh(*arg)); }


x86 assembly (clang, -O0):
<__q_tanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qtanh@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__q_tanh>:
sub    $0x18,%rsp
fldt   (%rdi)
fstpt  (%rsp)
call   1030 <__qtanh@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define x86_fp80 @__q_tanh(x86_fp80* nocapture %0) {
%2 = load x86_fp80, x86_fp80* %0
%3 = tail call x86_fp80 @__qtanh(x86_fp80 %2)
ret x86_fp80 %3
}
int test_imm_7Duint32_mem(unsigned int *val) {
  return ((*val) & (0x7D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Duint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 125
%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_7Duint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 125
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void g_param_spec_uint64() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_uint64() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ commSendResponseMsg(void *, char *);
void ftpALLO(void *ep_server, void *comm_obj, char *args) {
  commSendResponseMsg(comm_obj, "202 No storage allocation neccessary.");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"202 No storage allocation neccessary.\00"
define void @ftpALLO(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = call i32 @commSendResponseMsg(i8* %7, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"202 No storage allocation neccessary.\00"
define void @ftpALLO(i8* nocapture readnone %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @commSendResponseMsg(i8* %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}
int SIDE_TAG(int sd) {
  int pc = 16 + (sd << 4);
  return pc;
}


x86 assembly (clang, -O0):
<SIDE_TAG>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x4,%eax
add    $0x10,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIDE_TAG>:
shl    $0x4,%edi
lea    0x10(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @SIDE_TAG(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 4
%6 = add nsw i32 16, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @SIDE_TAG(i32 %0) {
%2 = shl i32 %0, 4
%3 = add nsw i32 %2, 16
ret i32 %3
}
int compare_nodes(const void *a, const void *b) { return 0; }


x86 assembly (clang, -O0):
<compare_nodes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compare_nodes(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @compare_nodes(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
void test_fixit_remove(void) {}


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

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

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

LLVM IR (-O2):
define void @test_fixit_remove() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ CRYPTO_EX_DATA;

/* Variables and functions */
void dummy_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl,
               void *argp) {}


x86 assembly (clang, -O0):
<dummy_new>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dummy_new(i8* %0, i8* %1, i32* %2, i32 %3, i64 %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i64
%12 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store i64 %4, i64* %11
store i8* %5, i8** %12
ret void
}

LLVM IR (-O2):
define void @dummy_new(i8* nocapture %0, i8* nocapture %1, i32* nocapture %2, i32 %3, i64 %4, i8* nocapture %5) {
ret void
}
/* Type definitions */
struct ibv_device {
  int dummy;
};

/* Variables and functions */
char *_get_device_name(struct ibv_device *);
const char *ibv_get_device_name(struct ibv_device *dev) {
  const char *rslt = _get_device_name(dev);
  return rslt;
}


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

x86 assembly (clang, -O2):
<ibv_get_device_name>:
jmp    1030 <_get_device_name@plt>

LLVM IR (-O0):
%struct.ibv_device = type { i32 }
define i8* @ibv_get_device_name(%struct.ibv_device* %0) {
%2 = alloca %struct.ibv_device*
%3 = alloca i8*
store %struct.ibv_device* %0, %struct.ibv_device** %2
%4 = load %struct.ibv_device*, %struct.ibv_device** %2
%5 = call i8* @_get_device_name(%struct.ibv_device* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
%struct.ibv_device = type { i32 }
define i8* @ibv_get_device_name(%struct.ibv_device* %0) {
%2 = tail call i8* @_get_device_name(%struct.ibv_device* %0)
ret i8* %2
}
int swap_u16(void *addr) {
  unsigned short *s = (unsigned short *)addr;
  *s = (((*s) >> 8) & 0x00FF) | (((*s) << 8) & 0xFF00);
}


x86 assembly (clang, -O0):
<swap_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzwl (%rax),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    -0x18(%rbp),%rcx
movzwl (%rcx),%ecx
shl    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @swap_u16(i8* nocapture %0) {
%2 = bitcast i8* %0 to i16*
%3 = load i16, i16* %2
%4 = tail call i16 @llvm.bswap.i16(i16 %3)
store i16 %4, i16* %2
ret i32 undef
}
/* Variables and functions */
char const *ttodatav(char const *, size_t, int, char *, size_t, size_t *,
                     char *, size_t, int /*<<< orphan*/);
const char *ttodata(const char *src, size_t srclen, int base, char *dst,
                    size_t dstlen, size_t *lenp) {
  return ttodatav(src, srclen, base, dst, dstlen, lenp, (char *)NULL, (size_t)0,
                  0);
}


x86 assembly (clang, -O0):
<ttodata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
xor    %eax,%eax
xor    %eax,%eax
movq   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <ttodatav@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ttodata>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <ttodatav@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i8* @ttodata(i8* %0, i64 %1, i32 %2, i8* %3, i64 %4, i64* %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i64*
store i8* %0, i8** %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i64 %4, i64* %11
store i64* %5, i64** %12
%13 = load i8*, i8** %7
%14 = load i64, i64* %8
%15 = load i32, i32* %9
%16 = load i8*, i8** %10
%17 = load i64, i64* %11
%18 = load i64*, i64** %12
%19 = call i8* @ttodatav(i8* %13, i64 %14, i32 %15, i8* %16, i64 %17, i64* %18, i8* null, i64 0, i32 0)
ret i8* %19
}

LLVM IR (-O2):
define i8* @ttodata(i8* %0, i64 %1, i32 %2, i8* %3, i64 %4, i64* %5) {
%7 = tail call i8* @ttodatav(i8* %0, i64 %1, i32 %2, i8* %3, i64 %4, i64* %5, i8* null, i64 0, i32 0)
ret i8* %7
}
/* Variables and functions */
int strcmp_dirorder(char *, char *, int);
int strcmp_dirorder_fold(char *s1, char *s2) {
  return strcmp_dirorder(s1, s2, 1);
}


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

x86 assembly (clang, -O2):
<strcmp_dirorder_fold>:
mov    $0x1,%edx
jmp    1030 <strcmp_dirorder@plt>

LLVM IR (-O0):
define i32 @strcmp_dirorder_fold(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcmp_dirorder(i8* %5, i8* %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @strcmp_dirorder_fold(i8* %0, i8* %1) {
%3 = tail call i32 @strcmp_dirorder(i8* %0, i8* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
size_t int_len(int nb) {
  int count;
  count = nb < 0 ? 1 : 0;
  while (nb >= 10) {
    nb /= 10;
    count++;
  }
  return (count + 1);
}


x86 assembly (clang, -O0):
<int_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     1140 <int_len+0x40>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111a <int_len+0x1a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_len>:
mov    %edi,%eax
shr    $0x1f,%eax
cmp    $0xa,%edi
jl     1124 <int_len+0x24>
mov    $0xcccccccd,%ecx
nop
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x63,%edi
mov    %edx,%edi
ja     1110 <int_len+0x10>
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i64 @int_len(i32 %0) {
%2 = lshr i32 %0, 31
%3 = icmp sgt i32 %0, 9
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ %2, %1 ]
%6 = phi i32 [ %7, %4 ], [ %0, %1 ]
%7 = udiv i32 %6, 10
%8 = add nuw nsw i32 %5, 1
%9 = icmp ugt i32 %6, 99
br i1 %9, label %4, label %10
10: ; preds = %4, %1
%11 = phi i32 [ %2, %1 ], [ %8, %4 ]
%12 = add nuw nsw i32 %11, 1
%13 = zext i32 %12 to i64
ret i64 %13
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int bitcnt(int);
int ctz(uint32_t x) { return bitcnt(~x & (x - 1)); }


x86 assembly (clang, -O0):
<ctz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    $0xffffffff,%edi
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    %eax,%edi
call   1030 <bitcnt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctz>:
mov    %edi,%eax
not    %eax
add    $0xffffffff,%edi
and    %eax,%edi
jmp    1030 <bitcnt@plt>

LLVM IR (-O0):
define i32 @ctz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 1
%7 = and i32 %4, %6
%8 = call i32 @bitcnt(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @ctz(i32 %0) {
%2 = xor i32 %0, -1
%3 = add nsw i32 %0, -1
%4 = and i32 %3, %2
%5 = tail call i32 @bitcnt(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int matchtype();
int /*<<< orphan*/ nexttok();
int consumetype() {
  int type = matchtype();
  if (!type) {
    error("expected type");
  }
  nexttok();
  return type;
}


x86 assembly (clang, -O0):
<consumetype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <matchtype@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1158 <consumetype+0x28>
lea    0xead(%rip),%rdi
call   1040 <error@plt>
mov    $0x0,%al
call   1030 <nexttok@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consumetype>:
push   %rbx
xor    %eax,%eax
call   1050 <matchtype@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    114a <consumetype+0x1a>
lea    0xebb(%rip),%rdi
call   1040 <error@plt>
xor    %eax,%eax
call   1030 <nexttok@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"expected type\00"
define i32 @consumetype() {
%1 = alloca i32
%2 = call i32 (...) @matchtype()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = call i32 (...) @nexttok()
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [14 x i8] c"expected type\00"
define i32 @consumetype() {
%1 = tail call i32 (...) @matchtype()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i32 (...) @nexttok()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ dequeueList();
int /*<<< orphan*/ peekList();
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int comma2() {
  if (strcmp(peekList(), ",") != 0) {
    return 0;
  }
  dequeueList();
  return 1;
}


x86 assembly (clang, -O0):
<comma2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <peekList@plt>
mov    %eax,%edi
lea    0xeb8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1163 <comma2+0x33>
movl   $0x0,-0x4(%rbp)
jmp    1171 <comma2+0x41>
mov    $0x0,%al
call   1050 <dequeueList@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comma2>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <peekList@plt>
lea    0xebf(%rip),%rsi
mov    %eax,%edi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1159 <comma2+0x29>
xor    %eax,%eax
call   1050 <dequeueList@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c",\00"
define i32 @comma2() {
%1 = alloca i32
%2 = call i32 (...) @peekList()
%3 = call i64 @strcmp(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %8
6: ; preds = %0
%7 = call i32 (...) @dequeueList()
store i32 1, i32* %1
br label %8
8: ; preds = %6, %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [2 x i8] c",\00"
define i32 @comma2() {
%1 = tail call i32 (...) @peekList()
%2 = tail call i64 @strcmp(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @dequeueList()
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ 1, %4 ], [ 0, %0 ]
ret i32 %7
}
int buildBell_il(void *ail, const char *matlabfilename) { return 99; }


x86 assembly (clang, -O0):
<buildBell_il>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x63,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @buildBell_il(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 99
}

LLVM IR (-O2):
define i32 @buildBell_il(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 99
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
main() {
  double raio, pi, area;
  scanf("%lf", &raio);
  pi = 3.14159;
  area = pi * (raio * raio);
  printf("A=%.4lf\n", area);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xebf(%rip),%xmm0
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"A=%.4lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
store double 3.141590e+00, double* %3
%6 = load double, double* %3
%7 = load double, double* %2
%8 = load double, double* %2
%9 = fmul double %7, %8
%10 = fmul double %6, %9
store double %10, double* %4
%11 = load double, double* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"A=%.4lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, %4
%6 = fmul double %5, 3.141590e+00
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %6)
ret i32 0
}
int coap_get_query_variable(void *packet, const char *name,
                            const char **output) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @coap_get_query_variable(i8* %0, i8* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @coap_get_query_variable(i8* nocapture readnone %0, i8* nocapture readnone %1, i8** nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
long ndb_add_ptr(void *old_ptr, void *i_ptr, size_t i_size, char *i_remark) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i64 @ndb_add_ptr(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i8* nocapture readnone %3) {
ret i64 0
}
void rte_mb(void) { __sync_synchronize(); }


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

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

LLVM IR (-O0):
define void @rte_mb() {
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @rte_mb() {
fence seq_cst
ret void
}
void answer_hint(void) {}


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

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

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

LLVM IR (-O2):
define void @answer_hint() {
ret void
}
int compara(const void *p1, const void *p2) {
  return *((int *)p1) - *((int *)p2);
}


x86 assembly (clang, -O0):
<compara>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compara>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compara(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compara(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void bwa_print_sam_PG() { printf("@PG\tID:bwa\tPN:bwa\tVN:%s\n", "0.5.9-r16"); }


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

x86 assembly (clang, -O2):
<bwa_print_sam_PG>:
lea    0xee9(%rip),%rdi
lea    0xefb(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"@PG\09ID:bwa\09PN:bwa\09VN:%s\0A\00"
@.str.1 = [10 x i8] c"0.5.9-r16\00"
define void @bwa_print_sam_PG() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"@PG\09ID:bwa\09PN:bwa\09VN:%s\0A\00"
@.str.1 = [10 x i8] c"0.5.9-r16\00"
define void @bwa_print_sam_PG() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long long int phi(long long int n) {
  long long result = 2, i;
  if (n == 1)
    return 1;
  for (i = 2; i <= n; i++) {
    if (n % i == 0) {
      result++;
      n = n / i;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<phi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    1128 <phi+0x28>
movq   $0x1,-0x8(%rbp)
jmp    118a <phi+0x8a>
movq   $0x2,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1182 <phi+0x82>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x20(%rbp)
cmp    $0x0,%rdx
jne    116c <phi+0x6c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cqto
idivq  -0x20(%rbp)
mov    %rax,-0x10(%rbp)
jmp    1171 <phi+0x71>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1130 <phi+0x30>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<phi>:
mov    $0x1,%ecx
cmp    $0x1,%rdi
je     1112 <phi+0x12>
mov    $0x2,%ecx
jg     1116 <phi+0x16>
mov    %rcx,%rax
ret
mov    $0x1,%esi
jmp    113c <phi+0x3c>
nopl   (%rax)
mov    %rdi,%rax
cqto
idiv   %rsi
test   %rdx,%rdx
cmove  %rax,%rdi
lea    0x1(%rcx),%rax
cmove  %rax,%rcx
cmp    %rdi,%rsi
jge    1112 <phi+0x12>
add    $0x1,%rsi
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
jne    1120 <phi+0x20>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
jmp    1128 <phi+0x28>

LLVM IR (-O0):
define i64 @phi(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 2, i64* %4
%6 = load i64, i64* %3
%7 = icmp eq i64 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %1
store i64 1, i64* %2
br label %31
9: ; preds = %1
store i64 2, i64* %5
br label %10
10: ; preds = %26, %9
%11 = load i64, i64* %5
%12 = load i64, i64* %3
%13 = icmp sle i64 %11, %12
br i1 %13, label %14, label %29
14: ; preds = %10
%15 = load i64, i64* %3
%16 = load i64, i64* %5
%17 = srem i64 %15, %16
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %14
%20 = load i64, i64* %4
%21 = add nsw i64 %20, 1
store i64 %21, i64* %4
%22 = load i64, i64* %3
%23 = load i64, i64* %5
%24 = sdiv i64 %22, %23
store i64 %24, i64* %3
br label %25
25: ; preds = %19, %14
br label %26
26: ; preds = %25
%27 = load i64, i64* %5
%28 = add nsw i64 %27, 1
store i64 %28, i64* %5
br label %10
29: ; preds = %10
%30 = load i64, i64* %4
store i64 %30, i64* %2
br label %31
31: ; preds = %29, %8
%32 = load i64, i64* %2
ret i64 %32
}

LLVM IR (-O2):
define i64 @phi(i64 %0) {
%2 = icmp eq i64 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = icmp slt i64 %0, 2
br i1 %4, label %17, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %15, %5 ], [ 2, %3 ]
%7 = phi i64 [ %14, %5 ], [ 2, %3 ]
%8 = phi i64 [ %13, %5 ], [ %0, %3 ]
%9 = srem i64 %8, %6
%10 = sdiv i64 %8, %6
%11 = icmp eq i64 %9, 0
%12 = add nsw i64 %7, 1
%13 = select i1 %11, i64 %10, i64 %8
%14 = select i1 %11, i64 %12, i64 %7
%15 = add nuw nsw i64 %6, 1
%16 = icmp slt i64 %6, %13
br i1 %16, label %5, label %17
17: ; preds = %5, %3, %1
%18 = phi i64 [ 1, %1 ], [ 2, %3 ], [ %14, %5 ]
ret i64 %18
}