xunge/DecIR huggingface dataset:
unsigned char cdops_disc_status() {
  return (*(volatile unsigned char *)(0xa05f7000 + (0x8c)));
}


x86 assembly (clang, -O0):
<cdops_disc_status>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa05f708c,%eax
mov    (%rax),%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdops_disc_status>:
mov    $0xa05f708c,%eax
mov    (%rax),%al
ret

LLVM IR (-O0):
define zeroext i8 @cdops_disc_status() {
%1 = load volatile i8, i8* inttoptr (i64 2690609292 to i8*)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @cdops_disc_status() {
%1 = load volatile i8, i8* inttoptr (i64 2690609292 to i8*)
ret i8 %1
}
int getByte(int x, int n) {
  int mask = 0xFF;
  return x >> (n << 3) & mask;
}


x86 assembly (clang, -O0):
<getByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xff,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
sar    %cl,%eax
and    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getByte>:
lea    0x0(,%rsi,8),%ecx
sar    %cl,%edi
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @getByte(i32 %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = ashr i32 %0, %3
%5 = and i32 %4, 255
ret i32 %5
}
void vectorAddNormalize(float a, float b, float c, float *vector) {
  vector[0] = vector[0] + a / 255;
  vector[1] = vector[1] + b / 255;
  vector[2] = vector[2] + c / 255;
}


x86 assembly (clang, -O0):
<vectorAddNormalize>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
movss  -0x4(%rbp),%xmm1
movss  0xed4(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xeae(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xe87(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectorAddNormalize>:
movss  0xef8(%rip),%xmm3
divss  %xmm3,%xmm0
addss  (%rdi),%xmm0
movss  %xmm0,(%rdi)
divss  %xmm3,%xmm1
addss  0x4(%rdi),%xmm1
movss  %xmm1,0x4(%rdi)
divss  %xmm3,%xmm2
addss  0x8(%rdi),%xmm2
movss  %xmm2,0x8(%rdi)
ret

LLVM IR (-O0):
define void @vectorAddNormalize(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** %8
%10 = getelementptr inbounds float, float* %9, i64 0
%11 = load float, float* %10
%12 = load float, float* %5
%13 = fdiv float %12, 2.550000e+02
%14 = fadd float %11, %13
%15 = load float*, float** %8
%16 = getelementptr inbounds float, float* %15, i64 0
store float %14, float* %16
%17 = load float*, float** %8
%18 = getelementptr inbounds float, float* %17, i64 1
%19 = load float, float* %18
%20 = load float, float* %6
%21 = fdiv float %20, 2.550000e+02
%22 = fadd float %19, %21
%23 = load float*, float** %8
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %8
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float, float* %7
%29 = fdiv float %28, 2.550000e+02
%30 = fadd float %27, %29
%31 = load float*, float** %8
%32 = getelementptr inbounds float, float* %31, i64 2
store float %30, float* %32
ret void
}

LLVM IR (-O2):
define void @vectorAddNormalize(float %0, float %1, float %2, float* nocapture %3) {
%5 = load float, float* %3
%6 = fdiv float %0, 2.550000e+02
%7 = fadd float %6, %5
store float %7, float* %3
%8 = getelementptr inbounds float, float* %3, i64 1
%9 = load float, float* %8
%10 = fdiv float %1, 2.550000e+02
%11 = fadd float %10, %9
store float %11, float* %8
%12 = getelementptr inbounds float, float* %3, i64 2
%13 = load float, float* %12
%14 = fdiv float %2, 2.550000e+02
%15 = fadd float %14, %13
store float %15, float* %12
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ checkInput(int *);
int checkPrime(int);
int /*<<< orphan*/ printf(char *);
int main() {
  int number;
  int isPrime;
  printf("Enter number: ");
  checkInput(&number);
  isPrime = checkPrime(number);
  printf(isPrime ? "true" : "false");
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1050 <checkInput@plt>
mov    -0x8(%rbp),%edi
call   1030 <checkPrime@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
lea    0xeab(%rip),%rdi
lea    0xe9f(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
call   1040 <printf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0x4(%rsp),%rdi
call   1050 <checkInput@plt>
mov    0x4(%rsp),%edi
call   1030 <checkPrime@plt>
test   %eax,%eax
lea    0xebb(%rip),%rax
lea    0xeaf(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter number: \00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @checkInput(i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @checkPrime(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%12 = call i32 @printf(i8* %11)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter number: \00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @checkInput(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @checkPrime(i32 %5)
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%9 = call i32 @printf(i8* dereferenceable(1) %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}
int fun891() { return 891; }


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

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

LLVM IR (-O0):
define i32 @fun891() {
ret i32 891
}

LLVM IR (-O2):
define i32 @fun891() {
ret i32 891
}
/* Variables and functions */
int /*<<< orphan*/ test1();
int main(void) { test1(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test1()
ret i32 0
}
void rt_init(int argc, char **argv) { return; }


x86 assembly (clang, -O0):
<rt_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @rt_init(i32 %0, i8** nocapture %1) {
ret void
}
const char *lb__lua_c_interface_version__(void) { return ("130"); }


x86 assembly (clang, -O0):
<lb__lua_c_interface_version__>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lb__lua_c_interface_version__>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"130\00"
define i8* @lb__lua_c_interface_version__() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"130\00"
define i8* @lb__lua_c_interface_version__() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int cifra;
  scanf("%d", &cifra);
  printf("\n%d\n", cifra * cifra);
  printf("%d\n", cifra * cifra * cifra);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
imul   %esi,%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
mov    %eax,%esi
imul   %eax,%esi
imul   %eax,%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"\0A%d\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %7
%9 = mul nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printMaxIntValue(int value) { printf("Max Int Value = %i \n", value); }


x86 assembly (clang, -O0):
<printMaxIntValue>:
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):
<printMaxIntValue>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"Max Int Value = %i \0A\00"
define void @printMaxIntValue(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  if (n % 2 != 0 && n > 20) {
    printf("True\n");
  } else {
    printf("False.\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     116e <main+0x4e>
cmpl   $0x14,-0x8(%rbp)
jle    116e <main+0x4e>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    117a <main+0x5a>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
lea    0xecd(%rip),%rdi
lea    0xebf(%rip),%rcx
test   $0x1,%al
cmove  %rcx,%rdi
cmp    $0x15,%eax
cmovl  %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"True\0A\00"
@.str.2 = [8 x i8] c"False.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 20
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %7, %0
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [7 x i8] c"False.\00"
@str.3 = [5 x i8] c"True\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
%7 = icmp sgt i32 %4, 20
%8 = and i1 %7, %6
%9 = select i1 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0)
%10 = call i32 @puts(i8* dereferenceable(1) %9)
ret i32 0
}
float QuadraticEaseOut(float p) { return -(p * (p - 2)); }


x86 assembly (clang, -O0):
<QuadraticEaseOut>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movss  0xee5(%rip),%xmm2
subss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuadraticEaseOut>:
movss  0xef8(%rip),%xmm1
addss  %xmm0,%xmm1
xorps  0xefd(%rip),%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @QuadraticEaseOut(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fsub float %4, 2.000000e+00
%6 = fmul float %3, %5
%7 = fneg float %6
ret float %7
}

LLVM IR (-O2):
define float @QuadraticEaseOut(float %0) {
%2 = fadd float %0, -2.000000e+00
%3 = fneg float %2
%4 = fmul float %3, %0
ret float %4
}
char *long_to_char(lng, string)
int *lng;
char *string;
{
  char *s = string;
  do
    *(s++) = (char)*lng;
  while (*(lng++) != 0);
  return (string);
}


x86 assembly (clang, -O0):
<long_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
cmpl   $0x0,(%rax)
jne    1114 <long_to_char+0x14>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_to_char>:
mov    %rsi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi,%rcx,4),%edx
mov    %dl,(%rax,%rcx,1)
cmpl   $0x0,(%rdi,%rcx,4)
lea    0x1(%rcx),%rcx
jne    1110 <long_to_char+0x10>
ret

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

LLVM IR (-O2):
define i8* @long_to_char(i32* nocapture %0, i8* returned writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32* [ %0, %2 ], [ %9, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = load i32, i32* %4
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = getelementptr inbounds i32, i32* %4, i64 1
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %3
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ set_busy(int);
void get_left_fork(int mine) {
  int item = (mine);
  set_busy(item);
}


x86 assembly (clang, -O0):
<get_left_fork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <set_busy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_left_fork>:
jmp    1030 <set_busy@plt>

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

LLVM IR (-O2):
define void @get_left_fork(i32 %0) {
%2 = tail call i32 @set_busy(i32 %0)
ret void
}
int bics_si_test2(int a, int b, int c) {
  int d = a & ~(b << 3);
  if (d <= 0)
    return a + c;
  else
    return b + d + c;
}


x86 assembly (clang, -O0):
<bics_si_test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1136 <bics_si_test2+0x36>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <bics_si_test2+0x42>
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bics_si_test2>:
lea    0x0(,%rsi,8),%ecx
not    %ecx
and    %edi,%ecx
lea    (%rsi,%rcx,1),%eax
test   %ecx,%ecx
cmovle %edi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @bics_si_test2(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 3
%5 = xor i32 %4, -1
%6 = and i32 %5, %0
%7 = icmp slt i32 %6, 1
%8 = add nsw i32 %6, %1
%9 = select i1 %7, i32 %0, i32 %8
%10 = add nsw i32 %9, %2
ret i32 %10
}
int test_imm_60uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x60 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_60uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 6291456
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void *must_calloc(int nmemb, int size) {
  void *new = calloc(nmemb, size);
  if (!new) {
    printf("OUT OF MEMORY\n");
    exit(1);
  }
  return new;
}


x86 assembly (clang, -O0):
<must_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <must_calloc+0x3e>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<must_calloc>:
push   %rax
call   1040 <calloc@plt>
test   %rax,%rax
je     113d <must_calloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"OUT OF MEMORY\0A\00"
define i8* @must_calloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i8* @calloc(i32 %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@str = [14 x i8] c"OUT OF MEMORY\00"
define noalias i8* @must_calloc(i32 %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int FD_CLOEXEC;
int /*<<< orphan*/ F_GETFD;
int /*<<< orphan*/ F_SETFD;
int fcntl(int, int /*<<< orphan*/, int);
int set_cloexec(int fd) {
  int val;
  if ((val = fcntl(fd, F_GETFD, 0)) < 0)
    return (-1);
  val |= FD_CLOEXEC;
  return (fcntl(fd, F_SETFD, val));
}


x86 assembly (clang, -O0):
<set_cloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1146 <set_cloexec+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <set_cloexec+0x5c>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cloexec>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
test   %eax,%eax
js     1143 <set_cloexec+0x33>
mov    0x2eaa(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFD = global i32 0
@FD_CLOEXEC = global i32 0
@F_SETFD = global i32 0
define i32 @set_cloexec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @F_GETFD
%7 = call i32 @fcntl(i32 %5, i32 %6, i32 0)
store i32 %7, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %18
10: ; preds = %1
%11 = load i32, i32* @FD_CLOEXEC
%12 = load i32, i32* %4
%13 = or i32 %12, %11
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = load i32, i32* @F_SETFD
%16 = load i32, i32* %4
%17 = call i32 @fcntl(i32 %14, i32 %15, i32 %16)
store i32 %17, i32* %2
br label %18
18: ; preds = %10, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@F_GETFD = global i32 0
@FD_CLOEXEC = global i32 0
@F_SETFD = global i32 0
define i32 @set_cloexec(i32 %0) {
%2 = load i32, i32* @F_GETFD
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @FD_CLOEXEC
%7 = or i32 %6, %3
%8 = load i32, i32* @F_SETFD
%9 = tail call i32 @fcntl(i32 %0, i32 %8, i32 %7)
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ -1, %1 ]
ret i32 %11
}
int __ev_cmp_changed() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__ev_cmp_changed() {
ret i32 0
}
char *get_first_ethernet() { return "eth0"; }


x86 assembly (clang, -O0):
<get_first_ethernet>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_first_ethernet>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"eth0\00"
define i8* @get_first_ethernet() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"eth0\00"
define i8* @get_first_ethernet() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t asrl1(int64_t x) { return x >> 1; }


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

x86 assembly (clang, -O2):
<asrl1>:
mov    %edi,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @asrl1(i32 %0) {
%2 = ashr i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int f304(int *);
int f305(int *p) { return f304(p); }


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

x86 assembly (clang, -O2):
<f305>:
jmp    1030 <f304@plt>

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

LLVM IR (-O2):
define i32 @f305(i32* %0) {
%2 = tail call i32 @f304(i32* %0)
ret i32 %2
}
/* Type definitions */
struct fpga_bits {
  int dummy;
};

/* Variables and functions */
void frame_clear_bit(scalar_t__, int);
scalar_t__ get_first_minor(struct fpga_bits *, int, int);
void clear_bit(struct fpga_bits *bits, int row, int major, int minor,
               int bit_i) {
  return frame_clear_bit(get_first_minor(bits, row, major) + minor * (65 * 2),
                         bit_i);
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <get_first_minor@plt>
mov    %rax,%rdi
imul   $0x82,-0x14(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0x18(%rbp),%esi
call   1040 <frame_clear_bit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
push   %rbp
push   %rbx
push   %rax
mov    %r8d,%ebp
mov    %ecx,%ebx
call   1030 <get_first_minor@plt>
mov    %ebx,%ecx
shl    $0x7,%ecx
lea    (%rcx,%rbx,2),%ecx
movslq %ecx,%rdi
add    %rax,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <frame_clear_bit@plt>

LLVM IR (-O0):
%struct.fpga_bits = type { i32 }
define void @clear_bit(%struct.fpga_bits* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.fpga_bits*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.fpga_bits* %0, %struct.fpga_bits** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.fpga_bits*, %struct.fpga_bits** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i64 @get_first_minor(%struct.fpga_bits* %11, i32 %12, i32 %13)
%15 = load i32, i32* %9
%16 = mul nsw i32 %15, 130
%17 = sext i32 %16 to i64
%18 = add nsw i64 %14, %17
%19 = load i32, i32* %10
ret void
}

LLVM IR (-O2):
%struct.fpga_bits = type { i32 }
define void @clear_bit(%struct.fpga_bits* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i64 @get_first_minor(%struct.fpga_bits* %0, i32 %1, i32 %2)
%7 = mul nsw i32 %3, 130
%8 = sext i32 %7 to i64
%9 = add nsw i64 %6, %8
tail call void @frame_clear_bit(i64 %9, i32 %4)
ret void
}
__attribute__((no)) unsigned int f(unsigned int x) { return x; }


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

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
char *malloc(int);
char *XGetAtomName(void *display, void *atom) {
  int size;
  if (size <= 0)
    while (1)
      ;
  return malloc(size);
}


x86 assembly (clang, -O0):
<XGetAtomName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1134 <XGetAtomName+0x24>
jmp    112f <XGetAtomName+0x1f>
jmp    112f <XGetAtomName+0x1f>
mov    -0x14(%rbp),%edi
call   1030 <malloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XGetAtomName>:
jmp    1100 <XGetAtomName>

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

LLVM IR (-O2):
define noalias i8* @XGetAtomName(i8* nocapture readnone %0, i8* nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  for (int x = 0; x < argc; x++)
    printf("%s\n", argv[x]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <main+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1145 <main+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
int /*<<< orphan*/ required_check();
unsigned long long int range(unsigned long long int x, int y) {
  y &= 3;
  x >>= sizeof(long long int) * 8 - 1 - y;
  if (x > 15)
    link_error();
  if (x == 15)
    required_check();
  return x;
}


x86 assembly (clang, -O0):
<range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    $0x3f,%ecx
sub    %rax,%rcx
mov    -0x8(%rbp),%rax
shr    %cl,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0xf,-0x8(%rbp)
jbe    1161 <range+0x41>
mov    $0x0,%al
call   1040 <link_error@plt>
cmpq   $0xf,-0x8(%rbp)
jne    1173 <range+0x53>
mov    $0x0,%al
call   1030 <required_check@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range>:
push   %rbx
mov    %esi,%ecx
mov    %rdi,%rbx
and    $0x3,%cl
xor    $0x3f,%cl
shr    %cl,%rbx
cmp    $0xf,%rbx
jne    112c <range+0x1c>
xor    %eax,%eax
call   1030 <required_check@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @range(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 3
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = sub i64 63, %8
%10 = load i64, i64* %3
%11 = lshr i64 %10, %9
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = icmp ugt i64 %12, 15
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 (...) @link_error()
br label %16
16: ; preds = %14, %2
%17 = load i64, i64* %3
%18 = icmp eq i64 %17, 15
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 (...) @required_check()
br label %21
21: ; preds = %19, %16
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
define i64 @range(i64 %0, i32 %1) {
%3 = and i32 %1, 3
%4 = xor i32 %3, 63
%5 = zext i32 %4 to i64
%6 = lshr i64 %0, %5
%7 = icmp eq i64 %6, 15
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (...) @required_check()
br label %10
10: ; preds = %8, %2
ret i64 %6
}
/* Type definitions */
struct tree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_tree(int /*<<< orphan*/, struct tree *);
struct tree **read_tree_pos();
void print() {
  struct tree **tree_pos = read_tree_pos();
  print_tree(0, *tree_pos);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <read_tree_pos@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
xor    %edi,%edi
call   1040 <print_tree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rax
xor    %eax,%eax
call   1030 <read_tree_pos@plt>
mov    (%rax),%rsi
xor    %edi,%edi
pop    %rax
jmp    1040 <print_tree@plt>

LLVM IR (-O0):
%struct.tree = type { i32 }
define void @print() {
%1 = alloca %struct.tree**
%2 = call %struct.tree** (...) @read_tree_pos()
store %struct.tree** %2, %struct.tree*** %1
%3 = load %struct.tree**, %struct.tree*** %1
%4 = load %struct.tree*, %struct.tree** %3
%5 = call i32 @print_tree(i32 0, %struct.tree* %4)
ret void
}

LLVM IR (-O2):
%struct.tree = type { i32 }
define void @print() {
%1 = tail call %struct.tree** (...) @read_tree_pos()
%2 = load %struct.tree*, %struct.tree** %1
%3 = tail call i32 @print_tree(i32 0, %struct.tree* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *xmalloc(size_t);
void *xzalloc(size_t size) {
  void *ret = xmalloc(size);
  memset(ret, 0, size);
  return ret;
}


x86 assembly (clang, -O0):
<xzalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xzalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @xzalloc(i64 %0) {
%2 = tail call i8* @xmalloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
float abs(float);
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(float);
void main() {
  float xx = abs(4.);
  print("xx 4.000000");
  xx = abs(-xx);
  printid(xx);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xec0(%rip),%xmm0
call   1030 <abs@plt>
movss  %xmm0,-0x4(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <print@plt>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <abs@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1050 <printid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movss  0xec4(%rip),%xmm0
call   1030 <abs@plt>
movaps %xmm0,(%rsp)
lea    0xed4(%rip),%rdi
call   1040 <print@plt>
movaps (%rsp),%xmm0
xorps  0xeb4(%rip),%xmm0
call   1030 <abs@plt>
add    $0x18,%rsp
jmp    1050 <printid@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"xx 4.000000\00"
define void @main() {
%1 = alloca float
%2 = call float @abs(float 4.000000e+00)
store float %2, float* %1
%3 = call i32 @print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = load float, float* %1
%5 = fneg float %4
%6 = call float @abs(float %5)
store float %6, float* %1
%7 = load float, float* %1
%8 = call i32 @printid(float %7)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"xx 4.000000\00"
define void @main() {
%1 = tail call float @abs(float 4.000000e+00)
%2 = tail call i32 @print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = fneg float %1
%4 = tail call float @abs(float %3)
%5 = tail call i32 @printid(float %4)
ret void
}
void GPIOPortD_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<GPIOPortD_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <GPIOPortD_Handler+0x9>
jmp    1109 <GPIOPortD_Handler+0x9>

x86 assembly (clang, -O2):
<GPIOPortD_Handler>:
jmp    1100 <GPIOPortD_Handler>

LLVM IR (-O0):
define void @GPIOPortD_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @GPIOPortD_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
__attribute__((no)) void bar(void) {}


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

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

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

LLVM IR (-O2):
define void @bar() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ non_existent(int);
__attribute__((__optimize__("O2"))) void hiphip(void (*f)()) {
  non_existent(2);
  f();
}


x86 assembly (clang, -O0):
<hiphip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
call   1030 <non_existent@plt>
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hiphip>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edi
call   1030 <non_existent@plt>
xor    %eax,%eax
mov    %rbx,%rcx
pop    %rbx
jmp    *%rcx

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

LLVM IR (-O2):
define void @hiphip(void (...)* nocapture %0) {
%2 = tail call i32 @non_existent(i32 2)
tail call void (...) %0()
ret void
}
void BIO_puts(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_puts() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void f4(double di, double d, double *dd) {
  if (d == 0 && di == 0)
    *dd = 0;
  bar();
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1161 <f4+0x51>
jp     1161 <f4+0x51>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1161 <f4+0x51>
jp     1161 <f4+0x51>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    112b <f4+0x1b>
jp     112b <f4+0x1b>
ucomisd %xmm2,%xmm1
jne    112b <f4+0x1b>
jp     112b <f4+0x1b>
movq   $0x0,(%rdi)
xor    %eax,%eax
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define void @f4(double %0, double %1, double* nocapture writeonly %2) {
%4 = fcmp oeq double %1, 0.000000e+00
%5 = fcmp oeq double %0, 0.000000e+00
%6 = and i1 %5, %4
br i1 %6, label %7, label %8
7: ; preds = %3
store double 0.000000e+00, double* %2
br label %8
8: ; preds = %7, %3
%9 = tail call i32 (...) @bar()
ret void
}
int test_imm_B6int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xB6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B6int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11927552
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ test_heap();
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  srand(time(NULL));
  test_heap();
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <test_heap@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
%3 = call i32 (...) @test_heap()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @test_heap()
ret i32 0
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("The value of EOF is %d\n", EOF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"The value of EOF is %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @EOF
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"The value of EOF is %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
unsigned int test5(unsigned int e) { return (e | 4) & 6; }


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x4,%eax
and    $0x6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
and    $0x2,%edi
lea    0x4(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @test5(i32 %0) {
%2 = and i32 %0, 2
%3 = or i32 %2, 4
ret i32 %3
}