xunge/DecIR huggingface dataset:
int dot_product(v1, v2)
float v1[], v2[];
{
  float result = 0.0;
  result = v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
  return (result);
  return (1);
}


x86 assembly (clang, -O0):
<dot_product>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
cvttss2si -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot_product>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
mulss  0x4(%rsi),%xmm1
mulss  (%rsi),%xmm0
movss  0x8(%rdi),%xmm2
mulss  0x8(%rsi),%xmm2
addss  %xmm1,%xmm0
addss  %xmm0,%xmm2
cvttss2si %xmm2,%eax
ret

LLVM IR (-O0):
define i32 @dot_product(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
store float* %0, float** %3
store float* %1, float** %4
store float 0.000000e+00, float* %5
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %4
%10 = getelementptr inbounds float, float* %9, i64 0
%11 = load float, float* %10
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 1
%17 = load float, float* %16
%18 = fmul float %14, %17
%19 = call float @llvm.fmuladd.f32(float %8, float %11, float %18)
%20 = load float*, float** %3
%21 = getelementptr inbounds float, float* %20, i64 2
%22 = load float, float* %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 2
%25 = load float, float* %24
%26 = call float @llvm.fmuladd.f32(float %22, float %25, float %19)
store float %26, float* %5
%27 = load float, float* %5
%28 = fptosi float %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @dot_product(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
%16 = fptosi float %15 to i32
ret i32 %16
}
void X509_PURPOSE_get_count(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_PURPOSE_get_count() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
double word64ToDouble(uint64_t input) {
  union {
    double d;
    uint64_t l;
  } u;
  u.l = input;
  return u.d;
}


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

x86 assembly (clang, -O2):
<word64ToDouble>:
mov    %edi,%eax
movq   %rax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { double }
define double @word64ToDouble(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = bitcast %union.anon* %3 to i32*
store i32 %4, i32* %5
%6 = bitcast %union.anon* %3 to double*
%7 = load double, double* %6
ret double %7
}

LLVM IR (-O2):
define double @word64ToDouble(i32 %0) {
%2 = zext i32 %0 to i64
%3 = bitcast i64 %2 to double
ret double %3
}
char *inclib(void) { return ""; }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @inclib() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @inclib() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int __u_char;

/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/, int);
int cbm_open(int f, __u_char dev, __u_char secadr) {
  return ioctl(f, _IO(0xcb, 4), (dev << 8) | secadr);
}


x86 assembly (clang, -O0):
<cbm_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0xcb,%edi
mov    $0x4,%esi
call   1030 <_IO@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
shl    $0x8,%edx
or     -0xc(%rbp),%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbm_open>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    $0xcb,%edi
mov    $0x4,%esi
call   1030 <_IO@plt>
shl    $0x8,%ebp
or     %ebp,%ebx
mov    %r14d,%edi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @cbm_open(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @_IO(i32 203, i32 4)
%9 = load i32, i32* %5
%10 = shl i32 %9, 8
%11 = load i32, i32* %6
%12 = or i32 %10, %11
%13 = call i32 @ioctl(i32 %7, i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @cbm_open(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_IO(i32 203, i32 4)
%5 = shl i32 %1, 8
%6 = or i32 %5, %2
%7 = tail call i32 @ioctl(i32 %0, i32 %4, i32 %6)
ret i32 %7
}
int main(int argc, char *argv[]) {
  int a = 0;
  int i = 0;
  int c = 0;
  while (i < 5) {
    i++;
    c = 0;
    while (c < 3) {
      c++;
    }
    a++;
  }
  c = i;
  if (a < 5) {
  ERROR:
    goto ERROR;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x5,-0x18(%rbp)
jge    1167 <main+0x67>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    1159 <main+0x59>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1141 <main+0x41>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <main+0x27>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1181 <main+0x81>
jmp    117c <main+0x7c>
jmp    117c <main+0x7c>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int readlink(char *, char *, unsigned long);
int _getExecPath(char *path, unsigned long maxlen) {
  return readlink("/proc/self/exe", path, maxlen);
}


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

x86 assembly (clang, -O2):
<_getExecPath>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <readlink@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"/proc/self/exe\00"
define i32 @_getExecPath(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5, i64 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [15 x i8] c"/proc/self/exe\00"
define i32 @_getExecPath(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;
typedef int int64_t;

/* Variables and functions */
int var_put_u64(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, int);
int var_put_s64(uint8_t *cp, const uint8_t *endp, int64_t i) {
  return var_put_u64(cp, endp, ((uint64_t)i << 1) ^ (i >> 63));
}


x86 assembly (clang, -O0):
<var_put_s64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
shl    $0x1,%edx
mov    -0x14(%rbp),%eax
mov    $0x3f,%ecx
sar    %cl,%eax
xor    %eax,%edx
call   1030 <var_put_u64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<var_put_s64>:
jmp    1030 <var_put_u64@plt>

LLVM IR (-O0):
define i32 @var_put_s64(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = shl i32 %9, 1
%11 = load i32, i32* %6
%12 = ashr i32 %11, 63
%13 = xor i32 %10, %12
%14 = call i32 @var_put_u64(i32* %7, i32* %8, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @var_put_s64(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @var_put_u64(i32* %0, i32* %1, i32 poison)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ internal_sleep(unsigned int);
int /*<<< orphan*/ myusec_delay(unsigned int);
void internal_delay(unsigned int usecs) {
  if (usecs > 1000000) {
    internal_sleep(usecs);
  } else {
    myusec_delay(usecs);
  }
}


x86 assembly (clang, -O0):
<internal_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xf4240,-0x4(%rbp)
jbe    1145 <internal_delay+0x25>
mov    -0x4(%rbp),%edi
call   1040 <internal_sleep@plt>
jmp    114d <internal_delay+0x2d>
mov    -0x4(%rbp),%edi
call   1030 <myusec_delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_delay>:
cmp    $0xf4241,%edi
jb     112d <internal_delay+0xd>
jmp    1040 <internal_sleep@plt>
jmp    1030 <myusec_delay@plt>

LLVM IR (-O0):
define void @internal_delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 1000000
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @internal_sleep(i32 %6)
br label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @myusec_delay(i32 %9)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @internal_delay(i32 %0) {
%2 = icmp ugt i32 %0, 1000000
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @internal_sleep(i32 %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @myusec_delay(i32 %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int /*<<< orphan*/);
void t_isodigit_0x00() {
  Assert_real((isodigit(0) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              5, ("isodigit should be 0 for 0x00"));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec2(%rip),%rsi
mov    $0x5,%edx
lea    0xf5f(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %edi,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec8(%rip),%rsi
lea    0xf6a(%rip),%rcx
mov    $0x5,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x00\00"
define void @t_isodigit_0x00() {
%1 = call i64 @isodigit(i32 0)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x00\00"
define void @t_isodigit_0x00() {
%1 = tail call i64 @isodigit(i32 0)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void finalize(int *l) { ; }


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

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

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

LLVM IR (-O2):
define void @finalize(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_f2u32(float);
int /*<<< orphan*/ rgph_u32_murmur32s_u32(int /*<<< orphan*/, uintptr_t);
uint32_t rgph_u32_murmur32s_f32(float value, uintptr_t seed) {
  return rgph_u32_murmur32s_u32(rgph_f2u32(value), seed);
}


x86 assembly (clang, -O0):
<rgph_u32_murmur32s_f32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <rgph_f2u32@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <rgph_u32_murmur32s_u32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u32_murmur32s_f32>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rgph_f2u32@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <rgph_u32_murmur32s_u32@plt>

LLVM IR (-O0):
define i32 @rgph_u32_murmur32s_f32(float %0, i64 %1) {
%3 = alloca float
%4 = alloca i64
store float %0, float* %3
store i64 %1, i64* %4
%5 = load float, float* %3
%6 = call i32 @rgph_f2u32(float %5)
%7 = load i64, i64* %4
%8 = call i32 @rgph_u32_murmur32s_u32(i32 %6, i64 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @rgph_u32_murmur32s_f32(float %0, i64 %1) {
%3 = tail call i32 @rgph_f2u32(float %0)
%4 = tail call i32 @rgph_u32_murmur32s_u32(i32 %3, i64 %1)
ret i32 %4
}
/* Variables and functions */
char getchar();
void clean_buffer(void) {
  while (getchar() != '\n')
    continue;
}


x86 assembly (clang, -O0):
<clean_buffer>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <clean_buffer+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <clean_buffer+0x21>
jmp    1119 <clean_buffer+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_buffer>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <clean_buffer+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @clean_buffer() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @clean_buffer() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void raext1024() {
  printf("\nChanging Read Ahead Cache size for External sdcard to 1024kb\n");
  char buf[256];
  sprintf(buf, "/system/bin/sh -c %s",
          "'echo 1024 > /sys/block/mmcblk1/queue/read_ahead_kb'");
  system(buf);
}


x86 assembly (clang, -O0):
<raext1024>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    0xeea(%rip),%rsi
lea    0xef8(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raext1024>:
push   %rbx
sub    $0x100,%rsp
lea    0xf0b(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [63 x i8] c"\0AChanging Read Ahead Cache size for External sdcard to 1024kb\0A\00"
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [53 x i8] c"'echo 1024 > /sys/block/mmcblk1/queue/read_ahead_kb'\00"
define void @raext1024() {
%1 = alloca [256 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [53 x i8] c"'echo 1024 > /sys/block/mmcblk1/queue/read_ahead_kb'\00"
@str = [62 x i8] c"\0AChanging Read Ahead Cache size for External sdcard to 1024kb\00"
define void @raext1024() {
%1 = alloca [256 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *, char const *,
                          char const *);
void mergeBranch(const char *branchName, const char *type, const char *into) {
  printf("git merge --no-ff %s -m \"Merge %s branch '%s' into '%s'\"\n",
         branchName, type, branchName, into);
}


x86 assembly (clang, -O0):
<mergeBranch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeBranch>:
mov    %rdx,%r8
mov    %rsi,%rdx
mov    %rdi,%rcx
lea    0xee0(%rip),%rdi
mov    %rcx,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"git merge --no-ff %s -m \22Merge %s branch '%s' into '%s'\22\0A\00"
define void @mergeBranch(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = load i8*, i8** %6
%11 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [58 x i8] c"git merge --no-ff %s -m \22Merge %s branch '%s' into '%s'\22\0A\00"
define void @mergeBranch(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %0, i8* %2)
ret void
}
/* Variables and functions */
int other_main(int, char **);
int main(int argc, char **argv) { return other_main(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <other_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <other_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @other_main(i32 %0, i8** %1)
ret i32 %3
}
int MAIN() {
  int g_a;
  int l_a;
  f();
  l_a = 4;
  write(l_a);
  write("\n");
  g_a = l_a;
  write(g_a);
  write("\n");
  f_p();
  return 0;
}


x86 assembly (clang, -O0):
<MAIN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <f@plt>
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <write@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <write@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <write@plt>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <write@plt>
mov    $0x0,%al
call   1030 <f_p@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAIN>:
push   %rbx
xor    %eax,%eax
call   1050 <f@plt>
mov    $0x4,%edi
xor    %eax,%eax
call   1040 <write@plt>
lea    0xeb5(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <write@plt>
mov    $0x4,%edi
xor    %eax,%eax
call   1040 <write@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <f_p@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @MAIN() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @f()
store i32 4, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @write to i32 (i32, ...)*)(i32 %4)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @write to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %2
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = call i32 (i32, ...) bitcast (i32 (...)* @write to i32 (i32, ...)*)(i32 %8)
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @write to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @f_p()
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @MAIN() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @write to i32 (i32, ...)*)(i32 4)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @write to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @write to i32 (i32, ...)*)(i32 4)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @write to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @f_p()
ret i32 0
}
void ff_hevc_put_hevc_uni_epel_hv64_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_hv64_10_sse4() {
ret void
}
/* Variables and functions */
float math_fabs(float);
float call_fabs(float x) { return math_fabs(x); }


x86 assembly (clang, -O0):
<call_fabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <math_fabs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_fabs>:
jmp    1030 <math_fabs@plt>

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

LLVM IR (-O2):
define float @call_fabs(float %0) {
%2 = tail call float @math_fabs(float %0)
ret float %2
}
void invoke_service_ocall() {}


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

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

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

LLVM IR (-O2):
define void @invoke_service_ocall() {
ret void
}
int set_sta_wep_key(int radio) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @set_sta_wep_key(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _IO(char, int);
int ioctl(int, int /*<<< orphan*/);
int beaglelogic_start(int fd) { return ioctl(fd, _IO('k', 0x29)); }


x86 assembly (clang, -O0):
<beaglelogic_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x6b,%edi
mov    $0x29,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beaglelogic_start>:
push   %rbx
mov    %edi,%ebx
mov    $0x6b,%edi
mov    $0x29,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @beaglelogic_start(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i8 signext 107, i32 41)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @beaglelogic_start(i32 %0) {
%2 = tail call i32 @_IO(i8 signext 107, i32 41)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int __attribute__((no)) foo(int a, int b) {
  int c = a ^ b;
  if (c == a)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113a <foo+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %2
ret i32 undef
}
void *__emutls_get_address(void) { return 0xdeadbeef; }


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

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

LLVM IR (-O0):
define i8* @__emutls_get_address() {
ret i8* inttoptr (i64 3735928559 to i8*)
}

LLVM IR (-O2):
define i8* @__emutls_get_address() {
ret i8* inttoptr (i64 3735928559 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("这是我的第一个C程序\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"\E8\BF\99\E6\98\AF\E6\88\91\E7\9A\84\E7\AC\AC\E4\B8\80\E4\B8\AAC\E7\A8\8B\E5\BA\8F\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"\E8\BF\99\E6\98\AF\E6\88\91\E7\9A\84\E7\AC\AC\E4\B8\80\E4\B8\AAC\E7\A8\8B\E5\BA\8F\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int isletter(c)
char c;
{ return (isalpha(c) || isdigit(c) || c == '_'); }


x86 assembly (clang, -O0):
<isletter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isalpha@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    116d <isletter+0x4d>
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    116d <isletter+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isletter>:
push   %rbp
push   %rbx
push   %rax
movsbl %dil,%ebx
mov    %edi,%ebp
shl    $0x18,%ebp
mov    %ebx,%edi
call   1030 <isalpha@plt>
test   %eax,%eax
setne  %al
add    $0xffffffd0,%ebx
cmp    $0xa,%ebx
setb   %cl
or     %al,%cl
cmp    $0x5f000000,%ebp
sete   %al
or     %cl,%al
movzbl %al,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isletter(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = call i32 @isalpha(i32 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %1
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = call i32 @isdigit(i32 %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 95
br label %17
17: ; preds = %13, %8, %1
%18 = phi i1 [ true, %8 ], [ true, %1 ], [ %16, %13 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @isletter(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = tail call i32 @isalpha(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = add nsw i32 %3, -48
%7 = icmp ult i32 %6, 10
%8 = select i1 %5, i1 true, i1 %7
%9 = icmp eq i32 %2, 1593835520
%10 = or i1 %9, %8
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ glWindowPos4f(short, short, short, int);
void glWindowPos3s(short x, short y, short z) { glWindowPos4f(x, y, z, 1); }


x86 assembly (clang, -O0):
<glWindowPos3s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x4(%rbp),%ax
mov    $0x1,%ecx
movswl %dx,%edi
movswl %ax,%esi
movswl -0x6(%rbp),%edx
call   1030 <glWindowPos4f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glWindowPos3s>:
mov    $0x1,%ecx
jmp    1030 <glWindowPos4f@plt>

LLVM IR (-O0):
define void @glWindowPos3s(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i16, i16* %4
%8 = load i16, i16* %5
%9 = load i16, i16* %6
%10 = call i32 @glWindowPos4f(i16 signext %7, i16 signext %8, i16 signext %9, i32 1)
ret void
}

LLVM IR (-O2):
define void @glWindowPos3s(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = tail call i32 @glWindowPos4f(i16 signext %0, i16 signext %1, i16 signext %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_TRIANGLES;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glColor4f(double, double, double, double);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex3f(double, double, double);
void alpha_drawRightTriangle(void) {
  glBegin(GL_TRIANGLES);
  glColor4f(0.0, 1.0, 1.0, 0.75);
  glVertex3f(0.9, 0.9, 0.0);
  glVertex3f(0.3, 0.5, 0.0);
  glVertex3f(0.9, 0.1, 0.0);
  glEnd();
}


x86 assembly (clang, -O0):
<alpha_drawRightTriangle>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
xorps  %xmm0,%xmm0
movsd  0xec3(%rip),%xmm2
movsd  0xec3(%rip),%xmm3
movaps %xmm2,%xmm1
call   1030 <glColor4f@plt>
movsd  0xe8b(%rip),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm0
call   1040 <glVertex3f@plt>
movsd  0xe88(%rip),%xmm0
movsd  0xe88(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
movsd  0xe60(%rip),%xmm0
movsd  0xe60(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
mov    $0x0,%al
call   1050 <glEnd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<alpha_drawRightTriangle>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
movsd  0xea9(%rip),%xmm1
movsd  0xea9(%rip),%xmm3
xorps  %xmm0,%xmm0
movaps %xmm1,%xmm2
call   1030 <glColor4f@plt>
movsd  0xe9e(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm1
call   1040 <glVertex3f@plt>
movsd  0xe93(%rip),%xmm0
movsd  0xe93(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
movsd  0xe8b(%rip),%xmm1
xorps  %xmm2,%xmm2
movsd  0xe68(%rip),%xmm0
call   1040 <glVertex3f@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glEnd@plt>

LLVM IR (-O0):
@GL_TRIANGLES = global i32 0
define void @alpha_drawRightTriangle() {
%1 = load i32, i32* @GL_TRIANGLES
%2 = call i32 @glBegin(i32 %1)
%3 = call i32 @glColor4f(double 0.000000e+00, double 1.000000e+00, double 1.000000e+00, double 7.500000e-01)
%4 = call i32 @glVertex3f(double 9.000000e-01, double 9.000000e-01, double 0.000000e+00)
%5 = call i32 @glVertex3f(double 3.000000e-01, double 5.000000e-01, double 0.000000e+00)
%6 = call i32 @glVertex3f(double 9.000000e-01, double 1.000000e-01, double 0.000000e+00)
%7 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_TRIANGLES = global i32 0
define void @alpha_drawRightTriangle() {
%1 = load i32, i32* @GL_TRIANGLES
%2 = tail call i32 @glBegin(i32 %1)
%3 = tail call i32 @glColor4f(double 0.000000e+00, double 1.000000e+00, double 1.000000e+00, double 7.500000e-01)
%4 = tail call i32 @glVertex3f(double 9.000000e-01, double 9.000000e-01, double 0.000000e+00)
%5 = tail call i32 @glVertex3f(double 3.000000e-01, double 5.000000e-01, double 0.000000e+00)
%6 = tail call i32 @glVertex3f(double 9.000000e-01, double 1.000000e-01, double 0.000000e+00)
%7 = tail call i32 (...) @glEnd()
ret void
}
/* Variables and functions */
scalar_t__ is_cap(char);
char to_lowercase(char value) {
  if (is_cap(value)) {
    return value + 32;
  }
  return value;
}


x86 assembly (clang, -O0):
<to_lowercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <is_cap@plt>
cmp    $0x0,%rax
je     1140 <to_lowercase+0x30>
movsbl -0x2(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1146 <to_lowercase+0x36>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_lowercase>:
push   %rbx
mov    %edi,%ebx
call   1030 <is_cap@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
movzbl %cl,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @to_lowercase(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @is_cap(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = add nsw i32 %9, 32
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %14
12: ; preds = %1
%13 = load i8, i8* %3
store i8 %13, i8* %2
br label %14
14: ; preds = %12, %7
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @to_lowercase(i8 signext %0) {
%2 = tail call i64 @is_cap(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %0, i8 %4
ret i8 %5
}
/* Variables and functions */
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char *strchr(char *, char);
char *mygetline(char *line, int size) {
  if (fgets(line, size, stdin)) {
    char *newline = strchr(line, '\n');
    if (newline) {
      *newline = '\0';
    }
  }
  return line;
}


x86 assembly (clang, -O0):
<mygetline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     1177 <mygetline+0x57>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1172 <mygetline+0x52>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
jmp    1177 <mygetline+0x57>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mygetline>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
test   %rax,%rax
je     114c <mygetline+0x2c>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     114c <mygetline+0x2c>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i8* @mygetline(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = load i32, i32* @stdin
%9 = call i64 @fgets(i8* %6, i32 %7, i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i8* @strchr(i8* %12, i8 signext 10)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = load i8*, i8** %5
store i8 0, i8* %17
br label %18
18: ; preds = %16, %11
br label %19
19: ; preds = %18, %2
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@stdin = global i32 0
define i8* @mygetline(i8* returned %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i64 @fgets(i8* %0, i32 %1, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%8 = icmp eq i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %6
store i8 0, i8* %7
br label %10
10: ; preds = %6, %9, %2
ret i8* %0
}
/* Type definitions */
typedef int Elf64_Xword;
typedef int Elf64_Addr;

/* Variables and functions */
int align_down(Elf64_Addr addr, Elf64_Xword align, Elf64_Addr *out_result) {
  if (align > 0 && (align & (align - 1)) == 0) {
    *out_result = addr & -align;
    return 0;
  } else
    return 1;
}


x86 assembly (clang, -O0):
<align_down>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1148 <align_down+0x48>
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1148 <align_down+0x48>
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
sub    -0xc(%rbp),%eax
and    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    114f <align_down+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_down>:
mov    $0x1,%eax
test   %esi,%esi
jle    1159 <align_down+0x59>
mov    %esi,%r8d
shr    %r8d
and    $0x55555555,%r8d
mov    %esi,%r9d
sub    %r8d,%r9d
mov    %r9d,%r8d
and    $0x33333333,%r8d
shr    $0x2,%r9d
and    $0x33333333,%r9d
add    %r8d,%r9d
mov    %r9d,%ecx
shr    $0x4,%ecx
add    %r9d,%ecx
and    $0xf0f0f0f,%ecx
imul   $0x1010101,%ecx,%ecx
shr    $0x18,%ecx
cmp    $0x1,%ecx
ja     1159 <align_down+0x59>
neg    %esi
and    %edi,%esi
mov    %esi,(%rdx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @align_down(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* %6
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %3
%11 = load i32, i32* %6
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, 1
%14 = and i32 %11, %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %10
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = sub nsw i32 0, %18
%20 = and i32 %17, %19
%21 = load i32*, i32** %7
store i32 %20, i32* %21
store i32 0, i32* %4
br label %23
22: ; preds = %10, %3
store i32 1, i32* %4
br label %23
23: ; preds = %22, %16
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @align_down(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp sgt i32 %1, 0
%5 = tail call i32 @llvm.ctpop.i32(i32 %1)
%6 = icmp ult i32 %5, 2
%7 = and i1 %4, %6
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = sub nsw i32 0, %1
%10 = and i32 %9, %0
store i32 %10, i32* %2
br label %11
11: ; preds = %3, %8
%12 = phi i32 [ 0, %8 ], [ 1, %3 ]
ret i32 %12
}
int nand_wait_rb_before(void) { return 0 ? 1 : 0; }


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

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

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

LLVM IR (-O2):
define i32 @nand_wait_rb_before() {
ret i32 0
}
/* Variables and functions */
void *realloc(void *, size_t);
void *rpl_realloc(void *ptr, size_t n) {
  if (n == 0)
    n = 1;
  return realloc(ptr, n);
}


x86 assembly (clang, -O0):
<rpl_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <rpl_realloc+0x23>
movq   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpl_realloc>:
test   %rsi,%rsi
mov    $0x1,%eax
cmove  %rax,%rsi
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @rpl_realloc(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = select i1 %3, i64 1, i64 %1
%5 = tail call i8* @realloc(i8* %0, i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
void printhexdigit(char *ptr, unsigned int d) {
  if (d > 9)
    d += 'A' - 10;
  else
    d += '0';
  sprintf(ptr, "%c", d);
}


x86 assembly (clang, -O0):
<printhexdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jbe    1137 <printhexdigit+0x27>
mov    -0xc(%rbp),%eax
add    $0x37,%eax
mov    %eax,-0xc(%rbp)
jmp    1140 <printhexdigit+0x30>
mov    -0xc(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xeb2(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printhexdigit>:
lea    0x30(%rsi),%eax
lea    0x37(%rsi),%ecx
cmp    $0xa,%esi
cmovb  %eax,%ecx
mov    %cl,(%rdi)
movb   $0x0,0x1(%rdi)
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @printhexdigit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ugt i32 %5, 9
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = add i32 %8, 55
store i32 %9, i32* %4
br label %13
10: ; preds = %2
%11 = load i32, i32* %4
%12 = add i32 %11, 48
store i32 %12, i32* %4
br label %13
13: ; preds = %10, %7
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
ret void
}

LLVM IR (-O2):
define void @printhexdigit(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp ugt i32 %1, 9
%4 = select i1 %3, i32 55, i32 48
%5 = add i32 %4, %1
%6 = trunc i32 %5 to i8
store i8 %6, i8* %0
%7 = getelementptr i8, i8* %0, i64 1
store i8 0, i8* %7
ret void
}
unsigned char RussianToLower(unsigned char symb) {
  if ((symb >= 128) && (symb <= 143)) {
    symb += 32;
  } else if ((symb >= 144) && (symb <= 159)) {
    symb += 80;
  }
  return symb;
}


x86 assembly (clang, -O0):
<RussianToLower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x80,%eax
jl     1137 <RussianToLower+0x37>
movzbl -0x1(%rbp),%eax
cmp    $0x8f,%eax
jg     1137 <RussianToLower+0x37>
movzbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1164 <RussianToLower+0x64>
movzbl -0x1(%rbp),%eax
cmp    $0x90,%eax
jl     115f <RussianToLower+0x5f>
movzbl -0x1(%rbp),%eax
cmp    $0x9f,%eax
jg     115f <RussianToLower+0x5f>
movzbl -0x1(%rbp),%eax
add    $0x50,%eax
mov    %al,-0x1(%rbp)
jmp    1164 <RussianToLower+0x64>
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RussianToLower>:
mov    %edi,%eax
cmp    $0x8f,%al
jg     1109 <RussianToLower+0x9>
add    $0x20,%al
ret
lea    0x50(%rax),%ecx
movzbl %al,%edx
and    $0xf0,%al
cmp    $0x90,%al
movzbl %cl,%eax
cmovne %edx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @RussianToLower(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 128
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 143
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = add nsw i32 %12, 32
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %29
15: ; preds = %6, %1
%16 = load i8, i8* %2
%17 = zext i8 %16 to i32
%18 = icmp sge i32 %17, 144
br i1 %18, label %19, label %28
19: ; preds = %15
%20 = load i8, i8* %2
%21 = zext i8 %20 to i32
%22 = icmp sle i32 %21, 159
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %2
%25 = zext i8 %24 to i32
%26 = add nsw i32 %25, 80
%27 = trunc i32 %26 to i8
store i8 %27, i8* %2
br label %28
28: ; preds = %23, %19, %15
br label %29
29: ; preds = %28, %10
%30 = load i8, i8* %2
ret i8 %30
}

LLVM IR (-O2):
define zeroext i8 @RussianToLower(i8 zeroext %0) {
%2 = icmp slt i8 %0, -112
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = add nuw nsw i8 %0, 32
br label %10
5: ; preds = %1
%6 = and i8 %0, -16
%7 = icmp eq i8 %6, -112
%8 = add i8 %0, 80
%9 = select i1 %7, i8 %8, i8 %0
br label %10
10: ; preds = %5, %3
%11 = phi i8 [ %4, %3 ], [ %9, %5 ]
ret i8 %11
}
/* Variables and functions */
size_t ftell(void *);
size_t file_getpos(void *file) { return ftell(file); }


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

x86 assembly (clang, -O2):
<file_getpos>:
jmp    1030 <ftell@plt>

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

LLVM IR (-O2):
define i64 @file_getpos(i8* nocapture %0) {
%2 = tail call i64 @ftell(i8* %0)
ret i64 %2
}