xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ putLinePicture(double, double, int, int /*<<< orphan*/,
                                  double);
void putHorizontalLinePicture(double px, double py, double len) {
  putLinePicture(px, py, 1, 0, len);
}


x86 assembly (clang, -O0):
<putHorizontalLinePicture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <putLinePicture@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putHorizontalLinePicture>:
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <putLinePicture@plt>

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

LLVM IR (-O2):
define void @putHorizontalLinePicture(double %0, double %1, double %2) {
%4 = tail call i32 @putLinePicture(double %0, double %1, i32 1, i32 0, double %2)
ret void
}
struct page *trans_huge_page_release_decode(struct page *page) {
  return page;
}


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

x86 assembly (clang, -O2):
<trans_huge_page_release_decode>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.page = type opaque
define %struct.page* @trans_huge_page_release_decode(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
%3 = load %struct.page*, %struct.page** %2
ret %struct.page* %3
}

LLVM IR (-O2):
%struct.page = type opaque
define %struct.page* @trans_huge_page_release_decode(%struct.page* readnone returned %0) {
ret %struct.page* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int product(int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a;
  int b;
  printf("Please enter a and b: ");
  scanf("%i %i", &a, &b);
  printf("a*b = %i\n", product(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <product@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1040 <product@plt>
lea    0xeb7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Please enter a and b: \00"
@.str.1 = [6 x i8] c"%i %i\00"
@.str.2 = [10 x i8] c"a*b = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @product(i32 %6, i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Please enter a and b: \00"
@.str.1 = [6 x i8] c"%i %i\00"
@.str.2 = [10 x i8] c"a*b = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @product(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf(
      "Usage: faith -[e,d] [-l filelist] [-p pass] [-f size] [-n] device\n-e - "
      "encryption\n-d - decryption\n-l - list of files\n-p - password\n-f - "
      "use file instead of disk. Requires size\n-n - don't fill file/device "
      "with random data\nExamples:\nEncrypt files in filelist to device named "
      "/dev/sdb1\nfaith -e -l filelist /dev/sdb1\nEncrypt files in filelist to "
      "file named testfile with size 100 megabytes\nfaith -e -l filelist -f "
      "100M testfile\n\nDecrypt device or file with password pass\nfaith -d -p "
      "pass /dev/sdb1\nfaith -d -p pass testfile\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [522 x i8] c"Usage: faith -[e,d] [-l filelist] [-p pass] [-f size] [-n] device\0A-e - encryption\0A-d - decryption\0A-l - list of files\0A-p - password\0A-f - use file instead of disk. Requires size\0A-n - don't fill file/device with random data\0AExamples:\0AEncrypt files in filelist to device named /dev/sdb1\0Afaith -e -l filelist /dev/sdb1\0AEncrypt files in filelist to file named testfile with size 100 megabytes\0Afaith -e -l filelist -f 100M testfile\0A\0ADecrypt device or file with password pass\0Afaith -d -p pass /dev/sdb1\0Afaith -d -p pass testfile\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([522 x i8], [522 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [521 x i8] c"Usage: faith -[e,d] [-l filelist] [-p pass] [-f size] [-n] device\0A-e - encryption\0A-d - decryption\0A-l - list of files\0A-p - password\0A-f - use file instead of disk. Requires size\0A-n - don't fill file/device with random data\0AExamples:\0AEncrypt files in filelist to device named /dev/sdb1\0Afaith -e -l filelist /dev/sdb1\0AEncrypt files in filelist to file named testfile with size 100 megabytes\0Afaith -e -l filelist -f 100M testfile\0A\0ADecrypt device or file with password pass\0Afaith -d -p pass /dev/sdb1\0Afaith -d -p pass testfile\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([521 x i8], [521 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
long utilMacZero(unsigned char *byMac) {
  if (byMac == (0))
    return (-1);
  *byMac++ = 0;
  *byMac++ = 0;
  *byMac++ = 0;
  *byMac++ = 0;
  *byMac++ = 0;
  *byMac = 0;
  return (0);
}


x86 assembly (clang, -O0):
<utilMacZero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <utilMacZero+0x20>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1189 <utilMacZero+0x89>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utilMacZero>:
test   %rdi,%rdi
je     1114 <utilMacZero+0x14>
movw   $0x0,0x4(%rdi)
movl   $0x0,(%rdi)
xor    %eax,%eax
ret
mov    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @utilMacZero(i8* writeonly %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
br label %4
4: ; preds = %1, %3
%5 = phi i64 [ 0, %3 ], [ -1, %1 ]
ret i64 %5
}
int nrn_isdouble(void *pd, double min, double max) {
  int i;
  if (!pd) {
    return 0;
  }
  return *((double *)pd) >= min && *((double *)pd) <= max;
}


x86 assembly (clang, -O0):
<nrn_isdouble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1129 <nrn_isdouble+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1163 <nrn_isdouble+0x63>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
xor    %eax,%eax
ucomisd -0x18(%rbp),%xmm0
mov    %al,-0x25(%rbp)
jb     1158 <nrn_isdouble+0x58>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrn_isdouble>:
test   %rdi,%rdi
je     111d <nrn_isdouble+0x1d>
movsd  (%rdi),%xmm2
ucomisd %xmm0,%xmm2
setae  %al
ucomisd %xmm2,%xmm1
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @nrn_isdouble(i8* %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
%8 = alloca i32
store i8* %0, i8** %5
store double %1, double* %6
store double %2, double* %7
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %3
store i32 0, i32* %4
br label %27
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = bitcast i8* %13 to double*
%15 = load double, double* %14
%16 = load double, double* %6
%17 = fcmp oge double %15, %16
br i1 %17, label %18, label %24
18: ; preds = %12
%19 = load i8*, i8** %5
%20 = bitcast i8* %19 to double*
%21 = load double, double* %20
%22 = load double, double* %7
%23 = fcmp ole double %21, %22
br label %24
24: ; preds = %18, %12
%25 = phi i1 [ false, %12 ], [ %23, %18 ]
%26 = zext i1 %25 to i32
store i32 %26, i32* %4
br label %27
27: ; preds = %24, %11
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @nrn_isdouble(i8* %0, double %1, double %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = bitcast i8* %0 to double*
%7 = load double, double* %6
%8 = fcmp oge double %7, %1
%9 = fcmp ole double %7, %2
%10 = and i1 %8, %9
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %3, %5
%13 = phi i32 [ %11, %5 ], [ 0, %3 ]
ret i32 %13
}
/* Variables and functions */
int sleep(int);
int maybe_sleep(int sec) {
  if (sec == 0)
    return (0);
  return (sleep(sec));
}


x86 assembly (clang, -O0):
<maybe_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <maybe_sleep+0x21>
movl   $0x0,-0x4(%rbp)
jmp    113c <maybe_sleep+0x2c>
mov    -0x8(%rbp),%edi
call   1030 <sleep@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maybe_sleep>:
test   %edi,%edi
je     1119 <maybe_sleep+0x9>
jmp    1030 <sleep@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @maybe_sleep(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 0, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @sleep(i32 %8)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @maybe_sleep(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sleep(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
void launchwebpage(char *webpagename) {}


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

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

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

LLVM IR (-O2):
define void @launchwebpage(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ search(int *, int, int);
int main() {
  int nums[] = {12, 15, 7, 11, 6};
  int size = 5;
  search(nums, 11, size);
  search(nums, 12, size);
  search(nums, 10, size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x5,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    $0xb,%esi
call   1030 <search@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    $0xc,%esi
call   1030 <search@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    $0xa,%esi
call   1030 <search@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xef5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xb,%esi
mov    $0x5,%edx
call   1030 <search@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
mov    $0x5,%edx
call   1030 <search@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x5,%edx
call   1030 <search@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.nums = [5 x i32] [i32 12, i32 15, i32 7, i32 11, i32 6]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
store i32 5, i32* %3
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @search(i32* %5, i32 11, i32 %6)
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @search(i32* %8, i32 12, i32 %9)
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %3
%13 = call i32 @search(i32* %11, i32 10, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [5 x i32] [i32 12, i32 15, i32 7, i32 11, i32 6]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @search(i32* %3, i32 11, i32 5)
%5 = call i32 @search(i32* %3, i32 12, i32 5)
%6 = call i32 @search(i32* %3, i32 10, i32 5)
ret i32 0
}
/* Variables and functions */
int strcmp(char *const, char *const);
int compare(const void *p1, const void *p2) {
  char *const *v1 = (char *const *)p1;
  char *const *v2 = (char *const *)p2;
  return strcmp(*v1, *v2);
}


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

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzCase_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKDOWN(int /*<<< orphan*/);
void BrzCase_ackdown(struct comp *comp, int port) {
  struct BrzCase_ *c = (struct BrzCase_ *)comp;
  SEND_ACKDOWN(0);
}


x86 assembly (clang, -O0):
<BrzCase_ackdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %edi,%edi
call   1030 <SEND_ACKDOWN@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzCase_ackdown>:
xor    %edi,%edi
jmp    1030 <SEND_ACKDOWN@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzCase_ = type { i32 }
define void @BrzCase_ackdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzCase_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzCase_*
store %struct.BrzCase_* %7, %struct.BrzCase_** %5
%8 = call i32 @SEND_ACKDOWN(i32 0)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzCase_ackdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_ACKDOWN(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x6b() {
  Assert_real((isgraph(107)),
              "/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",
              540, ("isgraph should be 1 for k"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0x6b>:
push   %rax
mov    $0x6b,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x21c,%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 = [26 x i8] c"isgraph should be 1 for k\00"
define void @t_isgraph_0x6b() {
%1 = call i32 @isgraph(i32 107)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 540, 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for k\00"
define void @t_isgraph_0x6b() {
%1 = tail call i32 @isgraph(i32 107)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 540, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double max(double a, double b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <max+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <max+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @max(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ AI_interface(char *, int *, int *, int *);
void AI(char *arr, int *row, int *col, int *flag) {
  AI_interface(arr, row, col, flag);
}


x86 assembly (clang, -O0):
<AI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <AI_interface@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AI>:
jmp    1030 <AI_interface@plt>

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

LLVM IR (-O2):
define void @AI(i8* %0, i32* %1, i32* %2, i32* %3) {
%5 = tail call i32 @AI_interface(i8* %0, i32* %1, i32* %2, i32* %3)
ret void
}
void core_deinit(struct context *ctx) {}


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

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

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

LLVM IR (-O2):
%struct.context = type opaque
define void @core_deinit(%struct.context* nocapture %0) {
ret void
}
/* Variables and functions */
int recv_byte(int);
int get_byte(void) { return recv_byte(30); }


x86 assembly (clang, -O0):
<get_byte>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1e,%edi
call   1030 <recv_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_byte>:
mov    $0x1e,%edi
jmp    1030 <recv_byte@plt>

LLVM IR (-O0):
define i32 @get_byte() {
%1 = call i32 @recv_byte(i32 30)
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_byte() {
%1 = tail call i32 @recv_byte(i32 30)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ _unsupported();
void _Unwind_GetRegionStart() { _unsupported(); }


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

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

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

LLVM IR (-O2):
define void @_Unwind_GetRegionStart() {
%1 = tail call i32 (...) @_unsupported()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("*%d*\n", 959);
  printf("*%2d*\n", 959);
  printf("*%10d*\n", 959);
  printf("*%-10d*\n", 959);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x3bf,%esi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x3bf,%esi
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x3bf,%esi
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x3bf,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3bf,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x3bf,%esi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x3bf,%esi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
mov    $0x3bf,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"*%d*\0A\00"
@.str.1 = [7 x i8] c"*%2d*\0A\00"
@.str.2 = [8 x i8] c"*%10d*\0A\00"
@.str.3 = [9 x i8] c"*%-10d*\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 959)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 959)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 959)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 959)
ret i32 0
}
void INT_Excep_CAC_OVFF(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_CAC_OVFF() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_idxset_get_by_index() {
  printf("NOT IMPLEMENTED:"
         "pa_idxset_get_by_index"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"NOT IMPLEMENTED:pa_idxset_get_by_index\0A\00"
define i32 @pa_idxset_get_by_index() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_idxset_get_by_index\00"
define i32 @pa_idxset_get_by_index() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct testobj {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct testobj *);
void testobj_delete(struct testobj *testobj) { free(testobj); }


x86 assembly (clang, -O0):
<testobj_delete>:
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):
<testobj_delete>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.testobj = type { i32 }
define void @testobj_delete(%struct.testobj* %0) {
%2 = alloca %struct.testobj*
store %struct.testobj* %0, %struct.testobj** %2
%3 = load %struct.testobj*, %struct.testobj** %2
%4 = call i32 @free(%struct.testobj* %3)
ret void
}

LLVM IR (-O2):
%struct.testobj = type { i32 }
define void @testobj_delete(%struct.testobj* nocapture %0) {
%2 = tail call i32 @free(%struct.testobj* %0)
ret void
}
int hash_func(int key, int size) { return key * 2654435761 % size; }


x86 assembly (clang, -O0):
<hash_func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movabs $0x9e3779b1,%rcx
imul   %rcx,%rax
movslq -0x8(%rbp),%rcx
cqto
idiv   %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_func>:
movslq %edi,%rcx
mov    $0x9e3779b1,%eax
imul   %rcx,%rax
movslq %esi,%rcx
cqto
idiv   %rcx
mov    %rdx,%rax
ret

LLVM IR (-O0):
define i32 @hash_func(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 = sext i32 %5 to i64
%7 = mul nsw i64 %6, 2654435761
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = srem i64 %7, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @hash_func(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = mul nsw i64 %3, 2654435761
%5 = sext i32 %1 to i64
%6 = srem i64 %4, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
unsigned int hash(const char *str) {
  unsigned int ret = 0;
  while (*str)
    ret = ret * 131 + *str++;
  return ret;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113f <hash+0x3f>
imul   $0x83,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <hash+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0x83,%eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 131
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_PMADDWD(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0xf5);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
}


x86 assembly (clang, -O0):
<MMX_PMADDWD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xf5,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_PMADDWD>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xf5,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebp
or     %ebx,%ebp
or     $0xc0,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_PMADDWD(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 245)
%8 = load i32, i32* %3
%9 = shl i32 %8, 3
%10 = or i32 192, %9
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_PMADDWD(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 245)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 192
%9 = tail call i32 @addbyte(i32 %8)
ret void
}
/* Variables and functions */
int ENOTSUP;
int /*<<< orphan*/ assert(char const *);
int smaunch_set_database_fs_path(const char *fsdb) {
  assert(fsdb);
  (void)fsdb;
  return -ENOTSUP;
}


x86 assembly (clang, -O0):
<smaunch_set_database_fs_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
xor    %eax,%eax
mov    0x2eba(%rip),%rcx
sub    (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smaunch_set_database_fs_path>:
push   %rax
call   1030 <assert@plt>
mov    0x2ecb(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOTSUP = global i32 0
define i32 @smaunch_set_database_fs_path(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = load i32, i32* @ENOTSUP
%7 = sub nsw i32 0, %6
ret i32 %7
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
define i32 @smaunch_set_database_fs_path(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = load i32, i32* @ENOTSUP
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ sched_getaffinity(int /*<<< orphan*/, int,
                                     int /*<<< orphan*/ *);
int /*<<< orphan*/ sched_setaffinity(int /*<<< orphan*/, int,
                                     int /*<<< orphan*/ *);
void set_cpu(int cpu) {
  cpu_set_t cpuset;
  sched_getaffinity(getpid(), sizeof(cpu_set_t), &cpuset);
  CPU_ZERO(&cpuset);
  CPU_SET(cpu, &cpuset);
  sched_setaffinity(getpid(), sizeof(cpu_set_t), &cpuset);
}


x86 assembly (clang, -O0):
<set_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    $0x4,%esi
lea    -0x8(%rbp),%rdx
call   1060 <sched_getaffinity@plt>
lea    -0x8(%rbp),%rdi
call   1050 <CPU_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1070 <CPU_SET@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    $0x4,%esi
lea    -0x8(%rbp),%rdx
call   1040 <sched_setaffinity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cpu>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0x4(%rsp),%rbx
mov    %eax,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
call   1060 <sched_getaffinity@plt>
mov    %rbx,%rdi
call   1050 <CPU_ZERO@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1070 <CPU_SET@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
call   1040 <sched_setaffinity@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @set_cpu(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @getpid()
%5 = call i32 @sched_getaffinity(i32 %4, i32 4, i32* %3)
%6 = call i32 @CPU_ZERO(i32* %3)
%7 = load i32, i32* %2
%8 = call i32 @CPU_SET(i32 %7, i32* %3)
%9 = call i32 (...) @getpid()
%10 = call i32 @sched_setaffinity(i32 %9, i32 4, i32* %3)
ret void
}

LLVM IR (-O2):
define void @set_cpu(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 (...) @getpid()
%5 = call i32 @sched_getaffinity(i32 %4, i32 4, i32* %2)
%6 = call i32 @CPU_ZERO(i32* %2)
%7 = call i32 @CPU_SET(i32 %0, i32* %2)
%8 = call i32 (...) @getpid()
%9 = call i32 @sched_setaffinity(i32 %8, i32 4, i32* %2)
ret void
}
int isset(char data, int bit) {
  data >>= bit;
  if (data & 1 == 0) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<isset>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
movsbl -0x5(%rbp),%eax
sar    %cl,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
and    $0x0,%eax
cmp    $0x0,%eax
je     1135 <isset+0x35>
movl   $0x0,-0x4(%rbp)
jmp    113c <isset+0x3c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isset(i8 signext %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = ashr i32 %8, %6
%10 = trunc i32 %9 to i8
store i8 %10, i8* %4
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = and i32 %12, 0
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %17
16: ; preds = %2
store i32 1, i32* %3
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @isset(i8 signext %0, i32 %1) {
ret i32 1
}
double dwb_fabs(double x) { return x < 0 ? -x : x; }


x86 assembly (clang, -O0):
<dwb_fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <dwb_fabs+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <dwb_fabs+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwb_fabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dwb_fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
br label %10
8: ; preds = %1
%9 = load double, double* %2
br label %10
10: ; preds = %8, %5
%11 = phi double [ %7, %5 ], [ %9, %8 ]
ret double %11
}

LLVM IR (-O2):
define double @dwb_fabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int printw(char const *, short);
int i2_printw(const char *fmt, short i) { return (printw(fmt, i)); }


x86 assembly (clang, -O0):
<i2_printw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movswl -0xa(%rbp),%esi
call   1030 <printw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2_printw>:
jmp    1030 <printw@plt>

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

LLVM IR (-O2):
define i32 @i2_printw(i8* %0, i16 signext %1) {
%3 = tail call i32 @printw(i8* %0, i16 signext %1)
ret i32 %3
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ test_tokenize(char *);
int main(int argc, char **argv) {
  int num_tokens, i;
  char *buf = malloc(6 * sizeof(char));
  strcpy(argv[0], "hello!");
  test_tokenize("echo \"hello\"");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x6,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe9e(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xe99(%rip),%rdi
call   1050 <test_tokenize@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xed0(%rip),%rdi
call   1040 <test_tokenize@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hello!\00"
@.str.1 = [13 x i8] c"echo \22hello\22\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i8* @malloc(i32 6)
store i8* %9, i8** %8
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @strcpy(i8* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @test_tokenize(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"hello!\00"
@.str.1 = [13 x i8] c"echo \22hello\22\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @test_tokenize(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float x = 0.1, y = 0.7;
  printf("%.20f\n", x);
  printf("%.20f\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef0(%rip),%rbx
movss  0xee0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xed4(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%.20f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float 0x3FB99999A0000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float 0x3FE6666660000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void die(char *msg) {
  fprintf(stderr, "Error: %s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
float calculateExpression(int x, int y) {
  int xx = x * x;
  int yy = y * y;
  int numerator = xx + yy;
  int denominator = x + y;
  float result = (float)numerator / (float)denominator;
  return result;
}


x86 assembly (clang, -O0):
<calculateExpression>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
cvtsi2ssl -0x14(%rbp),%xmm0
cvtsi2ssl -0x18(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateExpression>:
mov    %esi,%eax
add    %edi,%esi
imul   %edi,%edi
imul   %eax,%eax
add    %edi,%eax
cvtsi2ss %eax,%xmm0
cvtsi2ss %esi,%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @calculateExpression(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = mul nsw i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = load i32, i32* %4
%15 = mul nsw i32 %13, %14
store i32 %15, i32* %6
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = add nsw i32 %16, %17
store i32 %18, i32* %7
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = add nsw i32 %19, %20
store i32 %21, i32* %8
%22 = load i32, i32* %7
%23 = sitofp i32 %22 to float
%24 = load i32, i32* %8
%25 = sitofp i32 %24 to float
%26 = fdiv float %23, %25
store float %26, float* %9
%27 = load float, float* %9
ret float %27
}

LLVM IR (-O2):
define float @calculateExpression(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, %0
%4 = mul nsw i32 %1, %1
%5 = add nuw nsw i32 %4, %3
%6 = add nsw i32 %1, %0
%7 = sitofp i32 %5 to float
%8 = sitofp i32 %6 to float
%9 = fdiv float %7, %8
ret float %9
}
void ERR_peek_error(void) {}


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

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

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

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

/* Variables and functions */
uint16_t pos_uint16_t(uint16_t number) { return number; }


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

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

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

LLVM IR (-O2):
define i32 @pos_uint16_t(i32 returned %0) {
ret i32 %0
}
void XtCallConverter() {}


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

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

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

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