xunge/DecIR huggingface dataset:
/* Type definitions */
typedef void *time_t;
struct utimbuf {
  void *modtime;
  void *actime;
};

/* Variables and functions */
scalar_t__ utime(char *, struct utimbuf *);
int lha_arch_utime(char *filename, unsigned int timestamp) {
  struct utimbuf times;
  times.actime = (time_t)timestamp;
  times.modtime = (time_t)timestamp;
  return utime(filename, &times) == 0;
}


x86 assembly (clang, -O0):
<lha_arch_utime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <utime@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lha_arch_utime>:
sub    $0x18,%rsp
mov    %esi,%eax
mov    %rax,0x10(%rsp)
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
call   1030 <utime@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.utimbuf = type { i8*, i8* }
define i32 @lha_arch_utime(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.utimbuf
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %5, i32 0, i32 1
store i8* %8, i8** %9
%10 = load i32, i32* %4
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
%13 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %5, i32 0, i32 0
store i8* %12, i8** %13
%14 = load i8*, i8** %3
%15 = call i64 @utime(i8* %14, %struct.utimbuf* %5)
%16 = icmp eq i64 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
%struct.utimbuf = type { i8*, i8* }
define i32 @lha_arch_utime(i8* nocapture %0, i32 %1) {
%3 = alloca %struct.utimbuf
%4 = bitcast %struct.utimbuf* %3 to i8*
%5 = zext i32 %1 to i64
%6 = inttoptr i64 %5 to i8*
%7 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %3, i64 0, i32 1
store i8* %6, i8** %7
%8 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %3, i64 0, i32 0
store i8* %6, i8** %8
%9 = call i64 @utime(i8* %0, %struct.utimbuf* %3)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
float log10(float);
float sqrt(float);
void slabad(float *small, float *large) {
  if (log10(*large) > 2e3f) {
    *small = sqrt(*small);
    *large = sqrt(*large);
  }
}


x86 assembly (clang, -O0):
<slabad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <log10@plt>
movss  0xebb(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1178 <slabad+0x58>
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1040 <sqrt@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1040 <sqrt@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slabad>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movss  (%rsi),%xmm0
call   1030 <log10@plt>
ucomiss 0xec6(%rip),%xmm0
jbe    1174 <slabad+0x54>
movss  (%r14),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     114f <slabad+0x2f>
sqrtss %xmm0,%xmm0
jmp    1157 <slabad+0x37>
call   1040 <sqrt@plt>
xorps  %xmm1,%xmm1
movss  %xmm0,(%r14)
movss  (%rbx),%xmm0
ucomiss %xmm1,%xmm0
jb     116b <slabad+0x4b>
sqrtss %xmm0,%xmm0
jmp    1170 <slabad+0x50>
call   1040 <sqrt@plt>
movss  %xmm0,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @slabad(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = load float, float* %5
%7 = call float @log10(float %6)
%8 = fcmp ogt float %7, 2.000000e+03
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load float*, float** %3
%11 = load float, float* %10
%12 = call float @sqrt(float %11)
%13 = load float*, float** %3
store float %12, float* %13
%14 = load float*, float** %4
%15 = load float, float* %14
%16 = call float @sqrt(float %15)
%17 = load float*, float** %4
store float %16, float* %17
br label %18
18: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @slabad(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @log10(float %3)
%5 = fcmp ogt float %4, 2.000000e+03
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = load float, float* %0
%8 = tail call float @sqrt(float %7)
store float %8, float* %0
%9 = load float, float* %1
%10 = tail call float @sqrt(float %9)
store float %10, float* %1
br label %11
11: ; preds = %6, %2
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long property;
};
typedef TYPE_1__ XSelectionEvent;

/* Variables and functions */
void set_XSelectionEvent_property(void *_p, unsigned long _v) {
  ((XSelectionEvent *)_p)->property = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XSelectionEvent_property>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XSelectionEvent_property(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XSelectionEvent_property(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void XGetImage() {}


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

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

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

LLVM IR (-O2):
define void @XGetImage() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, double);
int main() {
  int days = 12 + 5 + 4;
  double width = 12.67;
  double height = 10.8;
  double perimeter = width + width + height + height;
  printf(" days: %d \n", days);
  printf("Perimeter %f\n", perimeter);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x15,-0x8(%rbp)
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
movsd  0xed4(%rip),%xmm0
call   1030 <printf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c" days: %d \0A\00"
@.str.1 = [14 x i8] c"Perimeter %f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
store i32 21, i32* %2
store double 1.267000e+01, double* %3
store double 1.080000e+01, double* %4
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fadd double %6, %7
%9 = load double, double* %4
%10 = fadd double %8, %9
%11 = load double, double* %4
%12 = fadd double %10, %11
store double %12, double* %5
%13 = load i32, i32* %2
%14 = sitofp i32 %13 to double
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %14)
%16 = load double, double* %5
%17 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %16)
%18 = load i32, i32* @EXIT_SUCCESS
ret i32 %18
}

LLVM IR (-O2):
@.str = [12 x i8] c" days: %d \0A\00"
@.str.1 = [14 x i8] c"Perimeter %f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double 2.100000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double 4.694000e+01)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
void timer_reset(struct timeval *tv) {
  tv->tv_sec = 0;
  tv->tv_usec = 0;
}


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

x86 assembly (clang, -O2):
<timer_reset>:
xorps  %xmm0,%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @timer_reset(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i64 0, i64* %4
%5 = load %struct.timeval*, %struct.timeval** %2
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
store i64 0, i64* %6
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @timer_reset(%struct.timeval* nocapture writeonly %0) {
%2 = bitcast %struct.timeval* %0 to i8*
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_u32x3_jenkins2v_data(int /*<<< orphan*/ const *, size_t,
                                             uintptr_t, int /*<<< orphan*/ *);
void rgph_u32x3_jenkins2v_u8a(const uint8_t *key, size_t len, uintptr_t seed,
                              uint32_t *h) {
  rgph_u32x3_jenkins2v_data(key, len, seed, h);
}


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

x86 assembly (clang, -O2):
<rgph_u32x3_jenkins2v_u8a>:
jmp    1030 <rgph_u32x3_jenkins2v_data@plt>

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

LLVM IR (-O2):
define void @rgph_u32x3_jenkins2v_u8a(i32* %0, i64 %1, i64 %2, i32* %3) {
%5 = tail call i32 @rgph_u32x3_jenkins2v_data(i32* %0, i64 %1, i64 %2, i32* %3)
ret void
}
void swapIt(int *Arr, int m, int n) {
  int temp;
  temp = Arr[m];
  Arr[m] = Arr[n];
  Arr[n] = temp;
}


x86 assembly (clang, -O0):
<swapIt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapIt>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swapIt(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swapIt(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
unsigned int string_hash(void *string) {
  unsigned int result = 5381;
  unsigned char *p;
  p = (unsigned char *)string;
  while (*p != '\0') {
    result = (result << 5) + result + *p;
    ++p;
  }
  return result;
}


x86 assembly (clang, -O0):
<string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     114d <string_hash+0x4d>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <string_hash+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <string_hash+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <string_hash+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @string_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 5381, %1 ]
%8 = zext i8 %5 to i32
%9 = mul i32 %7, 33
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ system_setup();
int /*<<< orphan*/ tfp_printf(char *, int);
void main() {
  int x = 12;
  system_setup();
  tfp_printf("Hello World = %d\r\n", x);
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc,-0x4(%rbp)
mov    $0x0,%al
call   1040 <system_setup@plt>
mov    -0x4(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <tfp_printf@plt>
jmp    1145 <main+0x25>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <system_setup@plt>
lea    0xed1(%rip),%rdi
mov    $0xc,%esi
call   1030 <tfp_printf@plt>
nopl   0x0(%rax)
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [19 x i8] c"Hello World = %d\0D\0A\00"
define void @main() {
%1 = alloca i32
store i32 12, i32* %1
%2 = call i32 (...) @system_setup()
%3 = load i32, i32* %1
%4 = call i32 @tfp_printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %5
5: ; preds = %0, %5
br label %5
}

LLVM IR (-O2):
@.str = [19 x i8] c"Hello World = %d\0D\0A\00"
define void @main() {
%1 = tail call i32 (...) @system_setup()
%2 = tail call i32 @tfp_printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 12)
br label %3
3: ; preds = %3, %0
br label %3
}
char *strchr(const char *s, int c) {
  for (; *s != (char)c; ++s)
    if (*s == '\0')
      return ((void *)0);
  return (char *)s;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
je     1153 <strchr+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113d <strchr+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    115b <strchr+0x5b>
jmp    1142 <strchr+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %8, %12, %2
%18 = phi i8* [ %0, %2 ], [ %13, %12 ], [ null, %8 ]
ret i8* %18
}
operand_error(access_type, data_type) int access_type;
int data_type;
{ PI_printf("Operand error: %c%c", access_type, data_type); }


x86 assembly (clang, -O0):
<operand_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <PI_printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<operand_error>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <PI_printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Operand error: %c%c\00"
define i32 @operand_error(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @PI_printf to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [20 x i8] c"Operand error: %c%c\00"
define i32 @operand_error(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @PI_printf to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 undef
}
float blend_overlay(float A, float B) {
  return (A < 0.5) ? 2.0 * A * B : (1.0 - 2.0 * (1.0 - A) * (1.0 - B));
}


x86 assembly (clang, -O0):
<blend_overlay>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee1(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1155 <blend_overlay+0x55>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    11b7 <blend_overlay+0xb7>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea2(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0xe9e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xe81(%rip),%xmm1
subsd  %xmm2,%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe5a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<blend_overlay>:
cvtss2sd %xmm0,%xmm2
movss  0xef4(%rip),%xmm3
ucomiss %xmm0,%xmm3
jbe    1125 <blend_overlay+0x25>
addsd  %xmm2,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
ret
movsd  0xedb(%rip),%xmm3
movapd %xmm3,%xmm0
subsd  %xmm2,%xmm0
cvtss2sd %xmm1,%xmm1
movapd %xmm3,%xmm2
subsd  %xmm1,%xmm2
mulsd  0xec7(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @blend_overlay(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = fcmp olt double %6, 5.000000e-01
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fmul double 2.000000e+00, %10
%12 = load float, float* %4
%13 = fpext float %12 to double
%14 = fmul double %11, %13
br label %25
15: ; preds = %2
%16 = load float, float* %3
%17 = fpext float %16 to double
%18 = fsub double 1.000000e+00, %17
%19 = fmul double 2.000000e+00, %18
%20 = load float, float* %4
%21 = fpext float %20 to double
%22 = fsub double 1.000000e+00, %21
%23 = fneg double %19
%24 = call double @llvm.fmuladd.f64(double %23, double %22, double 1.000000e+00)
br label %25
25: ; preds = %15, %8
%26 = phi double [ %14, %8 ], [ %24, %15 ]
%27 = fptrunc double %26 to float
ret float %27
}

LLVM IR (-O2):
define float @blend_overlay(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fcmp olt float %0, 5.000000e-01
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = fmul double %3, 2.000000e+00
%7 = fpext float %1 to double
%8 = fmul double %6, %7
br label %15
9: ; preds = %2
%10 = fsub double 1.000000e+00, %3
%11 = fpext float %1 to double
%12 = fsub double 1.000000e+00, %11
%13 = fmul double %10, -2.000000e+00
%14 = tail call double @llvm.fmuladd.f64(double %13, double %12, double 1.000000e+00)
br label %15
15: ; preds = %9, %5
%16 = phi double [ %8, %5 ], [ %14, %9 ]
%17 = fptrunc double %16 to float
ret float %17
}
cmp(s, t) register char *s, *t;
{
  while (*s == *t) {
    if (*s == 0)
      return (1);
    s++;
    t++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115b <cmp+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <cmp+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1162 <cmp+0x62>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <cmp+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
jne    1124 <cmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %cl,%cl
je     1125 <cmp+0x25>
movzbl (%rdi,%rdx,1),%ecx
lea    0x1(%rdx),%r8
cmp    (%rsi,%rdx,1),%cl
mov    %r8,%rdx
je     1110 <cmp+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %17, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %6, %11, %2
%18 = phi i32 [ 0, %2 ], [ 0, %11 ], [ 1, %6 ]
ret i32 %18
}
const char *Kernel_version(void) {
  return "Fulcrum "
         "v0"
         " compiled at "
         "Mar 17 2022"
         " "
         "02:22:08";
}


x86 assembly (clang, -O0):
<Kernel_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kernel_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Fulcrum v0 compiled at Mar 17 2022 02:22:08\00"
define i8* @Kernel_version() {
ret i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [44 x i8] c"Fulcrum v0 compiled at Mar 17 2022 02:22:08\00"
define i8* @Kernel_version() {
ret i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0)
}
void testClosureBLLBrV(void (*closure)(char, long long, char), char a1,
                       long long a2, char a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureBLLBrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rsi
movsbl %cl,%edi
movsbl -0x19(%rbp),%edx
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureBLLBrV>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    *%rax

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

LLVM IR (-O2):
define void @testClosureBLLBrV(void (i8, i64, i8)* nocapture %0, i8 signext %1, i64 %2, i8 signext %3) {
tail call void %0(i8 signext %1, i64 %2, i8 signext %3)
ret void
}
/* Variables and functions */
char *escape_string(char *);
int /*<<< orphan*/ s_internal(char *, char *, char *, int);
char *s_escape_string(char *str) {
  char *r = escape_string(str);
  (s_internal(str, "str",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/roswell/roswell/refs/heads/master/src/"
              "util-string.c",
              182));
  return r;
}


x86 assembly (clang, -O0):
<s_escape_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <escape_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebc(%rip),%rsi
lea    0xeb9(%rip),%rdx
mov    $0xb6,%ecx
call   1030 <s_internal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_escape_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <escape_string@plt>
mov    %rax,%r14
lea    0xeca(%rip),%rsi
lea    0xec7(%rip),%rdx
mov    %rbx,%rdi
mov    $0xb6,%ecx
call   1030 <s_internal@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"str\00"
@.str.1 = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/roswell/roswell/refs/heads/master/src/util-string.c\00"
define i8* @s_escape_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @escape_string(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @s_internal(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.1, i64 0, i64 0), i32 182)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"str\00"
@.str.1 = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/roswell/roswell/refs/heads/master/src/util-string.c\00"
define i8* @s_escape_string(i8* %0) {
%2 = tail call i8* @escape_string(i8* %0)
%3 = tail call i32 @s_internal(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.1, i64 0, i64 0), i32 182)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *tmpfile();
void resourceLeak_tmpfile(void) { FILE *fp = tmpfile(); }


x86 assembly (clang, -O0):
<resourceLeak_tmpfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <tmpfile@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @resourceLeak_tmpfile() {
%1 = alloca i32*
%2 = call i32* (...) @tmpfile()
store i32* %2, i32** %1
ret void
}

LLVM IR (-O2):
define void @resourceLeak_tmpfile() {
%1 = tail call i32* (...) @tmpfile()
ret void
}
unsigned int f2(unsigned int x, unsigned long int y) {
  return (x << y) | (x >> ((-y) & (8 * 4 - 1)));
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %rsi,%rcx
mov    %edi,%eax
rol    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @f2(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl i32 %0, %3
%5 = sub i32 0, %3
%6 = and i32 %5, 31
%7 = lshr i32 %0, %6
%8 = or i32 %7, %4
ret i32 %8
}
/* Variables and functions */
int dup(int);
int /*<<< orphan*/ panic(char *);
__attribute__((visibility("hidden"))) int xdup(int fd) {
  int ret = dup(fd);
  if (ret < 0)
    panic("xdup: dup failed\n");
  return ret;
}


x86 assembly (clang, -O0):
<xdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <dup@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    114c <xdup+0x2c>
lea    0xeb9(%rip),%rdi
call   1040 <panic@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdup>:
push   %rbx
call   1030 <dup@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <xdup+0x18>
lea    0xecd(%rip),%rdi
call   1040 <panic@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"xdup: dup failed\0A\00"
define hidden i32 @xdup(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @dup(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @panic(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [18 x i8] c"xdup: dup failed\0A\00"
define hidden i32 @xdup(i32 %0) {
%2 = tail call i32 @dup(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @panic(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
scalar_t__ access(char const *, int /*<<< orphan*/);
int sqlite3OsFileExists(const char *zFilename) {
  return access(zFilename, 0) == 0;
}


x86 assembly (clang, -O0):
<sqlite3OsFileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <access@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3OsFileExists>:
push   %rax
xor    %esi,%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sqlite3OsFileExists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @access(i8* %3, i32 0)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @sqlite3OsFileExists(i8* nocapture %0) {
%2 = tail call i64 @access(i8* %0, i32 0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void omap_barrier_reserve_memblock(void) {}


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

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

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

LLVM IR (-O2):
define void @omap_barrier_reserve_memblock() {
ret void
}
int max(int a, int b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}


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

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
double __nv_acosh(double);
double acosh(double __a) { return __nv_acosh(__a); }


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

x86 assembly (clang, -O2):
<acosh>:
jmp    1030 <__nv_acosh@plt>

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

LLVM IR (-O2):
define double @acosh(double %0) {
%2 = tail call double @__nv_acosh(double %0)
ret double %2
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *strdup(const char *str1) {
  size_t size = strlen(str1) + 1;
  char *str2 = malloc(size);
  if (str2 != NULL)
    memcpy(str2, str1, size);
  return str2;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1177 <strdup+0x47>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %18
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = load i64, i64* %3
%17 = call i32 @memcpy(i8* %14, i8* %15, i64 %16)
br label %18
18: ; preds = %13, %1
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
int allMarked(int a[], int len) {
  int i;
  for (i = 0; i < len; i++) {
    if (a[i] == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<allMarked>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114f <allMarked+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    113c <allMarked+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1156 <allMarked+0x56>
jmp    1141 <allMarked+0x41>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <allMarked+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<allMarked>:
mov    $0x1,%eax
test   %esi,%esi
jle    111f <allMarked+0x1f>
mov    %esi,%ecx
xor    %edx,%edx
nopl   (%rax)
cmpl   $0x0,(%rdi,%rdx,4)
je     1120 <allMarked+0x20>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <allMarked+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @allMarked(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %14, label %6
14: ; preds = %8, %6, %2
%15 = phi i32 [ 1, %2 ], [ 1, %6 ], [ 0, %8 ]
ret i32 %15
}
/* Variables and functions */
scalar_t__ COLS;
scalar_t__ LINES;
int /*<<< orphan*/ move(scalar_t__, scalar_t__);
int /*<<< orphan*/ napms(int);
int /*<<< orphan*/ refresh();
void myrefresh(void) {
  napms(200);
  move(LINES - 1, COLS - 1);
  refresh();
}


x86 assembly (clang, -O0):
<myrefresh>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc8,%edi
call   1040 <napms@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%rdi
sub    $0x1,%rdi
mov    0x2e8d(%rip),%rax
mov    (%rax),%rsi
sub    $0x1,%rsi
call   1050 <move@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrefresh>:
push   %rax
mov    $0xc8,%edi
call   1040 <napms@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%rdi
add    $0xffffffffffffffff,%rdi
mov    0x2e90(%rip),%rax
mov    (%rax),%rsi
add    $0xffffffffffffffff,%rsi
call   1050 <move@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <refresh@plt>

LLVM IR (-O0):
@LINES = global i64 0
@COLS = global i64 0
define void @myrefresh() {
%1 = call i32 @napms(i32 200)
%2 = load i64, i64* @LINES
%3 = sub nsw i64 %2, 1
%4 = load i64, i64* @COLS
%5 = sub nsw i64 %4, 1
%6 = call i32 @move(i64 %3, i64 %5)
%7 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@LINES = global i64 0
@COLS = global i64 0
define void @myrefresh() {
%1 = tail call i32 @napms(i32 200)
%2 = load i64, i64* @LINES
%3 = add nsw i64 %2, -1
%4 = load i64, i64* @COLS
%5 = add nsw i64 %4, -1
%6 = tail call i32 @move(i64 %3, i64 %5)
%7 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void micro_sleep(int microseconds) { usleep(microseconds); }


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

x86 assembly (clang, -O2):
<micro_sleep>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @micro_sleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SetOfFlag_asm();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  SetOfFlag_asm();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <SetOfFlag_asm@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int _TimerBaseValid(int);
void TimerClockSourceSet(uint32_t ui32Base, uint32_t ui32Source) {
  ASSERT(_TimerBaseValid(ui32Base));
  ASSERT((ui32Source == 0x00000000) || (ui32Source == 0x00000001));
  (*((volatile uint32_t *)(ui32Base + 0x00000FC8))) = ui32Source;
}


x86 assembly (clang, -O0):
<TimerClockSourceSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_TimerBaseValid@plt>
mov    %eax,%edi
call   1030 <ASSERT@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1156 <TimerClockSourceSet+0x36>
cmpl   $0x1,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xfc8,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerClockSourceSet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <_TimerBaseValid@plt>
mov    %eax,%edi
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x2,%ebx
setb   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
mov    %ebx,0xfc8(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @TimerClockSourceSet(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 = call i32 @_TimerBaseValid(i32 %5)
%7 = call i32 @ASSERT(i32 %6)
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 1
br label %13
13: ; preds = %10, %2
%14 = phi i1 [ true, %2 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
%16 = call i32 @ASSERT(i32 %15)
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 4040
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
store volatile i32 %17, i32* %21
ret void
}

LLVM IR (-O2):
define void @TimerClockSourceSet(i32 %0, i32 %1) {
%3 = tail call i32 @_TimerBaseValid(i32 %0)
%4 = tail call i32 @ASSERT(i32 %3)
%5 = icmp ult i32 %1, 2
%6 = zext i1 %5 to i32
%7 = tail call i32 @ASSERT(i32 %6)
%8 = add nsw i32 %0, 4040
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %1, i32* %10
ret void
}