xunge/DecIR huggingface dataset:
/* Variables and functions */
double get_whole_seconds(double const);
long get_fractional_microseconds(const double seconds) {
  const double whole_secs = get_whole_seconds(seconds);
  const double fractional_part = seconds - whole_secs;
  return (long)(fractional_part * 1000000);
}


x86 assembly (clang, -O0):
<get_fractional_microseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <get_whole_seconds@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xebd(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fractional_microseconds>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <get_whole_seconds@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xed4(%rip),%xmm1
cvttsd2si %xmm1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @get_fractional_microseconds(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @get_whole_seconds(double %5)
store double %6, double* %3
%7 = load double, double* %2
%8 = load double, double* %3
%9 = fsub double %7, %8
store double %9, double* %4
%10 = load double, double* %4
%11 = fmul double %10, 1.000000e+06
%12 = fptosi double %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @get_fractional_microseconds(double %0) {
%2 = tail call double @get_whole_seconds(double %0)
%3 = fsub double %0, %2
%4 = fmul double %3, 1.000000e+06
%5 = fptosi double %4 to i64
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *);
void panic() {
  kprintf("A fatal error has been encountered in the kernel. Panic has been "
          "called\n");
  kprintf("panic()\n");
  while (1) {
  }
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <kprintf@plt>
lea    0xf22(%rip),%rdi
call   1030 <kprintf@plt>
jmp    112c <panic+0x1c>

x86 assembly (clang, -O2):
<panic>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <kprintf@plt>
lea    0xf25(%rip),%rdi
call   1030 <kprintf@plt>
nopl   0x0(%rax)
jmp    1130 <panic+0x20>

LLVM IR (-O0):
@.str = [73 x i8] c"A fatal error has been encountered in the kernel. Panic has been called\0A\00"
@.str.1 = [9 x i8] c"panic()\0A\00"
define void @panic() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
@.str = [73 x i8] c"A fatal error has been encountered in the kernel. Panic has been called\0A\00"
@.str.1 = [9 x i8] c"panic()\0A\00"
define void @panic() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
br label %3
}
/* Variables and functions */
scalar_t__ constant_time_is_zero(unsigned int);
unsigned char constant_time_is_zero_8(unsigned int a) {
  return (unsigned char)(constant_time_is_zero(a));
}


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

x86 assembly (clang, -O2):
<constant_time_is_zero_8>:
push   %rax
call   1030 <constant_time_is_zero@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @constant_time_is_zero_8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @constant_time_is_zero(i32 %3)
%5 = trunc i64 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @constant_time_is_zero_8(i32 %0) {
%2 = tail call i64 @constant_time_is_zero(i32 %0)
%3 = trunc i64 %2 to i8
ret i8 %3
}
void pidTest() {}


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

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

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

LLVM IR (-O2):
define void @pidTest() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
void output(char p) {
  putchar(p);
  exit(0);
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<output>:
push   %rax
call   1030 <putchar@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @output(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @putchar(i8 signext %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @output(i8 signext %0) {
%2 = tail call i32 @putchar(i8 signext %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int rand();
void buf_fill(uint8_t *buf) {
  int i;
  for (i = 0; i < (1024 * 1024); i++) {
    *buf = (rand() & 0xff);
    buf++;
  }
}


x86 assembly (clang, -O0):
<buf_fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x100000,-0xc(%rbp)
jge    115f <buf_fill+0x4f>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <buf_fill+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_fill>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
movzbl %al,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    $0x100000,%ebx
jne    1120 <buf_fill+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @buf_fill(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1048576
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = call i32 (...) @rand()
%9 = and i32 %8, 255
%10 = load i32*, i32** %2
store i32 %9, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i32 1
store i32* %12, i32** %2
br label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @buf_fill(i32* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = phi i32* [ %0, %1 ], [ %7, %2 ]
%5 = tail call i32 (...) @rand()
%6 = and i32 %5, 255
store i32 %6, i32* %4
%7 = getelementptr inbounds i32, i32* %4, i64 1
%8 = add nuw nsw i32 %3, 1
%9 = icmp eq i32 %8, 1048576
br i1 %9, label %10, label %2
10: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void child2() { printf("child2 is me\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"child2 is me\0A\00"
define void @child2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"child2 is me\00"
define void @child2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int partition(double *, int, int);
void quicksortHelper(double lyst[], int lo, int hi) {
  if (lo >= hi)
    return;
  int b = partition(lyst, lo, hi);
  quicksortHelper(lyst, lo, b - 1);
  quicksortHelper(lyst, b + 1, hi);
}


x86 assembly (clang, -O0):
<quicksortHelper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1143 <quicksortHelper+0x23>
jmp    1179 <quicksortHelper+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quicksortHelper@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quicksortHelper@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksortHelper>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quicksortHelper+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quicksortHelper@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksortHelper+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quicksortHelper(double* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(double* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksortHelper(double* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int search_optab(char *);
int search_symtab(char *);
int main() {
  printf("%d", search_symtab("TOTAL"));
  printf("%d", search_optab("ADD"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebd(%rip),%rdi
call   1040 <search_symtab@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
call   1050 <search_optab@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xecb(%rip),%rdi
call   1040 <search_symtab@plt>
lea    0xebc(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
call   1050 <search_optab@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"TOTAL\00"
@.str.2 = [4 x i8] c"ADD\00"
define i32 @main() {
%1 = tail call i32 @search_symtab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @search_optab(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char, int);
int /*<<< orphan*/ stderr;
int c_syntax_test(int argc, char *argv[]) {
  fprintf(stderr, "test: %s %c %d\n", "str", 'x', 42);
  return 0;
}


x86 assembly (clang, -O0):
<c_syntax_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
lea    0xeda(%rip),%rdx
mov    $0x78,%ecx
mov    $0x2a,%r8d
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_syntax_test>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
lea    0xee8(%rip),%rdx
mov    $0x78,%ecx
mov    $0x2a,%r8d
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"test: %s %c %d\0A\00"
@.str.1 = [4 x i8] c"str\00"
define i32 @c_syntax_test(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 120, i32 42)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"test: %s %c %d\0A\00"
@.str.1 = [4 x i8] c"str\00"
define i32 @c_syntax_test(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 120, i32 42)
ret i32 0
}
/* Type definitions */
struct msghdr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ bsd_syscall_recvmsg(int, struct msghdr *, int);
ssize_t uptcp_recvmsg(int s, struct msghdr *msg, int flags) {
  return bsd_syscall_recvmsg(s, msg, flags);
}


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

x86 assembly (clang, -O2):
<uptcp_recvmsg>:
jmp    1030 <bsd_syscall_recvmsg@plt>

LLVM IR (-O0):
%struct.msghdr = type { i32 }
define i32 @uptcp_recvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.msghdr*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.msghdr* %1, %struct.msghdr** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.msghdr*, %struct.msghdr** %5
%9 = load i32, i32* %6
%10 = call i32 @bsd_syscall_recvmsg(i32 %7, %struct.msghdr* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.msghdr = type { i32 }
define i32 @uptcp_recvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = tail call i32 @bsd_syscall_recvmsg(i32 %0, %struct.msghdr* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_insert_epi16(int /*<<< orphan*/, int, int);
__m128i __mm_insert_epi16(__m128i A, int B, int const I) {
  return _mm_insert_epi16(A, B, 1);
}


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

x86 assembly (clang, -O2):
<__mm_insert_epi16>:
mov    $0x1,%edx
jmp    1030 <_mm_insert_epi16@plt>

LLVM IR (-O0):
define i32 @__mm_insert_epi16(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 = call i32 @_mm_insert_epi16(i32 %7, i32 %8, i32 1)
ret i32 %9
}

LLVM IR (-O2):
define i32 @__mm_insert_epi16(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_mm_insert_epi16(i32 %0, i32 %1, i32 1)
ret i32 %4
}
void initialize_dist_() { return; }


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

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

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

LLVM IR (-O2):
define void @initialize_dist_() {
ret void
}
void sub3(n) int n;
{
  work1(n);
#pragma omp barrier
  work2(n);
}


x86 assembly (clang, -O0):
<sub3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <work1@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <work2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub3>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <work1@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <work2@plt>

LLVM IR (-O0):
define void @sub3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @work1 to i32 (i32, ...)*)(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 (i32, ...) bitcast (i32 (...)* @work2 to i32 (i32, ...)*)(i32 %5)
ret void
}

LLVM IR (-O2):
define void @sub3(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @work1 to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @work2 to i32 (i32, ...)*)(i32 %0)
ret void
}
void HFillRectangle(int x0, int y0, int x1, int y1) {}


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

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

LLVM IR (-O0):
define void @HFillRectangle(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @HFillRectangle(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
void swap(int input[], int a, int b) {
  if (a == b)
    return;
  int temp = input[a];
  input[a] = input[b];
  input[b] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    111f <swap+0x1f>
jmp    1151 <swap+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
cmp    %edx,%esi
je     1116 <swap+0x16>
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %32
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
store i32 %17, i32* %7
%18 = load i32*, i32** %4
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
%27 = load i32, i32* %7
%28 = load i32*, i32** %4
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
store i32 %27, i32* %31
br label %32
32: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, %2
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
store i32 %11, i32* %7
store i32 %8, i32* %10
br label %12
12: ; preds = %3, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bcm2835_i2c_read_register_rs(char *, char *, unsigned int);
int /*<<< orphan*/ bcm2835_i2c_setSlaveAddress(unsigned char);
void I2C_ReadByteArray(unsigned char address, char reg, char *buffer,
                       unsigned int length) {
  bcm2835_i2c_setSlaveAddress(address);
  bcm2835_i2c_read_register_rs(&reg, buffer, length);
}


x86 assembly (clang, -O0):
<I2C_ReadByteArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <bcm2835_i2c_setSlaveAddress@plt>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x2(%rbp),%rdi
call   1040 <bcm2835_i2c_read_register_rs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2C_ReadByteArray>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
mov    %sil,0x7(%rsp)
call   1030 <bcm2835_i2c_setSlaveAddress@plt>
lea    0x7(%rsp),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <bcm2835_i2c_read_register_rs@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @I2C_ReadByteArray(i8 zeroext %0, i8 signext %1, i8* %2, i32 %3) {
%5 = alloca i8
store i8 %1, i8* %5
%6 = tail call i32 @bcm2835_i2c_setSlaveAddress(i8 zeroext %0)
%7 = call i32 @bcm2835_i2c_read_register_rs(i8* %5, i8* %2, i32 %3)
ret void
}
void NoPinC__0__GeneralIO__clr(void) {}


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

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

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

LLVM IR (-O2):
define void @NoPinC__0__GeneralIO__clr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("\nusage: cd (/path/to/SUBDIR)\n\n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"\0Ausage: cd (/path/to/SUBDIR)\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"\0Ausage: cd (/path/to/SUBDIR)\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
int mgrTuningCond(int code, void *arg1, void *arg2) {
  ;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @mgrTuningCond(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @mgrTuningCond(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void attano_yyfree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<attano_yyfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @attano_yyfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ORA_();
int /*<<< orphan*/ c64_memAbsoluteAddrY();
void ORA_absy(void) {
  c64_memAbsoluteAddrY();
  ORA_();
}


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

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

LLVM IR (-O0):
define void @ORA_absy() {
%1 = call i32 (...) @c64_memAbsoluteAddrY()
%2 = call i32 (...) @ORA_()
ret void
}

LLVM IR (-O2):
define void @ORA_absy() {
%1 = tail call i32 (...) @c64_memAbsoluteAddrY()
%2 = tail call i32 (...) @ORA_()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mg_freea(void *ptr) {
  if (ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<mg_freea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <mg_freea+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_freea>:
test   %rdi,%rdi
je     111a <mg_freea+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @mg_freea(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @mg_freea(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int ehrpwm_pwm_set_pol(int /*<<< orphan*/, int /*<<< orphan*/);
int mdaq_pwm_set_polarity(uint8_t channel, uint8_t polarity) {
  return ehrpwm_pwm_set_pol(channel, polarity);
}


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

x86 assembly (clang, -O2):
<mdaq_pwm_set_polarity>:
jmp    1030 <ehrpwm_pwm_set_pol@plt>

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

LLVM IR (-O2):
define i32 @mdaq_pwm_set_polarity(i32 %0, i32 %1) {
%3 = tail call i32 @ehrpwm_pwm_set_pol(i32 %0, i32 %1)
ret i32 %3
}
void lockdep_skip_validate(struct lockdep_map *lock) {}


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

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

LLVM IR (-O0):
%struct.lockdep_map = type opaque
define void @lockdep_skip_validate(%struct.lockdep_map* %0) {
%2 = alloca %struct.lockdep_map*
store %struct.lockdep_map* %0, %struct.lockdep_map** %2
ret void
}

LLVM IR (-O2):
%struct.lockdep_map = type opaque
define void @lockdep_skip_validate(%struct.lockdep_map* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *check_ptr(void *ptr) {
  if (!ptr) {
    fprintf(stderr, "memory depletion!\n");
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<check_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <check_ptr+0x36>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_ptr>:
test   %rdi,%rdi
je     1129 <check_ptr+0x9>
mov    %rdi,%rax
ret
push   %rax
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"memory depletion!\0A\00"
define i8* @check_ptr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"memory depletion!\0A\00"
define i8* @check_ptr(i8* readnone returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xca() {
  Assert_real((isgraph(202) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              1015, ("isgraph should be 0 for 0xca"));
}


x86 assembly (clang, -O0):
<t_isgraph_0xca>:
push   %rbp
mov    %rsp,%rbp
mov    $0xca,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3f7,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0xca>:
push   %rax
mov    $0xca,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3f7,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xca\00"
define void @t_isgraph_0xca() {
%1 = tail call i64 @isgraph(i32 202)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1015, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
int __byte_encode_array(void *_buf, int offset, int maxlen, const uint8_t *p,
                        int elements) {
  if (maxlen < elements)
    return -1;
  uint8_t *buf = (uint8_t *)_buf;
  memcpy(&buf[offset], p, elements);
  return elements;
}


x86 assembly (clang, -O0):
<__byte_encode_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1142 <__byte_encode_array+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <__byte_encode_array+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__byte_encode_array>:
mov    $0xffffffff,%eax
cmp    %r8d,%edx
jl     1133 <__byte_encode_array+0x23>
push   %rbx
mov    %r8d,%ebx
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
mov    %rcx,%rsi
mov    %r8d,%edx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @__byte_encode_array(i8* %0, i32 %1, i32 %2, i32* %3, i32 %4) {
%6 = icmp slt i32 %2, %4
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = bitcast i8* %0 to i32*
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i32, i32* %8, i64 %9
%11 = tail call i32 @memcpy(i32* %10, i32* %3, i32 %4)
br label %12
12: ; preds = %5, %7
%13 = phi i32 [ %4, %7 ], [ -1, %5 ]
ret i32 %13
}
hh1(a) { return a; }


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

x86 assembly (clang, -O2):
<hh1>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @hh1(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double Wtime_usec(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1e6 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<Wtime_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Wtime_usec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x8(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, double }
define double @Wtime_usec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = sitofp i32 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load double, double* %6
%8 = call double @llvm.fmuladd.f64(double %5, double 1.000000e+06, double %7)
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { i32, double }
define double @Wtime_usec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %6, double 1.000000e+06, double %8)
ret double %9
}
void REMR3Run(void) {}


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

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

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

LLVM IR (-O2):
define void @REMR3Run() {
ret void
}
/* Variables and functions */
char *parse_proc(char *, char *);
char *get_page_table_entries(char *proc_path) {
  char *pte = parse_proc(proc_path, "VmPTE:\t");
  return pte;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"VmPTE:\09\00"
define i8* @get_page_table_entries(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @parse_proc(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"VmPTE:\09\00"
define i8* @get_page_table_entries(i8* %0) {
%2 = tail call i8* @parse_proc(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Type definitions */
struct util_dirp {
  int dummy;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int errno;
int /*<<< orphan*/ *opendir(char const *);
int do_opendir(const char *name, struct util_dirp **dp) {
  DIR *rdp = opendir(name);
  if (!rdp)
    return -errno;
  *dp = (struct util_dirp *)rdp;
  return 0;
}


x86 assembly (clang, -O0):
<do_opendir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    114b <do_opendir+0x3b>
xor    %eax,%eax
mov    0x2e9f(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <do_opendir+0x4d>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_opendir>:
push   %rbx
mov    %rsi,%rbx
call   1030 <opendir@plt>
test   %rax,%rax
je     1125 <do_opendir+0x15>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret
mov    0x2eb4(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.util_dirp = type { i32 }
@errno = global i32 0
define i32 @do_opendir(i8* %0, %struct.util_dirp** %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.util_dirp**
%6 = alloca i32*
store i8* %0, i8** %4
store %struct.util_dirp** %1, %struct.util_dirp*** %5
%7 = load i8*, i8** %4
%8 = call i32* @opendir(i8* %7)
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = icmp ne i32* %9, null
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = sub nsw i32 0, %12
store i32 %13, i32* %3
br label %18
14: ; preds = %2
%15 = load i32*, i32** %6
%16 = bitcast i32* %15 to %struct.util_dirp*
%17 = load %struct.util_dirp**, %struct.util_dirp*** %5
store %struct.util_dirp* %16, %struct.util_dirp** %17
store i32 0, i32* %3
br label %18
18: ; preds = %14, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.util_dirp = type { i32 }
@errno = global i32 0
define i32 @do_opendir(i8* nocapture %0, %struct.util_dirp** nocapture writeonly %1) {
%3 = tail call i32* @opendir(i8* %0)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %2
%9 = bitcast %struct.util_dirp** %1 to i32**
store i32* %3, i32** %9
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ 0, %8 ], [ %7, %5 ]
ret i32 %11
}
int isalpha(int c) { return (64 < c && c < 91) || (96 < c && c < 123); }


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x40,%eax
cmp    -0x4(%rbp),%eax
jge    1124 <isalpha+0x24>
mov    $0x1,%al
cmpl   $0x5b,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1147 <isalpha+0x47>
xor    %eax,%eax
mov    $0x60,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x6(%rbp)
jge    1141 <isalpha+0x41>
cmpl   $0x7b,-0x4(%rbp)
setl   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 64, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 91
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp slt i32 96, %9
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 123
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int xop() {
  printf("XOP is not supported.");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"XOP is not supported.\00"
define i32 @xop() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"XOP is not supported.\00"
define i32 @xop() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ NupAndDownFast();
void NcrFast(void) {
  int x;
  *((unsigned int *)0xC000A044) &= ~(1 << 1);
  for (x = 0; x < 2; x++) {
    NupAndDownFast();
  }
}


x86 assembly (clang, -O0):
<NcrFast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc000a044,%eax
mov    (%rax),%ecx
and    $0xfffffffd,%ecx
mov    $0xc000a044,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    114f <NcrFast+0x3f>
mov    $0x0,%al
call   1030 <NupAndDownFast@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1130 <NcrFast+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NcrFast>:
push   %rax
mov    $0xc000a044,%eax
andb   $0xfd,(%rax)
xor    %eax,%eax
call   1030 <NupAndDownFast@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <NupAndDownFast@plt>

LLVM IR (-O0):
define void @NcrFast() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 3221266500 to i32*)
%3 = and i32 %2, -3
store i32 %3, i32* inttoptr (i64 3221266500 to i32*)
store i32 0, i32* %1
br label %4
4: ; preds = %9, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i32 (...) @NupAndDownFast()
br label %9
9: ; preds = %7
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @NcrFast() {
%1 = load i32, i32* inttoptr (i64 3221266500 to i32*)
%2 = and i32 %1, -3
store i32 %2, i32* inttoptr (i64 3221266500 to i32*)
%3 = tail call i32 (...) @NupAndDownFast()
%4 = tail call i32 (...) @NupAndDownFast()
ret void
}
void do_k_times_array(int n) {
  int k = n;
  int a[10];
  for (int i = 0; i < k; i++) {
    a[k] = 4 + k;
  }
}


x86 assembly (clang, -O0):
<do_k_times_array>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113c <do_k_times_array+0x3c>
mov    -0x8(%rbp),%ecx
add    $0x4,%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1114 <do_k_times_array+0x14>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @do_k_times_array(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x i32]
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
store i32 %6, i32* %3
store i32 0, i32* %5
br label %7
7: ; preds = %17, %1
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 4, %12
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %15
store i32 %13, i32* %16
br label %17
17: ; preds = %11
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %7
20: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @do_k_times_array(i32 %0) {
ret void
}
/* Variables and functions */
unsigned long dec(int *);
int /*<<< orphan*/ futex(int *, int, int, int /*<<< orphan*/ *,
                         int /*<<< orphan*/ *, int /*<<< orphan*/);
void fulock(int *val) {
  unsigned long n;
  if ((n = dec(val)) != 1) {
    *val = 0;
    futex(val, 1, 1, NULL, NULL, 0);
  }
}


x86 assembly (clang, -O0):
<fulock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <dec@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x1,%rax
je     1168 <fulock+0x48>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %edx,%esi
mov    %r8,%rcx
call   1040 <futex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fulock>:
push   %rbx
mov    %rdi,%rbx
call   1030 <dec@plt>
cmp    $0x1,%rax
jne    1131 <fulock+0x11>
pop    %rbx
ret
movl   $0x0,(%rbx)
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
pop    %rbx
jmp    1040 <futex@plt>

LLVM IR (-O0):
define void @fulock(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i64 @dec(i32* %4)
store i64 %5, i64* %3
%6 = icmp ne i64 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32*, i32** %2
store i32 0, i32* %8
%9 = load i32*, i32** %2
%10 = call i32 @futex(i32* %9, i32 1, i32 1, i32* null, i32* null, i32 0)
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @fulock(i32* %0) {
%2 = tail call i64 @dec(i32* %0)
%3 = icmp eq i64 %2, 1
br i1 %3, label %6, label %4
4: ; preds = %1
store i32 0, i32* %0
%5 = tail call i32 @futex(i32* %0, i32 1, i32 1, i32* null, i32* null, i32 0)
br label %6
6: ; preds = %4, %1
ret void
}