xunge/DecIR huggingface dataset:
/* Variables and functions */
int getch();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ timeout(int);
void waitExit() {
  int key;
  timeout(200);
  printw("\n\rPress Enter for exit\n\r");
  do {
    key = getch();
  } while (key != 10);
}


x86 assembly (clang, -O0):
<waitExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc8,%edi
call   1030 <timeout@plt>
lea    0xeb7(%rip),%rdi
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    114e <waitExit+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitExit>:
push   %rax
mov    $0xc8,%edi
call   1030 <timeout@plt>
lea    0xebe(%rip),%rdi
call   1040 <printw@plt>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getch@plt>
cmp    $0xa,%eax
jne    1150 <waitExit+0x20>
pop    %rax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\0A\0DPress Enter for exit\0A\0D\00"
define void @waitExit() {
%1 = alloca i32
%2 = call i32 @timeout(i32 200)
%3 = call i32 @printw(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %6, %0
%5 = call i32 (...) @getch()
store i32 %5, i32* %1
br label %6
6: ; preds = %4
%7 = load i32, i32* %1
%8 = icmp ne i32 %7, 10
br i1 %8, label %4, label %9
9: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0A\0DPress Enter for exit\0A\0D\00"
define void @waitExit() {
%1 = tail call i32 @timeout(i32 200)
%2 = tail call i32 @printw(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
%4 = tail call i32 (...) @getch()
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %3
6: ; preds = %3
ret void
}
double calculate_monthly_bill(int weekday_minutes, int night_minutes,
                              int weekend_minutes) {
  double monthly_bill = 39.99;
  if (weekday_minutes > 600) {
    weekday_minutes -= 600;
    monthly_bill += weekday_minutes * 0.40;
  }
  return monthly_bill;
}


x86 assembly (clang, -O0):
<calculate_monthly_bill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsd  0xeeb(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x258,-0x4(%rbp)
jle    1151 <calculate_monthly_bill+0x51>
mov    -0x4(%rbp),%eax
sub    $0x258,%eax
mov    %eax,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_monthly_bill>:
movsd  0xf00(%rip),%xmm0
cmp    $0x259,%edi
jl     1126 <calculate_monthly_bill+0x26>
add    $0xfffffda8,%edi
cvtsi2sd %edi,%xmm1
mulsd  0xede(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calculate_monthly_bill(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store double 3.999000e+01, double* %7
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 600
br i1 %9, label %10, label %17
10: ; preds = %3
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 600
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = sitofp i32 %13 to double
%15 = load double, double* %7
%16 = call double @llvm.fmuladd.f64(double %14, double 4.000000e-01, double %15)
store double %16, double* %7
br label %17
17: ; preds = %10, %3
%18 = load double, double* %7
ret double %18
}

LLVM IR (-O2):
define double @calculate_monthly_bill(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, 600
%5 = add nsw i32 %0, -600
%6 = sitofp i32 %5 to double
%7 = tail call double @llvm.fmuladd.f64(double %6, double 4.000000e-01, double 3.999000e+01)
%8 = select i1 %4, double %7, double 3.999000e+01
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ glDeleteTextures(int, unsigned int *);
void CNFGDeleteTex(unsigned int tex) { glDeleteTextures(1, &tex); }


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

x86 assembly (clang, -O2):
<CNFGDeleteTex>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
call   1030 <glDeleteTextures@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @CNFGDeleteTex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @glDeleteTextures(i32 1, i32* %2)
ret void
}

LLVM IR (-O2):
define void @CNFGDeleteTex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @glDeleteTextures(i32 1, i32* %2)
ret void
}
int ar_has_char(char *match, char q) {
  while (0x0 != match[0]) {
    if (match[0] == q) {
      return 0;
    }
    match++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<ar_has_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     114f <ar_has_char+0x4f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <ar_has_char+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1156 <ar_has_char+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <ar_has_char+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ar_has_char>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1120 <ar_has_char+0x20>
add    $0x1,%rdi
nop
cmp    %sil,%cl
je     1121 <ar_has_char+0x21>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ar_has_char+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ar_has_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = load i8, i8* %12
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2, %5
%9 = phi i8 [ %6, %5 ], [ %3, %2 ]
%10 = phi i8* [ %12, %5 ], [ %0, %2 ]
%11 = icmp eq i8 %9, %1
%12 = getelementptr inbounds i8, i8* %10, i64 1
br i1 %11, label %13, label %5
13: ; preds = %8, %5, %2
%14 = phi i32 [ 1, %2 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ __gcov_flush();
void mgcov_report(void) { __gcov_flush(); }


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

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

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

LLVM IR (-O2):
define void @mgcov_report() {
%1 = tail call i32 (...) @__gcov_flush()
ret void
}
void ath_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ath_init() {
ret void
}
/* Variables and functions */
int getID(int *);
int *getNextContext(int *);
int *findContext(int ID, int *in) {
  int *context;
  context = in;
  while (context != (int *)0) {
    if (getID(context) == ID)
      return context;
    context = getNextContext(context);
  }
  return (int *)0;
}


x86 assembly (clang, -O0):
<findContext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1173 <findContext+0x53>
mov    -0x20(%rbp),%rdi
call   1040 <getID@plt>
cmp    -0xc(%rbp),%eax
jne    1161 <findContext+0x41>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117b <findContext+0x5b>
mov    -0x20(%rbp),%rdi
call   1030 <getNextContext@plt>
mov    %rax,-0x20(%rbp)
jmp    1137 <findContext+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findContext>:
push   %rbp
push   %rbx
push   %rax
test   %rsi,%rsi
je     114c <findContext+0x2c>
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   (%rax)
mov    %rbx,%rdi
call   1040 <getID@plt>
cmp    %ebp,%eax
je     114e <findContext+0x2e>
mov    %rbx,%rdi
call   1030 <getNextContext@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1130 <findContext+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32* @findContext(i32 %0, i32* %1) {
%3 = icmp eq i32* %1, null
br i1 %3, label %11, label %4
4: ; preds = %2, %8
%5 = phi i32* [ %9, %8 ], [ %1, %2 ]
%6 = tail call i32 @getID(i32* %5)
%7 = icmp eq i32 %6, %0
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = tail call i32* @getNextContext(i32* %5)
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %8, %2
%12 = phi i32* [ null, %2 ], [ null, %8 ], [ %5, %4 ]
ret i32* %12
}
/* Variables and functions */
int strspn(char const *, char *);
char *util_skipws(const char *s) { return (char *)s + strspn(s, " \t"); }


x86 assembly (clang, -O0):
<util_skipws>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strspn@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_skipws>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strspn@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
define i8* @util_skipws(i8* %0) {
%2 = tail call i32 @strspn(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void myhandler(int signo __attribute__((unused))) {
  printf("Inside handler\n");
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Inside handler\0A\00"
define void @myhandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"Inside handler\00"
define void @myhandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double sin(double);
double m_sin_d(double rad) { return sin(rad); }


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

x86 assembly (clang, -O2):
<m_sin_d>:
jmp    1030 <sin@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *open_3(char *filename, void *unused) {
  FILE *this = fopen(filename, "r");
  return this;
}


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32* @open_3(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** %3
%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 i32*, i32** %5
ret i32* %8
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define noalias i32* @open_3(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %3
}
/* Type definitions */
struct ibv_device {
  int dummy;
};

/* Variables and functions */
char const *ibv_get_device_name(struct ibv_device *);
const char *mlx4_glue_get_device_name(struct ibv_device *device) {
  return ibv_get_device_name(device);
}


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

x86 assembly (clang, -O2):
<mlx4_glue_get_device_name>:
jmp    1030 <ibv_get_device_name@plt>

LLVM IR (-O0):
%struct.ibv_device = type { i32 }
define i8* @mlx4_glue_get_device_name(%struct.ibv_device* %0) {
%2 = alloca %struct.ibv_device*
store %struct.ibv_device* %0, %struct.ibv_device** %2
%3 = load %struct.ibv_device*, %struct.ibv_device** %2
%4 = call i8* @ibv_get_device_name(%struct.ibv_device* %3)
ret i8* %4
}

LLVM IR (-O2):
%struct.ibv_device = type { i32 }
define i8* @mlx4_glue_get_device_name(%struct.ibv_device* %0) {
%2 = tail call i8* @ibv_get_device_name(%struct.ibv_device* %0)
ret i8* %2
}
extern void outl_p(unsigned int value, unsigned short port) {
  __asm__ __volatile__("out"
                       "l"
                       " %"
                       "0,%"
                       "w"
                       "1"
                       "\noutb %%al,$0x80"
                       :
                       : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outl_p>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x6(%rbp),%dx
out    %eax,(%dx)
out    %al,$0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %eax,(%dx)
out    %al,$0x80
ret

LLVM IR (-O0):
define void @outl_p(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outl_p(i32 %0, i16 zeroext %1) {
tail call void asm sideeffect "outl $0,${1:w}\0Aoutb %al,$$0x80", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i16 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OpenSSL_add_all_digests();
int init_openssl(void) {
  static int inited = 0;
  if (!inited) {
    inited = 1;
    OpenSSL_add_all_digests();
  }
  return 0;
}


x86 assembly (clang, -O0):
<init_openssl>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
jne    1132 <init_openssl+0x22>
movl   $0x1,0x2f01(%rip)
mov    $0x0,%al
call   1030 <OpenSSL_add_all_digests@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_openssl>:
push   %rax
cmpb   $0x0,0x2f14(%rip)
jne    1128 <init_openssl+0x18>
movb   $0x1,0x2f0b(%rip)
xor    %eax,%eax
call   1030 <OpenSSL_add_all_digests@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@init_openssl.inited = internal global i32 0
define i32 @init_openssl() {
%1 = load i32, i32* @init_openssl.inited
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
store i32 1, i32* @init_openssl.inited
%4 = call i32 (...) @OpenSSL_add_all_digests()
br label %5
5: ; preds = %3, %0
ret i32 0
}

LLVM IR (-O2):
@init_openssl.inited = internal unnamed_addr global i1 false
define i32 @init_openssl() {
%1 = load i1, i1* @init_openssl.inited
br i1 %1, label %4, label %2
2: ; preds = %0
store i1 true, i1* @init_openssl.inited
%3 = tail call i32 (...) @OpenSSL_add_all_digests()
br label %4
4: ; preds = %2, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void _assert(int expression, char *file, int line) {
  if (expression) {
    printf(" *** Assert in %s, Line: %d ***\n", file, line);
  }
}


x86 assembly (clang, -O0):
<_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113f <_assert+0x2f>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert>:
test   %edi,%edi
je     1120 <_assert+0x10>
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [33 x i8] c" *** Assert in %s, Line: %d ***\0A\00"
define void @_assert(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11)
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c" *** Assert in %s, Line: %d ***\0A\00"
define void @_assert(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
scalar_t__ mkdir(char const *, int);
int /*<<< orphan*/ stderr;
void create_project_directory(const char *project_name) {
  if (mkdir(project_name, 0770) != 0) {
    char *err_fmt = "ERROR: Could not create project directory: %s\n";
    fprintf(stderr, err_fmt, project_name);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<create_project_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1f8,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
je     1183 <create_project_directory+0x53>
lea    0xea5(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1040 <fprintf@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_project_directory>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1f8,%esi
call   1030 <mkdir@plt>
test   %rax,%rax
jne    1145 <create_project_directory+0x15>
pop    %rbx
ret
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"ERROR: Could not create project directory: %s\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @create_project_directory(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @mkdir(i8* %4, i32 504)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %1
store i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8** %3
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %8, i8* %9, i8* %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"ERROR: Could not create project directory: %s\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @create_project_directory(i8* %0) {
%2 = tail call i64 @mkdir(i8* %0, i32 504)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("6=1+2+3\n28=1+2+4+7+14\n496=1+2+4+8+16+31+62+124+248");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [51 x i8] c"6=1+2+3\0A28=1+2+4+7+14\0A496=1+2+4+8+16+31+62+124+248\00"
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 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"6=1+2+3\0A28=1+2+4+7+14\0A496=1+2+4+8+16+31+62+124+248\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int p9_sysctl_register(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @p9_sysctl_register() {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t b_len(uint64_t n) {
  int32_t retVal = 0;
  while (n > 0) {
    n >>= 1;
    ++retVal;
  }
  return retVal;
}


x86 assembly (clang, -O0):
<b_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1133 <b_len+0x33>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110f <b_len+0xf>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_len>:
xor    %eax,%eax
test   %edi,%edi
jle    111d <b_len+0x1d>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%rax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <b_len+0x10>
ret

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

LLVM IR (-O2):
define i64 @b_len(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i64 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %7, %3 ]
ret i64 %10
}
/* Variables and functions */
long lswap4(long);
int /*<<< orphan*/ memmove(unsigned char *, unsigned char *, int);
long read_blk2len_compression(unsigned char *datablk) {
  long len;
  memmove((unsigned char *)&len, datablk + 7 + sizeof(long), sizeof(long));
  return lswap4(len);
}


x86 assembly (clang, -O0):
<read_blk2len_compression>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x7,%rsi
add    $0x8,%rsi
mov    $0x8,%edx
call   1040 <memmove@plt>
mov    -0x10(%rbp),%rdi
call   1030 <lswap4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_blk2len_compression>:
push   %rax
lea    0xf(%rdi),%rsi
mov    %rsp,%rdi
mov    $0x8,%edx
call   1040 <memmove@plt>
mov    (%rsp),%rdi
call   1030 <lswap4@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @read_blk2len_compression(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = bitcast i64* %3 to i8*
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 7
%7 = getelementptr inbounds i8, i8* %6, i64 8
%8 = call i32 @memmove(i8* %4, i8* %7, i32 8)
%9 = load i64, i64* %3
%10 = call i64 @lswap4(i64 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @read_blk2len_compression(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = getelementptr inbounds i8, i8* %0, i64 15
%5 = call i32 @memmove(i8* %3, i8* %4, i32 8)
%6 = load i64, i64* %2
%7 = call i64 @lswap4(i64 %6)
ret i64 %7
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
void to_base10(char *lastdig, uint64_t n) {
  while (n) {
    *lastdig = (n % 10) + '0';
    n /= 10;
    lastdig--;
  }
}


x86 assembly (clang, -O0):
<to_base10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114a <to_base10+0x4a>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <to_base10+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_base10>:
test   %esi,%esi
je     1142 <to_base10+0x42>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movslq %esi,%rax
imul   $0x66666667,%rax,%rsi
mov    %rsi,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rsi
add    %ecx,%esi
lea    (%rsi,%rsi,1),%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %eax,%edx
sub    %ecx,%edx
add    $0x30,%dl
mov    %dl,(%rdi)
add    $0xffffffffffffffff,%rdi
add    $0x9,%eax
cmp    $0x12,%eax
ja     1110 <to_base10+0x10>
ret

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

LLVM IR (-O2):
define void @to_base10(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ %1, %2 ]
%6 = phi i8* [ %11, %4 ], [ %0, %2 ]
%7 = srem i32 %5, 10
%8 = trunc i32 %7 to i8
%9 = add nsw i8 %8, 48
store i8 %9, i8* %6
%10 = sdiv i32 %5, 10
%11 = getelementptr inbounds i8, i8* %6, i64 -1
%12 = add i32 %5, 9
%13 = icmp ult i32 %12, 19
br i1 %13, label %14, label %4
14: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_4145() {
  Assert_real((isqrt(4145) == 64),
              "/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",
              1355, ("Integer square root of 4145 should be 64"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_4145>:
push   %rax
mov    $0x1031,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x40,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x54b,%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 = [41 x i8] c"Integer square root of 4145 should be 64\00"
define void @t_sqrt_4145() {
%1 = call i32 @isqrt(i32 4145)
%2 = icmp eq i32 %1, 64
%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 1355, i8* getelementptr inbounds ([41 x i8], [41 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 = [41 x i8] c"Integer square root of 4145 should be 64\00"
define void @t_sqrt_4145() {
%1 = tail call i32 @isqrt(i32 4145)
%2 = icmp eq i32 %1, 64
%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 1355, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int main(void) {
  setbuf(stdout, NULL);
  printf("str1");
  sleep(5);
  printf("str2");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <setbuf@plt>
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"str1\00"
@.str.1 = [5 x i8] c"str2\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @setbuf(i32 %2, i32* null)
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @sleep(i32 5)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"str1\00"
@.str.1 = [5 x i8] c"str2\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @setbuf(i32 %1, i32* null)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 5)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, size_t);
wchar_t *wmemcpy(wchar_t *__restrict d, const wchar_t *__restrict s, size_t n) {
  return (wchar_t *)memcpy(d, s, n * sizeof(wchar_t));
}


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

x86 assembly (clang, -O2):
<wmemcpy>:
shl    $0x2,%rdx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define i32* @wmemcpy(i32* noalias %0, i32* noalias %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i64, i64* %6
%10 = mul i64 %9, 4
%11 = call i64 @memcpy(i32* %7, i32* %8, i64 %10)
%12 = inttoptr i64 %11 to i32*
ret i32* %12
}

LLVM IR (-O2):
define i32* @wmemcpy(i32* noalias %0, i32* noalias %1, i64 %2) {
%4 = shl i64 %2, 2
%5 = tail call i64 @memcpy(i32* %0, i32* %1, i64 %4)
%6 = inttoptr i64 %5 to i32*
ret i32* %6
}
void lwt_show_queue(int q) {
  switch (q) {
  case 1:
    ((void)0);
    break;
  case 2:
    ((void)0);
    break;
  case 3:
    ((void)0);
  }
}


x86 assembly (clang, -O0):
<lwt_show_queue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     113d <lwt_show_queue+0x3d>
jmp    111b <lwt_show_queue+0x1b>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1142 <lwt_show_queue+0x42>
jmp    112c <lwt_show_queue+0x2c>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
je     1147 <lwt_show_queue+0x47>
jmp    114c <lwt_show_queue+0x4c>
jmp    114c <lwt_show_queue+0x4c>
jmp    114c <lwt_show_queue+0x4c>
jmp    114c <lwt_show_queue+0x4c>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @lwt_show_queue(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %7 [
i32 1, label %4
i32 2, label %5
i32 3, label %6
]
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %1, %5, %4
ret void
}

LLVM IR (-O2):
define void @lwt_show_queue(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int Free(void *devPtr) {
  free(devPtr);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @Free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
void gfx_ctx_destroy(void) {}


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

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

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

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

/* Variables and functions */
void cpu_nswap32p(uint32_t *outp, uint32_t in) { *outp = in; }


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

x86 assembly (clang, -O2):
<cpu_nswap32p>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @cpu_nswap32p(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
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @cpu_nswap32p(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
int multi(int a, int b) { return a * b; }


x86 assembly (clang, -O0):
<multi>:
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):
<multi>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @multi(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 @multi(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
int __test_and_change_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = (1UL << ((nr) % ((int)sizeof(unsigned long) * 8)));
  unsigned long *p =
      ((unsigned long *)addr) + ((nr) / ((int)sizeof(unsigned long) * 8));
  unsigned long old = *p;
  *p = old ^ mask;
  return (old & mask) != 0;
}


x86 assembly (clang, -O0):
<__test_and_change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
xor    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
and    -0x18(%rbp),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_and_change_bit>:
lea    0x3f(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    %eax,%ecx
and    $0xffffffc0,%ecx
sub    %ecx,%edi
sar    $0x6,%eax
cltq
mov    (%rsi,%rax,8),%rcx
mov    %rcx,%rdx
btc    %rdi,%rdx
mov    %rdx,(%rsi,%rax,8)
xor    %eax,%eax
bt     %rdi,%rcx
setb   %al
ret

LLVM IR (-O0):
define i32 @__test_and_change_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
%8 = load i32, i32* %3
%9 = srem i32 %8, 64
%10 = zext i32 %9 to i64
%11 = shl i64 1, %10
store i64 %11, i64* %5
%12 = load i64*, i64** %4
%13 = load i32, i32* %3
%14 = sdiv i32 %13, 64
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i64, i64* %12, i64 %15
store i64* %16, i64** %6
%17 = load i64*, i64** %6
%18 = load i64, i64* %17
store i64 %18, i64* %7
%19 = load i64, i64* %7
%20 = load i64, i64* %5
%21 = xor i64 %19, %20
%22 = load i64*, i64** %6
store i64 %21, i64* %22
%23 = load i64, i64* %7
%24 = load i64, i64* %5
%25 = and i64 %23, %24
%26 = icmp ne i64 %25, 0
%27 = zext i1 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @__test_and_change_bit(i32 %0, i64* nocapture %1) {
%3 = srem i32 %0, 64
%4 = zext i32 %3 to i64
%5 = shl nuw i64 1, %4
%6 = sdiv i32 %0, 64
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load i64, i64* %8
%10 = xor i64 %9, %5
store i64 %10, i64* %8
%11 = and i64 %9, %5
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ ap_str(char *);
void ap_char(char c) {
  char buf[2];
  buf[0] = c;
  buf[1] = '\0';
  ap_str(buf);
}


x86 assembly (clang, -O0):
<ap_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
movb   $0x0,-0x2(%rbp)
lea    -0x3(%rbp),%rdi
call   1030 <ap_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_char>:
push   %rax
mov    %dil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <ap_str@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @ap_char(i8 signext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %4, i8* %5
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %6
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%8 = call i32 @ap_str(i8* %7)
ret void
}

LLVM IR (-O2):
define void @ap_char(i8 signext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 %0, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 0, i8* %4
%5 = call i32 @ap_str(i8* %3)
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ keysizes(struct __test_metadata *);
void wrapper_keysizes(struct __test_metadata *_metadata,
                      struct __fixture_variant_metadata *variant) {
  keysizes(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_keysizes>:
jmp    1030 <keysizes@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_keysizes(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @keysizes(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_keysizes(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @keysizes(%struct.__test_metadata* %0)
ret void
}
int test_imm_C0int64_lowword_mem(long long *val) {
  return ((*val) & (0xC0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C0int64_lowword_mem>:
testb  $0xc0,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C0int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 192
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char string_1[] = "Rhinozeros";
  char string_2[11];
  int index = 0;
  while ((string_2[index] = string_1[index]) != '\0') {
    index += 1;
  }
  printf("string_2 = %s\n", string_2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xed7(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xecf(%rip),%al
mov    %al,-0x5(%rbp)
movl   $0x0,-0x20(%rbp)
movslq -0x20(%rbp),%rax
mov    -0xf(%rbp,%rax,1),%al
movslq -0x20(%rbp),%rcx
mov    %al,-0x1a(%rbp,%rcx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     116f <main+0x5f>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1145 <main+0x35>
lea    -0x1a(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x72657a6f6e696852,%rax
7a 65 72
mov    %rax,0x8(%rsp)
movl   $0x736f72,0xf(%rsp)
lea    0xed9(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.string_1 = [11 x i8] c"Rhinozeros\00"
@.str = [15 x i8] c"string_2 = %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
%3 = alloca [11 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [11 x i8]* %2 to i8*
store i32 0, i32* %4
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 %12
store i8 %10, i8* %13
%14 = sext i8 %10 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %6
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %6
19: ; preds = %6
%20 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %20)
ret i32 0
}

LLVM IR (-O2):
@__const.main.string_1 = [11 x i8] c"Rhinozeros\00"
@.str = [15 x i8] c"string_2 = %s\0A\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
scalar_t__ xisinff(float);
scalar_t__ xisnanf(float);
int checkfp(float x) {
  if (xisinff(x) || xisnanf(x))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<checkfp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <xisinff@plt>
cmp    $0x0,%rax
jne    1155 <checkfp+0x35>
movss  -0x8(%rbp),%xmm0
call   1040 <xisnanf@plt>
cmp    $0x0,%rax
je     1161 <checkfp+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1168 <checkfp+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkfp>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <xisinff@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     113b <checkfp+0x1b>
pop    %rcx
ret
movss  0x4(%rsp),%xmm0
call   1040 <xisnanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @checkfp(float %0) {
%2 = tail call i64 @xisinff(float %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @xisnanf(float %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}