xunge/DecIR huggingface dataset:
short mus_little_endian_short(unsigned char *inp) {
  short o;
  unsigned char *outp;
  outp = (unsigned char *)&o;
  outp[0] = inp[1];
  outp[1] = inp[0];
  return (o);
}


x86 assembly (clang, -O0):
<mus_little_endian_short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0xa(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
movswl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_little_endian_short>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

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

LLVM IR (-O2):
define signext i16 @mus_little_endian_short(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = load i8, i8* %0
%5 = zext i8 %4 to i16
%6 = shl nuw i16 %5, 8
%7 = zext i8 %3 to i16
%8 = or i16 %6, %7
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int timlib_factoral(int);
void test_factoral(void) {
  printf("should be 362880: is = %d\n", timlib_factoral(9));
}


x86 assembly (clang, -O0):
<test_factoral>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%edi
call   1040 <timlib_factoral@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_factoral>:
push   %rax
mov    $0x9,%edi
call   1040 <timlib_factoral@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"should be 362880: is = %d\0A\00"
define void @test_factoral() {
%1 = call i32 @timlib_factoral(i32 9)
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"should be 362880: is = %d\0A\00"
define void @test_factoral() {
%1 = tail call i32 @timlib_factoral(i32 9)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_nexttoward();
scalar_t__ nexttoward(double, long double);
void test_nexttoward(double d, long double x) {
  if (nexttoward(d, x) != nexttoward(d, x))
    link_failure_nexttoward();
}


x86 assembly (clang, -O0):
<test_nexttoward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
movsd  %xmm0,-0x8(%rbp)
fstpt  -0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <nexttoward@plt>
mov    %rax,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <nexttoward@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     1172 <test_nexttoward+0x52>
mov    $0x0,%al
call   1040 <link_failure_nexttoward@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nexttoward>:
push   %rbx
sub    $0x30,%rsp
movsd  %xmm0,0x18(%rsp)
fldt   0x40(%rsp)
fld    %st(0)
fstpt  0x24(%rsp)
fstpt  (%rsp)
call   1030 <nexttoward@plt>
mov    %rax,%rbx
fldt   0x24(%rsp)
fstpt  (%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <nexttoward@plt>
cmp    %rax,%rbx
jne    115d <test_nexttoward+0x3d>
add    $0x30,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
jmp    1040 <link_failure_nexttoward@plt>

LLVM IR (-O0):
define void @test_nexttoward(double %0, x86_fp80 %1) {
%3 = alloca double
%4 = alloca x86_fp80
store double %0, double* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load double, double* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call i64 @nexttoward(double %5, x86_fp80 %6)
%8 = load double, double* %3
%9 = load x86_fp80, x86_fp80* %4
%10 = call i64 @nexttoward(double %8, x86_fp80 %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_nexttoward()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_nexttoward(double %0, x86_fp80 %1) {
%3 = tail call i64 @nexttoward(double %0, x86_fp80 %1)
%4 = tail call i64 @nexttoward(double %0, x86_fp80 %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_nexttoward()
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint64_t encode_variantkey(uint8_t chrom, uint32_t pos, uint32_t refalt) {
  return (((uint64_t)chrom << 59) | ((uint64_t)pos << 31) | (uint64_t)refalt);
}


x86 assembly (clang, -O0):
<encode_variantkey>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3b,%ecx
shl    %cl,%eax
mov    -0x10(%rbp),%rcx
shl    $0x1f,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%rcx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @encode_variantkey(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 59
%10 = load i64, i64* %5
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 31
%13 = or i32 %9, %12
%14 = load i64, i64* %6
%15 = trunc i64 %14 to i32
%16 = or i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @encode_variantkey(i64 %0, i64 %1, i64 %2) {
ret i32 poison
}
/* Variables and functions */
int mus_data_format_to_bytes_per_sample(int);
int mus_bytes_to_samples(int format, int size) {
  return ((int)(size / (mus_data_format_to_bytes_per_sample(format))));
}


x86 assembly (clang, -O0):
<mus_bytes_to_samples>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <mus_data_format_to_bytes_per_sample@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_bytes_to_samples>:
push   %rbx
mov    %esi,%ebx
call   1030 <mus_data_format_to_bytes_per_sample@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mus_bytes_to_samples(i32 %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
%7 = call i32 @mus_data_format_to_bytes_per_sample(i32 %6)
%8 = sdiv i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @mus_bytes_to_samples(i32 %0, i32 %1) {
%3 = tail call i32 @mus_data_format_to_bytes_per_sample(i32 %0)
%4 = sdiv i32 %1, %3
ret i32 %4
}
/* Variables and functions */
int SIGINT;
int SIGQUIT;
int /*<<< orphan*/ printf(char *);
void my_func(int sign_no) {
  if (SIGINT == sign_no) {
    printf("I have got SIGINT\n");
  } else if (SIGQUIT == sign_no) {
    printf("I have got SIGQUIT\n");
  }
  return;
}


x86 assembly (clang, -O0):
<my_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
jne    113e <my_func+0x2e>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    1161 <my_func+0x51>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
jne    115c <my_func+0x4c>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
jmp    1161 <my_func+0x51>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_func>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1127 <my_func+0x17>
lea    0xef1(%rip),%rdi
jmp    1030 <puts@plt>
mov    0x2eb2(%rip),%rax
cmp    %edi,(%rax)
jne    113e <my_func+0x2e>
lea    0xec7(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [19 x i8] c"I have got SIGINT\0A\00"
@SIGQUIT = global i32 0
@.str.1 = [20 x i8] c"I have got SIGQUIT\0A\00"
define void @my_func(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGINT
%4 = load i32, i32* %2
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %15
8: ; preds = %1
%9 = load i32, i32* @SIGQUIT
%10 = load i32, i32* %2
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %8
br label %15
15: ; preds = %14, %6
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIGQUIT = global i32 0
@str = [19 x i8] c"I have got SIGQUIT\00"
@str.2 = [18 x i8] c"I have got SIGINT\00"
define void @my_func(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @SIGQUIT
%6 = icmp eq i32 %5, %0
br i1 %6, label %7, label %10
7: ; preds = %4, %1
%8 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @str.2, i64 0, i64 0), %1 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0), %4 ]
%9 = tail call i32 @puts(i8* dereferenceable(1) %8)
br label %10
10: ; preds = %7, %4
ret void
}
/* Variables and functions */
unsigned long long __blsr_u64(unsigned long long);
unsigned long long func_blsr64(unsigned long long X) { return __blsr_u64(X); }


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

x86 assembly (clang, -O2):
<func_blsr64>:
jmp    1030 <__blsr_u64@plt>

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

LLVM IR (-O2):
define i64 @func_blsr64(i64 %0) {
%2 = tail call i64 @__blsr_u64(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void function_b() {
  printf("***************\n");
  printf("*** BOOM!!! ***\n");
  printf("***************\n");
  exit(-1);
}


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

x86 assembly (clang, -O2):
<function_b>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"***************\0A\00"
@.str.1 = [17 x i8] c"*** BOOM!!! ***\0A\00"
define void @function_b() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str.2 = [16 x i8] c"*** BOOM!!! ***\00"
@str.3 = [16 x i8] c"***************\00"
define void @function_b() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.3, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @exit(i32 -1)
unreachable
}
void mutex_cdelay(const int cycles) {
  int cy = cycles;
  while (cy--) {
    asm volatile("");
  }
}


x86 assembly (clang, -O0):
<mutex_cdelay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1126 <mutex_cdelay+0x26>
jmp    110d <mutex_cdelay+0xd>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_cdelay>:
test   %edi,%edi
je     1115 <mutex_cdelay+0x15>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0xffffffff,%edi
jne    1110 <mutex_cdelay+0x10>
ret

LLVM IR (-O0):
define void @mutex_cdelay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* %3
%7 = add nsw i32 %6, -1
store i32 %7, i32* %3
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @mutex_cdelay(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ sorter_grail_common_sort(int /*<<< orphan*/ *, int,
                                            int /*<<< orphan*/ *,
                                            int /*<<< orphan*/);
void sorter_grail_sort(int64_t *arr, size_t Len) {
  sorter_grail_common_sort(arr, (int)Len, NULL, 0);
}


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

x86 assembly (clang, -O2):
<sorter_grail_sort>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <sorter_grail_common_sort@plt>

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

LLVM IR (-O2):
define void @sorter_grail_sort(i32* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = tail call i32 @sorter_grail_common_sort(i32* %0, i32 %3, i32* null, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
const char *timeStr(time_t t) {
  static char buffer[30];
  struct tm *tm = localtime(&t);
  strftime(buffer, sizeof(buffer), "%F %T ", tm);
  return buffer;
}


x86 assembly (clang, -O0):
<timeStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    0x2efd(%rip),%rdi
mov    $0x1e,%esi
lea    0xeb1(%rip),%rdx
call   1040 <strftime@plt>
lea    0x2ee5(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeStr>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0x2f06(%rip),%rbx
lea    0xebf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1e,%esi
mov    %rax,%rcx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@timeStr.buffer = internal global [30 x i8] zeroinitializer
@.str = [7 x i8] c"%F %T \00"
define i8* @timeStr(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.tm*
store i32 %0, i32* %2
%4 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %4, %struct.tm** %3
%5 = load %struct.tm*, %struct.tm** %3
%6 = call i32 @strftime(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @timeStr.buffer, i64 0, i64 0), i32 30, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @timeStr.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@timeStr.buffer = internal global [30 x i8] zeroinitializer
@.str = [7 x i8] c"%F %T \00"
define i8* @timeStr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call %struct.tm* @localtime(i32* %2)
%4 = call i32 @strftime(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @timeStr.buffer, i64 0, i64 0), i32 30, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @timeStr.buffer, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *thread_proc(void *arg) {
  sleep(60);
  return arg;
}


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

x86 assembly (clang, -O2):
<thread_proc>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3c,%edi
call   1030 <sleep@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @thread_proc(i8* readnone returned %0) {
%2 = tail call i32 @sleep(i32 60)
ret i8* %0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t weird_rol32(uint8_t input, int count) {
  if (count == 0)
    return 0;
  return (input << count) ^ (input >> (8 - count));
}


x86 assembly (clang, -O0):
<weird_rol32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1120 <weird_rol32+0x20>
movl   $0x0,-0x4(%rbp)
jmp    113c <weird_rol32+0x3c>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%edx
mov    $0x8,%ecx
sub    -0xc(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<weird_rol32>:
mov    %edi,%eax
mov    %esi,%ecx
shl    %cl,%eax
mov    $0x8,%cl
sub    %sil,%cl
sar    %cl,%edi
xor    %edi,%eax
test   %esi,%esi
cmove  %esi,%eax
ret

LLVM IR (-O0):
define i32 @weird_rol32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %18
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = shl i32 %10, %11
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = sub nsw i32 8, %14
%16 = ashr i32 %13, %15
%17 = xor i32 %12, %16
store i32 %17, i32* %3
br label %18
18: ; preds = %9, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @weird_rol32(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = shl i32 %0, %1
%5 = sub nsw i32 8, %1
%6 = ashr i32 %0, %5
%7 = xor i32 %6, %4
%8 = select i1 %3, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int do_smbus_read_byte(int, unsigned int, unsigned int);
int smbus_read_byte(unsigned device, unsigned address) {
  return do_smbus_read_byte(0x0f00, device, address);
}


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

x86 assembly (clang, -O2):
<smbus_read_byte>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0xf00,%edi
jmp    1030 <do_smbus_read_byte@plt>

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

LLVM IR (-O2):
define i32 @smbus_read_byte(i32 %0, i32 %1) {
%3 = tail call i32 @do_smbus_read_byte(i32 3840, i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x60() {
  Assert_real((isxdigit(96) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              485, ("isxdigit should be 0 for `"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x60>:
push   %rax
mov    $0x60,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1e5,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for `\00"
define void @t_isxdigit_0x60() {
%1 = call i64 @isxdigit(i32 96)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 485, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for `\00"
define void @t_isxdigit_0x60() {
%1 = tail call i64 @isxdigit(i32 96)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 485, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double fmin(double, double);
void test_fmin(double *__restrict__ r, double *__restrict__ a,
               double *__restrict__ b) {
  int i;
  for (i = 0; i < (16 / sizeof(double)); i++)
    r[i] = fmin(a[i], b[i]);
}


x86 assembly (clang, -O0):
<test_fmin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    $0x2,%rax
jae    1178 <test_fmin+0x78>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
minsd  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <test_fmin+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fmin>:
movupd (%rsi),%xmm0
movupd (%rdx),%xmm1
movapd %xmm1,%xmm2
minpd  %xmm0,%xmm2
cmpunordpd %xmm0,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
movupd %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @test_fmin(double* noalias nocapture writeonly %0, double* noalias nocapture %1, double* noalias nocapture %2) {
%4 = bitcast double* %1 to <2 x double>*
%5 = load <2 x double>, <2 x double>* %4
%6 = bitcast double* %2 to <2 x double>*
%7 = load <2 x double>, <2 x double>* %6
%8 = call <2 x double> @llvm.minnum.v2f64(<2 x double> %5, <2 x double> %7)
%9 = bitcast double* %0 to <2 x double>*
store <2 x double> %8, <2 x double>* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nested_sets_test();
int /*<<< orphan*/ set_ops_test();
int /*<<< orphan*/ simple_test();
int main(int argc, char *argv[]) {
  simple_test();
  nested_sets_test();
  set_ops_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <simple_test@plt>
mov    $0x0,%al
call   1030 <nested_sets_test@plt>
mov    $0x0,%al
call   1040 <set_ops_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <simple_test@plt>
xor    %eax,%eax
call   1030 <nested_sets_test@plt>
xor    %eax,%eax
call   1040 <set_ops_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @simple_test()
%7 = call i32 (...) @nested_sets_test()
%8 = call i32 (...) @set_ops_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @simple_test()
%4 = tail call i32 (...) @nested_sets_test()
%5 = tail call i32 (...) @set_ops_test()
ret i32 0
}
float *align16(float *x) {
  float *y;
  y = (float *)((((int)x) + 15) & (~15));
  return y;
}


x86 assembly (clang, -O0):
<align16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xf,%eax
and    $0xfffffff0,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align16>:
add    $0xf,%edi
movslq %edi,%rax
and    $0xfffffffffffffff0,%rax
ret

LLVM IR (-O0):
define float* @align16(float* %0) {
%2 = alloca float*
%3 = alloca float*
store float* %0, float** %2
%4 = load float*, float** %2
%5 = ptrtoint float* %4 to i32
%6 = add nsw i32 %5, 15
%7 = and i32 %6, -16
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to float*
store float* %9, float** %3
%10 = load float*, float** %3
ret float* %10
}

LLVM IR (-O2):
define float* @align16(float* %0) {
%2 = ptrtoint float* %0 to i64
%3 = shl i64 %2, 32
%4 = add i64 %3, 64424509440
%5 = ashr exact i64 %4, 32
%6 = and i64 %5, -16
%7 = inttoptr i64 %6 to float*
ret float* %7
}
int convert_digit_to_int(char input) { return input - '0'; }


x86 assembly (clang, -O0):
<convert_digit_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_digit_to_int>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @convert_digit_to_int(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @convert_digit_to_int(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ suma(int **);
int main() {
  int *sum = 645;
  suma(&sum);
  printf("Main: %d", (int)sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x285,%eax
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <suma@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x285,(%rsp)
mov    %rsp,%rdi
call   1040 <suma@plt>
mov    (%rsp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Main: %d\00"
define i32 @main() {
%1 = alloca i32*
store i32* inttoptr (i64 645 to i32*), i32** %1
%2 = call i32 @suma(i32** %1)
%3 = load i32*, i32** %1
%4 = ptrtoint i32* %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Main: %d\00"
define i32 @main() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
store i32* inttoptr (i64 645 to i32*), i32** %1
%3 = call i32 @suma(i32** %1)
%4 = load i32*, i32** %1
%5 = ptrtoint i32* %4 to i64
%6 = trunc i64 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_52() {
  Assert_real((isqrt(52) == 7),
              "/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/stdlib/isqrt.c",
              265, ("Integer square root of 52 should be 7"));
}


x86 assembly (clang, -O0):
<t_sqrt_52>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%edi
call   1030 <isqrt@plt>
cmp    $0x7,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x109,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_52>:
push   %rax
mov    $0x34,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x7,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x109,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 52 should be 7\00"
define void @t_sqrt_52() {
%1 = call i32 @isqrt(i32 52)
%2 = icmp eq i32 %1, 7
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 265, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 52 should be 7\00"
define void @t_sqrt_52() {
%1 = tail call i32 @isqrt(i32 52)
%2 = icmp eq i32 %1, 7
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 265, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int gvalue_hashInt(int);
uint32_t gvalue_hashDouble(double d) {
  return gvalue_hashInt(((uint32_t)d + 5381) ^ ((uint32_t)(d * 72865789.0)));
}


x86 assembly (clang, -O0):
<gvalue_hashDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%edi
add    $0x1505,%edi
movsd  0xed0(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
xor    %eax,%edi
call   1030 <gvalue_hashInt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gvalue_hashDouble>:
cvttsd2si %xmm0,%eax
mulsd  0xee4(%rip),%xmm0
add    $0x1505,%eax
cvttsd2si %xmm0,%edi
xor    %eax,%edi
jmp    1030 <gvalue_hashInt@plt>

LLVM IR (-O0):
define i32 @gvalue_hashDouble(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = add nsw i32 %4, 5381
%6 = load double, double* %2
%7 = fmul double %6, 0x41915F5FF4000000
%8 = fptosi double %7 to i32
%9 = xor i32 %5, %8
%10 = call i32 @gvalue_hashInt(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @gvalue_hashDouble(double %0) {
%2 = fptosi double %0 to i32
%3 = add nsw i32 %2, 5381
%4 = fmul double %0, 0x41915F5FF4000000
%5 = fptosi double %4 to i32
%6 = xor i32 %3, %5
%7 = tail call i32 @gvalue_hashInt(i32 %6)
ret i32 %7
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *clonestr(char *s) {
  char *res = malloc(sizeof(char) * strlen(s) + 1);
  strcpy(res, s);
  return res;
}


x86 assembly (clang, -O0):
<clonestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cltq
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clonestr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @clonestr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = mul i64 1, %6
%8 = add i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @clonestr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
struct macro_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct macro_list *);
void macro_list_dealloc(struct macro_list *ml) { free(ml); }


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

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

LLVM IR (-O2):
%struct.macro_list = type { i32 }
define void @macro_list_dealloc(%struct.macro_list* nocapture %0) {
%2 = tail call i32 @free(%struct.macro_list* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_slice_buffer_reset_and_unref() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_slice_buffer_reset_and_unref>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_slice_buffer_reset_and_unref>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_slice_buffer_reset_and_unref() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_slice_buffer_reset_and_unref() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ quest_readdb();
int do_init_quest(void) {
  quest_readdb();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @do_init_quest() {
%1 = call i32 (...) @quest_readdb()
ret i32 0
}

LLVM IR (-O2):
define i32 @do_init_quest() {
%1 = tail call i32 (...) @quest_readdb()
ret i32 0
}
/* Variables and functions */
int sign(int /*<<< orphan*/);
int /*<<< orphan*/ strcmp(void const *, void const *);
int signstrcmp(const void *s1, const void *s2) { return sign(strcmp(s1, s2)); }


x86 assembly (clang, -O0):
<signstrcmp>:
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 <strcmp@plt>
mov    %eax,%edi
call   1040 <sign@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signstrcmp>:
push   %rax
call   1030 <strcmp@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sign@plt>

LLVM IR (-O0):
define i32 @signstrcmp(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 @strcmp(i8* %5, i8* %6)
%8 = call i32 @sign(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @signstrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = tail call i32 @sign(i32 %3)
ret i32 %4
}
/* Variables and functions */
char *malloc(int);
int random_between(int, int);
int /*<<< orphan*/ string_fill_random(char *, int);
char *random_string(int max_size) {
  char *s;
  int size;
  size = random_between(4, max_size);
  s = malloc(size);
  string_fill_random(s, size);
  return s;
}


x86 assembly (clang, -O0):
<random_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x4,%edi
call   1030 <random_between@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <string_fill_random@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_string>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%esi
mov    $0x4,%edi
call   1030 <random_between@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1040 <string_fill_random@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @random_string(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @random_between(i32 4, i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 @string_fill_random(i8* %9, i32 %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @random_string(i32 %0) {
%2 = tail call i32 @random_between(i32 4, i32 %0)
%3 = tail call i8* @malloc(i32 %2)
%4 = tail call i32 @string_fill_random(i8* %3, i32 %2)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
struct clad_test {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clad_test_ok(struct clad_test *);
int /*<<< orphan*/ clad_test_vfail(struct clad_test *, char const *,
                                   int /*<<< orphan*/);
struct clad_test *clad_test_vassert(struct clad_test *test, int assert,
                                    const char *fmt, va_list ap) {
  if (assert) {
    clad_test_ok(test);
  } else {
    clad_test_vfail(test, fmt, ap);
  }
  return test;
}


x86 assembly (clang, -O0):
<clad_test_vassert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114e <clad_test_vassert+0x2e>
mov    -0x8(%rbp),%rdi
call   1040 <clad_test_ok@plt>
jmp    115e <clad_test_vassert+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <clad_test_vfail@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_test_vassert>:
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
je     112f <clad_test_vassert+0xf>
call   1040 <clad_test_ok@plt>
jmp    1139 <clad_test_vassert+0x19>
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <clad_test_vfail@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.clad_test = type { i32 }
define %struct.clad_test* @clad_test_vassert(%struct.clad_test* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.clad_test*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.clad_test* %0, %struct.clad_test** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load %struct.clad_test*, %struct.clad_test** %5
%13 = call i32 @clad_test_ok(%struct.clad_test* %12)
br label %19
14: ; preds = %4
%15 = load %struct.clad_test*, %struct.clad_test** %5
%16 = load i8*, i8** %7
%17 = load i32, i32* %8
%18 = call i32 @clad_test_vfail(%struct.clad_test* %15, i8* %16, i32 %17)
br label %19
19: ; preds = %14, %11
%20 = load %struct.clad_test*, %struct.clad_test** %5
ret %struct.clad_test* %20
}

LLVM IR (-O2):
%struct.clad_test = type { i32 }
define %struct.clad_test* @clad_test_vassert(%struct.clad_test* returned %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @clad_test_ok(%struct.clad_test* %0)
br label %10
8: ; preds = %4
%9 = tail call i32 @clad_test_vfail(%struct.clad_test* %0, i8* %2, i32 %3)
br label %10
10: ; preds = %8, %6
ret %struct.clad_test* %0
}
int hvt_gdb_enable_ss(struct hvt *hvt) { return -1; }


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

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

LLVM IR (-O0):
%struct.hvt = type opaque
define i32 @hvt_gdb_enable_ss(%struct.hvt* %0) {
%2 = alloca %struct.hvt*
store %struct.hvt* %0, %struct.hvt** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.hvt = type opaque
define i32 @hvt_gdb_enable_ss(%struct.hvt* nocapture readnone %0) {
ret i32 -1
}
void rop3_54_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | T;
  stk1 = S ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_54_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_54_0_0>:
or     (%rdi),%dl
xor    %sil,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_54_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
store i8 %22, i8* %23
ret void
}

LLVM IR (-O2):
define void @rop3_54_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
%6 = xor i8 %5, %1
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *kr_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<kr_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @kr_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
int max(int a, int b) {
  if (a > b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_visualbasic_comment_entities();
int /*<<< orphan*/ test_visualbasic_comments();
void all_visualbasic_tests() {
  test_visualbasic_comments();
  test_visualbasic_comment_entities();
}


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

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

LLVM IR (-O0):
define void @all_visualbasic_tests() {
%1 = call i32 (...) @test_visualbasic_comments()
%2 = call i32 (...) @test_visualbasic_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_visualbasic_tests() {
%1 = tail call i32 (...) @test_visualbasic_comments()
%2 = tail call i32 (...) @test_visualbasic_comment_entities()
ret void
}