xunge/DecIR huggingface dataset:
/* Variables and functions */
int find_k_min(int *, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a[] = {2, 5, 1, 3, 7, 0, 6, 9, 4, 8};
  int res = find_k_min(a, 0, 9, 4);
  printf("%d\n", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x4,%ecx
call   1030 <find_k_min@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x4,%ecx
call   1030 <find_k_min@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 2, i32 5, i32 1, i32 3, i32 7, i32 0, i32 6, i32 9, i32 4, i32 8]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @find_k_min(i32* %3, i32 0, i32 9, i32 4)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
double _Complex sub_double_cc(double _Complex a, double _Complex b) {
  return a - b;
}


x86 assembly (clang, -O0):
<sub_double_cc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x30(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm2
subsd  %xmm3,%xmm1
subsd  %xmm2,%xmm0
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_double_cc>:
subsd  %xmm2,%xmm0
subsd  %xmm3,%xmm1
ret

LLVM IR (-O0):
define { double, double } @sub_double_cc(double %0, double %1, double %2, double %3) {
%5 = alloca { double, double }
%6 = alloca { double, double }
%7 = alloca { double, double }
%8 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
store double %0, double* %8
%9 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
store double %1, double* %9
%10 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 0
store double %2, double* %10
%11 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 1
store double %3, double* %11
%12 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
%13 = load double, double* %12
%14 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
%15 = load double, double* %14
%16 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 0
%17 = load double, double* %16
%18 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 1
%19 = load double, double* %18
%20 = fsub double %13, %17
%21 = fsub double %15, %19
%22 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%23 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %20, double* %22
store double %21, double* %23
%24 = load { double, double }, { double, double }* %5
ret { double, double } %24
}

LLVM IR (-O2):
define { double, double } @sub_double_cc(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %2
%6 = fsub double %1, %3
%7 = insertvalue { double, double } poison, double %5, 0
%8 = insertvalue { double, double } %7, double %6, 1
ret { double, double } %8
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *child(void *arg) {
  sleep(1);
  return arg;
}


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

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

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

LLVM IR (-O2):
define i8* @child(i8* readnone returned %0) {
%2 = tail call i32 @sleep(i32 1)
ret i8* %0
}
int ld_bun_rm2(long double a1, long double *a2) {
  return !(__builtin_isunordered(a1, *a2));
}


x86 assembly (clang, -O0):
<ld_bun_rm2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bun_rm2>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setnp  %al
ret

LLVM IR (-O0):
define i32 @ld_bun_rm2(x86_fp80 %0, x86_fp80* %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80*
store x86_fp80 %0, x86_fp80* %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80*, x86_fp80** %4
%7 = load x86_fp80, x86_fp80* %6
%8 = fcmp uno x86_fp80 %5, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ld_bun_rm2(x86_fp80 %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %1
%4 = fcmp ord x86_fp80 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
int asalbul(int *psayi) {
  int i;
  for (i = 2; i < *psayi; i++) {
    if ((*psayi % i) == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<asalbul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    1150 <asalbul+0x50>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%edx
jne    113d <asalbul+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1157 <asalbul+0x57>
jmp    1142 <asalbul+0x42>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <asalbul+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asalbul>:
mov    (%rdi),%esi
mov    $0x1,%ecx
cmp    $0x3,%esi
jl     1130 <asalbul+0x30>
mov    $0x2,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %esi,%eax
cltd
idiv   %edi
test   %edx,%edx
je     1133 <asalbul+0x33>
add    $0x1,%edi
cmp    %edi,%esi
jne    1120 <asalbul+0x20>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @asalbul(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, 2
br i1 %3, label %6, label %11
4: ; preds = %6
%5 = icmp eq i32 %10, %2
br i1 %5, label %11, label %6
6: ; preds = %1, %4
%7 = phi i32 [ %10, %4 ], [ 2, %1 ]
%8 = srem i32 %2, %7
%9 = icmp eq i32 %8, 0
%10 = add nuw nsw i32 %7, 1
br i1 %9, label %11, label %4
11: ; preds = %6, %4, %1
%12 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ my_strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
int my_putstr(char *str) {
  write(1, str, my_strlen(str));
  return (0);
}


x86 assembly (clang, -O0):
<my_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1040 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putstr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <my_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @my_putstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @my_strlen(i8* %4)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @my_putstr(i8* %0) {
%2 = tail call i32 @my_strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret i32 0
}
void ble_rsp_test_phy_end(const struct ble_msg_test_phy_end_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_test_phy_end_rsp_t = type opaque
define void @ble_rsp_test_phy_end(%struct.ble_msg_test_phy_end_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int sine_taylor(double);
double cosecant_taylor(double radians) { return 1 / sine_taylor(radians); }


x86 assembly (clang, -O0):
<cosecant_taylor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sine_taylor@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosecant_taylor>:
push   %rax
call   1030 <sine_taylor@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @cosecant_taylor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @sine_taylor(double %3)
%5 = sdiv i32 1, %4
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @cosecant_taylor(double %0) {
%2 = tail call i32 @sine_taylor(double %0)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = sitofp i32 %5 to double
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ PTHREAD_CANCEL_DISABLE;
int /*<<< orphan*/ pthread_setcancelstate(int /*<<< orphan*/,
                                          int /*<<< orphan*/ *);
void disable_cancel(void) {
  pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
}


x86 assembly (clang, -O0):
<disable_cancel>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pthread_setcancelstate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_cancel>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
jmp    1030 <pthread_setcancelstate@plt>

LLVM IR (-O0):
@PTHREAD_CANCEL_DISABLE = global i32 0
define void @disable_cancel() {
%1 = load i32, i32* @PTHREAD_CANCEL_DISABLE
%2 = call i32 @pthread_setcancelstate(i32 %1, i32* null)
ret void
}

LLVM IR (-O2):
@PTHREAD_CANCEL_DISABLE = global i32 0
define void @disable_cancel() {
%1 = load i32, i32* @PTHREAD_CANCEL_DISABLE
%2 = tail call i32 @pthread_setcancelstate(i32 %1, i32* null)
ret void
}
int lookup_auto_defragment_which(void *context) { return ((1 << 0)); }


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

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

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

LLVM IR (-O2):
define i32 @lookup_auto_defragment_which(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ glutInitDisplayMode(unsigned int);
void glipInitDisplayMode(unsigned int mode) { glutInitDisplayMode(mode); }


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

x86 assembly (clang, -O2):
<glipInitDisplayMode>:
jmp    1030 <glutInitDisplayMode@plt>

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

LLVM IR (-O2):
define void @glipInitDisplayMode(i32 %0) {
%2 = tail call i32 @glutInitDisplayMode(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fwrite(char *, int, int /*<<< orphan*/,
                          int /*<<< orphan*/ *);
int /*<<< orphan*/ strlen(char *);
void writeContent(char *sentence, const char *filePath) {
  FILE *output = fopen(filePath, "w");
  fwrite(sentence, sizeof(char), strlen(sentence), output);
  fclose(output);
}


x86 assembly (clang, -O0):
<writeContent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1060 <fwrite@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeContent>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rax
mov    %rdi,%r14
lea    0xeaf(%rip),%rsi
mov    %rax,%rdi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define void @writeContent(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
%11 = load i32*, i32** %5
%12 = call i32 @fwrite(i8* %8, i32 1, i32 %10, i32* %11)
%13 = load i32*, i32** %5
%14 = call i32 @fclose(i32* %13)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @writeContent(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @fwrite(i8* %0, i32 1, i32 %4, i32* %3)
%6 = tail call i32 @fclose(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "cat"
        " [-u][file ...]\n  -u	Write without delay\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"Usage: cat [-u][file ...]\0A -u\09Write without delay\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [52 x i8] c"Usage: cat [-u][file ...]\0A -u\09Write without delay\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
int isbdigit(char c) { return c >= '0' && c <= '1'; }


x86 assembly (clang, -O0):
<isbdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isbdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x31,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isbdigit>:
and    $0xfe,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isbdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 49
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isbdigit(i8 signext %0) {
%2 = and i8 %0, -2
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
int gl_fx_dummy_function_vb(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gl_fx_dummy_function_vb() {
ret i32 0
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int8_t mul_int8_t(int8_t a, int8_t b) { return a * b; }


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

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

LLVM IR (-O0):
define i32 @mul_int8_t(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mul_int8_t(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
void add(int num1, int num2) {
  num1 = 10;
  num2 = 20;
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xa,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @add(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 10, i32* %3
store i32 20, i32* %4
ret void
}

LLVM IR (-O2):
define void @add(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x8d() {
  Assert_real((isprint(141) == 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_isprint.c",
              710, ("isprint should be 0 for 0x8d"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x8d\00"
define void @t_isprint_0x8d() {
%1 = tail call i64 @isprint(i32 141)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 710, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double mt19937_genrand_int32();
double mt19937_genrand_real1(void) {
  return mt19937_genrand_int32() * (1.0 / 4294967295.0);
}


x86 assembly (clang, -O0):
<mt19937_genrand_real1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mt19937_genrand_int32@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt19937_genrand_real1>:
push   %rax
xor    %eax,%eax
call   1030 <mt19937_genrand_int32@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mt19937_genrand_real1() {
%1 = call double (...) @mt19937_genrand_int32()
%2 = fmul double %1, 0x3DF0000000100000
ret double %2
}

LLVM IR (-O2):
define double @mt19937_genrand_real1() {
%1 = tail call double (...) @mt19937_genrand_int32()
%2 = fmul double %1, 0x3DF0000000100000
ret double %2
}
/* Variables and functions */
int mixed_text(int);
int drv_mixed_text(int p) { return mixed_text(p); }


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

x86 assembly (clang, -O2):
<drv_mixed_text>:
jmp    1030 <mixed_text@plt>

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

LLVM IR (-O2):
define i32 @drv_mixed_text(i32 %0) {
%2 = tail call i32 @mixed_text(i32 %0)
ret i32 %2
}
void decomposicao(double x, long *part_int, double *part_frac) {
  *part_int = (long)x;
  *part_frac = x - *part_int;
}


x86 assembly (clang, -O0):
<decomposicao>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cvttsd2si -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
cvtsi2sdq (%rax),%xmm1
subsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<decomposicao>:
cvttsd2si %xmm0,%rax
mov    %rax,(%rdi)
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @decomposicao(double %0, i64* %1, double* %2) {
%4 = alloca double
%5 = alloca i64*
%6 = alloca double*
store double %0, double* %4
store i64* %1, i64** %5
store double* %2, double** %6
%7 = load double, double* %4
%8 = fptosi double %7 to i64
%9 = load i64*, i64** %5
store i64 %8, i64* %9
%10 = load double, double* %4
%11 = load i64*, i64** %5
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
%14 = fsub double %10, %13
%15 = load double*, double** %6
store double %14, double* %15
ret void
}

LLVM IR (-O2):
define void @decomposicao(double %0, i64* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = fptosi double %0 to i64
store i64 %4, i64* %1
%5 = sitofp i64 %4 to double
%6 = fsub double %0, %5
store double %6, double* %2
ret void
}
int f2s(float f) { return (int)f; }


x86 assembly (clang, -O0):
<f2s>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2s>:
cvttss2si %xmm0,%eax
ret

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

LLVM IR (-O2):
define i32 @f2s(float %0) {
%2 = fptosi float %0 to i32
ret i32 %2
}
void set_winsize(tty) int tty;
{}


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

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

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

LLVM IR (-O2):
define void @set_winsize(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_channel_hash_table();
int /*<<< orphan*/ clear_localuser_hash_table();
int /*<<< orphan*/ clear_user_hash_table();
void init_hash(void) {
  clear_user_hash_table();
  clear_localuser_hash_table();
  clear_channel_hash_table();
}


x86 assembly (clang, -O0):
<init_hash>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <clear_user_hash_table@plt>
mov    $0x0,%al
call   1030 <clear_localuser_hash_table@plt>
mov    $0x0,%al
call   1050 <clear_channel_hash_table@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_hash>:
push   %rax
xor    %eax,%eax
call   1040 <clear_user_hash_table@plt>
xor    %eax,%eax
call   1030 <clear_localuser_hash_table@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <clear_channel_hash_table@plt>

LLVM IR (-O0):
define void @init_hash() {
%1 = call i32 (...) @clear_user_hash_table()
%2 = call i32 (...) @clear_localuser_hash_table()
%3 = call i32 (...) @clear_channel_hash_table()
ret void
}

LLVM IR (-O2):
define void @init_hash() {
%1 = tail call i32 (...) @clear_user_hash_table()
%2 = tail call i32 (...) @clear_localuser_hash_table()
%3 = tail call i32 (...) @clear_channel_hash_table()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nni_free(char *, scalar_t__);
scalar_t__ strlen(char *);
void nni_strfree(char *s) {
  if (s != NULL) {
    nni_free(s, strlen(s) + 1);
  }
}


x86 assembly (clang, -O0):
<nni_strfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1158 <nni_strfree+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1040 <nni_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nni_strfree>:
test   %rdi,%rdi
je     113b <nni_strfree+0x1b>
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <nni_free@plt>
ret

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

LLVM IR (-O2):
define void @nni_strfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i32 @nni_free(i8* %0, i64 %5)
br label %7
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
float _d2f(int /*<<< orphan*/);
int /*<<< orphan*/ _dflt(int);
float _fflt(int a) { return _d2f(_dflt(a)); }


x86 assembly (clang, -O0):
<_fflt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_dflt@plt>
mov    %eax,%edi
call   1030 <_d2f@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @_fflt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_dflt(i32 %3)
%5 = call float @_d2f(i32 %4)
ret float %5
}

LLVM IR (-O2):
define float @_fflt(i32 %0) {
%2 = tail call i32 @_dflt(i32 %0)
%3 = tail call float @_d2f(i32 %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ set_path(char *);
void add_path(char *path_to_add) { set_path(path_to_add); }


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

x86 assembly (clang, -O2):
<add_path>:
jmp    1030 <set_path@plt>

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

LLVM IR (-O2):
define void @add_path(i8* %0) {
%2 = tail call i32 @set_path(i8* %0)
ret void
}
int bitcount(unsigned x) {
  int b;
  for (b = 0; x != 0; x &= (x - 1)) {
    ++b;
  }
  return b;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <bitcount+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bitcount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bitcount+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = add i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ tell_me_two_bad_translated_jokes();
int main() {
  tell_me_two_bad_translated_jokes();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @tell_me_two_bad_translated_jokes()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @tell_me_two_bad_translated_jokes()
ret i32 0
}
/* Variables and functions */
double RandFloat();
double RandomClamped() { return RandFloat() - RandFloat(); }


x86 assembly (clang, -O0):
<RandomClamped>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <RandFloat@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <RandFloat@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomClamped>:
push   %rax
xor    %eax,%eax
call   1030 <RandFloat@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <RandFloat@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @RandomClamped() {
%1 = call double (...) @RandFloat()
%2 = call double (...) @RandFloat()
%3 = fsub double %1, %2
ret double %3
}

LLVM IR (-O2):
define double @RandomClamped() {
%1 = tail call double (...) @RandFloat()
%2 = tail call double (...) @RandFloat()
%3 = fsub double %1, %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
int is_linux_swap(char const *fs_type_name) {
  char const *prefix = "linux-swap";
  return strncmp(fs_type_name, prefix, strlen(prefix)) == 0;
}


x86 assembly (clang, -O0):
<is_linux_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_linux_swap>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"linux-swap\00"
define i32 @is_linux_swap(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = call i64 @strncmp(i8* %4, i8* %5, i32 %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@.str = [11 x i8] c"linux-swap\00"
define i32 @is_linux_swap(i8* %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main() {
  long int i = -2147483647L - 1L;
  char ca = 1;
  if (i >> ca != -1073741824L)
    abort();
  if (i >> i / -2000000000L != -1073741824L)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0xffffffff80000000,-0x10(%rbp)
80
movb   $0x1,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl -0x11(%rbp),%ecx
mov    %ecx,%ecx
sar    %cl,%rax
cmp    $0xffffffffc0000000,%rax
je     115b <main+0x3b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xffffffff88ca6c00,%rcx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
sar    %cl,%rax
cmp    $0xffffffffc0000000,%rax
je     1190 <main+0x70>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i8
store i32 0, i32* %1
store i64 -2147483648, i64* %2
store i8 1, i8* %3
%4 = load i64, i64* %2
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = zext i32 %6 to i64
%8 = ashr i64 %4, %7
%9 = icmp ne i64 %8, -1073741824
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %0
%13 = load i64, i64* %2
%14 = load i64, i64* %2
%15 = sdiv i64 %14, -2000000000
%16 = ashr i64 %13, %15
%17 = icmp ne i64 %16, -1073741824
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %12
%21 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void crash_fileno() {
  FILE *f;
  f = fopen("this_file_doesnt_exist", "r");
  fileno(f);
  fclose(f);
}


x86 assembly (clang, -O0):
<crash_fileno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fileno@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash_fileno>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <fileno@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @crash_fileno() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fileno(i32* %3)
%5 = load i32*, i32** %1
%6 = call i32 @fclose(i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @crash_fileno() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fileno(i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret void
}
void add_digits(char a, char b, char c, char *total, char *carry) {}


x86 assembly (clang, -O0):
<add_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    %rcx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @add_digits(i8 signext %0, i8 signext %1, i8 signext %2, i8* %3, i8* %4) {
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i8*
store i8 %0, i8* %6
store i8 %1, i8* %7
store i8 %2, i8* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
define void @add_digits(i8 signext %0, i8 signext %1, i8 signext %2, i8* nocapture %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: chrtopng [-hv] [-b <bbp>] [-o <f>] [-t <NxM>] [-w "
                  "<width>] [file ...]\n");
  fprintf(stderr, "-b <bbp>    bits per pixel for input file (default "
                  "2"
                  ").\n"
                  "-o <f>      output file (default '"
                  "out.png"
                  "').\n"
                  "-t <NxM>    size of tile (default "
                  "8"
                  "x"
                  "8"
                  ").\n"
                  "-w <width>  tiles per row (default "
                  "16"
                  ").\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf1f(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [78 x i8] c"usage: chrtopng [-hv] [-b <bbp>] [-o <f>] [-t <NxM>] [-w <width>] [file ...]\0A\00"
@.str.1 = [181 x i8] c"-b <bbp> bits per pixel for input file (default 2).\0A-o <f> output file (default 'out.png').\0A-t <NxM> size of tile (default 8x8).\0A-w <width> tiles per row (default 16).\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [78 x i8] c"usage: chrtopng [-hv] [-b <bbp>] [-o <f>] [-t <NxM>] [-w <width>] [file ...]\0A\00"
@.str.1 = [181 x i8] c"-b <bbp> bits per pixel for input file (default 2).\0A-o <f> output file (default 'out.png').\0A-t <NxM> size of tile (default 8x8).\0A-w <width> tiles per row (default 16).\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *);
float get_s(void) {
  float S;
  printf("Provide a value for S (surface speed of rack): ");
  scanf("%f", &S);
  assert(S > 0);
  return S;
}


x86 assembly (clang, -O0):
<get_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_s>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
xor    %edi,%edi
ucomiss %xmm1,%xmm0
seta   %dil
call   1040 <assert@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Provide a value for S (surface speed of rack): \00"
@.str.1 = [3 x i8] c"%f\00"
define float @get_s() {
%1 = alloca float
%2 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fcmp ogt float %4, 0.000000e+00
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load float, float* %1
ret float %8
}

LLVM IR (-O2):
@.str = [48 x i8] c"Provide a value for S (surface speed of rack): \00"
@.str.1 = [3 x i8] c"%f\00"
define float @get_s() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fcmp ogt float %5, 0.000000e+00
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load float, float* %1
ret float %9
}
int cmpul(const void *l1, const void *l2) {
  if (*((const unsigned long *)l1) < *((const unsigned long *)l2))
    return -1;
  if (*((const unsigned long *)l1) > *((const unsigned long *)l2))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmpul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jae    112c <cmpul+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <cmpul+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jbe    114c <cmpul+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <cmpul+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpul>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmpul(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp ult i64 %4, %6
%8 = icmp ugt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ srand48(long);
void init_random(int myid) {
  int __cil_tmp2;
  long __cil_tmp3;
  {
    {
      __cil_tmp2 = myid * 45;
      __cil_tmp3 = (long)__cil_tmp2;
      srand48(__cil_tmp3);
    }
    return;
  }
}


x86 assembly (clang, -O0):
<init_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x2d,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <srand48@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_random>:
lea    (%rdi,%rdi,8),%eax
lea    (%rax,%rax,4),%eax
movslq %eax,%rdi
jmp    1030 <srand48@plt>

LLVM IR (-O0):
define void @init_random(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 45
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = call i32 @srand48(i64 %9)
ret void
}

LLVM IR (-O2):
define void @init_random(i32 %0) {
%2 = mul nsw i32 %0, 45
%3 = sext i32 %2 to i64
%4 = tail call i32 @srand48(i64 %3)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ FixedPointSine(int);
int /*<<< orphan*/ assert(int);
int32_t FixedPointCosine(uint32_t theta) {
  assert(theta < 360);
  return FixedPointSine(theta + 90);
}


x86 assembly (clang, -O0):
<FixedPointCosine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x168,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%edi
add    $0x5a,%edi
call   1040 <FixedPointSine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FixedPointCosine>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x168,%ebx
setl   %dil
call   1030 <assert@plt>
add    $0x5a,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <FixedPointSine@plt>

LLVM IR (-O0):
define i32 @FixedPointCosine(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 360
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 90
%9 = call i32 @FixedPointSine(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @FixedPointCosine(i32 %0) {
%2 = icmp slt i32 %0, 360
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = add nsw i32 %0, 90
%6 = tail call i32 @FixedPointSine(i32 %5)
ret i32 %6
}