xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ print_stamp();
int /*<<< orphan*/ sleep(int);
void *th(void *arg) {
  while (1) {
    print_stamp();
    sleep(30);
  }
}


x86 assembly (clang, -O0):
<th>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <print_stamp@plt>
mov    $0x1e,%edi
call   1030 <sleep@plt>
jmp    112c <th+0xc>

x86 assembly (clang, -O2):
<th>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <print_stamp@plt>
mov    $0x1e,%edi
call   1030 <sleep@plt>
jmp    1130 <th+0x10>

LLVM IR (-O0):
define i8* @th(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (...) @print_stamp()
%5 = call i32 @sleep(i32 30)
br label %3
}

LLVM IR (-O2):
define noalias i8* @th(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @print_stamp()
%4 = tail call i32 @sleep(i32 30)
br label %2
}
unsigned min(unsigned a, unsigned b) { return (a < b) ? a : b; }


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
jae    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
struct timeval {
  long tv_usec;
  scalar_t__ tv_sec;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ read_timeout(int, void *, size_t, struct timeval *);
ssize_t read_timeout_usec(int fd, void *buf, size_t count, long usec_timeout) {
  struct timeval timeout;
  timeout.tv_sec = 0;
  timeout.tv_usec = usec_timeout;
  return read_timeout(fd, buf, count, &timeout);
}


x86 assembly (clang, -O0):
<read_timeout_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x30(%rbp),%rcx
call   1030 <read_timeout@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_timeout_usec>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
mov    %rcx,0x8(%rsp)
lea    0x8(%rsp),%rcx
call   1030 <read_timeout@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @read_timeout_usec(i32 %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca %struct.timeval
%6 = bitcast %struct.timeval* %5 to i8*
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 1
store i64 0, i64* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
store i64 %3, i64* %8
%9 = call i32 @read_timeout(i32 %0, i8* %1, i64 %2, %struct.timeval* %5)
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
int REG_NOMATCH;
int regexec(int /*<<< orphan*/ *, char *, int /*<<< orphan*/,
            int /*<<< orphan*/, int /*<<< orphan*/);
double regex_feature_recognize(regex_t *regex, char *sequence) {
  int res;
  res = regexec(regex, sequence, 0, 0, 0);
  if (res == REG_NOMATCH)
    return 0.0;
  else
    return 1.0;
}


x86 assembly (clang, -O0):
<regex_feature_recognize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <regexec@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%eax
jne    1158 <regex_feature_recognize+0x48>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1165 <regex_feature_recognize+0x55>
movsd  0xea0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<regex_feature_recognize>:
push   %rax
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <regexec@plt>
mov    0x2ec4(%rip),%rcx
xorps  %xmm0,%xmm0
cmp    (%rcx),%eax
je     1133 <regex_feature_recognize+0x23>
movsd  0xecd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@REG_NOMATCH = global i32 0
define double @regex_feature_recognize(i32* %0, i8* %1) {
%3 = alloca double
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = call i32 @regexec(i32* %7, i8* %8, i32 0, i32 0, i32 0)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = load i32, i32* @REG_NOMATCH
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store double 0.000000e+00, double* %3
br label %15
14: ; preds = %2
store double 1.000000e+00, double* %3
br label %15
15: ; preds = %14, %13
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
@REG_NOMATCH = global i32 0
define double @regex_feature_recognize(i32* %0, i8* %1) {
%3 = tail call i32 @regexec(i32* %0, i8* %1, i32 0, i32 0, i32 0)
%4 = load i32, i32* @REG_NOMATCH
%5 = icmp eq i32 %3, %4
%6 = select i1 %5, double 0.000000e+00, double 1.000000e+00
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ forkear(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc != 2)
    printf("Debe introducir un nombre para los archivos de reporte");
  else
    forkear(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1151 <main+0x31>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
jmp    115e <main+0x3e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <forkear@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1131 <main+0x11>
mov    0x8(%rsi),%rdi
call   1030 <forkear@plt>
jmp    113d <main+0x1d>
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"Debe introducir un nombre para los archivos de reporte\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @forkear(i8* %13)
br label %15
15: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [55 x i8] c"Debe introducir un nombre para los archivos de reporte\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @forkear(i8* %8)
br label %10
10: ; preds = %6, %4
ret i32 0
}
/* Variables and functions */
int read_permission_p(char *);
int fileutils___read_permission_p(char *filename) {
  return (read_permission_p(filename));
}


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

x86 assembly (clang, -O2):
<fileutils___read_permission_p>:
jmp    1030 <read_permission_p@plt>

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

LLVM IR (-O2):
define i32 @fileutils___read_permission_p(i8* %0) {
%2 = tail call i32 @read_permission_p(i8* %0)
ret i32 %2
}
int test_imm_46uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x46 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_46uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x46,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_46uint64_midword_reg>:
test   $0x460000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_46uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 70
%6 = icmp ne i64 %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_46uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 4587520
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
long strtol(char const *, char **, int);
long NV_strtolSeq(const char **restrict p, int base) {
  char *q;
  long n;
  n = strtol(*p, &q, base);
  *p = q;
  return n;
}


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

x86 assembly (clang, -O2):
<NV_strtolSeq>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%edx
mov    %rdi,%rbx
mov    (%rdi),%rdi
lea    0x8(%rsp),%rsi
call   1030 <strtol@plt>
mov    0x8(%rsp),%rcx
mov    %rcx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @NV_strtolSeq(i8** noalias %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i8** %0, i8*** %3
store i32 %1, i32* %4
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
%9 = load i32, i32* %4
%10 = call i64 @strtol(i8* %8, i8** %5, i32 %9)
store i64 %10, i64* %6
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %3
store i8* %11, i8** %12
%13 = load i64, i64* %6
ret i64 %13
}

LLVM IR (-O2):
define i64 @NV_strtolSeq(i8** noalias nocapture %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = load i8*, i8** %0
%6 = call i64 @strtol(i8* %5, i8** %3, i32 %1)
%7 = load i8*, i8** %3
store i8* %7, i8** %0
ret i64 %6
}
void g_boxed() {}


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

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

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

LLVM IR (-O2):
define void @g_boxed() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Merge(int *, int, int, int);
void MergeSort(int *array, int min, int max) {
  int mid;
  if (min < max) {
    mid = (min + max) / 2;
    MergeSort(array, min, mid);
    MergeSort(array, mid + 1, max);
    Merge(array, min, mid, max);
  }
}


x86 assembly (clang, -O0):
<MergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <MergeSort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <MergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <MergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <Merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MergeSort>:
cmp    %edx,%esi
jge    1172 <MergeSort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1040 <MergeSort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <MergeSort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <Merge@plt>
ret

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

LLVM IR (-O2):
define void @MergeSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @MergeSort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @MergeSort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @Merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
/* Variables and functions */
size_t pair_hash(size_t h0, size_t h1, size_t nr_bits) {
  size_t GOLDEN_RATIO_PRIME = 0x9e37fffffffc0001UL;
  h0 += (h1 ^ GOLDEN_RATIO_PRIME);
  h0 = h0 ^ ((h0 ^ GOLDEN_RATIO_PRIME) >> nr_bits);
  return h0;
}


x86 assembly (clang, -O0):
<pair_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movabs $0x9e37fffffffc0001,%rax
ff 37 9e
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
xor    -0x20(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rdx
xor    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
shr    %cl,%rdx
mov    %rdx,%rcx
xor    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair_hash>:
mov    %rdx,%rcx
movabs $0x9e37fffffffc0001,%rax
ff 37 9e
xor    %rax,%rsi
lea    (%rsi,%rdi,1),%rdx
xor    %rdx,%rax
shr    %cl,%rax
xor    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @pair_hash(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
store i64 -7045881617021403135, i64* %7
%8 = load i64, i64* %5
%9 = load i64, i64* %7
%10 = xor i64 %8, %9
%11 = load i64, i64* %4
%12 = add i64 %11, %10
store i64 %12, i64* %4
%13 = load i64, i64* %4
%14 = load i64, i64* %4
%15 = load i64, i64* %7
%16 = xor i64 %14, %15
%17 = load i64, i64* %6
%18 = lshr i64 %16, %17
%19 = xor i64 %13, %18
store i64 %19, i64* %4
%20 = load i64, i64* %4
ret i64 %20
}

LLVM IR (-O2):
define i64 @pair_hash(i64 %0, i64 %1, i64 %2) {
%4 = xor i64 %1, -7045881617021403135
%5 = add i64 %4, %0
%6 = xor i64 %5, -7045881617021403135
%7 = lshr i64 %6, %2
%8 = xor i64 %7, %5
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ cpy(unsigned char *, void *, int);
unsigned char getUChar(void *data) {
  unsigned char v;
  cpy(&v, data, sizeof(unsigned char));
  return v;
}


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

x86 assembly (clang, -O2):
<getUChar>:
push   %rax
mov    %rdi,%rsi
lea    0x7(%rsp),%rdi
mov    $0x1,%edx
call   1030 <cpy@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

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

LLVM IR (-O2):
define zeroext i8 @getUChar(i8* %0) {
%2 = alloca i8
%3 = call i32 @cpy(i8* %2, i8* %0, i32 1)
%4 = load i8, i8* %2
ret i8 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ec;

/* Variables and functions */
int /*<<< orphan*/ safef(char *, int, char *, char);
char *escapeChar(char c) {
  static char ec[4];
  safef(ec, sizeof(ec), "%%%02X", c);
  return ec;
}


x86 assembly (clang, -O0):
<escapeChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0x2f04(%rip),%rdi
mov    $0x4,%esi
lea    0xecf(%rip),%rdx
movsbl -0x1(%rbp),%ecx
call   1030 <safef@plt>
lea    0x2ee8(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escapeChar>:
push   %rbx
mov    %edi,%ecx
lea    0x2f0f(%rip),%rbx
lea    0xedf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <safef@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@escapeChar.ec = internal global [4 x i8] zeroinitializer
@.str = [7 x i8] c"%%%02X\00"
define i8* @escapeChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @safef(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @escapeChar.ec, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @escapeChar.ec, i64 0, i64 0)
}

LLVM IR (-O2):
@escapeChar.ec = internal global [4 x i8] zeroinitializer
@.str = [7 x i8] c"%%%02X\00"
define i8* @escapeChar(i8 signext %0) {
%2 = tail call i32 @safef(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @escapeChar.ec, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @escapeChar.ec, i64 0, i64 0)
}
/* Variables and functions */
bool is_valid_mac_address(char value[]) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @is_valid_mac_address(i8* nocapture readnone %0) {
ret i32 0
}
int s3cfb_direct_ioctl(int id, unsigned int cmd, unsigned long arg) {
  return 0;
}


x86 assembly (clang, -O0):
<s3cfb_direct_ioctl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @s3cfb_direct_ioctl(i32 %0, i32 %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ reportTests();
int /*<<< orphan*/ test();
int main() {
  test();
  reportTests();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test@plt>
mov    $0x0,%al
call   1030 <reportTests@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test()
%2 = call i32 (...) @reportTests()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = tail call i32 (...) @reportTests()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ init_ssl();
int /*<<< orphan*/ secure_connect(char const *);
int /*<<< orphan*/ stderr;
int main() {
  init_ssl();
  const char *hostname = "www.google.com:443";
  fprintf(stderr, "Trying an HTTPS connection to %s...\n", hostname);
  secure_connect(hostname);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <init_ssl@plt>
lea    0xeb3(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeae(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <secure_connect@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <init_ssl@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
lea    0xeb1(%rip),%rbx
mov    %rbx,%rdx
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <secure_connect@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"www.google.com:443\00"
@stderr = global i32 0
@.str.1 = [37 x i8] c"Trying an HTTPS connection to %s...\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 (...) @init_ssl()
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @secure_connect(i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"www.google.com:443\00"
@stderr = global i32 0
@.str.1 = [37 x i8] c"Trying an HTTPS connection to %s...\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @init_ssl()
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @secure_connect(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void thread_yield(void *arg_ptr) {
  tyield();
  printf(1, "Yielding thread: pid %d\n", getpid());
  texit();
}


x86 assembly (clang, -O0):
<thread_yield>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <tyield@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe98(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <texit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_yield>:
push   %rax
xor    %eax,%eax
call   1040 <tyield@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeaa(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <texit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Yielding thread: pid %d\0A\00"
define void @thread_yield(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @tyield()
%4 = call i32 (...) @getpid()
%5 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @texit()
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Yielding thread: pid %d\0A\00"
define void @thread_yield(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @tyield()
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @texit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_init();
void __attribute__((constructor)) init(void) { my_init(); }


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

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

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

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init, i8* null }]
define void @init() {
%1 = tail call i32 (...) @my_init()
ret void
}
void __assert_fail(const char *file, int line, const char *func,
                   const char *expr) {}


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

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

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

LLVM IR (-O2):
define void @__assert_fail(i8* nocapture %0, i32 %1, i8* nocapture %2, i8* nocapture %3) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ perror(char *);
int pthread_mutex_lock(int /*<<< orphan*/ *);
void checked_lock(pthread_mutex_t *lock) {
  assert(NULL != lock);
  if (-1 == pthread_mutex_lock(lock)) {
    perror("pthread_mutex_lock");
    assert(0);
  }
}


x86 assembly (clang, -O0):
<checked_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <pthread_mutex_lock@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    117a <checked_lock+0x4a>
lea    0xe92(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_lock>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1050 <pthread_mutex_lock@plt>
cmp    $0xffffffff,%eax
je     1151 <checked_lock+0x21>
pop    %rbx
ret
lea    0xea8(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
pop    %rbx
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"pthread_mutex_lock\00"
define void @checked_lock(i32* %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @pthread_mutex_lock(i32* %0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = tail call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @assert(i32 0)
br label %10
10: ; preds = %7, %1
ret void
}
/* Type definitions */
typedef int fexcept_t;

/* Variables and functions */
int /*<<< orphan*/ fesetexceptflag(int *, int);
int feraiseexcept(int excepts) {
  fexcept_t ex = excepts;
  fesetexceptflag(&ex, excepts);
  return 0;
}


x86 assembly (clang, -O0):
<feraiseexcept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1030 <fesetexceptflag@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feraiseexcept>:
push   %rax
mov    %edi,%esi
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <fesetexceptflag@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @feraiseexcept(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 %0, i32* %2
%4 = call i32 @fesetexceptflag(i32* %2, i32 %0)
ret i32 0
}
long extract_spr(unsigned long insn, int dialect __attribute__((unused)),
                 int *invalid __attribute__((unused))) {
  return ((insn >> 16) & 0x1f) | ((insn >> 6) & 0x3e0);
}


x86 assembly (clang, -O0):
<extract_spr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
and    $0x1f,%rax
mov    -0x8(%rbp),%rcx
shr    $0x6,%rcx
and    $0x3e0,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_spr>:
mov    %edi,%eax
shr    $0x10,%eax
and    $0x1f,%eax
shr    $0x6,%rdi
and    $0x3e0,%edi
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @extract_spr(i64 %0, i32 %1, i32* %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32*
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i64, i64* %4
%8 = lshr i64 %7, 16
%9 = and i64 %8, 31
%10 = load i64, i64* %4
%11 = lshr i64 %10, 6
%12 = and i64 %11, 992
%13 = or i64 %9, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @extract_spr(i64 %0, i32 %1, i32* nocapture readnone %2) {
%4 = lshr i64 %0, 16
%5 = and i64 %4, 31
%6 = lshr i64 %0, 6
%7 = and i64 %6, 992
%8 = or i64 %5, %7
ret i64 %8
}
unsigned short VIM_JPEG_ToolByPassMarker(unsigned char *ptr) {
  unsigned short len = (((unsigned short)(*((unsigned char *)ptr + 0)) << 8) +
                        (unsigned short)*((unsigned char *)ptr + 0 + 1));
  return len;
}


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

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

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

LLVM IR (-O2):
define zeroext i16 @VIM_JPEG_ToolByPassMarker(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_slli_epi32(int /*<<< orphan*/, int);
__m128i __attribute__((no, unused)) testneg64(__m128i s1) {
  return _mm_slli_epi32(s1, -64);
}


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

x86 assembly (clang, -O2):
<testneg64>:
mov    $0xffffffc0,%esi
jmp    1030 <_mm_slli_epi32@plt>

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

LLVM IR (-O2):
define i32 @testneg64(i32 %0) {
%2 = tail call i32 @_mm_slli_epi32(i32 %0, i32 -64)
ret i32 %2
}
/* Type definitions */
struct multiboot {
  int dummy;
};

/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int mpm_get_memtype(struct multiboot *mboot, const char *memname) {
  if (strcmp(memname, "flash") == 0)
    return 0x01;
  else if (strcmp(memname, "eeprom") == 0)
    return 0x02;
  return -1;
}


x86 assembly (clang, -O0):
<mpm_get_memtype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1146 <mpm_get_memtype+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1178 <mpm_get_memtype+0x68>
mov    -0x18(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    116c <mpm_get_memtype+0x5c>
movl   $0x2,-0x4(%rbp)
jmp    1178 <mpm_get_memtype+0x68>
jmp    1171 <mpm_get_memtype+0x61>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpm_get_memtype>:
push   %rbx
mov    %rsi,%rbx
lea    0xee5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1141 <mpm_get_memtype+0x31>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
neg    %rax
sbb    %eax,%eax
or     $0x2,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.multiboot = type { i32 }
@.str = [6 x i8] c"flash\00"
@.str.1 = [7 x i8] c"eeprom\00"
define i32 @mpm_get_memtype(%struct.multiboot* nocapture readnone %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i32 2, i32 -1
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int var = 0;
  int i;
#pragma omp parallel for num_threads(NUM_THREADS) shared(var)                  \
    schedule(static, 1)
  for (i = 0; i < 2; i++) {
#pragma omp task shared(var) if (0)
    { var++; }
  }
  int error = (var != 2);
  fprintf(stderr, "DONE\n");
  return error;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x18(%rbp)
jge    1155 <main+0x45>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1134 <main+0x24>
cmpl   $0x2,-0x14(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xe8c(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"DONE\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double sqr(double);
double dist2(double x1, double y1, double z1, double x2, double y2, double z2) {
  return sqr(x1 - x2) + sqr(y1 - y2) + sqr(z1 - z2);
}


x86 assembly (clang, -O0):
<dist2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
call   1030 <sqr@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
call   1030 <sqr@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
call   1030 <sqr@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist2>:
sub    $0x28,%rsp
movsd  %xmm5,0x20(%rsp)
movsd  %xmm4,(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
subsd  %xmm3,%xmm0
call   1030 <sqr@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
subsd  (%rsp),%xmm0
call   1030 <sqr@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
call   1030 <sqr@plt>
addsd  (%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @dist2(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %10
%15 = fsub double %13, %14
%16 = call double @sqr(double %15)
%17 = load double, double* %8
%18 = load double, double* %11
%19 = fsub double %17, %18
%20 = call double @sqr(double %19)
%21 = fadd double %16, %20
%22 = load double, double* %9
%23 = load double, double* %12
%24 = fsub double %22, %23
%25 = call double @sqr(double %24)
%26 = fadd double %21, %25
ret double %26
}

LLVM IR (-O2):
define double @dist2(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %0, %3
%8 = tail call double @sqr(double %7)
%9 = fsub double %1, %4
%10 = tail call double @sqr(double %9)
%11 = fadd double %8, %10
%12 = fsub double %2, %5
%13 = tail call double @sqr(double %12)
%14 = fadd double %11, %13
ret double %14
}
int compare_value_white(const void *move1, const void *move2) {
  if (((int *)move1)[2] > ((int *)move2)[2]) {
    return 1;
  } else if (((int *)move1)[2] < ((int *)move2)[2]) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<compare_value_white>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    0x8(%rcx),%eax
jle    112c <compare_value_white+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1158 <compare_value_white+0x58>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    0x8(%rcx),%eax
jge    114c <compare_value_white+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <compare_value_white+0x58>
jmp    1151 <compare_value_white+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_value_white>:
mov    0x8(%rdi),%eax
mov    0x8(%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_value_white(i8* nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 8
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = getelementptr inbounds i8, i8* %1, i64 8
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = icmp sgt i32 %5, %8
%10 = icmp slt i32 %5, %8
%11 = sext i1 %10 to i32
%12 = select i1 %9, i32 1, i32 %11
ret i32 %12
}
unsigned int make_float(unsigned int sign, unsigned int exponent,
                        unsigned int significand) {
  return (sign << 31) | ((exponent & 0xff) << 23) | (significand & 0x7fffff);
}


x86 assembly (clang, -O0):
<make_float>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1f,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
shl    $0x17,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0x7fffff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_float>:
shl    $0x1f,%edi
movzbl %sil,%eax
shl    $0x17,%eax
or     %edi,%eax
and    $0x7fffff,%edx
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @make_float(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 = shl i32 %7, 31
%9 = load i32, i32* %5
%10 = and i32 %9, 255
%11 = shl i32 %10, 23
%12 = or i32 %8, %11
%13 = load i32, i32* %6
%14 = and i32 %13, 8388607
%15 = or i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @make_float(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 31
%5 = shl i32 %1, 23
%6 = and i32 %5, 2139095040
%7 = or i32 %6, %4
%8 = and i32 %2, 8388607
%9 = or i32 %7, %8
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ Complain(char *, char *, char *);
int /*<<< orphan*/ *fopen(char *, char *);
FILE *Fopen(char *fname, char *fmode) {
  FILE *fp;
  if ((fp = fopen(fname, fmode)) == NULL) {
    Complain("Couldn't open file \"%s\" in mode \"%s\".\n", fname, fmode);
  }
  return (fp);
}


x86 assembly (clang, -O0):
<Fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115f <Fopen+0x3f>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xea6(%rip),%rdi
call   1030 <Complain@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fopen>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114a <Fopen+0x2a>
lea    0xec1(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <Complain@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [39 x i8] c"Couldn't open file \22%s\22 in mode \22%s\22.\0A\00"
define noalias i32* @Fopen(i8* %0, i8* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @Complain(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %7
7: ; preds = %5, %2
ret i32* %3
}
adrx0adr1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((((unsigned char *)10000000)[x0]) <= (*((unsigned char *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movzbl (%rax,%rcx,1),%eax
mov    $0xa98ac7,%ecx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jg     1147 <adrx0adr1+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <adrx0adr1+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adr1>:
movslq %edx,%rax
mov    0x989680(%rax),%cl
xor    %eax,%eax
cmp    0xa98ac7,%cl
setbe  %al
ret

LLVM IR (-O0):
define i32 @adrx0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* inttoptr (i64 10000000 to i8*), i64 %17
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = load i8, i8* inttoptr (i64 11111111 to i8*)
%22 = zext i8 %21 to i32
%23 = icmp sle i32 %20, %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 @adrx0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* inttoptr (i64 10000000 to i8*), i64 %7
%9 = load i8, i8* %8
%10 = load i8, i8* inttoptr (i64 11111111 to i8*)
%11 = icmp ule i8 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}