xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ askQuestions(int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand((time(NULL)));
  askQuestions(2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x2,%edi
call   1030 <askQuestions@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x2,%edi
call   1030 <askQuestions@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 @askQuestions(i32 2)
ret i32 0
}
/* Variables and functions */
unsigned long long fib(bool reset) {
  static unsigned long long prev_a, prev_b;
  unsigned long long temp = 0;
  if (reset) {
    prev_a = 0;
    prev_b = 1;
    return 1;
  }
  temp = prev_a;
  prev_a = prev_b;
  prev_b = prev_a + temp;
  return prev_b;
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113c <fib+0x3c>
movq   $0x0,0x2f04(%rip)
movq   $0x1,0x2f01(%rip)
movq   $0x1,-0x8(%rbp)
jmp    1172 <fib+0x72>
mov    0x2ee5(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ee2(%rip),%rax
mov    %rax,0x2ed3(%rip)
mov    0x2ecc(%rip),%rax
add    -0x18(%rbp),%rax
mov    %rax,0x2ec9(%rip)
mov    0x2ec2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
test   %edi,%edi
je     111c <fib+0x1c>
movq   $0x0,0x2f19(%rip)
mov    $0x1,%eax
mov    %rax,0x2f15(%rip)
ret
mov    0x2f0d(%rip),%rcx
mov    0x2efe(%rip),%rax
add    %rcx,%rax
mov    %rcx,0x2ef4(%rip)
mov    %rax,0x2ef5(%rip)
ret

LLVM IR (-O0):
@fib.prev_a = internal global i64 0
@fib.prev_b = internal global i64 0
define i64 @fib(i32 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 0, i64* %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 0, i64* @fib.prev_a
store i64 1, i64* @fib.prev_b
store i64 1, i64* %2
br label %15
8: ; preds = %1
%9 = load i64, i64* @fib.prev_a
store i64 %9, i64* %4
%10 = load i64, i64* @fib.prev_b
store i64 %10, i64* @fib.prev_a
%11 = load i64, i64* @fib.prev_a
%12 = load i64, i64* %4
%13 = add i64 %11, %12
store i64 %13, i64* @fib.prev_b
%14 = load i64, i64* @fib.prev_b
store i64 %14, i64* %2
br label %15
15: ; preds = %8, %7
%16 = load i64, i64* %2
ret i64 %16
}

LLVM IR (-O2):
@fib.prev_a = internal unnamed_addr global i64 0
@fib.prev_b = internal unnamed_addr global i64 0
define i64 @fib(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %1
store i64 0, i64* @fib.prev_a
br label %8
4: ; preds = %1
%5 = load i64, i64* @fib.prev_a
%6 = load i64, i64* @fib.prev_b
store i64 %6, i64* @fib.prev_a
%7 = add i64 %6, %5
br label %8
8: ; preds = %4, %3
%9 = phi i64 [ %7, %4 ], [ 1, %3 ]
store i64 %9, i64* @fib.prev_b
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void MG_finalize(void) {
  printf("ERROR: MG_finalize called but DDalphaAMG library not included.\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [64 x i8] c"ERROR: MG_finalize called but DDalphaAMG library not included.\0A\00"
define void @MG_finalize() {
%1 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [63 x i8] c"ERROR: MG_finalize called but DDalphaAMG library not included.\00"
define void @MG_finalize() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _Check(int /*<<< orphan*/, char *, char *, int);
void *calloc(size_t, size_t);
void *_New(size_t Num, size_t Size) {
  void *ret = calloc(Num, Size);
  _Check(
      ret != NULL, "ret != NULL",
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/eaglef2/Shellzilla/refs/heads/master/check.c",
      36);
  return ret;
}


x86 assembly (clang, -O0):
<_New>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeab(%rip),%rsi
lea    0xeb0(%rip),%rdx
mov    $0x24,%ecx
call   1040 <_Check@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_New>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
lea    0xec7(%rip),%rsi
lea    0xecc(%rip),%rdx
mov    $0x24,%ecx
call   1040 <_Check@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"ret != NULL\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/eaglef2/Shellzilla/refs/heads/master/check.c\00"
define i8* @_New(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @_Check(i32 %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 36)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
@.str = [12 x i8] c"ret != NULL\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/eaglef2/Shellzilla/refs/heads/master/check.c\00"
define noalias i8* @_New(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @_Check(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 36)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ skytraq_rd_deinit();
void miniHomer_rd_deinit(void) { skytraq_rd_deinit(); }


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

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

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

LLVM IR (-O2):
define void @miniHomer_rd_deinit() {
%1 = tail call i32 (...) @skytraq_rd_deinit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void lib_msleep(int v0) { printf("msleep  %d \n", v0); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"msleep %d \0A\00"
define void @lib_msleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"msleep %d \0A\00"
define void @lib_msleep(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int gcd2nums(int, int);
int gcdnnums(int *arr, int n) {
  int gcd = arr[0];
  for (int i = 1; i < n; i++) {
    gcd = gcd2nums(arr[i], gcd);
  }
  return gcd;
}


x86 assembly (clang, -O0):
<gcdnnums>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <gcdnnums+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x10(%rbp),%esi
call   1030 <gcd2nums@plt>
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <gcdnnums+0x1f>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcdnnums>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%eax
cmp    $0x2,%esi
jl     1144 <gcdnnums+0x34>
mov    %rdi,%r15
mov    %esi,%r14d
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
mov    %eax,%esi
call   1030 <gcd2nums@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <gcdnnums+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @gcdnnums(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9, %2
%8 = phi i32 [ %3, %2 ], [ %14, %9 ]
ret i32 %8
9: ; preds = %5, %9
%10 = phi i64 [ 1, %5 ], [ %15, %9 ]
%11 = phi i32 [ %3, %5 ], [ %14, %9 ]
%12 = getelementptr inbounds i32, i32* %0, i64 %10
%13 = load i32, i32* %12
%14 = tail call i32 @gcd2nums(i32 %13, i32 %11)
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %6
br i1 %16, label %7, label %9
}
float floatMultiply(float a, float b) { return a * b; }


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

x86 assembly (clang, -O2):
<floatMultiply>:
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @floatMultiply(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @floatMultiply(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
void acquire_fs(struct ext2_fs *f) {}


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

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

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

LLVM IR (-O2):
%struct.ext2_fs = type opaque
define void @acquire_fs(%struct.ext2_fs* nocapture %0) {
ret void
}
void foo176() {}


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

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

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

LLVM IR (-O2):
define void @foo176() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void writeToFile() {
  FILE *fp;
  fp = fopen("/home/caleb/Documents/genesis/data/myself", "w");
  char name[10] = "London";
  fprintf(fp, "This is a flight ticket to %s\n", name);
  fclose(fp);
}


x86 assembly (clang, -O0):
<writeToFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    0xef5(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xef2(%rip),%ax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x12(%rbp),%rdx
lea    0xeb8(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeToFile>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xee7(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
movabs $0x6e6f646e6f4c,%rax
mov    %rax,(%rsp)
movw   $0x0,0x8(%rsp)
lea    0xec5(%rip),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"/home/caleb/Documents/genesis/data/myself\00"
@.str.1 = [2 x i8] c"w\00"
@__const.writeToFile.name = [10 x i8] c"London\00\00\00\00"
@.str.2 = [31 x i8] c"This is a flight ticket to %s\0A\00"
define void @writeToFile() {
%1 = alloca i32*
%2 = alloca [10 x i8]
%3 = call i32* @fopen(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = bitcast [10 x i8]* %2 to i8*
%5 = load i32*, i32** %1
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %1
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"/home/caleb/Documents/genesis/data/myself\00"
@.str.1 = [2 x i8] c"w\00"
@__const.writeToFile.name = [10 x i8] c"London\00\00\00\00"
@.str.2 = [31 x i8] c"This is a flight ticket to %s\0A\00"
define void @writeToFile() {
%1 = alloca [10 x i8]
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%5 = call i32 @fclose(i32* %2)
ret void
}
double arcmin2deg(double x) { return (x / 60.0); }


x86 assembly (clang, -O0):
<arcmin2deg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @arcmin2deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 6.000000e+01
ret double %4
}

LLVM IR (-O2):
define double @arcmin2deg(double %0) {
%2 = fdiv double %0, 6.000000e+01
ret double %2
}
int test_imm_A6int64_lowword_reg(long long val) {
  return ((val) & (0xA6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A6int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xa6,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A6int64_lowword_reg>:
test   $0xa6,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A6int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 166
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_A6int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 166
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_end() { fprintf(stderr, "----- p end   -----\n"); }


x86 assembly (clang, -O0):
<print_end>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_end>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"----- p end -----\0A\00"
define void @print_end() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"----- p end -----\0A\00"
define void @print_end() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ array_unshift(void *, void *);
void _unshift_cb(void *p_array, void *p_void) {
  array_unshift(p_array, p_void);
}


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

x86 assembly (clang, -O2):
<_unshift_cb>:
jmp    1030 <array_unshift@plt>

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

LLVM IR (-O2):
define void @_unshift_cb(i8* %0, i8* %1) {
%3 = tail call i32 @array_unshift(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ kbd_buffer_add(int);
int serial_poll(void) {
  int ready = inb(0xfffb) & 0x01;
  if (ready)
    kbd_buffer_add(inb(0xfffa));
  return ready;
}


x86 assembly (clang, -O0):
<serial_poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xfffb,%edi
call   1030 <inb@plt>
and    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1153 <serial_poll+0x33>
mov    $0xfffa,%edi
call   1030 <inb@plt>
mov    %eax,%edi
call   1040 <kbd_buffer_add@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_poll>:
push   %rbx
mov    $0xfffb,%edi
call   1030 <inb@plt>
mov    %eax,%ebx
and    $0x1,%ebx
je     1143 <serial_poll+0x23>
mov    $0xfffa,%edi
call   1030 <inb@plt>
mov    %eax,%edi
call   1040 <kbd_buffer_add@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @serial_poll() {
%1 = alloca i32
%2 = call i32 @inb(i32 65531)
%3 = and i32 %2, 1
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @inb(i32 65530)
%8 = call i32 @kbd_buffer_add(i32 %7)
br label %9
9: ; preds = %6, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @serial_poll() {
%1 = tail call i32 @inb(i32 65531)
%2 = and i32 %1, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 @inb(i32 65530)
%6 = tail call i32 @kbd_buffer_add(i32 %5)
br label %7
7: ; preds = %4, %0
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __setCHRBank1High(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ m22_SetChrROMBank1();
void m22_setParamsBXX3(uint16_t addr, uint8_t val) {
  __setCHRBank1High(addr, val);
  m22_SetChrROMBank1();
}


x86 assembly (clang, -O0):
<m22_setParamsBXX3>:
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 <__setCHRBank1High@plt>
mov    $0x0,%al
call   1040 <m22_SetChrROMBank1@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @m22_setParamsBXX3(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 @__setCHRBank1High(i32 %5, i32 %6)
%8 = call i32 (...) @m22_SetChrROMBank1()
ret void
}

LLVM IR (-O2):
define void @m22_setParamsBXX3(i32 %0, i32 %1) {
%3 = tail call i32 @__setCHRBank1High(i32 %0, i32 %1)
%4 = tail call i32 (...) @m22_SetChrROMBank1()
ret void
}
short axt_to_int16(short axt_int16) {
  unsigned char *buf = (unsigned char *)&axt_int16;
  return (((unsigned int)buf[0]) << 8) + (((unsigned int)buf[1]));
}


x86 assembly (clang, -O0):
<axt_to_int16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<axt_to_int16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define signext i16 @axt_to_int16(i16 signext %0) {
%2 = alloca i16
%3 = alloca i8*
store i16 %0, i16* %2
%4 = bitcast i16* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = add i32 %9, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define signext i16 @axt_to_int16(i16 signext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
int octave_o_rdwr_wrapper(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @octave_o_rdwr_wrapper() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @octave_o_rdwr_wrapper() {
ret i32 -1
}
unsigned setBit_fun_uint(unsigned x, unsigned i) { return x | 1 << i; }


x86 assembly (clang, -O0):
<setBit_fun_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @setBit_fun_uint(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 = shl i32 1, %6
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @setBit_fun_uint(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int remove(char *);
int unlink(char *filename) { return remove(filename); }


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

x86 assembly (clang, -O2):
<unlink>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define i32 @unlink(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
/* Type definitions */
struct msghdr {
  int dummy;
};
typedef int ssize_t;

/* Variables and functions */
int recvmsg(int, struct msghdr *, int);
ssize_t xrecvmsg(int sockfd, struct msghdr *msg, int flags) {
  int rec = recvmsg(sockfd, msg, flags);
  if (rec == -1) {
    ;
  }
  return rec;
}


x86 assembly (clang, -O0):
<xrecvmsg>:
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 <recvmsg@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1143 <xrecvmsg+0x33>
jmp    1143 <xrecvmsg+0x33>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrecvmsg>:
jmp    1030 <recvmsg@plt>

LLVM IR (-O0):
%struct.msghdr = type { i32 }
define i32 @xrecvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.msghdr*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store %struct.msghdr* %1, %struct.msghdr** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load %struct.msghdr*, %struct.msghdr** %5
%10 = load i32, i32* %6
%11 = call i32 @recvmsg(i32 %8, %struct.msghdr* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %3
br label %15
15: ; preds = %14, %3
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
%struct.msghdr = type { i32 }
define i32 @xrecvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = tail call i32 @recvmsg(i32 %0, %struct.msghdr* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_pm(int hour) {
  if ((hour < 10 && hour >= 0) || (hour < 23 && hour > 12)) {
    printf(".00 P.M. AND 0%d.00 P.M.", hour);
  } else {
    printf(".00 P.M. AND %d.00 P.M.", hour);
  }
}


x86 assembly (clang, -O0):
<print_pm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    112f <print_pm+0x1f>
cmpl   $0x0,-0x4(%rbp)
jge    1143 <print_pm+0x33>
cmpl   $0x17,-0x4(%rbp)
jge    1157 <print_pm+0x47>
cmpl   $0xc,-0x4(%rbp)
jle    1157 <print_pm+0x47>
mov    -0x4(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1166 <print_pm+0x56>
mov    -0x4(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_pm>:
mov    %edi,%esi
lea    -0xd(%rsi),%eax
cmp    $0xa,%eax
lea    0xee1(%rip),%rax
lea    0xef3(%rip),%rdi
cmovb  %rax,%rdi
cmp    $0xa,%esi
cmovb  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c".00 P.M. AND 0%d.00 P.M.\00"
@.str.1 = [24 x i8] c".00 P.M. AND %d.00 P.M.\00"
define void @print_pm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 23
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 12
br i1 %13, label %14, label %17
14: ; preds = %11, %5
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %20
17: ; preds = %11, %8
%18 = load i32, i32* %2
%19 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %17, %14
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c".00 P.M. AND 0%d.00 P.M.\00"
@.str.1 = [24 x i8] c".00 P.M. AND %d.00 P.M.\00"
define void @print_pm(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = add i32 %0, -13
%4 = icmp ult i32 %3, 10
%5 = or i1 %2, %4
%6 = select i1 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0)
%7 = tail call i32 @printf(i8* %6, i32 %0)
ret void
}
char chop_at(char *str, int position) {
  char last_char = str[position];
  str[position] = '\0';
  return last_char;
}


x86 assembly (clang, -O0):
<chop_at>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movsbl -0xd(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chop_at>:
movslq %esi,%rcx
mov    (%rdi,%rcx,1),%al
movb   $0x0,(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define signext i8 @chop_at(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
store i8 %10, i8* %5
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
%15 = load i8, i8* %5
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @chop_at(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
store i8 0, i8* %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isupper(int);
void t_isupper_0x4d() {
  Assert_real((isupper(77)),
              "/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_isupper.c",
              390, ("isupper should be 1 for M"));
}


x86 assembly (clang, -O0):
<t_isupper_0x4d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4d,%edi
call   1030 <isupper@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x186,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x4d>:
push   %rax
mov    $0x4d,%edi
call   1030 <isupper@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x186,%edx
pop    %rax
jmp    1040 <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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for M\00"
define void @t_isupper_0x4d() {
%1 = call i32 @isupper(i32 77)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 390, i8* getelementptr inbounds ([26 x i8], [26 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for M\00"
define void @t_isupper_0x4d() {
%1 = tail call i32 @isupper(i32 77)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 390, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_27uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x27 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_27uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x27,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_27uint64_lowword_reg>:
test   $0x27,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_27uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 39
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_27uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 39
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
scalar_t__ strncmp(char *, char const *, int);
int /*<<< orphan*/ utf8_strlen_until_trailing_whitespace(char const *);
int64_t match_c_comment(const char *str) {
  if (strncmp("//", str, 2) == 0)
    return utf8_strlen_until_trailing_whitespace(str);
  return 0;
}


x86 assembly (clang, -O0):
<match_c_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    115c <match_c_comment+0x3c>
mov    -0x10(%rbp),%rdi
call   1040 <utf8_strlen_until_trailing_whitespace@plt>
mov    %eax,-0x4(%rbp)
jmp    1163 <match_c_comment+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_c_comment>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1141 <match_c_comment+0x21>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <utf8_strlen_until_trailing_whitespace@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"//\00"
define i32 @match_c_comment(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strncmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4, i32 2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @utf8_strlen_until_trailing_whitespace(i8* %8)
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"//\00"
define i32 @match_c_comment(i8* %0) {
%2 = tail call i64 @strncmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0, i32 2)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @utf8_strlen_until_trailing_whitespace(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
float floorf(float);
__attribute__((__weak__, __always___)) float softboundcets_floorf(float x) {
  return floorf(x);
}


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

x86 assembly (clang, -O2):
<softboundcets_floorf>:
jmp    1030 <floorf@plt>

LLVM IR (-O0):
define weak float @softboundcets_floorf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.floor.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define weak float @softboundcets_floorf(float %0) {
%2 = tail call float @llvm.floor.f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ SDL_Quit();
int /*<<< orphan*/ printlog(int, char *);
void graphics_quit(void) {
  printlog(1, "=> Quit graphics\n");
  SDL_Quit();
}


x86 assembly (clang, -O0):
<graphics_quit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xed0(%rip),%rsi
call   1040 <printlog@plt>
mov    $0x0,%al
call   1030 <SDL_Quit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<graphics_quit>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
call   1040 <printlog@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <SDL_Quit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"=> Quit graphics\0A\00"
define void @graphics_quit() {
%1 = call i32 @printlog(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @SDL_Quit()
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"=> Quit graphics\0A\00"
define void @graphics_quit() {
%1 = tail call i32 @printlog(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @SDL_Quit()
ret void
}
int factorial(int N) {
  if (N == 0)
    return 1;
  else
    N *factorial(N - 1);
  printf("%d", N);
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1141 <factorial+0x21>
movl   $0x1,-0x4(%rbp)
jmp    115d <factorial+0x3d>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
test   %edi,%edi
je     1140 <factorial+0x20>
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1030 <factorial@plt>
lea    0xeca(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rbx
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @factorial(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1, %4
ret i32 1
4: ; preds = %1
%5 = add nsw i32 %0, -1
%6 = tail call i32 @factorial(i32 %5)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %3
}
/* Variables and functions */
scalar_t__ strrchr(char const *, char);
const char *ShortPackageName(const char *str) {
  char *p = (char *)strrchr(str, '.');
  return (p == NULL) ? str : (const char *)p + 1;
}


x86 assembly (clang, -O0):
<ShortPackageName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1146 <ShortPackageName+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <ShortPackageName+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShortPackageName>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ShortPackageName(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strrchr(i8* %4, i8 signext 46)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %2
br label %14
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
br label %14
14: ; preds = %11, %9
%15 = phi i8* [ %10, %9 ], [ %13, %11 ]
ret i8* %15
}

LLVM IR (-O2):
define i8* @ShortPackageName(i8* %0) {
%2 = tail call i64 @strrchr(i8* %0, i8 signext 46)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = select i1 %4, i8* %0, i8* %5
ret i8* %6
}
int fn2(int a, int b) {
  int tem1 = b & a;
  int tem2 = a ^ b;
  return tem1 ^ tem2;
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = and i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = xor i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = xor i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn2(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int sqrt(int);
int isprime(int n) {
  int m;
  int sqrt_n = sqrt(n);
  for (m = 2; m <= sqrt_n + 1; m++)
    if ((n % m) == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     116d <isprime+0x5d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    115a <isprime+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1174 <isprime+0x64>
jmp    115f <isprime+0x4f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <isprime+0x1d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
push   %rbx
mov    %edi,%ebx
call   1030 <sqrt@plt>
mov    $0x1,%ecx
test   %eax,%eax
jle    114f <isprime+0x3f>
mov    %eax,%esi
neg    %esi
mov    $0x2,%edi
nopw   0x0(%rax,%rax,1)
mov    %ebx,%eax
cltd
idiv   %edi
test   %edx,%edx
je     114d <isprime+0x3d>
lea    (%rsi,%rdi,1),%eax
add    $0x1,%eax
mov    %edi,%edx
add    $0x1,%edx
mov    %edx,%edi
cmp    $0x2,%eax
jne    1130 <isprime+0x20>
jmp    114f <isprime+0x3f>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = add i32 %2, 1
br label %9
6: ; preds = %9
%7 = add nuw i32 %10, 1
%8 = icmp eq i32 %10, %5
br i1 %8, label %13, label %9
9: ; preds = %4, %6
%10 = phi i32 [ %7, %6 ], [ 2, %4 ]
%11 = srem i32 %0, %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %9, %6, %1
%14 = phi i32 [ 1, %1 ], [ 1, %6 ], [ 0, %9 ]
ret i32 %14
}
int do_486() { return 486; }


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

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

LLVM IR (-O0):
define i32 @do_486() {
ret i32 486
}

LLVM IR (-O2):
define i32 @do_486() {
ret i32 486
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *format_byte_one(uint8_t *restrict buffer, uint8_t byte) {
  *buffer = byte;
  return buffer + 1;
}


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

x86 assembly (clang, -O2):
<format_byte_one>:
mov    %esi,(%rdi)
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @format_byte_one(i32* noalias %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
store i32 %5, i32* %6
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 1
ret i32* %8
}

LLVM IR (-O2):
define i32* @format_byte_one(i32* noalias writeonly %0, i32 %1) {
store i32 %1, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ memset(char *, int, int);
int strlen(char *);
void foo() {
  char a[15000];
  a[0] = 0;
  memset(&a[0], 0xCD, 13371);
  a[13371] = 0;
  if (strlen(a) != 13371)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3aa0,%rsp
movb   $0x0,-0x3aa0(%rbp)
lea    -0x3aa0(%rbp),%rdi
mov    $0xcd,%esi
mov    $0x343b,%edx
call   1050 <memset@plt>
movb   $0x0,-0x665(%rbp)
lea    -0x3aa0(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x343b,%eax
je     117d <foo+0x4d>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x3aa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
sub    $0x3aa0,%rsp
movb   $0x0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xcd,%esi
mov    $0x343b,%edx
call   1050 <memset@plt>
movb   $0x0,0x343b(%rsp)
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    $0x343b,%eax
jne    1171 <foo+0x41>
add    $0x3aa0,%rsp
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo() {
%1 = alloca [15000 x i8]
%2 = getelementptr inbounds [15000 x i8], [15000 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = getelementptr inbounds [15000 x i8], [15000 x i8]* %1, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 205, i32 13371)
%5 = getelementptr inbounds [15000 x i8], [15000 x i8]* %1, i64 0, i64 13371
store i8 0, i8* %5
%6 = getelementptr inbounds [15000 x i8], [15000 x i8]* %1, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
%8 = icmp ne i32 %7, 13371
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = alloca [15000 x i8]
%2 = getelementptr inbounds [15000 x i8], [15000 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = call i32 @memset(i8* %2, i32 205, i32 13371)
%4 = getelementptr inbounds [15000 x i8], [15000 x i8]* %1, i64 0, i64 13371
store i8 0, i8* %4
%5 = call i32 @strlen(i8* %2)
%6 = icmp eq i32 %5, 13371
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
ret void
}
void vtime_user_exit(struct task_struct *tsk) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @vtime_user_exit(%struct.task_struct* nocapture %0) {
ret void
}
/* Type definitions */
struct po_parser {
  int dummy;
};
typedef int /*<<< orphan*/ empty;

/* Variables and functions */
int poparser_feed_line(struct po_parser *, char *, int);
int poparser_finish(struct po_parser *p) {
  char empty[4] = "";
  return poparser_feed_line(p, empty, sizeof(empty));
}


x86 assembly (clang, -O0):
<poparser_finish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <poparser_feed_line@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poparser_finish>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <poparser_feed_line@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.po_parser = type { i32 }
define i32 @poparser_finish(%struct.po_parser* %0) {
%2 = alloca %struct.po_parser*
%3 = alloca [4 x i8]
store %struct.po_parser* %0, %struct.po_parser** %2
%4 = bitcast [4 x i8]* %3 to i8*
%5 = load %struct.po_parser*, %struct.po_parser** %2
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%7 = call i32 @poparser_feed_line(%struct.po_parser* %5, i8* %6, i32 4)
ret i32 %7
}

LLVM IR (-O2):
%struct.po_parser = type { i32 }
define i32 @poparser_finish(%struct.po_parser* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @poparser_feed_line(%struct.po_parser* %0, i8* %3, i32 4)
ret i32 %4
}