xunge/DecIR huggingface dataset:
long get_rm_freesize(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @get_rm_freesize() {
ret i64 0
}

LLVM IR (-O2):
define i64 @get_rm_freesize() {
ret i64 0
}
/* Variables and functions */
scalar_t__ fabs(double);
long double fabsl(long double x) { return (long double)fabs((double)x); }


x86 assembly (clang, -O0):
<fabsl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <fabs@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @fabsl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @fabs(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @fabsl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @fabs(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
/* Variables and functions */
bool nrf52_errata_219(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_219() {
ret i32 0
}
int Operand_simm12b_decode(unsigned int *valp) {
  unsigned simm12b_0, imm12b_0;
  imm12b_0 = *valp & 0xfff;
  simm12b_0 = ((int)imm12b_0 << 20) >> 20;
  *valp = simm12b_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_simm12b_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xfff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x14,%eax
sar    $0x14,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_simm12b_decode>:
mov    (%rdi),%eax
shl    $0x14,%eax
sar    $0x14,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_simm12b_decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = and i32 %6, 4095
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = shl i32 %8, 20
%10 = ashr i32 %9, 20
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = load i32*, i32** %2
store i32 %11, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_simm12b_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 20
%4 = ashr exact i32 %3, 20
store i32 %4, i32* %0
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_permute_quaddobl_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(479, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_permute_quaddobl_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1df,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_permute_quaddobl_system>:
mov    $0x1df,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @celcon_permute_quaddobl_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 479, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_permute_quaddobl_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 479, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ function(char *);
void function1(char *p) {
  p++;
  function(p);
}


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

x86 assembly (clang, -O2):
<function1>:
add    $0x1,%rdi
jmp    1030 <function@plt>

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

LLVM IR (-O2):
define void @function1(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i32 @function(i8* %2)
ret void
}
long f2(int *p) { return *p; }


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

x86 assembly (clang, -O2):
<f2>:
movslq (%rdi),%rax
ret

LLVM IR (-O0):
define i64 @f2(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @f2(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
ret i64 %3
}
void addon_setup() {}


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

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

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

LLVM IR (-O2):
define void @addon_setup() {
ret void
}
/* Variables and functions */
bool nrf53_errata_73(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_73() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
void sprint_rl(char *str) { sprintf(str, "RL    A                         "); }


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

x86 assembly (clang, -O2):
<sprint_rl>:
movups 0xf09(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movups 0xeee(%rip),%xmm0
movups %xmm0,(%rdi)
movb   $0x0,0x20(%rdi)
ret

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

LLVM IR (-O2):
@.str = [33 x i8] c"RL A \00"
define void @sprint_rl(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(33) %0, i8* align 1 dereferenceable(33) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 33, i1 false)
ret void
}
void upvp_to_xy(float up, float vp, float *xc, float *yc) {
  *xc = (9 * up) / ((6 * up) - (16 * vp) + 12);
  *yc = (4 * vp) / ((6 * up) - (16 * vp) + 12);
}


x86 assembly (clang, -O0):
<upvp_to_xy>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  0xef2(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movss  0xed8(%rip),%xmm2
mulss  -0x8(%rbp),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
movss  0xeba(%rip),%xmm3
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
movss  0xea6(%rip),%xmm2
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  0xe9a(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movss  0xe84(%rip),%xmm2
mulss  -0x8(%rbp),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
movss  0xe66(%rip),%xmm3
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
movss  0xe52(%rip),%xmm2
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<upvp_to_xy>:
movss  0xef8(%rip),%xmm2
mulss  %xmm0,%xmm2
movss  0xef0(%rip),%xmm3
mulss  %xmm1,%xmm3
mulss  0xee8(%rip),%xmm0
addss  %xmm3,%xmm0
addss  0xee0(%rip),%xmm0
divss  %xmm0,%xmm2
movss  %xmm2,(%rdi)
mulss  0xed4(%rip),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @upvp_to_xy(float %0, float %1, float* %2, float* %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float*
%8 = alloca float*
store float %0, float* %5
store float %1, float* %6
store float* %2, float** %7
store float* %3, float** %8
%9 = load float, float* %5
%10 = fmul float 9.000000e+00, %9
%11 = load float, float* %5
%12 = load float, float* %6
%13 = fmul float 1.600000e+01, %12
%14 = fneg float %13
%15 = call float @llvm.fmuladd.f32(float 6.000000e+00, float %11, float %14)
%16 = fadd float %15, 1.200000e+01
%17 = fdiv float %10, %16
%18 = load float*, float** %7
store float %17, float* %18
%19 = load float, float* %6
%20 = fmul float 4.000000e+00, %19
%21 = load float, float* %5
%22 = load float, float* %6
%23 = fmul float 1.600000e+01, %22
%24 = fneg float %23
%25 = call float @llvm.fmuladd.f32(float 6.000000e+00, float %21, float %24)
%26 = fadd float %25, 1.200000e+01
%27 = fdiv float %20, %26
%28 = load float*, float** %8
store float %27, float* %28
ret void
}

LLVM IR (-O2):
define void @upvp_to_xy(float %0, float %1, float* nocapture writeonly %2, float* nocapture writeonly %3) {
%5 = fmul float %0, 9.000000e+00
%6 = fmul float %1, -1.600000e+01
%7 = tail call float @llvm.fmuladd.f32(float %0, float 6.000000e+00, float %6)
%8 = fadd float %7, 1.200000e+01
%9 = fdiv float %5, %8
store float %9, float* %2
%10 = fmul float %1, 4.000000e+00
%11 = fdiv float %10, %8
store float %11, float* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void help(const char *program) {
  printf(
      "NAME\n"
      "       aes-crypt - encrypts/decrypts standard input with 256 bit AES\n"
      "\n"
      "SYNOPSIS\n"
      "       %s [-h] [-e] [d] password\n"
      "\n"
      "DESCRIPTION\n"
      "       Encrypts/decrypts data on standard input using AES 256 bit\n"
      "       encryption  and outputs the result on standard output.\n"
      "\n"
      "OPTIONS\n"
      "       -h      Display this message.\n"
      "\n"
      "       -e      Encrypt standard input.  Mutual exclusivity with -d "
      "flag.\n"
      "\n"
      "       -d      Decrypt standard input.  Mutual exclusivity with -e "
      "flag.\n"
      "\n"
      "updated: Monday, April 20, 2015\n",
      program);
}


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

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

LLVM IR (-O0):
@.str = [486 x i8] c"NAME\0A aes-crypt - encrypts/decrypts standard input with 256 bit AES\0A\0ASYNOPSIS\0A %s [-h] [-e] [d] password\0A\0ADESCRIPTION\0A Encrypts/decrypts data on standard input using AES 256 bit\0A encryption and outputs the result on standard output.\0A\0AOPTIONS\0A -h Display this message.\0A\0A -e Encrypt standard input. Mutual exclusivity with -d flag.\0A\0A -d Decrypt standard input. Mutual exclusivity with -e flag.\0A\0Aupdated: Monday, April 20, 2015\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([486 x i8], [486 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [486 x i8] c"NAME\0A aes-crypt - encrypts/decrypts standard input with 256 bit AES\0A\0ASYNOPSIS\0A %s [-h] [-e] [d] password\0A\0ADESCRIPTION\0A Encrypts/decrypts data on standard input using AES 256 bit\0A encryption and outputs the result on standard output.\0A\0AOPTIONS\0A -h Display this message.\0A\0A -e Encrypt standard input. Mutual exclusivity with -d flag.\0A\0A -d Decrypt standard input. Mutual exclusivity with -e flag.\0A\0Aupdated: Monday, April 20, 2015\0A\00"
define void @help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([486 x i8], [486 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ mostWordInString(char *);
int main(void) {
  char s1[1024] = {};
  int i = 0;
  while ((s1[i] = getchar()) != '\n')
    i++;
  s1[i] = '\0';
  mostWordInString(s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
movl   $0x0,-0x414(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
movslq -0x414(%rbp),%rcx
mov    %al,-0x410(%rbp,%rcx,1)
movsbl %al,%eax
cmp    $0xa,%eax
je     1194 <main+0x64>
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    115f <main+0x2f>
movslq -0x414(%rbp),%rax
movb   $0x0,-0x410(%rbp,%rax,1)
lea    -0x410(%rbp),%rdi
call   1050 <mostWordInString@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    $0xffffffffffffffff,%rbx
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,0x1(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0xa,%al
jne    1150 <main+0x20>
mov    %ebx,%eax
movb   $0x0,(%rsp,%rax,1)
mov    %rsp,%rdi
call   1050 <mostWordInString@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [1024 x i8]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %12, %0
%6 = call signext i8 (...) @getchar()
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %8
store i8 %6, i8* %9
%10 = sext i8 %6 to i32
%11 = icmp ne i32 %10, 10
br i1 %11, label %12, label %15
12: ; preds = %5
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %17
store i8 0, i8* %18
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%20 = call i32 @mostWordInString(i8* %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = phi i64 [ %8, %3 ], [ 0, %0 ]
%5 = tail call signext i8 (...) @getchar()
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %4
store i8 %5, i8* %6
%7 = icmp eq i8 %5, 10
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = and i64 %4, 4294967295
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %10
store i8 0, i8* %11
%12 = call i32 @mostWordInString(i8* %2)
ret i32 0
}
/* Variables and functions */
double atan2(double, double);
double atan2pi(double x, double y) {
  return atan2(x, y) / 3.14159265358979323846;
}


x86 assembly (clang, -O0):
<atan2pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <atan2@plt>
movsd  0xec7(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan2pi>:
push   %rax
call   1030 <atan2@plt>
divsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @atan2pi(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @atan2(double %5, double %6)
%8 = fdiv double %7, 0x400921FB54442D18
ret double %8
}

LLVM IR (-O2):
define double @atan2pi(double %0, double %1) {
%3 = tail call double @atan2(double %0, double %1)
%4 = fdiv double %3, 0x400921FB54442D18
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
time_t get_or_set_grab_request(int update) {
  static time_t last_grab_request;
  if (update)
    time(&last_grab_request);
  return last_grab_request;
}


x86 assembly (clang, -O0):
<get_or_set_grab_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1131 <get_or_set_grab_request+0x21>
lea    0x2f00(%rip),%rdi
call   1030 <time@plt>
mov    0x2ef5(%rip),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_or_set_grab_request>:
push   %rax
test   %edi,%edi
je     1121 <get_or_set_grab_request+0x11>
lea    0x2f10(%rip),%rdi
call   1030 <time@plt>
mov    0x2f05(%rip),%eax
pop    %rcx
ret

LLVM IR (-O0):
@get_or_set_grab_request.last_grab_request = internal global i32 0
define i32 @get_or_set_grab_request(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @time(i32* @get_or_set_grab_request.last_grab_request)
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* @get_or_set_grab_request.last_grab_request
ret i32 %8
}

LLVM IR (-O2):
@get_or_set_grab_request.last_grab_request = internal global i32 0
define i32 @get_or_set_grab_request(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @time(i32* @get_or_set_grab_request.last_grab_request)
br label %5
5: ; preds = %3, %1
%6 = load i32, i32* @get_or_set_grab_request.last_grab_request
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void test() { printf("ok!"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"ok!\00"
define void @test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"ok!\00"
define void @test() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
free_ivector(v, nl, nh) int *v, nl, nh;
{ free((char *)(v + nl)); }


x86 assembly (clang, -O0):
<free_ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ivector>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define i32 @free_ivector(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 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = bitcast i32* %11 to i8*
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
define i32 @free_ivector(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = bitcast i32* %5 to i8*
tail call void @free(i8* %6)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short, short, short);
signed short test_func_fn(signed short a1, signed short a2) {
  signed short result;
  result = a1 + a2;
  printf("%d %d: %d\n", a1, a2, result);
  return result;
}


x86 assembly (clang, -O0):
<test_func_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x6(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x4(%rbp),%ax
lea    0xebd(%rip),%rdi
movswl %cx,%esi
movswl %ax,%edx
movswl -0x6(%rbp),%ecx
call   1030 <printf@plt>
movswl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func_fn>:
push   %rbx
mov    %esi,%edx
mov    %edi,%esi
lea    (%rdx,%rsi,1),%eax
movswl %ax,%ebx
lea    0xede(%rip),%rdi
mov    %ebx,%ecx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%d %d: %d\0A\00"
define signext i16 @test_func_fn(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = sext i16 %6 to i32
%8 = load i16, i16* %4
%9 = sext i16 %8 to i32
%10 = add nsw i32 %7, %9
%11 = trunc i32 %10 to i16
store i16 %11, i16* %5
%12 = load i16, i16* %3
%13 = load i16, i16* %4
%14 = load i16, i16* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i16 signext %12, i16 signext %13, i16 signext %14)
%16 = load i16, i16* %5
ret i16 %16
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d %d: %d\0A\00"
define signext i16 @test_func_fn(i16 signext %0, i16 signext %1) {
%3 = add i16 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i16 signext %0, i16 signext %1, i16 signext %3)
ret i16 %3
}
/* Type definitions */
struct ast_bridge {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __ao2_unlock(struct ast_bridge *, char const *, char const *,
                                int, char const *);
void _ast_bridge_unlock(struct ast_bridge *bridge, const char *file,
                        const char *function, int line, const char *var) {
  __ao2_unlock(bridge, file, function, line, var);
}


x86 assembly (clang, -O0):
<_ast_bridge_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
call   1030 <__ao2_unlock@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ast_bridge_unlock>:
jmp    1030 <__ao2_unlock@plt>

LLVM IR (-O0):
%struct.ast_bridge = type { i32 }
define void @_ast_bridge_unlock(%struct.ast_bridge* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca %struct.ast_bridge*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store %struct.ast_bridge* %0, %struct.ast_bridge** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load %struct.ast_bridge*, %struct.ast_bridge** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
%16 = call i32 @__ao2_unlock(%struct.ast_bridge* %11, i8* %12, i8* %13, i32 %14, i8* %15)
ret void
}

LLVM IR (-O2):
%struct.ast_bridge = type { i32 }
define void @_ast_bridge_unlock(%struct.ast_bridge* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = tail call i32 @__ao2_unlock(%struct.ast_bridge* %0, i8* %1, i8* %2, i32 %3, i8* %4)
ret void
}
int getGcm(int a, int b) {
  int tmp;
  while (b != 0) {
    tmp = a % b;
    a = b;
    b = tmp;
  }
  return a;
}


x86 assembly (clang, -O0):
<getGcm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <getGcm+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <getGcm+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getGcm>:
mov    %edi,%eax
test   %esi,%esi
je     111d <getGcm+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <getGcm+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getGcm(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Type definitions */
typedef uintptr_t uint16_t;

/* Variables and functions */
void *seg_ofs_to_prot(uint16_t seg, uint16_t ofs) {
  uintptr_t retval = seg;
  retval *= 16;
  retval += ofs;
  return (void *)retval;
}


x86 assembly (clang, -O0):
<seg_ofs_to_prot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seg_ofs_to_prot>:
shl    $0x4,%rdi
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i8* @seg_ofs_to_prot(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
store i64 %6, i64* %5
%7 = load i64, i64* %5
%8 = mul i64 %7, 16
store i64 %8, i64* %5
%9 = load i64, i64* %4
%10 = load i64, i64* %5
%11 = add i64 %10, %9
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = inttoptr i64 %12 to i8*
ret i8* %13
}

LLVM IR (-O2):
define i8* @seg_ofs_to_prot(i64 %0, i64 %1) {
%3 = shl i64 %0, 4
%4 = add i64 %3, %1
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
void *test_anti_range_64(unsigned short n) {
  extern void *alloc_anti_range_64(unsigned short)
      __attribute__((alloc_size(1)));
  if (0 <= n && n <= 0)
    n = 0 - 1;
  return alloc_anti_range_64(n);
}


x86 assembly (clang, -O0):
<test_anti_range_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     1140 <test_anti_range_64+0x30>
movzwl -0x2(%rbp),%eax
cmp    $0x0,%eax
jg     1140 <test_anti_range_64+0x30>
movw   $0xffff,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_64>:
cmp    $0x1,%edi
sbb    %eax,%eax
or     %edi,%eax
movzwl %ax,%edi
jmp    1030 <alloc_anti_range_64@plt>

LLVM IR (-O0):
define i8* @test_anti_range_64(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp sle i32 0, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 -1, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_64(i16 zeroext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_64(i16 zeroext %0) {
%2 = icmp eq i16 %0, 0
%3 = select i1 %2, i16 -1, i16 %0
%4 = tail call i8* @alloc_anti_range_64(i16 zeroext %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ giveup(char *);
void *malloc(long);
void *alloc(long siz) {
  void *p;
  if (!(p = malloc(siz)))
    giveup("No memory");
  return p;
}


x86 assembly (clang, -O0):
<alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114f <alloc+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <giveup@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <alloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <giveup@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"No memory\00"
define noalias i8* @alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @giveup(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *strndup(const char *str, size_t n) {
  char *copy;
  if ((copy = (char *)malloc(n + 1)) == NULL) {
    return NULL;
  }
  memcpy(copy, str, n);
  copy[n] = '\0';
  return copy;
}


x86 assembly (clang, -O0):
<strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1158 <strndup+0x38>
movq   $0x0,-0x8(%rbp)
jmp    117d <strndup+0x5d>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1151 <strndup+0x31>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r14,1)
jmp    1153 <strndup+0x33>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %1)
%9 = getelementptr inbounds i8, i8* %5, i64 %1
store i8 0, i8* %9
br label %10
10: ; preds = %2, %7
%11 = phi i8* [ %5, %7 ], [ null, %2 ]
ret i8* %11
}
int magic() { return 123456789; }


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

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

LLVM IR (-O0):
define i32 @magic() {
ret i32 123456789
}

LLVM IR (-O2):
define i32 @magic() {
ret i32 123456789
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("%s", "linux.h");
  printf("\nPress any key to end...");
  getchar();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed4(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [8 x i8] c"linux.h\00"
@.str.2 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [8 x i8] c"linux.h\00"
@.str.2 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
double __ieee754_log2(double);
double log2(double x) { return __ieee754_log2(x); }


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

x86 assembly (clang, -O2):
<log2>:
jmp    1030 <__ieee754_log2@plt>

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

LLVM IR (-O2):
define double @log2(double %0) {
%2 = tail call double @__ieee754_log2(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
__attribute__((__noreturn__)) void exitfunc13(void) {
  printf("Executing exitfunc"
         "13"
         ".\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Executing exitfunc13.\0A\00"
define void @exitfunc13() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"Executing exitfunc13.\00"
define void @exitfunc13() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double asin(double);
double libm_asin(double x) { return asin(x); }


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

x86 assembly (clang, -O2):
<libm_asin>:
jmp    1030 <asin@plt>

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

LLVM IR (-O2):
define double @libm_asin(double %0) {
%2 = tail call double @asin(double %0)
ret double %2
}
int neg_interleave(int x, int ref) {
  if (x < ref)
    return -2 * (x - ref) - 1;
  else if (x < 2 * ref)
    return 2 * (x - ref);
  else
    return x - 1;
}


x86 assembly (clang, -O0):
<neg_interleave>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    112d <neg_interleave+0x2d>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
imul   $0xfffffffe,%eax,%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <neg_interleave+0x58>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    114f <neg_interleave+0x4f>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <neg_interleave+0x58>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg_interleave>:
mov    %edi,%eax
sub    %esi,%eax
jge    110f <neg_interleave+0xf>
sub    %edi,%esi
lea    (%rsi,%rsi,1),%eax
add    $0xffffffff,%eax
ret
add    %esi,%esi
cmp    %edi,%esi
jle    1118 <neg_interleave+0x18>
add    %eax,%eax
ret
add    $0xffffffff,%edi
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @neg_interleave(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = sub i32 %1, %0
%6 = shl i32 %5, 1
%7 = add nsw i32 %6, -1
br label %16
8: ; preds = %2
%9 = shl nsw i32 %1, 1
%10 = icmp sgt i32 %9, %0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = sub nsw i32 %0, %1
%13 = shl nsw i32 %12, 1
br label %16
14: ; preds = %8
%15 = add nsw i32 %0, -1
br label %16
16: ; preds = %14, %11, %4
%17 = phi i32 [ %7, %4 ], [ %13, %11 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
void s2winPostRedisplay(void) { glutPostRedisplay(); }


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

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

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

LLVM IR (-O2):
define void @s2winPostRedisplay() {
%1 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
bool tread_arr_end(void *s) {
  fprintf(stderr, "arr_end\n");
  return true;
}


x86 assembly (clang, -O0):
<tread_arr_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"arr_end\0A\00"
define i32 @tread_arr_end(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"arr_end\0A\00"
define i32 @tread_arr_end(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
void DIST_POINT_NAME_new(void) {}


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

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

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

LLVM IR (-O2):
define void @DIST_POINT_NAME_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tx(int);
void tx_int(int i) {
  tx(i & 0xff);
  tx((i >> 8) & 0xff);
  tx((i >> 16) & 0xff);
  tx((i >> 24) & 0xff);
}


x86 assembly (clang, -O0):
<tx_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <tx@plt>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1030 <tx@plt>
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
and    $0xff,%edi
call   1030 <tx@plt>
mov    -0x4(%rbp),%edi
sar    $0x18,%edi
and    $0xff,%edi
call   1030 <tx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tx_int>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <tx@plt>
movzbl %bh,%edi
call   1030 <tx@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1030 <tx@plt>
shr    $0x18,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <tx@plt>

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

LLVM IR (-O2):
define void @tx_int(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @tx(i32 %2)
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = tail call i32 @tx(i32 %5)
%7 = lshr i32 %0, 16
%8 = and i32 %7, 255
%9 = tail call i32 @tx(i32 %8)
%10 = lshr i32 %0, 24
%11 = tail call i32 @tx(i32 %10)
ret void
}
int InterruptPriority(int InterruptSource) {
  return ((((volatile unsigned long *)(0xE000E000 +
                                       (0x400)))[(InterruptSource >> 2)] >>
           ((InterruptSource & 3) * 8)) >>
          3) &
         0x1F;
}


x86 assembly (clang, -O0):
<InterruptPriority>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
movslq %eax,%rcx
mov    $0xe000e400,%eax
mov    (%rax,%rcx,8),%rax
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
shl    $0x3,%ecx
mov    %ecx,%ecx
shr    %cl,%rax
shr    $0x3,%rax
and    $0x1f,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<InterruptPriority>:
lea    0x0(,%rdi,8),%ecx
mov    %edi,%eax
sar    $0x2,%eax
cltq
mov    $0xe000e400,%edx
mov    (%rdx,%rax,8),%rax
and    $0x18,%cl
shr    %cl,%rax
shr    $0x3,%eax
and    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @InterruptPriority(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i64, i64* inttoptr (i64 3758154752 to i64*), i64 %5
%7 = load volatile i64, i64* %6
%8 = load i32, i32* %2
%9 = and i32 %8, 3
%10 = mul nsw i32 %9, 8
%11 = zext i32 %10 to i64
%12 = lshr i64 %7, %11
%13 = lshr i64 %12, 3
%14 = and i64 %13, 31
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @InterruptPriority(i32 %0) {
%2 = ashr i32 %0, 2
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i64, i64* inttoptr (i64 3758154752 to i64*), i64 %3
%5 = load volatile i64, i64* %4
%6 = shl i32 %0, 3
%7 = and i32 %6, 24
%8 = zext i32 %7 to i64
%9 = lshr i64 %5, %8
%10 = trunc i64 %9 to i32
%11 = lshr i32 %10, 3
%12 = and i32 %11, 31
ret i32 %12
}
int func(void) {
  int n = 3;
  int m = 5;
  n |= m;
  return 0;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @func() {
%1 = alloca i32
%2 = alloca i32
store i32 3, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %1
%5 = or i32 %4, %3
store i32 %5, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void test(const char *message) { printf("** %s **\n", message); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"** %s **\0A\00"
define void @test(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DMA4_DriverIRQHandler();
__attribute__((weak)) void DMA4_IRQHandler(void) { DMA4_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @DMA4_IRQHandler() {
%1 = call i32 (...) @DMA4_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA4_IRQHandler() {
%1 = tail call i32 (...) @DMA4_DriverIRQHandler()
ret void
}
/* Type definitions */
struct entity_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destroy_shield(struct entity_t *);
void weapon_shield_collision(struct entity_t *weapon, struct entity_t *shield) {
  destroy_shield(shield);
}


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

x86 assembly (clang, -O2):
<weapon_shield_collision>:
mov    %rsi,%rdi
jmp    1030 <destroy_shield@plt>

LLVM IR (-O0):
%struct.entity_t = type { i32 }
define void @weapon_shield_collision(%struct.entity_t* %0, %struct.entity_t* %1) {
%3 = alloca %struct.entity_t*
%4 = alloca %struct.entity_t*
store %struct.entity_t* %0, %struct.entity_t** %3
store %struct.entity_t* %1, %struct.entity_t** %4
%5 = load %struct.entity_t*, %struct.entity_t** %4
%6 = call i32 @destroy_shield(%struct.entity_t* %5)
ret void
}

LLVM IR (-O2):
%struct.entity_t = type { i32 }
define void @weapon_shield_collision(%struct.entity_t* nocapture readnone %0, %struct.entity_t* %1) {
%3 = tail call i32 @destroy_shield(%struct.entity_t* %1)
ret void
}