xunge/DecIR huggingface dataset:
/* Variables and functions */
int ext_syms(char, int);
int /*<<< orphan*/ ungetch(char);
int getword_ext(char *w, int *lim, int beginning) {
  int res = 0;
  int c;
  if ((c = ext_syms(*w, beginning)) == -1) {
    ungetch(*w);
    res = -1;
  } else if (c > 0) {
    res = c;
  }
  return res;
}


x86 assembly (clang, -O0):
<getword_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    -0x14(%rbp),%esi
movsbl %al,%edi
call   1040 <ext_syms@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
jne    116f <getword_ext+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <ungetch@plt>
movl   $0xffffffff,-0x18(%rbp)
jmp    1184 <getword_ext+0x64>
cmpl   $0x0,-0x1c(%rbp)
jle    117f <getword_ext+0x5f>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1184 <getword_ext+0x64>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getword_ext>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
mov    %edx,%esi
call   1040 <ext_syms@plt>
cmp    $0xffffffff,%eax
je     113e <getword_ext+0x1e>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
pop    %rbx
ret
movsbl (%rbx),%edi
call   1030 <ungetch@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getword_ext(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store i32 0, i32* %7
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = load i32, i32* %6
%12 = call i32 @ext_syms(i8 signext %10, i32 %11)
store i32 %12, i32* %8
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %18
14: ; preds = %3
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = call i32 @ungetch(i8 signext %16)
store i32 -1, i32* %7
br label %24
18: ; preds = %3
%19 = load i32, i32* %8
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32, i32* %8
store i32 %22, i32* %7
br label %23
23: ; preds = %21, %18
br label %24
24: ; preds = %23, %14
%25 = load i32, i32* %7
ret i32 %25
}

