xunge/DecIR huggingface dataset:
/* Variables and functions */
double log10(double);
double vlog10(double *a, double *b, int n) {
  int i;
  for (i = 0; i < n; i++)
    a[i] = log10(b[i]);
}


x86 assembly (clang, -O0):
<vlog10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1163 <vlog10+0x53>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <log10@plt>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112a <vlog10+0x1a>
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlog10>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    114a <vlog10+0x3a>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsd  (%r14,%rbx,8),%xmm0
call   1030 <log10@plt>
movsd  %xmm0,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <vlog10+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define double @vlog10(double* nocapture writeonly %0, double* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds double, double* %1, i64 %8
%10 = load double, double* %9
%11 = tail call double @log10(double %10)
%12 = getelementptr inbounds double, double* %0, i64 %8
store double %11, double* %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret double undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ShowMsg(char *s) {
  printf(s);
  return;
}


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

x86 assembly (clang, -O2):
<ShowMsg>:
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @ShowMsg(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
unsigned int mb_ver(void) {
  return ((1 * 0x01000000) + (0 * 0x00010000) + (40));
}


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

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

LLVM IR (-O0):
define i32 @mb_ver() {
ret i32 16777256
}

LLVM IR (-O2):
define i32 @mb_ver() {
ret i32 16777256
}
void main(void) {
  unsigned long a, b, c, d;
  volatile unsigned long *val = (volatile unsigned long *)0x1234;
  a = val[0];
  b = val[1];
  d = val[2];
  c = a * b;
  val[3] = c;
  a = c / d;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1234,%eax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x28(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x20(%rbp)
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x1234,%rax
imul   0x123c,%rax
mov    0x1244,%rcx
mov    %rax,0x124c
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64*
store i64* inttoptr (i64 4660 to i64*), i64** %5
%6 = load i64*, i64** %5
%7 = getelementptr inbounds i64, i64* %6, i64 0
%8 = load volatile i64, i64* %7
store i64 %8, i64* %1
%9 = load i64*, i64** %5
%10 = getelementptr inbounds i64, i64* %9, i64 1
%11 = load volatile i64, i64* %10
store i64 %11, i64* %2
%12 = load i64*, i64** %5
%13 = getelementptr inbounds i64, i64* %12, i64 2
%14 = load volatile i64, i64* %13
store i64 %14, i64* %4
%15 = load i64, i64* %1
%16 = load i64, i64* %2
%17 = mul i64 %15, %16
store i64 %17, i64* %3
%18 = load i64, i64* %3
%19 = load i64*, i64** %5
%20 = getelementptr inbounds i64, i64* %19, i64 3
store volatile i64 %18, i64* %20
%21 = load i64, i64* %3
%22 = load i64, i64* %4
%23 = udiv i64 %21, %22
store i64 %23, i64* %1
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = load volatile i64, i64* inttoptr (i64 4660 to i64*)
%2 = load volatile i64, i64* inttoptr (i64 4668 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 4676 to i64*)
%4 = mul i64 %2, %1
store volatile i64 %4, i64* inttoptr (i64 4684 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free_tab(int *);
int /*<<< orphan*/ printf(char *);
void handle_prompt_error(int errno, int *tab) {
  if (errno != 0) {
    printf("\nMerci de saisir un nombre entier, exiting\n");
    free_tab(tab);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<handle_prompt_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     116c <handle_prompt_error+0x3c>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free_tab@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_prompt_error>:
test   %edi,%edi
jne    1135 <handle_prompt_error+0x5>
ret
push   %rbx
mov    %rsi,%rbx
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <free_tab@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"\0AMerci de saisir un nombre entier, exiting\0A\00"
@EXIT_FAILURE = global i32 0
define void @handle_prompt_error(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%9 = load i32*, i32** %4
%10 = call i32 @free_tab(i32* %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [43 x i8] c"\0AMerci de saisir un nombre entier, exiting\00"
define void @handle_prompt_error(i32 %0, i32* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @free_tab(i32* %1)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
void initializeString(char *string, int stringSize) {
  int i = 0;
  for (i = 0; i < stringSize; i++) {
    string[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<initializeString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113f <initializeString+0x3f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <initializeString+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initializeString>:
test   %esi,%esi
jle    1122 <initializeString+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @initializeString(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
double run_vectorized() { return 0.0; }


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

x86 assembly (clang, -O2):
<run_vectorized>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @run_vectorized() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @run_vectorized() {
ret double 0.000000e+00
}
int set_apcli_disconnect_ap(int radio) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @set_apcli_disconnect_ap(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sig_eater(int signum) { printf("got signal %d\n", signum); }


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

x86 assembly (clang, -O2):
<sig_eater>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"got signal %d\0A\00"
define void @sig_eater(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"got signal %d\0A\00"
define void @sig_eater(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int fun1101() { return 1101; }


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

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

LLVM IR (-O0):
define i32 @fun1101() {
ret i32 1101
}

LLVM IR (-O2):
define i32 @fun1101() {
ret i32 1101
}
int db5500_prcmu_set_display_clocks(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @db5500_prcmu_set_display_clocks() {
ret i32 0
}
/* Variables and functions */
int system(char *);
int main(void) { return system(":"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c":\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
txt_noteoff(chan, pitch, vol) {
  prtime();
  printf("Note off, chan=%d pitch=%d vol=%d\n", chan + 1, pitch, vol);
}


x86 assembly (clang, -O0):
<txt_noteoff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txt_noteoff>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <prtime@plt>
add    $0x1,%ebx
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Note off, chan=%d pitch=%d vol=%d\0A\00"
define i32 @txt_noteoff(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = call i32 (...) @prtime()
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
@.str = [35 x i8] c"Note off, chan=%d pitch=%d vol=%d\0A\00"
define i32 @txt_noteoff(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @prtime()
%5 = add nsw i32 %0, 1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %1, i32 %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void handle_fatal_error(char message[]) {
  fprintf(stderr, "%s\n", message);
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @handle_fatal_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @handle_fatal_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
scalar_t__ ECHILD;
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int wait(int *);
void _waitall(void) {
  int pid;
  int status;
  for (;;) {
    pid = wait(&status);
    if (pid == -1) {
      if (errno == ECHILD)
        break;
      perror("wait");
      exit(-1);
    }
  }
}


x86 assembly (clang, -O0):
<_waitall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1050 <wait@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1183 <_waitall+0x53>
mov    0x2e8b(%rip),%rax
mov    (%rax),%rax
mov    0x2e79(%rip),%rcx
cmp    (%rcx),%rax
jne    116d <_waitall+0x3d>
jmp    1188 <_waitall+0x58>
lea    0xe8c(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
jmp    1138 <_waitall+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_waitall>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <wait@plt>
cmp    $0xffffffff,%eax
jne    1140 <_waitall+0x10>
mov    0x2e8c(%rip),%rax
mov    (%rax),%rax
mov    0x2e7a(%rip),%rcx
cmp    (%rcx),%rax
jne    1169 <_waitall+0x39>
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe90(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@ECHILD = global i64 0
@.str = [5 x i8] c"wait\00"
define void @_waitall() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %15, %0
%4 = call i32 @wait(i32* %2)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %15
7: ; preds = %3
%8 = load i64, i64* @errno
%9 = load i64, i64* @ECHILD
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7
br label %16
12: ; preds = %7
%13 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %3
br label %3
16: ; preds = %11
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@ECHILD = global i64 0
@.str = [5 x i8] c"wait\00"
define void @_waitall() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 @wait(i32* %1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = load i64, i64* @errno
%8 = load i64, i64* @ECHILD
%9 = icmp eq i64 %7, %8
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 -1)
unreachable
13: ; preds = %6
ret void
}
IR0I1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((*p0) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0I1>:
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)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x21,%eax
jg     113a <IR0I1+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <IR0I1+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0I1>:
xor    %eax,%eax
cmpb   $0x22,(%r8)
setb   %al
ret

LLVM IR (-O0):
define i32 @IR0I1(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 i8*, i8** %12
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = icmp sle i32 %18, 33
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @IR0I1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture readnone %5) {
%7 = load i8, i8* %4
%8 = icmp ult i8 %7, 34
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int putenv(char *envval) {
  printf(" Env String = %s\n", envval);
  return 0;
}


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

x86 assembly (clang, -O2):
<putenv>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c" Env String = %s\0A\00"
define i32 @putenv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c" Env String = %s\0A\00"
define i32 @putenv(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showErr(int id) {
  switch (id) {
  case 0: {
    printf("\nOhhh! exceeded the limit of the deque\n");
    break;
  }
  case 1: {
    break;
  }
  case 2: {
    break;
  }
  }
  return;
}


x86 assembly (clang, -O0):
<showErr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1150 <showErr+0x40>
jmp    112e <showErr+0x1e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1161 <showErr+0x51>
jmp    113f <showErr+0x2f>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1166 <showErr+0x56>
jmp    116b <showErr+0x5b>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    116b <showErr+0x5b>
jmp    116b <showErr+0x5b>
jmp    116b <showErr+0x5b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showErr>:
test   %edi,%edi
je     1115 <showErr+0x5>
ret
lea    0xee4(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"\0AOhhh! exceeded the limit of the deque\0A\00"
define void @showErr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 0, label %4
i32 1, label %6
i32 2, label %7
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %4
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c"\0AOhhh! exceeded the limit of the deque\00"
define void @showErr(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, unsigned int volatile);
int main() {
  volatile unsigned b = (unsigned)(-1);
  foo(-1, b);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
mov    0x4(%rsp),%esi
mov    $0xffffffff,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 -1, i32* %1
%3 = load volatile i32, i32* %1
%4 = tail call i32 @foo(i32 -1, i32 %3)
ret i32 0
}
int audioUpdate() { return 1; }


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

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

LLVM IR (-O0):
define i32 @audioUpdate() {
ret i32 1
}

LLVM IR (-O2):
define i32 @audioUpdate() {
ret i32 1
}
int swap_add(int *xp, int *yp) {
  int x = *xp;
  int y = *yp;
  if (x != y) {
    x = 2 * x;
  }
  *xp = y;
  *yp = x;
  return x + y;
}


x86 assembly (clang, -O0):
<swap_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
je     1133 <swap_add+0x33>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_add>:
mov    (%rdi),%eax
mov    (%rsi),%edx
cmp    %edx,%eax
setne  %cl
shl    %cl,%eax
mov    %edx,(%rdi)
mov    %eax,(%rsi)
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @swap_add(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp ne i32 %3, %4
%6 = zext i1 %5 to i32
%7 = shl nsw i32 %3, %6
store i32 %4, i32* %0
store i32 %7, i32* %1
%8 = add nsw i32 %7, %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ servtest();
void *server_thread(void *arg) { servtest(); }


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

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

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

LLVM IR (-O2):
define noalias i8* @server_thread(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @servtest()
ret i8* undef
}
/* Variables and functions */
size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog) {
  size_t maxHeaderSize = (((maxSymbolValue + 1) * tableLog) >> 3) + 3;
  return maxSymbolValue ? maxHeaderSize : 512;
}


x86 assembly (clang, -O0):
<FSE_NCountWriteBound>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
imul   -0x8(%rbp),%eax
shr    $0x3,%eax
add    $0x3,%eax
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1137 <FSE_NCountWriteBound+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1145 <FSE_NCountWriteBound+0x45>
mov    $0x200,%eax
mov    %rax,-0x18(%rbp)
jmp    1145 <FSE_NCountWriteBound+0x45>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FSE_NCountWriteBound>:
lea    0x1(%rdi),%ecx
imul   %esi,%ecx
shr    $0x3,%ecx
add    $0x3,%ecx
test   %edi,%edi
mov    $0x200,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i64 @FSE_NCountWriteBound(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 1
%8 = load i32, i32* %4
%9 = mul i32 %7, %8
%10 = lshr i32 %9, 3
%11 = add i32 %10, 3
%12 = zext i32 %11 to i64
store i64 %12, i64* %5
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = load i64, i64* %5
br label %18
17: ; preds = %2
br label %18
18: ; preds = %17, %15
%19 = phi i64 [ %16, %15 ], [ 512, %17 ]
ret i64 %19
}

LLVM IR (-O2):
define i64 @FSE_NCountWriteBound(i32 %0, i32 %1) {
%3 = add i32 %0, 1
%4 = mul i32 %3, %1
%5 = lshr i32 %4, 3
%6 = add nuw nsw i32 %5, 3
%7 = icmp eq i32 %0, 0
%8 = select i1 %7, i32 512, i32 %6
%9 = zext i32 %8 to i64
ret i64 %9
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int fs_exsists(const char *restrict filepath) {
  struct stat file_status = {0};
  if (stat(filepath, &file_status) == -1) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<fs_exsists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
jne    115e <fs_exsists+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1165 <fs_exsists+0x45>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_exsists>:
push   %rax
movl   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fs_exsists(i8* noalias %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = bitcast %struct.stat* %4 to i8*
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %11
10: ; preds = %1
store i32 1, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fs_exsists(i8* noalias nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
store i32 0, i32* %4
%5 = call i32 @stat(i8* %0, %struct.stat* %2)
%6 = icmp ne i32 %5, -1
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void alarm_func() {
  printf("\n\n*Alarm interrupt come on,the func running!*\n");
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"\0A\0A*Alarm interrupt come on,the func running!*\0A\00"
define void @alarm_func() {
%1 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [46 x i8] c"\0A\0A*Alarm interrupt come on,the func running!*\00"
define void @alarm_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int ones(int);
uint32_t leadingZeroCount(uint32_t x) {
  x |= (x >> 1);
  x |= (x >> 2);
  x |= (x >> 4);
  x |= (x >> 8);
  x |= (x >> 16);
  return (32 - ones(x));
}


x86 assembly (clang, -O0):
<leadingZeroCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ones@plt>
mov    %eax,%ecx
mov    $0x20,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leadingZeroCount>:
push   %rax
mov    %edi,%eax
sar    %eax
or     %eax,%edi
mov    %edi,%eax
sar    $0x2,%eax
or     %eax,%edi
mov    %edi,%eax
sar    $0x4,%eax
or     %eax,%edi
mov    %edi,%eax
sar    $0x8,%eax
or     %eax,%edi
mov    %edi,%eax
sar    $0x10,%eax
or     %eax,%edi
call   1030 <ones@plt>
mov    $0x20,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @leadingZeroCount(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = load i32, i32* %2
%6 = or i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 2
%9 = load i32, i32* %2
%10 = or i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = ashr i32 %11, 4
%13 = load i32, i32* %2
%14 = or i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 8
%17 = load i32, i32* %2
%18 = or i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = ashr i32 %19, 16
%21 = load i32, i32* %2
%22 = or i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = call i32 @ones(i32 %23)
%25 = sub nsw i32 32, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @leadingZeroCount(i32 %0) {
%2 = ashr i32 %0, 1
%3 = or i32 %2, %0
%4 = ashr i32 %3, 2
%5 = or i32 %4, %3
%6 = ashr i32 %5, 4
%7 = or i32 %6, %5
%8 = ashr i32 %7, 8
%9 = or i32 %8, %7
%10 = ashr i32 %9, 16
%11 = or i32 %10, %9
%12 = tail call i32 @ones(i32 %11)
%13 = sub nsw i32 32, %12
ret i32 %13
}
/* Variables and functions */
int EINVAL;
int ENOSYS;
int PTHREAD_CANCEL_DISABLE;
int PTHREAD_CANCEL_ENABLE;
int pthread_setcancelstate(int state, int *oldstate) {
  if ((state != PTHREAD_CANCEL_ENABLE) || (state != PTHREAD_CANCEL_DISABLE))
    return (EINVAL);
  return (ENOSYS);
}


x86 assembly (clang, -O0):
<pthread_setcancelstate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    112f <pthread_setcancelstate+0x2f>
mov    -0x8(%rbp),%eax
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%eax
je     1140 <pthread_setcancelstate+0x40>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <pthread_setcancelstate+0x4c>
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_setcancelstate>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
xor    %edi,%eax
mov    0x2eae(%rip),%rcx
xor    (%rcx),%edi
or     %eax,%edi
jne    1122 <pthread_setcancelstate+0x22>
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@PTHREAD_CANCEL_ENABLE = global i32 0
@PTHREAD_CANCEL_DISABLE = global i32 0
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @pthread_setcancelstate(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32, i32* %4
%7 = load i32, i32* @PTHREAD_CANCEL_ENABLE
%8 = icmp ne i32 %6, %7
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* @PTHREAD_CANCEL_DISABLE
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9, %2
%14 = load i32, i32* @EINVAL
store i32 %14, i32* %3
br label %17
15: ; preds = %9
%16 = load i32, i32* @ENOSYS
store i32 %16, i32* %3
br label %17
17: ; preds = %15, %13
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@PTHREAD_CANCEL_ENABLE = global i32 0
@PTHREAD_CANCEL_DISABLE = global i32 0
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @pthread_setcancelstate(i32 %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @PTHREAD_CANCEL_ENABLE
%4 = icmp eq i32 %3, %0
%5 = load i32, i32* @PTHREAD_CANCEL_DISABLE
%6 = icmp eq i32 %5, %0
%7 = select i1 %4, i1 %6, i1 false
%8 = load i32, i32* @ENOSYS
%9 = load i32, i32* @EINVAL
%10 = select i1 %7, i32 %8, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ abort();
assert(_Bool cond) {
  if (!cond)
    abort();
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x5(%rbp)
testb  $0x1,-0x5(%rbp)
jne    1131 <assert+0x21>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
test   %edi,%edi
je     1115 <assert+0x5>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @assert(i1 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = zext i1 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = trunc i8 %5 to i1
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @assert(i1 zeroext %0) {
br i1 %0, label %4, label %2
2: ; preds = %1
%3 = tail call i32 (...) @abort()
unreachable
4: ; preds = %1
ret i32 undef
}
double rad(double d) { return d * 0.017453292519943295; }


x86 assembly (clang, -O0):
<rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @rad(double %0) {
%2 = fmul double %0, 0x3F91DF46A2529D39
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ expected_pk_fault(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ pkey_access_deny(int /*<<< orphan*/);
int /*<<< orphan*/ sigsafe_printf(char *, int /*<<< orphan*/);
void test_write_of_access_disabled_region(int *ptr, uint16_t pkey) {
  do {
    if (1 <= 0)
      sigsafe_printf("disabling access to PKEY[%02d], doing write\n", pkey);
    fflush(NULL);
  } while (0);
  pkey_access_deny(pkey);
  *ptr = 1019;
  expected_pk_fault(pkey);
}


x86 assembly (clang, -O0):
<test_write_of_access_disabled_region>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <fflush@plt>
mov    -0xc(%rbp),%edi
call   1040 <pkey_access_deny@plt>
mov    -0x8(%rbp),%rax
movl   $0x3fb,(%rax)
mov    -0xc(%rbp),%edi
call   1050 <expected_pk_fault@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_write_of_access_disabled_region>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %edi,%edi
call   1030 <fflush@plt>
mov    %ebx,%edi
call   1040 <pkey_access_deny@plt>
movl   $0x3fb,(%r14)
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <expected_pk_fault@plt>

LLVM IR (-O0):
define void @test_write_of_access_disabled_region(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %2
%6 = call i32 @fflush(i32* null)
br label %7
7: ; preds = %5
%8 = load i32, i32* %4
%9 = call i32 @pkey_access_deny(i32 %8)
%10 = load i32*, i32** %3
store i32 1019, i32* %10
%11 = load i32, i32* %4
%12 = call i32 @expected_pk_fault(i32 %11)
ret void
}

LLVM IR (-O2):
define void @test_write_of_access_disabled_region(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @fflush(i32* null)
%4 = tail call i32 @pkey_access_deny(i32 %1)
store i32 1019, i32* %0
%5 = tail call i32 @expected_pk_fault(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CG_DrawActiveBets();
int /*<<< orphan*/ CG_DrawActiveBetsSums();
int /*<<< orphan*/ CG_DrawBalance();
int /*<<< orphan*/ CG_DrawGameStageInfo();
int /*<<< orphan*/ CG_DrawOatotTimer();
void CG_DrawOatotStuff(void) {
  CG_DrawGameStageInfo();
  CG_DrawOatotTimer();
  CG_DrawBalance();
  CG_DrawActiveBetsSums();
  CG_DrawActiveBets();
}


x86 assembly (clang, -O0):
<CG_DrawOatotStuff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CG_DrawGameStageInfo@plt>
mov    $0x0,%al
call   1060 <CG_DrawOatotTimer@plt>
mov    $0x0,%al
call   1070 <CG_DrawBalance@plt>
mov    $0x0,%al
call   1050 <CG_DrawActiveBetsSums@plt>
mov    $0x0,%al
call   1040 <CG_DrawActiveBets@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_DrawOatotStuff>:
push   %rax
xor    %eax,%eax
call   1030 <CG_DrawGameStageInfo@plt>
xor    %eax,%eax
call   1060 <CG_DrawOatotTimer@plt>
xor    %eax,%eax
call   1070 <CG_DrawBalance@plt>
xor    %eax,%eax
call   1050 <CG_DrawActiveBetsSums@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <CG_DrawActiveBets@plt>

LLVM IR (-O0):
define void @CG_DrawOatotStuff() {
%1 = call i32 (...) @CG_DrawGameStageInfo()
%2 = call i32 (...) @CG_DrawOatotTimer()
%3 = call i32 (...) @CG_DrawBalance()
%4 = call i32 (...) @CG_DrawActiveBetsSums()
%5 = call i32 (...) @CG_DrawActiveBets()
ret void
}

LLVM IR (-O2):
define void @CG_DrawOatotStuff() {
%1 = tail call i32 (...) @CG_DrawGameStageInfo()
%2 = tail call i32 (...) @CG_DrawOatotTimer()
%3 = tail call i32 (...) @CG_DrawBalance()
%4 = tail call i32 (...) @CG_DrawActiveBetsSums()
%5 = tail call i32 (...) @CG_DrawActiveBets()
ret void
}
/* Variables and functions */
void *memset(void *b, int c, size_t len) {
  *((char *)b) = 't';
  return b;
}


x86 assembly (clang, -O0):
<memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x74,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset>:
mov    %rdi,%rax
movb   $0x74,(%rdi)
ret

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

LLVM IR (-O2):
define i8* @memset(i8* returned writeonly %0, i32 %1, i64 %2) {
store i8 116, i8* %0
ret i8* %0
}
int comp(int *e1, int *e2) { return *e1 - *e2; }


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

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

LLVM IR (-O0):
define i32 @comp(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @comp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}
void gtk_cell_view_set_model() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_view_set_model() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void usage(void) {
  puts("usage: spyserv [ -s client ] [ -p clientport ] [ -l localport ]");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [64 x i8] c"usage: spyserv [ -s client ] [ -p clientport ] [ -l localport ]\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [64 x i8] c"usage: spyserv [ -s client ] [ -p clientport ] [ -l localport ]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler() { printf("15 seconds pass\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"15 seconds pass\00"
define void @handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
void evtchn_send() {}


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

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

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

LLVM IR (-O2):
define void @evtchn_send() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t simple_strlen(char *pcBuf) {
  uint32_t ui32RetVal = 0;
  if (!pcBuf) {
    return ui32RetVal;
  }
  while (*pcBuf++) {
    ui32RetVal++;
  }
  return ui32RetVal;
}


x86 assembly (clang, -O0):
<simple_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1128 <simple_strlen+0x28>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115e <simple_strlen+0x5e>
jmp    112d <simple_strlen+0x2d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     1156 <simple_strlen+0x56>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112d <simple_strlen+0x2d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_strlen>:
test   %rdi,%rdi
je     111f <simple_strlen+0x1f>
cmpb   $0x0,(%rdi)
je     111f <simple_strlen+0x1f>
xor    %ecx,%ecx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <simple_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @simple_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %10, %6 ], [ 0, %3 ]
%8 = phi i8* [ %9, %6 ], [ %0, %3 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = add nuw nsw i64 %7, 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i64 [ 0, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i64 %14
}
void classifier_cleanup_fun() {}


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

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

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

LLVM IR (-O2):
define void @classifier_cleanup_fun() {
ret void
}