xunge/DecIR huggingface dataset:
int *hop(int *elem) {
  int *new_element = elem + *elem;
  return new_element;
}


x86 assembly (clang, -O0):
<hop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32* @hop(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
store i32* %8, i32** %3
%9 = load i32*, i32** %3
ret i32* %9
}

LLVM IR (-O2):
define i32* @hop(i32* %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("Hello world"); }


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 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define void @foo() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ stdout;
void report_init(const char *filename, int fmttype) {
  fprintf(stdout, "report created at %s with format type: %d\n", filename,
          fmttype);
  return;
}


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

x86 assembly (clang, -O2):
<report_init>:
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [43 x i8] c"report created at %s with format type: %d\0A\00"
define void @report_init(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [43 x i8] c"report created at %s with format type: %d\0A\00"
define void @report_init(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
void RTC_C_IRQHandler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @RTC_C_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage_old() {
  printf("Usage: sg_turs [-n=NUM] [-p] [-t] [-v] [-V] "
         "DEVICE\n"
         "  where:\n"
         "    -n=NUM    number of test_unit_ready commands "
         "(def: 1)\n"
         "    -p        outputs progress indication (percentage) "
         "if available\n"
         "    -t        outputs total duration and commands per "
         "second\n"
         "    -v        increase verbosity\n"
         "    -V        print version string then exit\n\n"
         "Performs a SCSI TEST UNIT READY command (or many of them)\n");
}


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

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

LLVM IR (-O0):
@.str = [385 x i8] c"Usage: sg_turs [-n=NUM] [-p] [-t] [-v] [-V] DEVICE\0A where:\0A -n=NUM number of test_unit_ready commands (def: 1)\0A -p outputs progress indication (percentage) if available\0A -t outputs total duration and commands per second\0A -v increase verbosity\0A -V print version string then exit\0A\0APerforms a SCSI TEST UNIT READY command (or many of them)\0A\00"
define void @usage_old() {
%1 = call i32 @printf(i8* getelementptr inbounds ([385 x i8], [385 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [384 x i8] c"Usage: sg_turs [-n=NUM] [-p] [-t] [-v] [-V] DEVICE\0A where:\0A -n=NUM number of test_unit_ready commands (def: 1)\0A -p outputs progress indication (percentage) if available\0A -t outputs total duration and commands per second\0A -v increase verbosity\0A -V print version string then exit\0A\0APerforms a SCSI TEST UNIT READY command (or many of them)\00"
define void @usage_old() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([384 x i8], [384 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("Hello, Turing Machine:\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Hello, Turing Machine:\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Hello, Turing Machine:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *prog) {
  printf("usage: %s in1.grib in2.grib out.grib\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [38 x i8] c"usage: %s in1.grib in2.grib out.grib\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [38 x i8] c"usage: %s in1.grib in2.grib out.grib\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void fini(void) {}


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

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

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

LLVM IR (-O2):
define void @fini() {
ret void
}
double SPeir2(double a, double b, double c, double d) {
  return (a * d) - (b * c) / ((a + c) * (b + d));
}


x86 assembly (clang, -O0):
<SPeir2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm3
addsd  -0x18(%rbp),%xmm3
movsd  -0x10(%rbp),%xmm4
addsd  -0x20(%rbp),%xmm4
mulsd  %xmm4,%xmm3
divsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPeir2>:
movapd %xmm0,%xmm4
addsd  %xmm2,%xmm4
movapd %xmm1,%xmm5
addsd  %xmm3,%xmm5
mulsd  %xmm4,%xmm5
mulsd  %xmm2,%xmm1
divsd  %xmm5,%xmm1
mulsd  %xmm3,%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @SPeir2(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %8
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fmul double %11, %12
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fadd double %14, %15
%17 = load double, double* %6
%18 = load double, double* %8
%19 = fadd double %17, %18
%20 = fmul double %16, %19
%21 = fdiv double %13, %20
%22 = fneg double %21
%23 = call double @llvm.fmuladd.f64(double %9, double %10, double %22)
ret double %23
}

LLVM IR (-O2):
define double @SPeir2(double %0, double %1, double %2, double %3) {
%5 = fadd double %0, %2
%6 = fadd double %1, %3
%7 = fmul double %5, %6
%8 = fneg double %1
%9 = fmul double %8, %2
%10 = fdiv double %9, %7
%11 = tail call double @llvm.fmuladd.f64(double %0, double %3, double %10)
ret double %11
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main(int argc, char **argv) {
  int ch;
  while ((ch = getchar()) != EOF) {
    if (ch & 0x80)
      putchar('#');
    putchar(ch & 0x7f);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     117a <main+0x5a>
mov    -0x14(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     116a <main+0x4a>
mov    $0x23,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%edi
and    $0x7f,%edi
call   1030 <putchar@plt>
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%eax
jne    1141 <main+0x21>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %eax,%ebx
jmp    1168 <main+0x48>
cs nopw 0x0(%rax,%rax,1)
nop
and    $0x7f,%ebx
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%eax
je     1137 <main+0x17>
test   $0x80,%bl
je     1150 <main+0x30>
mov    $0x23,%edi
call   1030 <putchar@plt>
jmp    1150 <main+0x30>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %17, %2
%8 = call i32 (...) @getchar()
store i32 %8, i32* %6
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i32, i32* %6
%13 = and i32 %12, 128
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 @putchar(i32 35)
br label %17
17: ; preds = %15, %11
%18 = load i32, i32* %6
%19 = and i32 %18, 127
%20 = call i32 @putchar(i32 %19)
br label %7
21: ; preds = %7
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %18, label %6
6: ; preds = %2, %12
%7 = phi i32 [ %15, %12 ], [ %3, %2 ]
%8 = and i32 %7, 128
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = tail call i32 @putchar(i32 35)
br label %12
12: ; preds = %10, %6
%13 = and i32 %7, 127
%14 = tail call i32 @putchar(i32 %13)
%15 = tail call i32 (...) @getchar()
%16 = load i32, i32* @EOF
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %6
18: ; preds = %12, %2
ret i32 0
}
int deg2chr(int degree) {
  if (degree >= -90 && degree <= 90)
    return (degree + 90 + 0x4B);
  else
    return 0;
}


x86 assembly (clang, -O0):
<deg2chr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xffffffa6,-0x8(%rbp)
jl     112c <deg2chr+0x2c>
cmpl   $0x5a,-0x8(%rbp)
jg     112c <deg2chr+0x2c>
mov    -0x8(%rbp),%eax
add    $0x5a,%eax
add    $0x4b,%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <deg2chr+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg2chr>:
lea    0x5a(%rdi),%ecx
lea    0xa5(%rdi),%edx
xor    %eax,%eax
cmp    $0xb5,%ecx
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @deg2chr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, -90
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 90
%12 = add nsw i32 %11, 75
store i32 %12, i32* %2
br label %14
13: ; preds = %6, %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @deg2chr(i32 %0) {
%2 = add i32 %0, 90
%3 = icmp ult i32 %2, 181
%4 = add nsw i32 %0, 165
%5 = select i1 %3, i32 %4, i32 0
ret i32 %5
}
void *read_byte(void *src, int *x) {
  *x = *(unsigned char *)src;
  return (unsigned char *)src + 1;
}


x86 assembly (clang, -O0):
<read_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_byte>:
movzbl (%rdi),%eax
mov    %eax,(%rsi)
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @read_byte(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = load i32*, i32** %4
store i32 %7, i32* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
ret i8* %10
}

LLVM IR (-O2):
define i8* @read_byte(i8* %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
store i32 %4, i32* %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %5
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ select(int, int /*<<< orphan*/ *, int /*<<< orphan*/,
                          int /*<<< orphan*/, struct timeval *);
int main() {
  fd_set f;
  struct timeval tv;
  FD_ZERO(&f);
  tv.tv_sec = 3;
  tv.tv_usec = 0;
  select(1, &f, 0, 0, &tv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <FD_ZERO@plt>
movl   $0x3,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
xor    %ecx,%ecx
lea    -0x18(%rbp),%r8
mov    %ecx,%edx
call   1040 <select@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <FD_ZERO@plt>
movl   $0x3,0x10(%rsp)
movq   $0x0,0x18(%rsp)
lea    0x10(%rsp),%r8
mov    $0x1,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <select@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.timeval
store i32 0, i32* %1
%4 = call i32 @FD_ZERO(i32* %2)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i32 3, i32* %5
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i64 0, i64* %6
%7 = call i32 @select(i32 1, i32* %2, i32 0, i32 0, %struct.timeval* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = bitcast i32* %1 to i8*
%4 = bitcast %struct.timeval* %2 to i8*
%5 = call i32 @FD_ZERO(i32* %1)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 3, i32* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i64 0, i64* %7
%8 = call i32 @select(i32 1, i32* %1, i32 0, i32 0, %struct.timeval* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tc_perf_1();
int tc_skl_main(int argc, char **argv) {
  tc_perf_1();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @tc_skl_main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @tc_perf_1()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_eval(int);
void test_22(int i, int j) { __analyzer_eval(i + j == i + j); }


x86 assembly (clang, -O0):
<test_22>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_22>:
mov    $0x1,%edi
jmp    1030 <__analyzer_eval@plt>

LLVM IR (-O0):
define void @test_22(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 = add nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
%13 = call i32 @__analyzer_eval(i32 %12)
ret void
}

LLVM IR (-O2):
define void @test_22(i32 %0, i32 %1) {
%3 = tail call i32 @__analyzer_eval(i32 1)
ret void
}
/* Variables and functions */
float gammp(double, float);
float erff(float x) { return x < 0.0 ? -gammp(0.5, x * x) : gammp(0.5, x * x); }


x86 assembly (clang, -O0):
<erff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1161 <erff+0x51>
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movsd  0xebb(%rip),%xmm0
call   1030 <gammp@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    117d <erff+0x6d>
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movsd  0xe8d(%rip),%xmm0
call   1030 <gammp@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erff>:
sub    $0x18,%rsp
movaps %xmm0,(%rsp)
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
movsd  0xed9(%rip),%xmm0
call   1030 <gammp@plt>
movaps 0xedd(%rip),%xmm1
xorps  %xmm0,%xmm1
xorps  %xmm2,%xmm2
movaps (%rsp),%xmm3
cmpltss %xmm2,%xmm3
movaps %xmm3,%xmm2
andnps %xmm0,%xmm2
andps  %xmm1,%xmm3
orps   %xmm2,%xmm3
movaps %xmm3,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @erff(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load float, float* %2
%8 = load float, float* %2
%9 = fmul float %7, %8
%10 = call float @gammp(double 5.000000e-01, float %9)
%11 = fneg float %10
br label %17
12: ; preds = %1
%13 = load float, float* %2
%14 = load float, float* %2
%15 = fmul float %13, %14
%16 = call float @gammp(double 5.000000e-01, float %15)
br label %17
17: ; preds = %12, %6
%18 = phi float [ %11, %6 ], [ %16, %12 ]
ret float %18
}

LLVM IR (-O2):
define float @erff(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fmul float %0, %0
%4 = tail call float @gammp(double 5.000000e-01, float %3)
%5 = fneg float %4
%6 = select i1 %2, float %5, float %4
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void writehw(volatile void *reg, uint16_t value) {
  *(volatile uint16_t *)reg = value;
}


x86 assembly (clang, -O0):
<writehw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writehw>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @writehw(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @writehw(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
void os_finish_with_sample(int a) {}


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

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

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

LLVM IR (-O2):
define void @os_finish_with_sample(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_intro() {
  printf("This library is OceanBase C API,\n"
         "containing interfaces for developing\n"
         "applications accessing OceanBase.\n");
}


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

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

LLVM IR (-O0):
@.str = [105 x i8] c"This library is OceanBase C API,\0Acontaining interfaces for developing\0Aapplications accessing OceanBase.\0A\00"
define void @print_intro() {
%1 = call i32 @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [104 x i8] c"This library is OceanBase C API,\0Acontaining interfaces for developing\0Aapplications accessing OceanBase.\00"
define void @print_intro() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([104 x i8], [104 x i8]* @str, i64 0, i64 0))
ret void
}
void DestroyArcList(Schema, A) struct frvStruct *Schema;
struct Vertex *A;
{
}


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

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

LLVM IR (-O0):
%struct.frvStruct = type opaque
%struct.Vertex = type opaque
define void @DestroyArcList(%struct.frvStruct* %0, %struct.Vertex* %1) {
%3 = alloca %struct.frvStruct*
%4 = alloca %struct.Vertex*
store %struct.frvStruct* %0, %struct.frvStruct** %3
store %struct.Vertex* %1, %struct.Vertex** %4
ret void
}

LLVM IR (-O2):
%struct.frvStruct = type opaque
%struct.Vertex = type opaque
define void @DestroyArcList(%struct.frvStruct* nocapture %0, %struct.Vertex* nocapture %1) {
ret void
}
int __isinf(double d) {
  union {
    unsigned long long l;
    double d;
  } u;
  u.d = d;
  return (u.l == 0x7FF0000000000000ll   ? 1
          : u.l == 0xFFF0000000000000ll ? -1
                                        : 0);
}


x86 assembly (clang, -O0):
<__isinf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movabs $0x7ff0000000000000,%rax
cmp    %rax,-0x10(%rbp)
jne    1134 <__isinf+0x34>
mov    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1152 <__isinf+0x52>
mov    -0x10(%rbp),%rdx
movabs $0xfff0000000000000,%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isinf>:
movq   %xmm0,%rax
movabs $0xfff0000000000000,%rcx
xor    %edx,%edx
cmp    %rcx,%rax
sete   %dl
neg    %edx
movabs $0x7ff0000000000000,%rcx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovne %edx,%eax
ret

LLVM IR (-O0):
%union.anon = type { i64 }
define i32 @__isinf(double %0) {
%2 = alloca double
%3 = alloca %union.anon
store double %0, double* %2
%4 = load double, double* %2
%5 = bitcast %union.anon* %3 to double*
store double %4, double* %5
%6 = bitcast %union.anon* %3 to i64*
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 9218868437227405312
br i1 %8, label %9, label %10
9: ; preds = %1
br label %16
10: ; preds = %1
%11 = bitcast %union.anon* %3 to i64*
%12 = load i64, i64* %11
%13 = icmp eq i64 %12, -4503599627370496
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 -1, i32 0
br label %16
16: ; preds = %10, %9
%17 = phi i32 [ 1, %9 ], [ %15, %10 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @__isinf(double %0) {
%2 = bitcast double %0 to i64
%3 = icmp eq i64 %2, 9218868437227405312
%4 = icmp eq i64 %2, -4503599627370496
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
/* Variables and functions */
char *IcsExtensionFind(char *);
char *IcsFileNameFind(char const *);
int /*<<< orphan*/ IcsStrCpy(char *, char const *, int);
void IcsGetFileName(char *dest, char const *src) {
  char const *begin;
  char *end;
  begin = IcsFileNameFind(src);
  IcsStrCpy(dest, begin, 512);
  end = IcsExtensionFind(dest);
  if (end != NULL) {
    *end = '\0';
  }
}


x86 assembly (clang, -O0):
<IcsGetFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <IcsFileNameFind@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x200,%edx
call   1040 <IcsStrCpy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <IcsExtensionFind@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     117e <IcsGetFileName+0x4e>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IcsGetFileName>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1050 <IcsFileNameFind@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x200,%edx
call   1040 <IcsStrCpy@plt>
mov    %rbx,%rdi
call   1030 <IcsExtensionFind@plt>
test   %rax,%rax
je     115c <IcsGetFileName+0x2c>
movb   $0x0,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @IcsGetFileName(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i8* @IcsFileNameFind(i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %5
%11 = call i32 @IcsStrCpy(i8* %9, i8* %10, i32 512)
%12 = load i8*, i8** %3
%13 = call i8* @IcsExtensionFind(i8* %12)
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = load i8*, i8** %6
store i8 0, i8* %17
br label %18
18: ; preds = %16, %2
ret void
}

LLVM IR (-O2):
define void @IcsGetFileName(i8* %0, i8* %1) {
%3 = tail call i8* @IcsFileNameFind(i8* %1)
%4 = tail call i32 @IcsStrCpy(i8* %0, i8* %3, i32 512)
%5 = tail call i8* @IcsExtensionFind(i8* %0)
%6 = icmp eq i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %2
store i8 0, i8* %5
br label %8
8: ; preds = %7, %2
ret void
}
int detect(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @detect() {
ret i32 0
}
/* Type definitions */
struct html {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ htprintf(struct html *, char *);
void begin_colour_bar(struct html *ctx) {
  htprintf(ctx, "<table cellspacing=0 cellpadding=0"
                " style=\"border:0\">\n<tr>\n");
}


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

x86 assembly (clang, -O2):
<begin_colour_bar>:
lea    0xee9(%rip),%rsi
jmp    1030 <htprintf@plt>

LLVM IR (-O0):
%struct.html = type { i32 }
@.str = [59 x i8] c"<table cellspacing=0 cellpadding=0 style=\22border:0\22>\0A<tr>\0A\00"
define void @begin_colour_bar(%struct.html* %0) {
%2 = alloca %struct.html*
store %struct.html* %0, %struct.html** %2
%3 = load %struct.html*, %struct.html** %2
%4 = call i32 @htprintf(%struct.html* %3, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.html = type { i32 }
@.str = [59 x i8] c"<table cellspacing=0 cellpadding=0 style=\22border:0\22>\0A<tr>\0A\00"
define void @begin_colour_bar(%struct.html* %0) {
%2 = tail call i32 @htprintf(%struct.html* %0, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int myfunc(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ qfunc();
int /*<<< orphan*/ vfunc(int);
int main() {
  printf("%d\n", myfunc(3));
  printf("%d\n", myfunc(4));
  vfunc(1234);
  qfunc();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1060 <myfunc@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
call   1050 <printf@plt>
mov    $0x4,%edi
call   1060 <myfunc@plt>
mov    %eax,%esi
lea    0xe86(%rip),%rdi
call   1050 <printf@plt>
mov    $0x4d2,%edi
call   1030 <vfunc@plt>
mov    $0x0,%al
call   1040 <qfunc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
call   1060 <myfunc@plt>
lea    0xeae(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    $0x4,%edi
call   1060 <myfunc@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    $0x4d2,%edi
call   1030 <vfunc@plt>
xor    %eax,%eax
call   1040 <qfunc@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @myfunc(i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @myfunc(i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @vfunc(i32 1234)
%6 = tail call i32 (...) @qfunc()
ret i32 0
}
void swap(void *vector[], int source, int target) {
  void *place_holder = vector[source];
  vector[source] = vector[target];
  vector[target] = place_holder;
}


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,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
store i8* %9, i8** %5
store i8* %6, i8** %8
ret void
}
/* Variables and functions */
float ceil(float);
float f_ceil(float x) { return ceil(x); }


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

x86 assembly (clang, -O2):
<f_ceil>:
jmp    1030 <ceilf@plt>

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

LLVM IR (-O2):
define float @f_ceil(float %0) {
%2 = tail call float @llvm.ceil.f32(float %0)
ret float %2
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_write_quaddobl_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(381, a, b, c, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @syscon_write_quaddobl_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 381, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int tputs(char *string, int nlines, int (*outfun)()) {
  while (*string)
    outfun(*string++);
}


x86 assembly (clang, -O0):
<tputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     113f <tputs+0x3f>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   *%rcx
jmp    1113 <tputs+0x13>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tputs>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1133 <tputs+0x33>
mov    %rdx,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
xor    %eax,%eax
call   *%r14
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <tputs+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @tputs(i8* nocapture %0, i32 %1, i32 (...)* nocapture %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3
%7 = bitcast i32 (...)* %2 to i32 (i32, ...)*
br label %8
8: ; preds = %6, %8
%9 = phi i8 [ %4, %6 ], [ %14, %8 ]
%10 = phi i8* [ %0, %6 ], [ %11, %8 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = sext i8 %9 to i32
%13 = tail call i32 (i32, ...) %7(i32 %12)
%14 = load i8, i8* %11
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %8, %3
ret i32 undef
}
/* Variables and functions */
scalar_t__ syscall(int, char *, int);
int open(char *file, int omode) { return (int)syscall(1, file, omode); }


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @open(i8* %0, i32 %1) {
%3 = tail call i64 @syscall(i32 1, i8* %0, i32 %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ Parray();
scalar_t__ PnameDef();
PvalueNameDef() {
  int b = -1;
  ;
  b = PnameDef() || Parray();
  return (b);
}


x86 assembly (clang, -O0):
<PvalueNameDef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    $0x0,%al
call   1030 <PnameDef@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1159 <PvalueNameDef+0x39>
mov    $0x0,%al
call   1040 <Parray@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PvalueNameDef>:
push   %rax
xor    %eax,%eax
call   1030 <PnameDef@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <PvalueNameDef+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <Parray@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PvalueNameDef() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i64 (...) @PnameDef()
%3 = icmp ne i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = call i64 (...) @Parray()
%6 = icmp ne i64 %5, 0
br label %7
7: ; preds = %4, %0
%8 = phi i1 [ true, %0 ], [ %6, %4 ]
%9 = zext i1 %8 to i32
store i32 %9, i32* %1
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @PvalueNameDef() {
%1 = tail call i64 (...) @PnameDef()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @Parray()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
void sti(void) { asm volatile("sti" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @sti() {
tail call void asm sideeffect "sti", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *memcpy(void *, void const *, size_t);
void *my_memdup(const void *src, size_t len) {
  void *dup = malloc(len);
  return dup ? memcpy(dup, src, len) : NULL;
}


x86 assembly (clang, -O0):
<my_memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116a <my_memdup+0x4a>
mov    -0x18(%rbp),%rdi
mov    %rdi,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1175 <my_memdup+0x55>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1175 <my_memdup+0x55>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <my_memdup+0x29>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @my_memdup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %10
%16 = phi i8* [ %11, %10 ], [ null, %14 ]
ret i8* %16
}

LLVM IR (-O2):
define noalias i8* @my_memdup(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %3, i8* align 1 %0, i64 %1, i1 false)
br label %6
6: ; preds = %2, %5
ret i8* %3
}
unsigned int kernel_assert_strlen(const char *str) {
  register unsigned int i = 0;
  while (str[i] != 0)
    ++i;
  return i;
}


x86 assembly (clang, -O0):
<kernel_assert_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1131 <kernel_assert_strlen+0x31>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <kernel_assert_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_assert_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi,%rax,1)
jne    1110 <kernel_assert_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @kernel_assert_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
char *langDbgDevS1990() { return "S1990"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"S1990\00"
define i8* @langDbgDevS1990() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int strlen(char *);
int verificaCpf(char *cpf) {
  if (cpf == NULL || strlen(cpf) != 11)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<verificaCpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1139 <verificaCpf+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0xb,%eax
je     1145 <verificaCpf+0x35>
movl   $0x0,-0x4(%rbp)
jmp    114c <verificaCpf+0x3c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verificaCpf>:
test   %rdi,%rdi
je     112a <verificaCpf+0x1a>
push   %rax
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xb,%ecx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @verificaCpf(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 11
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_lock_history(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_lock_history>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_lock_history(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_lock_history(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t uart2_getc() {
  while (!((*((volatile uint32_t *)0xE2900810)) & 0x01))
    ;
  return (*((volatile uint32_t *)0xE2900824));
}


x86 assembly (clang, -O0):
<uart2_getc>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <uart2_getc+0x9>
mov    $0xe2900810,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1128 <uart2_getc+0x28>
jmp    112d <uart2_getc+0x2d>
jmp    1109 <uart2_getc+0x9>
mov    $0xe2900824,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart2_getc>:
mov    $0xe2900810,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x1,(%rax)
je     1110 <uart2_getc+0x10>
mov    0x14(%rax),%eax
ret

LLVM IR (-O0):
define i32 @uart2_getc() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i32, i32* inttoptr (i64 3801090064 to i32*)
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
%8 = load volatile i32, i32* inttoptr (i64 3801090084 to i32*)
ret i32 %8
}

LLVM IR (-O2):
define i32 @uart2_getc() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 3801090064 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 3801090084 to i32*)
ret i32 %6
}