LLVM IR (-O2):
define i32 @getword_ext(i8* nocapture %0, i32* nocapture readnone %1, i32 %2) {
%4 = load i8, i8* %0
%5 = tail call i32 @ext_syms(i8 signext %4, i32 %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i8, i8* %0
%9 = tail call i32 @ungetch(i8 signext %8)
br label %13
10: ; preds = %3
%11 = icmp sgt i32 %5, 0
%12 = select i1 %11, i32 %5, i32 0
br label %13
13: ; preds = %10, %7
%14 = phi i32 [ -1, %7 ], [ %12, %10 ]
ret i32 %14
}
void swap(double *pa, double *pb) {
  double a, b, t;
  a = *pa;
  b = *pb;
  t = b;
  b = a;
  a = t;
  *pa = a;
  *pb = b;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movsd  %xmm1,(%rdi)
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @swap(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%8 = load double*, double** %3
%9 = load double, double* %8
store double %9, double* %5
%10 = load double*, double** %4
%11 = load double, double* %10
store double %11, double* %6
%12 = load double, double* %6
store double %12, double* %7
%13 = load double, double* %5
store double %13, double* %6
%14 = load double, double* %7
store double %14, double* %5
%15 = load double, double* %5
%16 = load double*, double** %3
store double %15, double* %16
%17 = load double, double* %6
%18 = load double*, double** %4
store double %17, double* %18
ret void
}

LLVM IR (-O2):
define void @swap(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
store double %4, double* %0
store double %3, double* %1
ret void
}
double int100ToDouble(int x) { return (double)x / 100.0; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
cvtsi2sd %edi,%xmm0
divsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @int100ToDouble(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.000000e+02
ret double %5
}

LLVM IR (-O2):
define double @int100ToDouble(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 1.000000e+02
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ internal_logit(char *, int, char *, char *);
void set_realtime_prio() {
  internal_logit(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/gitkaste/moc/refs/heads/master/out_buf.c",
      55, "UNKNOWN_FUNC",
      "No sched_get_priority_max() function: realtime priority not "
      "used.");
}


x86 assembly (clang, -O0):
<set_realtime_prio>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x37,%esi
lea    0xf5c(%rip),%rdx
lea    0xf62(%rip),%rcx
call   1030 <internal_logit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_realtime_prio>:
lea    0xee9(%rip),%rdi
lea    0xf65(%rip),%rdx
lea    0xf6b(%rip),%rcx
mov    $0x37,%esi
jmp    1030 <internal_logit@plt>

LLVM IR (-O0):
@.str = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gitkaste/moc/refs/heads/master/out_buf.c\00"
@.str.1 = [13 x i8] c"UNKNOWN_FUNC\00"
@.str.2 = [66 x i8] c"No sched_get_priority_max() function: realtime priority not used.\00"
define void @set_realtime_prio() {
%1 = call i32 @internal_logit(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gitkaste/moc/refs/heads/master/out_buf.c\00"
@.str.1 = [13 x i8] c"UNKNOWN_FUNC\00"
@.str.2 = [66 x i8] c"No sched_get_priority_max() function: realtime priority not used.\00"
define void @set_realtime_prio() {
%1 = tail call i32 @internal_logit(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void __attribute__((visibility("default"))) lib2_default(void) {}


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

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

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

LLVM IR (-O2):
define void @lib2_default() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void yyerror(const char *s) { fprintf(stderr, "%s", s); }


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

x86 assembly (clang, -O2):
<yyerror>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int strlen(char const *);
int length_char(__const char *str) { return strlen(str); }


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

x86 assembly (clang, -O2):
<length_char>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @length_char(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void helper_set_random_seed(void) { srand(time(NULL)); }


x86 assembly (clang, -O0):
<helper_set_random_seed>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<helper_set_random_seed>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @helper_set_random_seed() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @helper_set_random_seed() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lapic_set(int, int);
void lapic_init() {
  lapic_set(0x0080, 0x00000);
  lapic_set(0x0320, 0x10000);
  lapic_set(0x0340, 0x10000);
  lapic_set(0x0350, 0x08700);
  lapic_set(0x0360, 0x00400);
  lapic_set(0x0280, 0x00370);
  lapic_set(0x00F0, 0x0010F);
}


x86 assembly (clang, -O0):
<lapic_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%edi
xor    %esi,%esi
call   1030 <lapic_set@plt>
mov    $0x320,%edi
mov    $0x10000,%esi
call   1030 <lapic_set@plt>
mov    $0x340,%edi
mov    $0x10000,%esi
call   1030 <lapic_set@plt>
mov    $0x350,%edi
mov    $0x8700,%esi
call   1030 <lapic_set@plt>
mov    $0x360,%edi
mov    $0x400,%esi
call   1030 <lapic_set@plt>
mov    $0x280,%edi
mov    $0x370,%esi
call   1030 <lapic_set@plt>
mov    $0xf0,%edi
mov    $0x10f,%esi
call   1030 <lapic_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lapic_init>:
push   %rax
mov    $0x80,%edi
xor    %esi,%esi
call   1030 <lapic_set@plt>
mov    $0x320,%edi
mov    $0x10000,%esi
call   1030 <lapic_set@plt>
mov    $0x340,%edi
mov    $0x10000,%esi
call   1030 <lapic_set@plt>
mov    $0x350,%edi
mov    $0x8700,%esi
call   1030 <lapic_set@plt>
mov    $0x360,%edi
mov    $0x400,%esi
call   1030 <lapic_set@plt>
mov    $0x280,%edi
mov    $0x370,%esi
call   1030 <lapic_set@plt>
mov    $0xf0,%edi
mov    $0x10f,%esi
pop    %rax
jmp    1030 <lapic_set@plt>

LLVM IR (-O0):
define void @lapic_init() {
%1 = call i32 @lapic_set(i32 128, i32 0)
%2 = call i32 @lapic_set(i32 800, i32 65536)
%3 = call i32 @lapic_set(i32 832, i32 65536)
%4 = call i32 @lapic_set(i32 848, i32 34560)
%5 = call i32 @lapic_set(i32 864, i32 1024)
%6 = call i32 @lapic_set(i32 640, i32 880)
%7 = call i32 @lapic_set(i32 240, i32 271)
ret void
}

LLVM IR (-O2):
define void @lapic_init() {
%1 = tail call i32 @lapic_set(i32 128, i32 0)
%2 = tail call i32 @lapic_set(i32 800, i32 65536)
%3 = tail call i32 @lapic_set(i32 832, i32 65536)
%4 = tail call i32 @lapic_set(i32 848, i32 34560)
%5 = tail call i32 @lapic_set(i32 864, i32 1024)
%6 = tail call i32 @lapic_set(i32 640, i32 880)
%7 = tail call i32 @lapic_set(i32 240, i32 271)
ret void
}
void *list_copy_char(void *_data) {
  char *new_data = malloc(sizeof(char));
  memcpy(new_data, _data, sizeof(char));
  return new_data;
}


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

x86 assembly (clang, -O2):
<list_copy_char>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    (%rbx),%cl
mov    %cl,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @list_copy_char(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i64 1)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @list_copy_char(i8* nocapture %0) {
%2 = tail call dereferenceable_or_null(1) i8* @malloc(i64 1)
%3 = load i8, i8* %0
store i8 %3, i8* %2
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_slli_epi64(int /*<<< orphan*/, int);
__m128i test_mm_slli_epi64_2(__m128i A, int B) { return _mm_slli_epi64(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_slli_epi64_2>:
jmp    1030 <_mm_slli_epi64@plt>

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

LLVM IR (-O2):
define i32 @test_mm_slli_epi64_2(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_slli_epi64(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t adts_get_num_blocks(const uint8_t *p_adts) {
  return (p_adts[6] & 0x03);
}


x86 assembly (clang, -O0):
<adts_get_num_blocks>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adts_get_num_blocks>:
mov    0x18(%rdi),%eax
and    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @adts_get_num_blocks(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 6
%3 = load i32, i32* %2
%4 = and i32 %3, 3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("Set a breakpoint here.\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Set a breakpoint here.\0A\00"
define void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"Set a breakpoint here.\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
int do_908() { return 908; }


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

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

LLVM IR (-O0):
define i32 @do_908() {
ret i32 908
}

LLVM IR (-O2):
define i32 @do_908() {
ret i32 908
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int main() {
  char buff0[100];
  char buff1[] = "My buffer source";
  memcpy(&buff0[0], &buff1[0], strlen(buff1));
  memcpy(&buff0[0], &buff1[0], strlen(buff1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0xebc(%rip),%al
mov    %al,-0x80(%rbp)
lea    -0x70(%rbp),%rax
mov    %rax,-0xb0(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0xa8(%rbp)
lea    -0x90(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0xb0(%rbp),%rdi
mov    -0xa8(%rbp),%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
lea    -0x70(%rbp),%rax
mov    %rax,-0xa0(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0x98(%rbp)
lea    -0x90(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0xa0(%rbp),%rdi
mov    -0x98(%rbp),%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.buff1 = [17 x i8] c"My buffer source\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [17 x i8]
store i32 0, i32* %1
%4 = bitcast [17 x i8]* %3 to i8*
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @memcpy(i8* %5, i8* %6, i32 %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @memcpy(i8* %10, i8* %11, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.buff1 = [17 x i8] c"My buffer source\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [17 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @memcpy(i8* %3, i8* %4, i32 %5)
%7 = call i32 @strlen(i8* %4)
%8 = call i32 @memcpy(i8* %3, i8* %4, i32 %7)
ret i32 0
}
void dv2_division(double *a, double b) {
  a[0] /= b;
  a[1] /= b;
  a[2] /= b;
}


x86 assembly (clang, -O0):
<dv2_division>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x10(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dv2_division>:
movupd (%rdi),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
divpd  %xmm2,%xmm1
movupd %xmm1,(%rdi)
movsd  0x10(%rdi),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rdi)
ret

LLVM IR (-O0):
define void @dv2_division(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = fdiv double %8, %5
store double %9, double* %7
%10 = load double, double* %4
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = fdiv double %13, %10
store double %14, double* %12
%15 = load double, double* %4
%16 = load double*, double** %3
%17 = getelementptr inbounds double, double* %16, i64 2
%18 = load double, double* %17
%19 = fdiv double %18, %15
store double %19, double* %17
ret void
}

LLVM IR (-O2):
define void @dv2_division(double* nocapture %0, double %1) {
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = insertelement <2 x double> poison, double %1, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = fdiv <2 x double> %4, %6
%8 = bitcast double* %0 to <2 x double>*
store <2 x double> %7, <2 x double>* %8
%9 = getelementptr inbounds double, double* %0, i64 2
%10 = load double, double* %9
%11 = fdiv double %10, %1
store double %11, double* %9
ret void
}
int fun277() { return 277; }


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

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

LLVM IR (-O0):
define i32 @fun277() {
ret i32 277
}

LLVM IR (-O2):
define i32 @fun277() {
ret i32 277
}
/* Variables and functions */
int /*<<< orphan*/ fmax(double, double);
double fmin(int /*<<< orphan*/, double);
double Saturate(double x, double low, double high) {
  return fmin(fmax(x, low), high);
}


x86 assembly (clang, -O0):
<Saturate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <fmax@plt>
mov    %eax,%edi
movsd  -0x18(%rbp),%xmm0
call   1030 <fmin@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Saturate>:
push   %rax
movsd  %xmm2,(%rsp)
call   1040 <fmax@plt>
mov    %eax,%edi
movsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <fmin@plt>

LLVM IR (-O0):
define double @Saturate(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = call i32 @fmax(double %7, double %8)
%10 = load double, double* %6
%11 = call double @fmin(i32 %9, double %10)
ret double %11
}

LLVM IR (-O2):
define double @Saturate(double %0, double %1, double %2) {
%4 = tail call i32 @fmax(double %0, double %1)
%5 = tail call double @fmin(i32 %4, double %2)
ret double %5
}
/* Variables and functions */
size_t add2(size_t, size_t);
size_t add3(size_t a, size_t b, size_t c) { return add2(add2(a, b), c); }


x86 assembly (clang, -O0):
<add3>:
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
call   1030 <add2@plt>
mov    %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <add2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add3>:
push   %rbx
mov    %rdx,%rbx
call   1030 <add2@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <add2@plt>

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

LLVM IR (-O2):
define i64 @add3(i64 %0, i64 %1, i64 %2) {
%4 = tail call i64 @add2(i64 %0, i64 %1)
%5 = tail call i64 @add2(i64 %4, i64 %2)
ret i64 %5
}
/* Variables and functions */
int ENXIO;
int pm8921_calculate_pj_level(int Vjk, int is_charging, int batt_temp) {
  return -ENXIO;
}


x86 assembly (clang, -O0):
<pm8921_calculate_pj_level>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
mov    0x2eca(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8921_calculate_pj_level>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENXIO = global i32 0
define i32 @pm8921_calculate_pj_level(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* @ENXIO
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @pm8921_calculate_pj_level(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENXIO
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
main() {
  char **a = {"hello", "world"};
  char *b = a[0];
  printf("\n%s", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xecd(%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
movabs $0x6f6c6c6568,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"\0A%s\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* inttoptr (i64 478560413032 to i8*))
ret i32 0
}
int CMP_CompareInts(void *pA, void *pB) {
  int *a, *b;
  a = pA;
  b = pB;
  if (*a >= *b)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<CMP_CompareInts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jl     113a <CMP_CompareInts+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <CMP_CompareInts+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMP_CompareInts>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setge  %al
ret

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

LLVM IR (-O2):
define i32 @CMP_CompareInts(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sge i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void exit_with_help() {
  printf("Usage: svm-scale [options] data_filename\n"
         "options:\n"
         "-l lower : x scaling lower limit (default -1)\n"
         "-u upper : x scaling upper limit (default +1)\n"
         "-y y_lower y_upper : y scaling limits (default: no y scaling)\n"
         "-s save_filename : save scaling parameters to save_filename\n"
         "-r restore_filename : restore scaling parameters from "
         "restore_filename\n\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [337 x i8] c"Usage: svm-scale [options] data_filename\0Aoptions:\0A-l lower : x scaling lower limit (default -1)\0A-u upper : x scaling upper limit (default +1)\0A-y y_lower y_upper : y scaling limits (default: no y scaling)\0A-s save_filename : save scaling parameters to save_filename\0A-r restore_filename : restore scaling parameters from restore_filename\0A\0A\00"
define void @exit_with_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([337 x i8], [337 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [336 x i8] c"Usage: svm-scale [options] data_filename\0Aoptions:\0A-l lower : x scaling lower limit (default -1)\0A-u upper : x scaling upper limit (default +1)\0A-y y_lower y_upper : y scaling limits (default: no y scaling)\0A-s save_filename : save scaling parameters to save_filename\0A-r restore_filename : restore scaling parameters from restore_filename\0A\00"
define void @exit_with_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([336 x i8], [336 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct tupid_tree {
  int dummy;
};
struct tupid_entries {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ *tupid_entries_RB_INSERT(struct tupid_entries *,
                                            struct tupid_tree *);
int tupid_tree_insert(struct tupid_entries *root, struct tupid_tree *data) {
  if (tupid_entries_RB_INSERT(root, data) != NULL) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tupid_tree_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <tupid_entries_RB_INSERT@plt>
cmp    $0x0,%rax
je     1143 <tupid_tree_insert+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <tupid_tree_insert+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tupid_tree_insert>:
push   %rax
call   1030 <tupid_entries_RB_INSERT@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.tupid_entries = type { i32 }
%struct.tupid_tree = type { i32 }
define i32 @tupid_tree_insert(%struct.tupid_entries* %0, %struct.tupid_tree* %1) {
%3 = tail call i32* @tupid_entries_RB_INSERT(%struct.tupid_entries* %0, %struct.tupid_tree* %1)
%4 = icmp ne i32* %3, null
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef scalar_t__ ssize_t;

/* Variables and functions */
int errno;
scalar_t__ readv(int, struct iovec const *, int);
ssize_t __sulong_posix_readv(int fd, const struct iovec *iov, int iovcnt) {
  {
    int native_errno = errno;
    ssize_t result = readv(fd, iov, iovcnt);
    if (result == (ssize_t)-1) {
      result = (ssize_t)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_readv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <readv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0xffffffffffffffff,-0x20(%rbp)
jne    115d <__sulong_posix_readv+0x4d>
xor    %eax,%eax
mov    0x2e8b(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%ecx
mov    0x2e79(%rip),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_readv>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <readv@plt>
movslq (%rbx),%rcx
neg    %rcx
cmp    $0xffffffffffffffff,%rax
cmove  %rcx,%rax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.iovec = type { i32 }
@errno = global i32 0
define i64 @__sulong_posix_readv(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.iovec*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store i32 %0, i32* %4
store %struct.iovec* %1, %struct.iovec** %5
store i32 %2, i32* %6
%9 = load i32, i32* @errno
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = load %struct.iovec*, %struct.iovec** %5
%12 = load i32, i32* %6
%13 = call i64 @readv(i32 %10, %struct.iovec* %11, i32 %12)
store i64 %13, i64* %8
%14 = load i64, i64* %8
%15 = icmp eq i64 %14, -1
br i1 %15, label %16, label %20
16: ; preds = %3
%17 = load i32, i32* @errno
%18 = sub nsw i32 0, %17
%19 = sext i32 %18 to i64
store i64 %19, i64* %8
br label %20
20: ; preds = %16, %3
%21 = load i32, i32* %7
store i32 %21, i32* @errno
%22 = load i64, i64* %8
ret i64 %22
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
@errno = global i32 0
define i64 @__sulong_posix_readv(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = load i32, i32* @errno
%5 = tail call i64 @readv(i32 %0, %struct.iovec* %1, i32 %2)
%6 = icmp eq i64 %5, -1
%7 = load i32, i32* @errno
%8 = sub nsw i32 0, %7
%9 = sext i32 %8 to i64
%10 = select i1 %6, i64 %9, i64 %5
store i32 %4, i32* @errno
ret i64 %10
}
void BlockTests(void) {}


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

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

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

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


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

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

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

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

/* Variables and functions */
void AUXTDCEnable(uint32_t ui32Base, uint32_t ui32RunMode) {
  ;

  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000000))) = ui32RunMode;
}


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

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

LLVM IR (-O0):
define void @AUXTDCEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 0
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @AUXTDCEnable(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %3
ret void
}
/* Variables and functions */
double const exp(double const);
void f2(const double *y, const double *x, double *res) {
  *res = 1 - *x * exp(*y);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe97(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movsd  (%rsi),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rdi),%xmm0
call   1030 <exp@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0xec7(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @f2(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = load double, double* %7
%9 = load double*, double** %4
%10 = load double, double* %9
%11 = call double @exp(double %10)
%12 = fneg double %8
%13 = call double @llvm.fmuladd.f64(double %12, double %11, double 1.000000e+00)
%14 = load double*, double** %6
store double %13, double* %14
ret void
}

LLVM IR (-O2):
define void @f2(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %1
%5 = load double, double* %0
%6 = tail call double @exp(double %5)
%7 = fneg double %4
%8 = tail call double @llvm.fmuladd.f64(double %7, double %6, double 1.000000e+00)
store double %8, double* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ screset(int);
scinit() {
  int chan;
  for (chan = 0; chan < 4; ++chan)
    screset(chan);
}


x86 assembly (clang, -O0):
<scinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    113f <scinit+0x2f>
mov    -0x8(%rbp),%edi
call   1030 <screset@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111f <scinit+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scinit>:
push   %rax
xor    %edi,%edi
call   1030 <screset@plt>
mov    $0x1,%edi
call   1030 <screset@plt>
mov    $0x2,%edi
call   1030 <screset@plt>
mov    $0x3,%edi
pop    %rax
jmp    1030 <screset@plt>

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

LLVM IR (-O2):
define i32 @scinit() {
%1 = tail call i32 @screset(i32 0)
%2 = tail call i32 @screset(i32 1)
%3 = tail call i32 @screset(i32 2)
%4 = tail call i32 @screset(i32 3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
char *showdate();
void int_handler() {
  printf("Interrupted %s\n", showdate());
  exit(1);
}


x86 assembly (clang, -O0):
<int_handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <showdate@plt>
mov    %rax,%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<int_handler>:
push   %rax
xor    %eax,%eax
call   1040 <showdate@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"Interrupted %s\0A\00"
define void @int_handler() {
%1 = tail call i8* (...) @showdate()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char *test;
  test = (char *)malloc(10 * sizeof(char));
  strcpy(test, "Mayank Johri");
  (void)printf("Testname: %s\n", test);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Mayank Johri\00"
@.str.1 = [14 x i8] c"Testname: %s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 10)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Mayank Johri\00"
@.str.1 = [14 x i8] c"Testname: %s\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 10)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int android_atomic_cas(int /*<<< orphan*/, int /*<<< orphan*/,
                       int /*<<< orphan*/ volatile *);
extern __attribute__((always_)) int
android_atomic_acquire_cas(int32_t old_value, int32_t new_value,
                           volatile int32_t *ptr) {
  return android_atomic_cas(old_value, new_value, ptr);
}


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

x86 assembly (clang, -O2):
<android_atomic_acquire_cas>:
jmp    1030 <android_atomic_cas@plt>

LLVM IR (-O0):
define i32 @android_atomic_acquire_cas(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 = call i32 @android_atomic_cas(i32 %7, i32 %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @android_atomic_acquire_cas(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @android_atomic_cas(i32 %0, i32 %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ PROT_NONE;
int /*<<< orphan*/ getpagesize();
int mprotect(void *, int /*<<< orphan*/, int /*<<< orphan*/);
int hide_guard_page(void *page_ptr) {
  return mprotect(page_ptr, getpagesize(), PROT_NONE);
}


x86 assembly (clang, -O0):
<hide_guard_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getpagesize@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
call   1030 <mprotect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hide_guard_page>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <getpagesize@plt>
mov    0x2ebe(%rip),%rcx
mov    (%rcx),%edx
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <mprotect@plt>

LLVM IR (-O0):
@PROT_NONE = global i32 0
define i32 @hide_guard_page(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @getpagesize()
%5 = load i32, i32* @PROT_NONE
%6 = call i32 @mprotect(i8* %3, i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@PROT_NONE = global i32 0
define i32 @hide_guard_page(i8* %0) {
%2 = tail call i32 (...) @getpagesize()
%3 = load i32, i32* @PROT_NONE
%4 = tail call i32 @mprotect(i8* %0, i32 %2, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t uvisor_read32(uint32_t volatile *addr) {
  return *(addr);
}


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

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

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

LLVM IR (-O2):
define i32 @uvisor_read32(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int mul02(int);
uint8_t mul03(uint8_t v) { return (uint8_t)(mul02(v) ^ v); }


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

x86 assembly (clang, -O2):
<mul03>:
push   %rbx
mov    %edi,%ebx
call   1030 <mul02@plt>
xor    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @mul03(i32 %0) {
%2 = tail call i32 @mul02(i32 %0)
%3 = xor i32 %2, %0
ret i32 %3
}
OP(dd, fb) {
  illegal_1();
  op_fb();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_fb@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_fb@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_fb()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScalef(float, float, float);
int /*<<< orphan*/ glutWireCube(double);
void drawCuboid(void) {
  glColor3f(1.5, 0.0, 0.5);
  glPushMatrix();
  glScalef(2.0f, 1.0f, 2.0f);
  glutWireCube(5.0);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<drawCuboid>:
push   %rbp
mov    %rsp,%rbp
movsd  0xeac(%rip),%xmm0
xorps  %xmm1,%xmm1
movsd  0xea9(%rip),%xmm2
call   1040 <glColor3f@plt>
mov    $0x0,%al
call   1060 <glPushMatrix@plt>
movss  0xe9d(%rip),%xmm2
movss  0xe99(%rip),%xmm1
movaps %xmm2,%xmm0
call   1050 <glScalef@plt>
movsd  0xe6d(%rip),%xmm0
call   1070 <glutWireCube@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawCuboid>:
push   %rax
movsd  0xea7(%rip),%xmm0
movsd  0xea7(%rip),%xmm2
xorps  %xmm1,%xmm1
call   1040 <glColor3f@plt>
xor    %eax,%eax
call   1060 <glPushMatrix@plt>
movss  0xea0(%rip),%xmm1
movss  0xe9c(%rip),%xmm0
movaps %xmm0,%xmm2
call   1050 <glScalef@plt>
movsd  0xe80(%rip),%xmm0
call   1070 <glutWireCube@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <glPopMatrix@plt>

LLVM IR (-O0):
define void @drawCuboid() {
%1 = call i32 @glColor3f(double 1.500000e+00, double 0.000000e+00, double 5.000000e-01)
%2 = call i32 (...) @glPushMatrix()
%3 = call i32 @glScalef(float 2.000000e+00, float 1.000000e+00, float 2.000000e+00)
%4 = call i32 @glutWireCube(double 5.000000e+00)
%5 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @drawCuboid() {
%1 = tail call i32 @glColor3f(double 1.500000e+00, double 0.000000e+00, double 5.000000e-01)
%2 = tail call i32 (...) @glPushMatrix()
%3 = tail call i32 @glScalef(float 2.000000e+00, float 1.000000e+00, float 2.000000e+00)
%4 = tail call i32 @glutWireCube(double 5.000000e+00)
%5 = tail call i32 (...) @glPopMatrix()
ret void
}