xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, int, char const *, int /*<<< orphan*/);
signed int vsprintf(char *pString, const char *pFormat, va_list ap) {
  return vsnprintf(pString, 255, pFormat, ap);
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0xff,%esi
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0xff,%esi
jmp    1030 <vsnprintf@plt>

LLVM IR (-O0):
define i32 @vsprintf(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @vsnprintf(i8* %7, i32 255, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @vsprintf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @vsnprintf(i8* %0, i32 255, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pixel_avg_wxh(unsigned char *, int, unsigned char *, int,
                                 int, int);
void pixel_avg_8x16(unsigned char *pix1, int i_stride_pix1, unsigned char *pix2,
                    int i_stride_pix2) {
  pixel_avg_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 8, 16);
}


x86 assembly (clang, -O0):
<pixel_avg_8x16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x8,%r8d
mov    $0x10,%r9d
call   1030 <pixel_avg_wxh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_8x16>:
mov    $0x8,%r8d
mov    $0x10,%r9d
jmp    1030 <pixel_avg_wxh@plt>

LLVM IR (-O0):
define void @pixel_avg_8x16(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @pixel_avg_wxh(i8* %9, i32 %10, i8* %11, i32 %12, i32 8, i32 16)
ret void
}

LLVM IR (-O2):
define void @pixel_avg_8x16(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @pixel_avg_wxh(i8* %0, i32 %1, i8* %2, i32 %3, i32 8, i32 16)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ r;

/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, void const *, int);
double S_LD_D(const void *a) {
  double r;
  memcpy(&r, a, sizeof(r));
  return r;
}


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

x86 assembly (clang, -O2):
<S_LD_D>:
push   %rax
mov    %rdi,%rsi
mov    %rsp,%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @S_LD_D(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(double* %3, i8* %4, i32 8)
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @S_LD_D(i8* %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 @memcpy(double* %2, i8* %0, i32 8)
%5 = load double, double* %2
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int *p;
  int a;
  p = &a;
  a = 0;
  *p = 1;
  assert(a == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
cmpl   $0x1,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
store i32* %3, i32** %2
store i32 0, i32* %3
%4 = load i32*, i32** %2
store i32 1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  unsigned int i = 0x0102;
  char *p = (char *)&i;
  printf("Bytes of i: %d, %d\n", p[0], p[1]);
  assert(p[0] == 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x102,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
lea    0xeb8(%rip),%rdi
movsbl %cl,%esi
movsbl 0x1(%rax),%edx
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Bytes of i: %d, %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 258, i32* %1
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8 signext %6, i8 signext %9)
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 2
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Bytes of i: %d, %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8 signext 2, i8 signext 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
void _vBuzzer(void) {}


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

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

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

LLVM IR (-O2):
define void @_vBuzzer() {
ret void
}
/* Variables and functions */
size_t strnlen(const char *s, size_t len) {
  size_t n;
  for (n = 0; s[n] != 0 && n < len; n++)
    ;
  return n;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     113c <strnlen+0x3c>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <strnlen+0x4c>
jmp    1162 <strnlen+0x62>
jmp    1151 <strnlen+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,(%rdi,%rcx,1)
je     1122 <strnlen+0x22>
cmp    %rsi,%rcx
mov    %rax,%rcx
jb     1110 <strnlen+0x10>
add    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %20, %2
%7 = load i8*, i8** %3
%8 = load i64, i64* %5
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %6
%14 = load i64, i64* %5
%15 = load i64, i64* %4
%16 = icmp ult i64 %14, %15
br label %17
17: ; preds = %13, %6
%18 = phi i1 [ false, %6 ], [ %16, %13 ]
br i1 %18, label %19, label %23
19: ; preds = %17
br label %20
20: ; preds = %19
%21 = load i64, i64* %5
%22 = add i64 %21, 1
store i64 %22, i64* %5
br label %6
23: ; preds = %17
%24 = load i64, i64* %5
ret i64 %24
}

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %10, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
%8 = icmp ult i64 %4, %1
%9 = select i1 %7, i1 %8, i1 false
%10 = add nuw i64 %4, 1
br i1 %9, label %3, label %11
11: ; preds = %3
ret i64 %4
}
/* Variables and functions */
bool nrf52_errata_20(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_20() {
ret i32 0
}
/* Variables and functions */
int arg_int(int, int);
int use_arg_int(int i, int j) { return arg_int(i, j); }


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

x86 assembly (clang, -O2):
<use_arg_int>:
jmp    1030 <arg_int@plt>

LLVM IR (-O0):
define i32 @use_arg_int(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 @arg_int(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @use_arg_int(i32 %0, i32 %1) {
%3 = tail call i32 @arg_int(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int fail(char *format, char *data) {
  fprintf(stderr, format, data);
  return 2;
}


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

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
mov    $0x2,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
define i32 @fail(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* %0, i8* %1)
ret i32 2
}
double swi_angnorm(double x) {
  if (x < 0.0)
    return x + (2.0 * 3.14159265358979323846);
  else if (x >= (2.0 * 3.14159265358979323846))
    return x - (2.0 * 3.14159265358979323846);
  else
    return x;
}


x86 assembly (clang, -O0):
<swi_angnorm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112e <swi_angnorm+0x2e>
movsd  0xee1(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116a <swi_angnorm+0x6a>
movsd  -0x10(%rbp),%xmm0
movsd  0xec5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1160 <swi_angnorm+0x60>
movsd  -0x10(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116a <swi_angnorm+0x6a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<swi_angnorm>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1113 <swi_angnorm+0x13>
addsd  0xeee(%rip),%xmm0
ret
ucomisd 0xee5(%rip),%xmm0
jb     1125 <swi_angnorm+0x25>
addsd  0xee3(%rip),%xmm0
ret

LLVM IR (-O0):
define double @swi_angnorm(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fadd double %7, 0x401921FB54442D18
store double %8, double* %2
br label %17
9: ; preds = %1
%10 = load double, double* %3
%11 = fcmp oge double %10, 0x401921FB54442D18
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load double, double* %3
%14 = fsub double %13, 0x401921FB54442D18
store double %14, double* %2
br label %17
15: ; preds = %9
%16 = load double, double* %3
store double %16, double* %2
br label %17
17: ; preds = %15, %12, %6
%18 = load double, double* %2
ret double %18
}

LLVM IR (-O2):
define double @swi_angnorm(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = fadd double %0, 0x401921FB54442D18
br label %9
5: ; preds = %1
%6 = fcmp ult double %0, 0x401921FB54442D18
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = fadd double %0, 0xC01921FB54442D18
br label %9
9: ; preds = %5, %7, %3
%10 = phi double [ %4, %3 ], [ %8, %7 ], [ %0, %5 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read(int /*<<< orphan*/, int *, int);
void wait_human() {
  int c;
  printf("waiting human ...\n");
  read(STDIN_FILENO, &c, 1);
}


x86 assembly (clang, -O0):
<wait_human>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_human>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"waiting human ...\0A\00"
@STDIN_FILENO = global i32 0
define void @wait_human() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @STDIN_FILENO
%4 = call i32 @read(i32 %3, i32* %1, i32 1)
ret void
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@str = [18 x i8] c"waiting human ...\00"
define void @wait_human() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @STDIN_FILENO
%5 = call i32 @read(i32 %4, i32* %1, i32 1)
ret void
}
int fun583() { return 583; }


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

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

LLVM IR (-O0):
define i32 @fun583() {
ret i32 583
}

LLVM IR (-O2):
define i32 @fun583() {
ret i32 583
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;
struct serializer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ s_wl16(struct serializer *, int /*<<< orphan*/);
void s_wl32(struct serializer *s, uint32_t u32) {
  s_wl16(s, (uint16_t)u32);
  s_wl16(s, (uint16_t)(u32 >> 16));
  return;
}


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

x86 assembly (clang, -O2):
<s_wl32>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <s_wl16@plt>
sar    $0x10,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <s_wl16@plt>

LLVM IR (-O0):
%struct.serializer = type { i32 }
define void @s_wl32(%struct.serializer* %0, i32 %1) {
%3 = alloca %struct.serializer*
%4 = alloca i32
store %struct.serializer* %0, %struct.serializer** %3
store i32 %1, i32* %4
%5 = load %struct.serializer*, %struct.serializer** %3
%6 = load i32, i32* %4
%7 = call i32 @s_wl16(%struct.serializer* %5, i32 %6)
%8 = load %struct.serializer*, %struct.serializer** %3
%9 = load i32, i32* %4
%10 = ashr i32 %9, 16
%11 = call i32 @s_wl16(%struct.serializer* %8, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.serializer = type { i32 }
define void @s_wl32(%struct.serializer* %0, i32 %1) {
%3 = tail call i32 @s_wl16(%struct.serializer* %0, i32 %1)
%4 = ashr i32 %1, 16
%5 = tail call i32 @s_wl16(%struct.serializer* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dot(double *, double *, int);
double sqrt(int /*<<< orphan*/);
double norm(double *ar, int len) { return sqrt(dot(ar, ar, len)); }


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

x86 assembly (clang, -O2):
<norm>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
call   1030 <dot@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

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

LLVM IR (-O2):
define double @norm(double* %0, i32 %1) {
%3 = tail call i32 @dot(double* %0, double* %0, i32 %1)
%4 = tail call double @sqrt(i32 %3)
ret double %4
}
int dummyfn3(int a, int b, int c) { return (a + b + c); }


x86 assembly (clang, -O0):
<dummyfn3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummyfn3>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @dummyfn3(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 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @dummyfn3(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
char *strdup(char *);
char *xml_bool(bool b) {
  if (b) {
    return strdup("<bool>true</bool>");
  } else {
    return strdup("<bool>false</bool>");
  }
}


x86 assembly (clang, -O0):
<xml_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113a <xml_bool+0x2a>
lea    0xed4(%rip),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    114a <xml_bool+0x3a>
lea    0xed1(%rip),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xml_bool>:
test   %edi,%edi
je     1120 <xml_bool+0x10>
lea    0xee5(%rip),%rdi
jmp    1030 <strdup@plt>
lea    0xeeb(%rip),%rdi
jmp    1030 <strdup@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"<bool>true</bool>\00"
@.str.1 = [19 x i8] c"<bool>false</bool>\00"
define i8* @xml_bool(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i8* @strdup(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %2
br label %10
8: ; preds = %1
%9 = call i8* @strdup(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
store i8* %9, i8** %2
br label %10
10: ; preds = %8, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [18 x i8] c"<bool>true</bool>\00"
@.str.1 = [19 x i8] c"<bool>false</bool>\00"
define noalias i8* @xml_bool(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call dereferenceable_or_null(18) i8* @strdup(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call dereferenceable_or_null(19) i8* @strdup(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = phi i8* [ %4, %3 ], [ %6, %5 ]
ret i8* %8
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, prime;
  printf("Enter number: \n");
  scanf("%d", &n);
  prime = is_prime(n);
  if (prime == 1) {
    printf("1", n);
  } else {
    printf("0", n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <is_prime@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1188 <main+0x58>
mov    -0x8(%rbp),%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1199 <main+0x69>
mov    -0x8(%rbp),%esi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xebb(%rip),%rdi
call   1040 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <is_prime@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
or     $0x30,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [15 x i8] c"Enter number: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @is_prime(i32 %5)
%7 = icmp eq i32 %6, 1
%8 = select i1 %7, i32 49, i32 48
%9 = call i32 @putchar(i32 %8)
ret i32 0
}
/* Variables and functions */
int zero();
int main() {
  int i;
  i = 1 / zero();
  return i;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <zero@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovae %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @zero()
%2 = add i32 %1, 1
%3 = icmp ult i32 %2, 3
%4 = select i1 %3, i32 %1, i32 0
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int autotune_continuation_parameters(int difficulty_level,
                                     int digits_of_precision) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(193, &difficulty_level, &digits_of_precision, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<autotune_continuation_parameters>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0xc1,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @autotune_continuation_parameters(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc4c(i32 193, i32* %3, i32* %4, double* undef, i32 0)
ret i32 %5
}
int er(int x) {
  int i, sum = 1;
  for (i = 1; i <= x; i++)
    sum *= 2;
  return sum;
}


x86 assembly (clang, -O0):
<er>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1138 <er+0x38>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <er+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<er>:
test   %edi,%edi
jle    1118 <er+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <er+0x1e>
mov    $0x1,%eax
jmp    1138 <er+0x38>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%eax
add    $0xfffffff8,%edi
jne    1130 <er+0x30>
test   %ecx,%ecx
je     1147 <er+0x47>
nopl   0x0(%rax)
add    %eax,%eax
add    $0xffffffff,%ecx
jne    1140 <er+0x40>
ret

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

LLVM IR (-O2):
define i32 @er(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %25, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 1, %7 ], [ %12, %9 ]
%11 = phi i32 [ 0, %7 ], [ %13, %9 ]
%12 = shl i32 %10, 8
%13 = add i32 %11, 8
%14 = icmp eq i32 %13, %8
br i1 %14, label %15, label %9
15: ; preds = %9, %3
%16 = phi i32 [ undef, %3 ], [ %12, %9 ]
%17 = phi i32 [ 1, %3 ], [ %12, %9 ]
%18 = icmp eq i32 %5, 0
br i1 %18, label %25, label %19
19: ; preds = %15, %19
%20 = phi i32 [ %22, %19 ], [ %17, %15 ]
%21 = phi i32 [ %23, %19 ], [ 0, %15 ]
%22 = shl nsw i32 %20, 1
%23 = add i32 %21, 1
%24 = icmp eq i32 %23, %5
br i1 %24, label %25, label %19
25: ; preds = %15, %19, %1
%26 = phi i32 [ 1, %1 ], [ %16, %15 ], [ %22, %19 ]
ret i32 %26
}
/* Variables and functions */
int unnibble(unsigned char);
unsigned char unhex(unsigned char hex1, unsigned char hex2) {
  return (unnibble(hex1) * 16 + unnibble(hex2));
}


x86 assembly (clang, -O0):
<unhex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <unnibble@plt>
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x2(%rbp),%edi
call   1030 <unnibble@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unhex>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <unnibble@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
mov    %ebx,%edi
call   1030 <unnibble@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @unhex(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @unnibble(i8 zeroext %5)
%7 = mul nsw i32 %6, 16
%8 = load i8, i8* %4
%9 = call i32 @unnibble(i8 zeroext %8)
%10 = add nsw i32 %7, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @unhex(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @unnibble(i8 zeroext %0)
%4 = shl nsw i32 %3, 4
%5 = tail call i32 @unnibble(i8 zeroext %1)
%6 = add nsw i32 %4, %5
%7 = trunc i32 %6 to i8
ret i8 %7
}
/* Type definitions */
struct argp_state {
  int dummy;
};
typedef int /*<<< orphan*/ error_t;

/* Variables and functions */
int /*<<< orphan*/ ARGP_ERR_UNKNOWN;
error_t parse_opt(int key, char *arg, struct argp_state *state) {
  return ARGP_ERR_UNKNOWN;
}


x86 assembly (clang, -O0):
<parse_opt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_opt>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.argp_state = type { i32 }
@ARGP_ERR_UNKNOWN = global i32 0
define i32 @parse_opt(i32 %0, i8* %1, %struct.argp_state* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.argp_state*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.argp_state* %2, %struct.argp_state** %6
%7 = load i32, i32* @ARGP_ERR_UNKNOWN
ret i32 %7
}

LLVM IR (-O2):
%struct.argp_state = type { i32 }
@ARGP_ERR_UNKNOWN = global i32 0
define i32 @parse_opt(i32 %0, i8* nocapture readnone %1, %struct.argp_state* nocapture readnone %2) {
%4 = load i32, i32* @ARGP_ERR_UNKNOWN
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printCommands() {
  printf("[A]: Attack\n");
  printf("[B]: Block\n");
  printf("[H]: Heal\n");
  printf("[F]: Flee\n");
}


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

x86 assembly (clang, -O2):
<printCommands>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"[A]: Attack\0A\00"
@.str.1 = [12 x i8] c"[B]: Block\0A\00"
@.str.2 = [11 x i8] c"[H]: Heal\0A\00"
@.str.3 = [11 x i8] c"[F]: Flee\0A\00"
define void @printCommands() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"[A]: Attack\00"
@str.4 = [11 x i8] c"[B]: Block\00"
@str.5 = [10 x i8] c"[H]: Heal\00"
@str.6 = [10 x i8] c"[F]: Flee\00"
define void @printCommands() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.6, i64 0, i64 0))
ret void
}
ISR(TIMER1_COMPB_vect) {}


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

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

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

LLVM IR (-O2):
define i32 @ISR(i32 %0) {
ret i32 undef
}
/* Variables and functions */
char *jsonZcb(char *, int);
char *jsonZcbResetRsp(int ret) { return (jsonZcb("resetrsp", ret)); }


x86 assembly (clang, -O0):
<jsonZcbResetRsp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <jsonZcb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsonZcbResetRsp>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <jsonZcb@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"resetrsp\00"
define i8* @jsonZcbResetRsp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @jsonZcb(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [9 x i8] c"resetrsp\00"
define i8* @jsonZcbResetRsp(i32 %0) {
%2 = tail call i8* @jsonZcb(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %2
}
/* Variables and functions */
unsigned int sys_call(int, int /*<<< orphan*/, unsigned int, int /*<<< orphan*/,
                      int /*<<< orphan*/);
unsigned int timer_get_time(unsigned int *time) {
  return sys_call(0x05, 0, (unsigned int)time, 0, 0);
}


x86 assembly (clang, -O0):
<timer_get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edx
mov    $0x5,%edi
xor    %r8d,%r8d
mov    %r8d,%esi
mov    %r8d,%ecx
call   1030 <sys_call@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_get_time>:
mov    %rdi,%rdx
mov    $0x5,%edi
xor    %esi,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
define i32 @timer_get_time(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i32
%5 = call i32 @sys_call(i32 5, i32 0, i32 %4, i32 0, i32 0)
ret i32 %5
}

LLVM IR (-O2):
define i32 @timer_get_time(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @sys_call(i32 5, i32 0, i32 %3, i32 0, i32 0)
ret i32 %4
}
int PDMCCompare1(P, PDMCQStruct)
struct Teacher **P;
struct AllGradStruct *PDMCQStruct;
{
  return (0);
}


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

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

LLVM IR (-O0):
%struct.Teacher = type opaque
%struct.AllGradStruct = type opaque
define i32 @PDMCCompare1(%struct.Teacher** %0, %struct.AllGradStruct* %1) {
%3 = alloca %struct.Teacher**
%4 = alloca %struct.AllGradStruct*
store %struct.Teacher** %0, %struct.Teacher*** %3
store %struct.AllGradStruct* %1, %struct.AllGradStruct** %4
ret i32 0
}

LLVM IR (-O2):
%struct.Teacher = type opaque
%struct.AllGradStruct = type opaque
define i32 @PDMCCompare1(%struct.Teacher** nocapture readnone %0, %struct.AllGradStruct* nocapture readnone %1) {
ret i32 0
}
int test1(int x) {
  static volatile int thestatic;
  thestatic = x;
  return thestatic + x;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,0x2f14(%rip)
mov    0x2f0e(%rip),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
mov    %edi,%eax
mov    %edi,0x2f1c(%rip)
add    0x2f16(%rip),%eax
ret

LLVM IR (-O0):
@test1.thestatic = internal global i32 0
define i32 @test1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* @test1.thestatic
%4 = load volatile i32, i32* @test1.thestatic
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
@test1.thestatic = internal global i32 0
define i32 @test1(i32 %0) {
store volatile i32 %0, i32* @test1.thestatic
%2 = load volatile i32, i32* @test1.thestatic
%3 = add nsw i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int send(int, void const *, int, int);
int g_tcp_send(int sck, const void *ptr, int len, int flags) {
  return send(sck, ptr, len, flags);
}


x86 assembly (clang, -O0):
<g_tcp_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_tcp_send>:
jmp    1030 <send@plt>

LLVM IR (-O0):
define i32 @g_tcp_send(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @send(i32 %9, i8* %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @g_tcp_send(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
int dead_state_pause(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dead_state_pause() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__22__IO__makeInput();
void ControllerP__CheckRoot__makeInput(void) {
  HplAtm128GeneralIOPinP__22__IO__makeInput();
}


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

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

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

LLVM IR (-O2):
define void @ControllerP__CheckRoot__makeInput() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__22__IO__makeInput()
ret void
}
float map_value_forward(double v, float min, float max) {
  return min + (max - min) * v;
}


x86 assembly (clang, -O0):
<map_value_forward>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_value_forward>:
cvtss2sd %xmm1,%xmm3
subss  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm3,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @map_value_forward(double %0, float %1, float %2) {
%4 = alloca double
%5 = alloca float
%6 = alloca float
store double %0, double* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = fpext float %7 to double
%9 = load float, float* %6
%10 = load float, float* %5
%11 = fsub float %9, %10
%12 = fpext float %11 to double
%13 = load double, double* %4
%14 = call double @llvm.fmuladd.f64(double %12, double %13, double %8)
%15 = fptrunc double %14 to float
ret float %15
}

LLVM IR (-O2):
define float @map_value_forward(double %0, float %1, float %2) {
%4 = fpext float %1 to double
%5 = fsub float %2, %1
%6 = fpext float %5 to double
%7 = tail call double @llvm.fmuladd.f64(double %6, double %0, double %4)
%8 = fptrunc double %7 to float
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ initPte(int /*<<< orphan*/, int);
void InitCache(int sessionId) { initPte(0, sessionId); }


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

x86 assembly (clang, -O2):
<InitCache>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <initPte@plt>

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

LLVM IR (-O2):
define void @InitCache(i32 %0) {
%2 = tail call i32 @initPte(i32 0, i32 %0)
ret void
}
/* Type definitions */
struct soap {
  int dummy;
};

/* Variables and functions */
int soap_send_raw(struct soap *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int soap_send(struct soap *soap, const char *s) {
  return soap_send_raw(soap, s, strlen(s));
}


x86 assembly (clang, -O0):
<soap_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <soap_send_raw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soap_send>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <soap_send_raw@plt>

LLVM IR (-O0):
%struct.soap = type { i32 }
define i32 @soap_send(%struct.soap* %0, i8* %1) {
%3 = alloca %struct.soap*
%4 = alloca i8*
store %struct.soap* %0, %struct.soap** %3
store i8* %1, i8** %4
%5 = load %struct.soap*, %struct.soap** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @soap_send_raw(%struct.soap* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.soap = type { i32 }
define i32 @soap_send(%struct.soap* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @soap_send_raw(%struct.soap* %0, i8* %1, i32 %3)
ret i32 %4
}
void __gccmain() {}


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

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

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

LLVM IR (-O2):
define void @__gccmain() {
ret void
}
int SetVelocity(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @SetVelocity() {
ret i32 0
}
void mvVecScale3(float *v, float factor) {
  v[0] *= factor;
  v[1] *= factor;
  v[2] *= factor;
}


x86 assembly (clang, -O0):
<mvVecScale3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  (%rax),%xmm0
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
movss  %xmm0,0x4(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x8(%rax),%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvVecScale3>:
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @mvVecScale3(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fmul float %3, %1
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fmul float %6, %1
store float %7, float* %5
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fmul float %9, %1
store float %10, float* %8
ret void
}
/* Variables and functions */
unsigned int fmt_ulong(char *, unsigned int);
unsigned int fmt_uint(register char *s, register unsigned int u) {
  return fmt_ulong(s, u);
}


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

x86 assembly (clang, -O2):
<fmt_uint>:
jmp    1030 <fmt_ulong@plt>

LLVM IR (-O0):
define i32 @fmt_uint(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 i32 @fmt_ulong(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @fmt_uint(i8* %0, i32 %1) {
%3 = tail call i32 @fmt_ulong(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ mod(long double, int);
int ldfloor(long double n) { return (int)(n - mod(n, 1)); }


x86 assembly (clang, -O0):
<ldfloor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fld    %st(0)
fstpt  -0x30(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
mov    $0x1,%edi
call   1030 <mod@plt>
fldt   -0x30(%rbp)
mov    %rax,-0x20(%rbp)
fildll -0x20(%rbp)
fsubrp %st,%st(1)
fnstcw -0x22(%rbp)
movzwl -0x22(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x24(%rbp)
fldcw  -0x24(%rbp)
fistpl -0x14(%rbp)
fldcw  -0x22(%rbp)
mov    -0x14(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldfloor>:
sub    $0x38,%rsp
fldt   0x40(%rsp)
fld    %st(0)
fstpt  0x2c(%rsp)
fstpt  (%rsp)
mov    $0x1,%edi
call   1030 <mod@plt>
mov    %rax,0x20(%rsp)
fildll 0x20(%rsp)
fldt   0x2c(%rsp)
fsubp  %st,%st(1)
fnstcw 0x18(%rsp)
movzwl 0x18(%rsp),%eax
or     $0xc00,%eax
mov    %ax,0x1a(%rsp)
fldcw  0x1a(%rsp)
fistpl 0x1c(%rsp)
fldcw  0x18(%rsp)
mov    0x1c(%rsp),%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
define i32 @ldfloor(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = call i64 @mod(x86_fp80 %4, i32 1)
%6 = sitofp i64 %5 to x86_fp80
%7 = fsub x86_fp80 %3, %6
%8 = fptosi x86_fp80 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ldfloor(x86_fp80 %0) {
%2 = tail call i64 @mod(x86_fp80 %0, i32 1)
%3 = sitofp i64 %2 to x86_fp80
%4 = fsub x86_fp80 %0, %3
%5 = fptosi x86_fp80 %4 to i32
ret i32 %5
}