xunge/DecIR huggingface dataset:
int test_imm_45int64_lowword_reg(long long val) {
  return ((val) & (0x45 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_45int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 69
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ get_next_word(int /*<<< orphan*/ *);
int main() {
  FILE *f = fopen("tmp.txt", "r");
  get_next_word(f);
  get_next_word(f);
  get_next_word(f);
  get_next_word(f);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <get_next_word@plt>
mov    %rbx,%rdi
call   1030 <get_next_word@plt>
mov    %rbx,%rdi
call   1030 <get_next_word@plt>
mov    %rbx,%rdi
call   1030 <get_next_word@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"tmp.txt\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @get_next_word(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @get_next_word(i32* %6)
%8 = load i32*, i32** %2
%9 = call i32 @get_next_word(i32* %8)
%10 = load i32*, i32** %2
%11 = call i32 @get_next_word(i32* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"tmp.txt\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @get_next_word(i32* %1)
%3 = tail call i32 @get_next_word(i32* %1)
%4 = tail call i32 @get_next_word(i32* %1)
%5 = tail call i32 @get_next_word(i32* %1)
ret i32 0
}
void sched_clock_resume(void) {}


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

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

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

LLVM IR (-O2):
define void @sched_clock_resume() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int fun4() {
  printf("\nin fun4\n");
  return 5;
}


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

x86 assembly (clang, -O2):
<fun4>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\0Ain fun4\0A\00"
define i32 @fun4() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 5
}

LLVM IR (-O2):
@str = [9 x i8] c"\0Ain fun4\00"
define i32 @fun4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 5
}
extern long long unsigned unsigned_long_modulo(long long unsigned a,
                                               long long unsigned b) {
  if (!b)
    return a;
  return a % b;
}


x86 assembly (clang, -O0):
<unsigned_long_modulo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1124 <unsigned_long_modulo+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1134 <unsigned_long_modulo+0x34>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rdx,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_long_modulo>:
mov    %rdi,%rax
test   %rsi,%rsi
je     111c <unsigned_long_modulo+0x1c>
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     111d <unsigned_long_modulo+0x1d>
xor    %edx,%edx
div    %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i64 @unsigned_long_modulo(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = urem i64 %0, %1
br label %6
6: ; preds = %2, %4
%7 = phi i64 [ %5, %4 ], [ %0, %2 ]
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void strncpy_exactly_matching_buffer2(char *y) {
  if (strlen(y) >= 4)
    return;
  char x[4];
  strncpy(x, y, 4);
  clang_analyzer_eval(strlen(x) <= 3);
}


x86 assembly (clang, -O0):
<strncpy_exactly_matching_buffer2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x4,%eax
jl     1153 <strncpy_exactly_matching_buffer2+0x23>
jmp    117e <strncpy_exactly_matching_buffer2+0x4e>
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <strncpy@plt>
lea    -0xc(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x3,%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_exactly_matching_buffer2>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <strlen@plt>
cmp    $0x3,%eax
jg     116c <strncpy_exactly_matching_buffer2+0x3c>
lea    0x4(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <strncpy@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
xor    %edi,%edi
cmp    $0x4,%eax
setl   %dil
call   1050 <clang_analyzer_eval@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @strncpy_exactly_matching_buffer2(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = icmp sge i32 %5, 4
br i1 %6, label %7, label %8
7: ; preds = %1
br label %17
8: ; preds = %1
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%10 = load i8*, i8** %2
%11 = call i32 @strncpy(i8* %9, i8* %10, i32 4)
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
%14 = icmp sle i32 %13, 3
%15 = zext i1 %14 to i32
%16 = call i32 @clang_analyzer_eval(i32 %15)
br label %17
17: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @strncpy_exactly_matching_buffer2(i8* %0) {
%2 = alloca [4 x i8]
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, 3
br i1 %4, label %12, label %5
5: ; preds = %1
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%7 = call i32 @strncpy(i8* %6, i8* %0, i32 4)
%8 = call i32 @strlen(i8* %6)
%9 = icmp slt i32 %8, 4
%10 = zext i1 %9 to i32
%11 = call i32 @clang_analyzer_eval(i32 %10)
br label %12
12: ; preds = %1, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_read_line_from_file() {
  printf("NOT IMPLEMENTED:"
         "pa_read_line_from_file"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"NOT IMPLEMENTED:pa_read_line_from_file\0A\00"
define i32 @pa_read_line_from_file() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_read_line_from_file\00"
define i32 @pa_read_line_from_file() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
double cos(double);
double sin(double);
double tan(double x) {
  double temp;
  temp = cos(x);
  if (temp == 0.0) {
    return (9.999999999999999999999E72);
  }
  return (sin(x) / cos(x));
}


x86 assembly (clang, -O0):
<tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1166 <tan+0x46>
jp     1166 <tan+0x46>
movsd  0xea4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1190 <tan+0x70>
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tan>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <cos@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1148 <tan+0x28>
jp     1148 <tan+0x28>
movsd  0xebd(%rip),%xmm0
add    $0x18,%rsp
ret
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @tan(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = call double @cos(double %5)
store double %6, double* %4
%7 = load double, double* %4
%8 = fcmp oeq double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %1
store double 0x4F16A3A275D49491, double* %2
br label %16
10: ; preds = %1
%11 = load double, double* %3
%12 = call double @sin(double %11)
%13 = load double, double* %3
%14 = call double @cos(double %13)
%15 = fdiv double %12, %14
store double %15, double* %2
br label %16
16: ; preds = %10, %9
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @tan(double %0) {
%2 = tail call double @cos(double %0)
%3 = fcmp oeq double %2, 0.000000e+00
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call double @sin(double %0)
%6 = tail call double @cos(double %0)
%7 = fdiv double %5, %6
br label %8
8: ; preds = %1, %4
%9 = phi double [ %7, %4 ], [ 0x4F16A3A275D49491, %1 ]
ret double %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void write(FILE *f, char **password, int length) {
  for (int i = 0; i < length; i++) {
    fprintf(f, "%s\n", password[i]);
  }
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1160 <write+0x50>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <write+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
jle    1148 <write+0x38>
mov    %rsi,%r14
mov    %rdi,%r12
mov    %edx,%r13d
xor    %ebx,%ebx
lea    0xed1(%rip),%r15
nop
mov    (%r14,%rbx,8),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1130 <write+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @write(i32* nocapture %0, i8** nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %13, %8 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %7, label %8
}
void AcmeThread_nanoSleep(unsigned long ns) { ns = ns; }


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

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

LLVM IR (-O0):
define void @AcmeThread_nanoSleep(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store i64 %3, i64* %2
ret void
}

LLVM IR (-O2):
define void @AcmeThread_nanoSleep(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ M3_profile(int, char const *, int);
void M3_ProfileStart(int sectionID, const char *sectionName) {
#pragma omp master
  { M3_profile(sectionID, sectionName, 2); }
}


x86 assembly (clang, -O0):
<M3_ProfileStart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1030 <M3_profile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M3_ProfileStart>:
mov    $0x2,%edx
jmp    1030 <M3_profile@plt>

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

LLVM IR (-O2):
define void @M3_ProfileStart(i32 %0, i8* %1) {
%3 = tail call i32 @M3_profile(i32 %0, i8* %1, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void abort() {
  raise(SIGABRT);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
jmp    1122 <abort+0x12>

x86 assembly (clang, -O2):
<abort>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
nop
jmp    1120 <abort+0x10>

LLVM IR (-O0):
@SIGABRT = global i32 0
define void @abort() {
%1 = load i32, i32* @SIGABRT
%2 = call i32 @raise(i32 %1)
br label %3
3: ; preds = %3, %0
br label %3
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define void @abort() {
%1 = load i32, i32* @SIGABRT
%2 = tail call i32 @raise(i32 %1)
br label %3
3: ; preds = %3, %0
br label %3
}
int I_NoAppServicesLobbyCheckStartGame(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @I_NoAppServicesLobbyCheckStartGame() {
ret i32 0
}
/* Type definitions */
struct resource {
  int dummy;
};

/* Variables and functions */
void *malloc(unsigned int);
struct resource *request_mem_region(unsigned long start, unsigned long len,
                                    char const *name) {
  void *tmp;
  unsigned int __cil_tmp5;
  {
    {
      __cil_tmp5 = (unsigned int)32UL;
      tmp = malloc(__cil_tmp5);
    }
    return ((struct resource *)tmp);
  }
}


x86 assembly (clang, -O0):
<request_mem_region>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x20,-0x24(%rbp)
mov    -0x24(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<request_mem_region>:
mov    $0x20,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
%struct.resource = type { i32 }
define %struct.resource* @request_mem_region(i64 %0, i64 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
store i32 32, i32* %8
%9 = load i32, i32* %8
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = bitcast i8* %11 to %struct.resource*
ret %struct.resource* %12
}

LLVM IR (-O2):
%struct.resource = type { i32 }
define noalias %struct.resource* @request_mem_region(i64 %0, i64 %1, i8* nocapture readnone %2) {
%4 = tail call dereferenceable_or_null(32) i8* @malloc(i32 32)
%5 = bitcast i8* %4 to %struct.resource*
ret %struct.resource* %5
}
void test_require_linux(void) {}


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

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

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

LLVM IR (-O2):
define void @test_require_linux() {
ret void
}
int fun209() { return 209; }


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

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

LLVM IR (-O0):
define i32 @fun209() {
ret i32 209
}

LLVM IR (-O2):
define i32 @fun209() {
ret i32 209
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t minipack_unpack_array32(void *ptr, size_t *sz) {
  *sz = 5;
  return ntohl(*((uint32_t *)(ptr + 1)));
}


x86 assembly (clang, -O0):
<minipack_unpack_array32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x5,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%edi
call   1030 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_array32>:
movq   $0x5,(%rsi)
mov    0x1(%rdi),%edi
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define i32 @minipack_unpack_array32(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
store i64 5, i64* %5
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 1
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = call i32 @ntohl(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @minipack_unpack_array32(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 5, i64* %1
%3 = getelementptr i8, i8* %0, i64 1
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @ntohl(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void signal_handler(int signum) {
  printf("Oh noes, a seg fault!\n");
  exit(1);
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<signal_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Oh noes, a seg fault!\0A\00"
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"Oh noes, a seg fault!\00"
define void @signal_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int execlp(char *, char *, char *);
int my_ls(char *dir) {
  if ((execlp("ls", dir, (char *)NULL)) == -1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<my_ls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed9(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <execlp@plt>
cmp    $0xffffffff,%eax
jne    1145 <my_ls+0x35>
movl   $0x0,-0x4(%rbp)
jmp    114c <my_ls+0x3c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_ls>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
xor    %edx,%edx
call   1030 <execlp@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
define i32 @my_ls(i8* %0) {
%2 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0, i8* null)
%3 = icmp ne i32 %2, -1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int ssize_t;
typedef int /*<<< orphan*/ mqd_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
ssize_t mq_timedreceive(mqd_t mqdes, char *__restrict msg_ptr, size_t msg_len,
                        unsigned int *__restrict msg_prio,
                        const struct timespec *__restrict abs_timeout) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<mq_timedreceive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mq_timedreceive>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@ENOSYS = global i32 0
define i32 @mq_timedreceive(i32 %0, i8* noalias %1, i64 %2, i32* noalias %3, %struct.timespec* noalias %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32*
%10 = alloca %struct.timespec*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i32* %3, i32** %9
store %struct.timespec* %4, %struct.timespec** %10
%11 = load i32, i32* @ENOSYS
%12 = call i32 @__set_errno(i32 %11)
ret i32 -1
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@ENOSYS = global i32 0
define i32 @mq_timedreceive(i32 %0, i8* noalias nocapture readnone %1, i64 %2, i32* noalias nocapture readnone %3, %struct.timespec* noalias nocapture readnone %4) {
%6 = load i32, i32* @ENOSYS
%7 = tail call i32 @__set_errno(i32 %6)
ret i32 -1
}
void mvVecAdd3(float *r, const float *a, const float *b) {
  r[0] = a[0] + b[0];
  r[1] = a[1] + b[1];
  r[2] = a[2] + b[2];
}


x86 assembly (clang, -O0):
<mvVecAdd3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvVecAdd3>:
movss  (%rsi),%xmm0
addss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
addss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
addss  0x8(%rdx),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @mvVecAdd3(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %6
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fadd float %9, %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fadd float %18, %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %5
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %6
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fadd float %27, %30
%32 = load float*, float** %4
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @mvVecAdd3(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fadd float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fadd float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret void
}
/* Variables and functions */
int random();
int random_level(void) {
  const double p = 0.25;
  int level = 1;
  while ((random() & 0xffff) < 0xffff * p)
    level++;
  return level > 32 ? 32 : level;
}


x86 assembly (clang, -O0):
<random_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
and    $0xffff,%eax
cvtsi2sd %eax,%xmm1
movsd  0xec4(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    115c <random_level+0x4c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <random_level+0x1c>
cmpl   $0x20,-0xc(%rbp)
jle    1173 <random_level+0x63>
mov    $0x20,%eax
mov    %eax,-0x10(%rbp)
jmp    1179 <random_level+0x69>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_level>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <random@plt>
add    $0x1,%ebx
test   $0xc000,%eax
je     1120 <random_level+0x10>
cmp    $0x20,%ebx
mov    $0x20,%eax
cmovb  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random_level() {
%1 = alloca double
%2 = alloca i32
store double 2.500000e-01, double* %1
store i32 1, i32* %2
br label %3
3: ; preds = %8, %0
%4 = call i32 (...) @random()
%5 = and i32 %4, 65535
%6 = sitofp i32 %5 to double
%7 = fcmp olt double %6, 0x40CFFFE000000000
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 32
br i1 %13, label %14, label %15
14: ; preds = %11
br label %17
15: ; preds = %11
%16 = load i32, i32* %2
br label %17
17: ; preds = %15, %14
%18 = phi i32 [ 32, %14 ], [ %16, %15 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @random_level() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @random()
%4 = and i32 %3, 49152
%5 = icmp eq i32 %4, 0
%6 = add nuw nsw i32 %2, 1
br i1 %5, label %1, label %7
7: ; preds = %1
%8 = icmp ult i32 %2, 32
%9 = select i1 %8, i32 %2, i32 32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ gethostname(char *, int);
void wsys_computer_name(char *name, int maxlen) { gethostname(name, maxlen); }


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

x86 assembly (clang, -O2):
<wsys_computer_name>:
jmp    1030 <gethostname@plt>

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

LLVM IR (-O2):
define void @wsys_computer_name(i8* %0, i32 %1) {
%3 = tail call i32 @gethostname(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_cond_signal(int /*<<< orphan*/ *);
void Pthread_cond_signal(pthread_cond_t *cond) {
  int retval;
  assert(cond != NULL);
  retval = pthread_cond_signal(cond);
  if (retval != 0)
    Sys_failure("pthread_cond_signal");
}


x86 assembly (clang, -O0):
<Pthread_cond_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <pthread_cond_signal@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1170 <Pthread_cond_signal+0x40>
lea    0xe95(%rip),%rdi
call   1050 <Sys_failure@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pthread_cond_signal>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <pthread_cond_signal@plt>
test   %eax,%eax
je     115b <Pthread_cond_signal+0x2b>
lea    0xeab(%rip),%rdi
pop    %rbx
jmp    1050 <Sys_failure@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"pthread_cond_signal\00"
define void @Pthread_cond_signal(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_cond_signal(i32* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}
int test_imm_FDint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xFD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FDint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 253
%7 = icmp ne i64 %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_FDint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 16580608
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef long int32_t;

/* Variables and functions */
int /*<<< orphan*/ CAS(long, long, long volatile *);
long SUBSTRACT_ATOMIC(volatile int32_t *val, int32_t addval) {
  int32_t actual;
  do {
    actual = *val;
  } while (!CAS(actual, actual - addval, val));
  return actual;
}


x86 assembly (clang, -O0):
<SUBSTRACT_ATOMIC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
sub    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1030 <CAS@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1120 <SUBSTRACT_ATOMIC+0x10>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SUBSTRACT_ATOMIC>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
nopl   0x0(%rax,%rax,1)
mov    (%r15),%rbx
mov    %rbx,%rsi
sub    %r14,%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
call   1030 <CAS@plt>
test   %eax,%eax
je     1120 <SUBSTRACT_ATOMIC+0x10>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @SUBSTRACT_ATOMIC(i64* %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = load volatile i64, i64* %0
%5 = sub nsw i64 %4, %1
%6 = tail call i32 @CAS(i64 %4, i64 %5, i64* %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %3, label %8
8: ; preds = %3
ret i64 %4
}
/* Variables and functions */
double proximity(char *const, char *const);
double distance(char *const aString1, char *const aString2) {
  return 1.0 - proximity(aString1, aString2);
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <proximity@plt>
movaps %xmm0,%xmm1
movsd  0xec8(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
push   %rax
call   1030 <proximity@plt>
movsd  0xee2(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @distance(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 double @proximity(i8* %5, i8* %6)
%8 = fsub double 1.000000e+00, %7
ret double %8
}

LLVM IR (-O2):
define double @distance(i8* %0, i8* %1) {
%3 = tail call double @proximity(i8* %0, i8* %1)
%4 = fsub double 1.000000e+00, %3
ret double %4
}
void PWMFaultIntClear(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000001C))) = 0x00010000;
}


x86 assembly (clang, -O0):
<PWMFaultIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x10000,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMFaultIntClear>:
movq   $0x10000,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @PWMFaultIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 28
%5 = inttoptr i64 %4 to i64*
store volatile i64 65536, i64* %5
ret void
}

LLVM IR (-O2):
define void @PWMFaultIntClear(i64 %0) {
%2 = add i64 %0, 28
%3 = inttoptr i64 %2 to i64*
store volatile i64 65536, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ adjust_indent(int);
int /*<<< orphan*/ output(char *);
void block_end(void) {
  adjust_indent(-3);
  output("}");
}


x86 assembly (clang, -O0):
<block_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffd,%edi
call   1040 <adjust_indent@plt>
lea    0xecb(%rip),%rdi
call   1030 <output@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_end>:
push   %rax
mov    $0xfffffffd,%edi
call   1040 <adjust_indent@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <output@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"}\00"
define void @block_end() {
%1 = call i32 @adjust_indent(i32 -3)
%2 = call i32 @output(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"}\00"
define void @block_end() {
%1 = tail call i32 @adjust_indent(i32 -3)
%2 = tail call i32 @output(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
long M_PI;
int /*<<< orphan*/ printf(char *, long, long);
int /*<<< orphan*/ scanf(char *, short *);
int main() {
  short r;
  long r2;
  scanf("%hd", &r);
  r2 = r * r;
  printf("%.6f\n%ld.000000\n", r2 * M_PI, r2 * 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x6(%rbp),%rsi
call   1040 <scanf@plt>
movswl -0x6(%rbp),%eax
movswl -0x6(%rbp),%ecx
imul   %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    0x2e8d(%rip),%rax
imul   (%rax),%rsi
mov    -0x10(%rbp),%rdx
shl    $0x1,%rdx
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x6(%rsp),%rsi
call   1040 <scanf@plt>
movswl 0x6(%rsp),%edx
imul   %edx,%edx
mov    0x2ea7(%rip),%rax
mov    (%rax),%rsi
imul   %rdx,%rsi
add    %rdx,%rdx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%hd\00"
@.str.1 = [17 x i8] c"%.6f\0A%ld.000000\0A\00"
@M_PI = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %2)
%5 = load i16, i16* %2
%6 = sext i16 %5 to i32
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = mul nsw i32 %6, %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = load i64, i64* @M_PI
%13 = mul nsw i64 %11, %12
%14 = load i64, i64* %3
%15 = mul nsw i64 %14, 2
%16 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i64 %13, i64 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%hd\00"
@.str.1 = [17 x i8] c"%.6f\0A%ld.000000\0A\00"
@M_PI = global i64 0
define i32 @main() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %1)
%4 = load i16, i16* %1
%5 = sext i16 %4 to i32
%6 = mul nsw i32 %5, %5
%7 = zext i32 %6 to i64
%8 = load i64, i64* @M_PI
%9 = mul nsw i64 %8, %7
%10 = shl nuw nsw i64 %7, 1
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i64 %9, i64 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("timetracker: a program to track time.\nThis program maintains "
         "multiple stopwatches to track time.\nThe timers are defined in a "
         "configuration file.\n\nusage: timetracker [options]\noptions "
         "include:\n-f [conf file]           The configuration file to use\n-h "
         "                      Print this help message and quit\n-N           "
         "            Do *not* try to use color\n");
}


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

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

LLVM IR (-O0):
@.str = [357 x i8] c"timetracker: a program to track time.\0AThis program maintains multiple stopwatches to track time.\0AThe timers are defined in a configuration file.\0A\0Ausage: timetracker [options]\0Aoptions include:\0A-f [conf file] The configuration file to use\0A-h Print this help message and quit\0A-N Do *not* try to use color\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([357 x i8], [357 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [356 x i8] c"timetracker: a program to track time.\0AThis program maintains multiple stopwatches to track time.\0AThe timers are defined in a configuration file.\0A\0Ausage: timetracker [options]\0Aoptions include:\0A-f [conf file] The configuration file to use\0A-h Print this help message and quit\0A-N Do *not* try to use color\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([356 x i8], [356 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ACEND_SaveNodes();
void ACECM_Store() { ACEND_SaveNodes(); }


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

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

LLVM IR (-O0):
define void @ACECM_Store() {
%1 = call i32 (...) @ACEND_SaveNodes()
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int writing(FILE *f, int *arr, int size) {
  for (int i = 0; i < size; i++) {
    fprintf(f, "%i ", arr[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<writing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115f <writing+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <writing+0x1a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writing>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
jle    1148 <writing+0x38>
mov    %rsi,%r14
mov    %rdi,%r12
mov    %edx,%r13d
xor    %ebx,%ebx
lea    0xed1(%rip),%r15
nop
mov    (%r14,%rbx,4),%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1130 <writing+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i \00"
define i32 @writing(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %8
7: ; preds = %8, %3
ret i32 0
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %1, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %7, label %8
}
void main(void) {
  int a[3];
  int x[10];
  int y;
  int z;
  int w;
  x[3] = y + z;
  x[y] = y = z + w;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0x44(%rbp),%eax
add    -0x48(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x48(%rbp),%ecx
add    -0x4c(%rbp),%ecx
mov    %ecx,-0x44(%rbp)
movslq -0x44(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca [3 x i32]
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = add nsw i32 %10, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %14
store i32 %12, i32* %15
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
unsigned long nextpow2(unsigned long);
unsigned long ensurepow2(unsigned long n) { return nextpow2(n - 1); }


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

x86 assembly (clang, -O2):
<ensurepow2>:
add    $0xffffffffffffffff,%rdi
jmp    1030 <nextpow2@plt>

LLVM IR (-O0):
define i64 @ensurepow2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub i64 %3, 1
%5 = call i64 @nextpow2(i64 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @ensurepow2(i64 %0) {
%2 = add i64 %0, -1
%3 = tail call i64 @nextpow2(i64 %2)
ret i64 %3
}