xunge/DecIR huggingface dataset:
char *strcopy(char *s1, const char *s2) {
  char *s = s1;
  while ((*s++ = *s2++) != 0)
    ;
  return (s1);
}


x86 assembly (clang, -O0):
<strcopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcopy+0x47>
jmp    1114 <strcopy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @strcopy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
int simulated_nested_loop_more_expensive_constant(int p) {
  int k = 0;
  int t = 5;
  int j = 0;
  for (int i = 0; i < 5; i++) {
  B:
    t = 3;
    j++;
    if (j < 100)
      goto B;
    else {
      j = 0;
    }
  }
  return k;
}


x86 assembly (clang, -O0):
<simulated_nested_loop_more_expensive_constant>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    116b <simulated_nested_loop_more_expensive_constant+0x6b>
jmp    1132 <simulated_nested_loop_more_expensive_constant+0x32>
movl   $0x3,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
jge    1151 <simulated_nested_loop_more_expensive_constant+0x51>
jmp    1132 <simulated_nested_loop_more_expensive_constant+0x32>
movl   $0x0,-0x10(%rbp)
jmp    115d <simulated_nested_loop_more_expensive_constant+0x5d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <simulated_nested_loop_more_expensive_constant+0x23>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @simulated_nested_loop_more_expensive_constant(i32 %0) {
ret i32 0
}
float to_rad(const float deg) {
  return deg * (3.14159265358979323846f / 180.0f);
}


x86 assembly (clang, -O0):
<to_rad>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @to_rad(float %0) {
%2 = fmul float %0, 0x3F91DF46A0000000
ret float %2
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int dobldobl_diagonal_cascade_solutions(int a, int b) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(297, &a, &b, c);
  return fail;
}


x86 assembly (clang, -O0):
<dobldobl_diagonal_cascade_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x129,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobldobl_diagonal_cascade_solutions>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x129,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @dobldobl_diagonal_cascade_solutions(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc(i32 297, i32* %3, i32* %4, double* undef)
ret i32 %5
}
void *test_anti_range_118(signed char n) {
  extern void *alloc_anti_range_118(signed char) __attribute__((alloc_size(1)));
  if ((-0x7f - 1) + 2 <= n && n <= 0)
    n = (-0x7f - 1) + 2 - 1;
  return alloc_anti_range_118(n);
}


x86 assembly (clang, -O0):
<test_anti_range_118>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0xffffff82,%eax
cmp    %ecx,%eax
jg     1140 <test_anti_range_118+0x30>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jg     1140 <test_anti_range_118+0x30>
movb   $0x81,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <alloc_anti_range_118@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_118>:
lea    0x7e(%rdi),%eax
cmp    $0x7f,%al
mov    $0x81,%eax
cmovae %edi,%eax
movsbl %al,%edi
jmp    1030 <alloc_anti_range_118@plt>

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

LLVM IR (-O2):
define i8* @test_anti_range_118(i8 signext %0) {
%2 = add i8 %0, 126
%3 = icmp ult i8 %2, 127
%4 = select i1 %3, i8 -127, i8 %0
%5 = tail call i8* @alloc_anti_range_118(i8 signext %4)
ret i8* %5
}
int sys$cli(void *cliv, int par1, int par2) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(par2);
    register long int _a2 asm("rsi") = (long)(par1);
    register long int _a1 asm("rdi") = (long)(cliv);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(103), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$cli>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movslq -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x67,%rax
int    $0x81
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$cli>:
movslq %edx,%rdx
movslq %esi,%rsi
mov    $0x67,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$cli"(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
store i64 %13, i64* %8
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
store i64 %15, i64* %9
%16 = load i8*, i8** %4
%17 = ptrtoint i8* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 103, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @"sys$cli"(i8* %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = sext i32 %1 to i64
%6 = ptrtoint i8* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 103, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRE1_set(void) { return U_WMRCORENONE_set("U_WMRE1"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRE1\00"
define i8* @U_WMRE1_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRE1\00"
define i8* @U_WMRE1_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ prom_putchar(char);
void putc(char c) { prom_putchar(c); }


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <prom_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
jmp    1030 <prom_putchar@plt>

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

LLVM IR (-O2):
define void @putc(i8 signext %0) {
%2 = tail call i32 @prom_putchar(i8 signext %0)
ret void
}
float debuginator__floor(float v) {
  if ((int)v == v) {
    return v;
  }
  return (float)((int)v);
}


x86 assembly (clang, -O0):
<debuginator__floor>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    1131 <debuginator__floor+0x31>
jp     1131 <debuginator__floor+0x31>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113f <debuginator__floor+0x3f>
cvttss2si -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<debuginator__floor>:
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
movaps %xmm1,%xmm2
cmpeqss %xmm0,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @debuginator__floor(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fptosi float %4 to i32
%6 = sitofp i32 %5 to float
%7 = load float, float* %3
%8 = fcmp oeq float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load float, float* %3
store float %10, float* %2
br label %15
11: ; preds = %1
%12 = load float, float* %3
%13 = fptosi float %12 to i32
%14 = sitofp i32 %13 to float
store float %14, float* %2
br label %15
15: ; preds = %11, %9
%16 = load float, float* %2
ret float %16
}

LLVM IR (-O2):
define float @debuginator__floor(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fcmp oeq float %3, %0
%5 = select i1 %4, float %0, float %3
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ atomic(int /*<<< orphan*/);
void atomic_down() { atomic(0); }


x86 assembly (clang, -O0):
<atomic_down>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <atomic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_down>:
xor    %edi,%edi
jmp    1030 <atomic@plt>

LLVM IR (-O0):
define void @atomic_down() {
%1 = call i32 @atomic(i32 0)
ret void
}

LLVM IR (-O2):
define void @atomic_down() {
%1 = tail call i32 @atomic(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage(int /*<<< orphan*/);
void help(void) {
  usage(0);
  fprintf(stderr,
          "Command Summary:\n\t-f    Hash algorithm\n\t\t\t(sha1, sha256, "
          "sha512, whirlpool, ripemd)\n\n\t-h    Print this help\n\nReport "
          "bugs to: https://github.com/meschi/chashpipe\n");
  exit(1);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <usage@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
xor    %edi,%edi
call   1040 <usage@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [162 x i8] c"Command Summary:\0A\09-f Hash algorithm\0A\09\09\09(sha1, sha256, sha512, whirlpool, ripemd)\0A\0A\09-h Print this help\0A\0AReport bugs to: https://github.com/meschi/chashpipe\0A\00"
define void @help() {
%1 = call i32 @usage(i32 0)
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [162 x i8] c"Command Summary:\0A\09-f Hash algorithm\0A\09\09\09(sha1, sha256, sha512, whirlpool, ripemd)\0A\0A\09-h Print this help\0A\0AReport bugs to: https://github.com/meschi/chashpipe\0A\00"
define void @help() {
%1 = tail call i32 @usage(i32 0)
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
bool audio_valid_sample_rate(unsigned sample_rate) {
  return sample_rate > 0 && sample_rate < (1 << 30);
}


x86 assembly (clang, -O0):
<audio_valid_sample_rate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jbe    1123 <audio_valid_sample_rate+0x23>
cmpl   $0x40000000,-0x4(%rbp)
setb   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_valid_sample_rate>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x3fffffff,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @audio_valid_sample_rate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ult i32 %6, 1073741824
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @audio_valid_sample_rate(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 1073741823
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SMARTCARD0_DriverIRQHandler();
__attribute__((weak)) void SMARTCARD0_IRQHandler(void) {
  SMARTCARD0_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @SMARTCARD0_IRQHandler() {
%1 = tail call i32 (...) @SMARTCARD0_DriverIRQHandler()
ret void
}
/* Variables and functions */
float log10(float);
float accurate_coefficient_to_dB(float coeff) { return 20.0f * log10(coeff); }


x86 assembly (clang, -O0):
<accurate_coefficient_to_dB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @accurate_coefficient_to_dB(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @log10(float %3)
%5 = fmul float 2.000000e+01, %4
ret float %5
}

LLVM IR (-O2):
define float @accurate_coefficient_to_dB(float %0) {
%2 = tail call float @log10(float %0)
%3 = fmul float %2, 2.000000e+01
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ some_function(int *);
int main() {
  int v;
  some_function(&v);
  return v;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <some_function@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @some_function(i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
void ff_hevc_put_hevc_bi_w_qpel_v24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_v24_10_sse4() {
ret void
}
void foo(void) {
  static const unsigned short array[] = (const unsigned short[]){0x0D2B};
  const unsigned short *ptr = array;
  bar(ptr);
}


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

x86 assembly (clang, -O2):
<foo>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <bar@plt>

LLVM IR (-O0):
@foo.array = internal constant [1 x i16] [i16 3371]
define void @foo() {
%1 = alloca i16*
store i16* getelementptr inbounds ([1 x i16], [1 x i16]* @foo.array, i64 0, i64 0), i16** %1
%2 = load i16*, i16** %1
%3 = call i32 (i16*, ...) bitcast (i32 (...)* @bar to i32 (i16*, ...)*)(i16* %2)
ret void
}

LLVM IR (-O2):
@foo.array = internal constant [1 x i16] [i16 3371]
define void @foo() {
%1 = tail call i32 (i16*, ...) bitcast (i32 (...)* @bar to i32 (i16*, ...)*)(i16* getelementptr inbounds ([1 x i16], [1 x i16]* @foo.array, i64 0, i64 0))
ret void
}
/* Variables and functions */
int basic();
int compare();
int main(void) { return basic() + compare(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <basic@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <compare@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <basic@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <compare@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @basic()
%3 = call i32 (...) @compare()
%4 = add nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @basic()
%2 = tail call i32 (...) @compare()
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Type definitions */
struct cpufreq_policy {
  int dummy;
};

/* Variables and functions */
struct cpufreq_policy *proc_get_policy(unsigned int);
struct cpufreq_policy *sysfs_get_policy(unsigned int);
struct cpufreq_policy *cpufreq_get_policy(unsigned int cpu) {
  struct cpufreq_policy *ret;
  ret = sysfs_get_policy(cpu);
  if (!ret)
    ret = proc_get_policy(cpu);
  return (ret);
}


x86 assembly (clang, -O0):
<cpufreq_get_policy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sysfs_get_policy@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <cpufreq_get_policy+0x2e>
mov    -0x4(%rbp),%edi
call   1040 <proc_get_policy@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpufreq_get_policy>:
push   %rbx
mov    %edi,%ebx
call   1030 <sysfs_get_policy@plt>
test   %rax,%rax
je     112f <cpufreq_get_policy+0xf>
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1040 <proc_get_policy@plt>

LLVM IR (-O0):
%struct.cpufreq_policy = type { i32 }
define %struct.cpufreq_policy* @cpufreq_get_policy(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.cpufreq_policy*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.cpufreq_policy* @sysfs_get_policy(i32 %4)
store %struct.cpufreq_policy* %5, %struct.cpufreq_policy** %3
%6 = load %struct.cpufreq_policy*, %struct.cpufreq_policy** %3
%7 = icmp ne %struct.cpufreq_policy* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call %struct.cpufreq_policy* @proc_get_policy(i32 %9)
store %struct.cpufreq_policy* %10, %struct.cpufreq_policy** %3
br label %11
11: ; preds = %8, %1
%12 = load %struct.cpufreq_policy*, %struct.cpufreq_policy** %3
ret %struct.cpufreq_policy* %12
}

LLVM IR (-O2):
%struct.cpufreq_policy = type { i32 }
define %struct.cpufreq_policy* @cpufreq_get_policy(i32 %0) {
%2 = tail call %struct.cpufreq_policy* @sysfs_get_policy(i32 %0)
%3 = icmp eq %struct.cpufreq_policy* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call %struct.cpufreq_policy* @proc_get_policy(i32 %0)
br label %6
6: ; preds = %4, %1
%7 = phi %struct.cpufreq_policy* [ %2, %1 ], [ %5, %4 ]
ret %struct.cpufreq_policy* %7
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, size_t);
char *strncpy0(char *dest, char *src, size_t size) {
  strncpy(dest, src, size);
  dest[size - 1] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<strncpy0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy0>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strncpy0(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = sub i64 %12, 1
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @strncpy0(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long);
void printInput(unsigned long a, unsigned long b) {
  printf("\na: %lu, b%lu\n\n", a, b);
  return;
}


x86 assembly (clang, -O0):
<printInput>:
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 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"\0Aa: %lu, b%lu\0A\0A\00"
define void @printInput(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %5, i64 %6)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0Aa: %lu, b%lu\0A\0A\00"
define void @printInput(i64 %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
ret void
}
int test_imm_CAint8_mem(signed char *val) {
  return ((*val) & (0xCA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CAint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xca,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_CAint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 202
%7 = icmp ne i32 %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_CAint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -54
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void swap(int a[], int x, int y) {
  int swap;
  swap = a[x];
  a[x] = a[y];
  a[y] = swap;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void syntax_same_line_block(void) {
  printf("<div class=\"syntax-same-line-block\">");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"<div class=\22syntax-same-line-block\22>\00"
define void @syntax_same_line_block() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"<div class=\22syntax-same-line-block\22>\00"
define void @syntax_same_line_block() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double gsl_ran_binomial_pdf(long, double, long);
double pdf_Binomial(double p, long n, long x) {
  return gsl_ran_binomial_pdf(x, p, n);
}


x86 assembly (clang, -O0):
<pdf_Binomial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
call   1030 <gsl_ran_binomial_pdf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdf_Binomial>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <gsl_ran_binomial_pdf@plt>

LLVM IR (-O0):
define double @pdf_Binomial(double %0, i64 %1, i64 %2) {
%4 = alloca double
%5 = alloca i64
%6 = alloca i64
store double %0, double* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load double, double* %4
%9 = load i64, i64* %5
%10 = call double @gsl_ran_binomial_pdf(i64 %7, double %8, i64 %9)
ret double %10
}

LLVM IR (-O2):
define double @pdf_Binomial(double %0, i64 %1, i64 %2) {
%4 = tail call double @gsl_ran_binomial_pdf(i64 %2, double %0, i64 %1)
ret double %4
}
int comport_iter_next(char *buffer, int buffer_length) { return 0; }


x86 assembly (clang, -O0):
<comport_iter_next>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @comport_iter_next(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *ctrl_handler(void *arg) {
  printf("Closing thread\n");
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Closing thread\0A\00"
define i8* @ctrl_handler(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [15 x i8] c"Closing thread\00"
define noalias i8* @ctrl_handler(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
void readFile(char *fileName) {
  FILE *myFile;
  myFile = fopen(fileName, "r");
  char buffer[20];
  fgets(buffer, 20, (FILE *)myFile);
  printf("From file \n%s", buffer);
}


x86 assembly (clang, -O0):
<readFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x14,%esi
call   1040 <fgets@plt>
lea    -0x30(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readFile>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %rax,%rdx
call   1040 <fgets@plt>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [14 x i8] c"From file \0A%s\00"
define void @readFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca [20 x i8]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %3
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%8 = load i32*, i32** %3
%9 = call i32 @fgets(i8* %7, i32 20, i32* %8)
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [14 x i8] c"From file \0A%s\00"
define void @readFile(i8* nocapture %0) {
%2 = alloca [20 x i8]
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @fgets(i8* %4, i32 20, i32* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
void GetRotate(double *telrotate) {}


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

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

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

LLVM IR (-O2):
define void @GetRotate(double* nocapture %0) {
ret void
}
/* Variables and functions */
int arthmc(int *, int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int a[] = {20, 10};
  int i;
  printf("%d", arthmc(a, 1));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0xa00000014,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <arthmc@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [2 x i32] [i32 20, i32 10]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [2 x i32]* %2 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%6 = call i32 @arthmc(i32* %5, i32 1)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 42949672980, i64* %1
%3 = bitcast i64* %1 to i32*
%4 = call i32 @arthmc(i32* %3, i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
struct lexem *get_lexem() {}


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

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

LLVM IR (-O0):
%struct.lexem = type opaque
define %struct.lexem* @get_lexem() {
%1 = alloca %struct.lexem*
%2 = load %struct.lexem*, %struct.lexem** %1
ret %struct.lexem* %2
}

LLVM IR (-O2):
%struct.lexem = type opaque
define noalias %struct.lexem* @get_lexem() {
ret %struct.lexem* undef
}
/* Variables and functions */
char *atrf_default_driver_name();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char *);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr,
          "usage: %s [-b] [-d driver[:arg]] [-v ...] [port]\n\n"
          "  port             listen on the specified port (default: %d)\n\n"
          "  -b               background the process after initialization\n"
          "  -d driver[:arg]  use the specified driver (default: %s)\n"
          "  -v ...           increase verbosity level\n",
          name, 0x1540, atrf_default_driver_name());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <atrf_default_driver_name@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%r8
lea    0xe98(%rip),%rsi
mov    $0x1540,%ecx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <atrf_default_driver_name@plt>
lea    0xeb3(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    $0x1540,%ecx
mov    %rax,%r8
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [279 x i8] c"usage: %s [-b] [-d driver[:arg]] [-v ...] [port]\0A\0A port listen on the specified port (default: %d)\0A\0A -b background the process after initialization\0A -d driver[:arg] use the specified driver (default: %s)\0A -v ... increase verbosity level\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i8* (...) @atrf_default_driver_name()
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([279 x i8], [279 x i8]* @.str, i64 0, i64 0), i8* %4, i32 5440, i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [279 x i8] c"usage: %s [-b] [-d driver[:arg]] [-v ...] [port]\0A\0A port listen on the specified port (default: %d)\0A\0A -b background the process after initialization\0A -d driver[:arg] use the specified driver (default: %s)\0A -v ... increase verbosity level\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i8* (...) @atrf_default_driver_name()
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([279 x i8], [279 x i8]* @.str, i64 0, i64 0), i8* %0, i32 5440, i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_socket_client_ref() {
  printf("NOT IMPLEMENTED:"
         "pa_socket_client_ref"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [37 x i8] c"NOT IMPLEMENTED:pa_socket_client_ref\00"
define i32 @pa_socket_client_ref() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ readLine(char **);
int /*<<< orphan*/ system(char *);
int main() {
  char *str;
  readLine(&str);
  printf("Your string: %s\n", str);
  free(str);
  system("PAUSE");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
call   1060 <readLine@plt>
mov    -0x10(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    0xe99(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1060 <readLine@plt>
mov    (%rsp),%rsi
lea    0xeac(%rip),%rdi
call   1050 <printf@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
lea    0xea8(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Your string: %s\0A\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 @readLine(i8** %2)
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
%8 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Your string: %s\0A\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = call i32 @readLine(i8** %1)
%4 = load i8*, i8** %1
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
%8 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CE(int);
int /*<<< orphan*/ SCK(int /*<<< orphan*/);
void init() {
  SCK(0);
  CE(1);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <SCK@plt>
mov    $0x1,%edi
call   1040 <CE@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %edi,%edi
call   1030 <SCK@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <CE@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 @SCK(i32 0)
%2 = call i32 @CE(i32 1)
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 @SCK(i32 0)
%2 = tail call i32 @CE(i32 1)
ret void
}
/* Variables and functions */
int crypto_scalarmult_curve25519_tweet_base(unsigned char *, unsigned char *);
int /*<<< orphan*/ randombytes(unsigned char *, int);
int crypto_box_curve25519xsalsa20poly1305_tweet_keypair(unsigned char *y,
                                                        unsigned char *x) {
  randombytes(x, 32);
  return crypto_scalarmult_curve25519_tweet_base(y, x);
}


x86 assembly (clang, -O0):
<crypto_box_curve25519xsalsa20poly1305_tweet_keypair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1030 <randombytes@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <crypto_scalarmult_curve25519_tweet_base@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_box_curve25519xsalsa20poly1305_tweet_keypair>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    $0x20,%esi
call   1030 <randombytes@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <crypto_scalarmult_curve25519_tweet_base@plt>

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

LLVM IR (-O2):
define i32 @crypto_box_curve25519xsalsa20poly1305_tweet_keypair(i8* %0, i8* %1) {
%3 = tail call i32 @randombytes(i8* %1, i32 32)
%4 = tail call i32 @crypto_scalarmult_curve25519_tweet_base(i8* %0, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int i, n;
  scanf("%d", &n);
  for (i = 0; i < 1000; i++) {
    printf("N[%d] = %d\n", i, i % 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    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1177 <main+0x57>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
xchg   %ax,%ax
mov    %ebx,%eax
cltd
idivl  0x4(%rsp)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x3e8,%ebx
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"N[%d] = %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)
br label %4
4: ; preds = %0, %4
%5 = phi i32 [ 0, %0 ], [ %9, %4 ]
%6 = load i32, i32* %1
%7 = srem i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %7)
%9 = add nuw nsw i32 %5, 1
%10 = icmp eq i32 %9, 1000
br i1 %10, label %11, label %4
11: ; preds = %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ utest_control();
void utest_adts_hash(void) {
  utest_control();
  return;
}


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

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

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

LLVM IR (-O2):
define void @utest_adts_hash() {
%1 = tail call i32 (...) @utest_control()
ret void
}