xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool rtp_6184_fu_check_start(uint8_t header) { return header & 0x80; }


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

x86 assembly (clang, -O2):
<rtp_6184_fu_check_start>:
mov    %edi,%eax
and    $0x80,%eax
ret

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

LLVM IR (-O2):
define i32 @rtp_6184_fu_check_start(i32 %0) {
%2 = and i32 %0, 128
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, char *);
int /*<<< orphan*/ wcsutil_double2str(char *, char *, double);
void write_date(char *buf, int hour, int minute, double sec) {
  char ctmp[32];
  wcsutil_double2str(ctmp, "%04.1f", sec);
  sprintf(buf, "T%.2d:%.2d:%s", hour, minute, ctmp);
}


x86 assembly (clang, -O0):
<write_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
lea    0xeb9(%rip),%rsi
call   1040 <wcsutil_double2str@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    -0x40(%rbp),%r8
lea    0xea6(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_date>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xec7(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <wcsutil_double2str@plt>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
mov    %r14d,%ecx
mov    %r15,%r8
call   1030 <sprintf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%04.1f\00"
@.str.1 = [14 x i8] c"T%.2d:%.2d:%s\00"
define void @write_date(i8* %0, i32 %1, i32 %2, double %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca [32 x i8]
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double %3, double* %8
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%11 = load double, double* %8
%12 = call i32 @wcsutil_double2str(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %11)
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%17 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%04.1f\00"
@.str.1 = [14 x i8] c"T%.2d:%.2d:%s\00"
define void @write_date(i8* nocapture writeonly %0, i32 %1, i32 %2, double %3) {
%5 = alloca [32 x i8]
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = call i32 @wcsutil_double2str(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %3)
%8 = call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %2, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(double);
void delay(double seconds) { usleep(seconds * 1000000.0); }


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

x86 assembly (clang, -O2):
<delay>:
mulsd  0xee8(%rip),%xmm0
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @delay(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.000000e+06
%5 = call i32 @usleep(double %4)
ret void
}

LLVM IR (-O2):
define void @delay(double %0) {
%2 = fmul double %0, 1.000000e+06
%3 = tail call i32 @usleep(double %2)
ret void
}
void XCopyPlane() {}


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

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

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

LLVM IR (-O2):
define void @XCopyPlane() {
ret void
}
/* Variables and functions */
scalar_t__ check_prime(int);
int /*<<< orphan*/ printf(char *, int);
void print_prime(int n1, int n2) {
  int i;
  for (i = n1; i <= n2; i++) {
    if (check_prime(i))
      printf("%d ", i);
  }
}


x86 assembly (clang, -O0):
<print_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1174 <print_prime+0x54>
mov    -0xc(%rbp),%edi
call   1030 <check_prime@plt>
cmp    $0x0,%rax
je     1161 <print_prime+0x41>
mov    -0xc(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
jmp    1166 <print_prime+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <print_prime+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_prime>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edi
jle    112d <print_prime+0xd>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %esi,%ebx
mov    %edi,%ebp
add    $0x1,%ebx
lea    0xec5(%rip),%r14
jmp    1147 <print_prime+0x27>
nopl   (%rax)
add    $0x1,%ebp
cmp    %ebp,%ebx
je     1128 <print_prime+0x8>
mov    %ebp,%edi
call   1030 <check_prime@plt>
test   %rax,%rax
je     1140 <print_prime+0x20>
mov    %r14,%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
jmp    1140 <print_prime+0x20>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_prime(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2, %10
%5 = phi i32 [ %11, %10 ], [ %0, %2 ]
%6 = tail call i64 @check_prime(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %10
10: ; preds = %4, %8
%11 = add i32 %5, 1
%12 = icmp eq i32 %5, %1
br i1 %12, label %13, label %4
13: ; preds = %10, %2
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
unsigned long long get_timer_nsec(struct timespec *timer) {
  return timer->tv_sec * 1E6 + timer->tv_nsec / 1000;
}


x86 assembly (clang, -O0):
<get_timer_nsec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
movslq 0x4(%rax),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xecc(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
movsd  0xeb5(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_timer_nsec>:
cvtsi2sdl (%rdi),%xmm0
movslq 0x4(%rdi),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  0xed8(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
subsd  0xec8(%rip),%xmm0
cvttsd2si %xmm0,%rax
and    %rdx,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i64 @get_timer_nsec(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = sitofp i32 %10 to double
%12 = call double @llvm.fmuladd.f64(double %6, double 1.000000e+06, double %11)
%13 = fptoui double %12 to i64
ret i64 %13
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i64 @get_timer_nsec(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = sdiv i32 %6, 1000
%8 = sitofp i32 %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %4, double 1.000000e+06, double %8)
%10 = fptoui double %9 to i64
ret i64 %10
}
/* Variables and functions */
void *__builtin_memset(void *, int, size_t);
void *memset(void *s, int c, size_t n) { return __builtin_memset(s, c, n); }


x86 assembly (clang, -O0):
<memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rdx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @memset(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = trunc i32 %8 to i8
%10 = load i64, i64* %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %4, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
unsigned int simplerng_getuint_pr(unsigned int *, unsigned int *);
double simplerng_getuniform_pr(unsigned int *u, unsigned int *v) {
  unsigned int z = simplerng_getuint_pr(u, v);
  return z * 2.328306435996595e-10;
}


x86 assembly (clang, -O0):
<simplerng_getuniform_pr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <simplerng_getuint_pr@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xec0(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simplerng_getuniform_pr>:
push   %rax
call   1030 <simplerng_getuint_pr@plt>
mov    %eax,%eax
cvtsi2sd %rax,%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @simplerng_getuniform_pr(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = call i32 @simplerng_getuint_pr(i32* %6, i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = uitofp i32 %9 to double
%11 = fmul double %10, 0x3DEFFFFFFFDFFFFF
ret double %11
}

LLVM IR (-O2):
define double @simplerng_getuniform_pr(i32* %0, i32* %1) {
%3 = tail call i32 @simplerng_getuint_pr(i32* %0, i32* %1)
%4 = uitofp i32 %3 to double
%5 = fmul double %4, 0x3DEFFFFFFFDFFFFF
ret double %5
}
/* Type definitions */
struct chirp_statfs {
  int dummy;
};
typedef int int64_t;

/* Variables and functions */
int chirp_fs_hdfs_resolve(char const *, char *);
int do_statfs(char const *, struct chirp_statfs *);
int64_t chirp_fs_hdfs_statfs(const char *path, struct chirp_statfs *buf) {
  char resolved_path[1024];
  if (chirp_fs_hdfs_resolve(path, resolved_path) == -1)
    return -1;
  path = resolved_path;
  return do_statfs(path, buf);
}


x86 assembly (clang, -O0):
<chirp_fs_hdfs_statfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x420(%rbp),%rsi
call   1030 <chirp_fs_hdfs_resolve@plt>
cmp    $0xffffffff,%eax
jne    1158 <chirp_fs_hdfs_statfs+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <chirp_fs_hdfs_statfs+0x53>
lea    -0x420(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <do_statfs@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_fs_hdfs_statfs>:
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%rbx
mov    %rsp,%rsi
call   1030 <chirp_fs_hdfs_resolve@plt>
cmp    $0xffffffff,%eax
je     1145 <chirp_fs_hdfs_statfs+0x25>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1040 <do_statfs@plt>
jmp    114a <chirp_fs_hdfs_statfs+0x2a>
mov    $0xffffffff,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.chirp_statfs = type { i32 }
define i32 @chirp_fs_hdfs_statfs(i8* %0, %struct.chirp_statfs* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.chirp_statfs*
%6 = alloca [1024 x i8]
store i8* %0, i8** %4
store %struct.chirp_statfs* %1, %struct.chirp_statfs** %5
%7 = load i8*, i8** %4
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%9 = call i32 @chirp_fs_hdfs_resolve(i8* %7, i8* %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %17
12: ; preds = %2
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = load %struct.chirp_statfs*, %struct.chirp_statfs** %5
%16 = call i32 @do_statfs(i8* %14, %struct.chirp_statfs* %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %12, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.chirp_statfs = type { i32 }
define i32 @chirp_fs_hdfs_statfs(i8* %0, %struct.chirp_statfs* %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @chirp_fs_hdfs_resolve(i8* %0, i8* %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @do_statfs(i8* %4, %struct.chirp_statfs* %1)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ -1, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int darm_my_lsr(int value, int shift) {
  assert(shift >= 0);
  if (shift == 0) {
    return value;
  } else {
    return ((unsigned)value >> shift);
  }
}


x86 assembly (clang, -O0):
<darm_my_lsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0xc(%rbp)
jne    1144 <darm_my_lsr+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114f <darm_my_lsr+0x3f>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<darm_my_lsr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
mov    %ebx,%ecx
shr    %cl,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @darm_my_lsr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp sge i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i32, i32* %4
store i32 %13, i32* %3
br label %18
14: ; preds = %2
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = lshr i32 %15, %16
store i32 %17, i32* %3
br label %18
18: ; preds = %14, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @darm_my_lsr(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = lshr i32 %3, 31
%5 = tail call i32 @assert(i32 %4)
%6 = lshr i32 %0, %1
ret i32 %6
}
/* Variables and functions */
double __nv_norm(int, double const *);
double norm(int __dim, const double *__t) { return __nv_norm(__dim, __t); }


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

x86 assembly (clang, -O2):
<norm>:
jmp    1030 <__nv_norm@plt>

LLVM IR (-O0):
define double @norm(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
store i32 %0, i32* %3
store double* %1, double** %4
%5 = load i32, i32* %3
%6 = load double*, double** %4
%7 = call double @__nv_norm(i32 %5, double* %6)
ret double %7
}

LLVM IR (-O2):
define double @norm(i32 %0, double* %1) {
%3 = tail call double @__nv_norm(i32 %0, double* %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_ADDB(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0xfc);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
}


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

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

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

LLVM IR (-O2):
define void @MMX_ADDB(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 252)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 192
%9 = tail call i32 @addbyte(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clearLastError();
int pintoGPIO(int);
int writeIntValueToFile(char *, int);
int unexportGPIOPin(int pin) {
  clearLastError();
  int gpio = pintoGPIO(pin);
  return writeIntValueToFile("/sys/class/gpio/unexport", gpio);
}


x86 assembly (clang, -O0):
<unexportGPIOPin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <clearLastError@plt>
mov    -0x4(%rbp),%edi
call   1030 <pintoGPIO@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1050 <writeIntValueToFile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unexportGPIOPin>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <clearLastError@plt>
mov    %ebx,%edi
call   1030 <pintoGPIO@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
pop    %rbx
jmp    1050 <writeIntValueToFile@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"/sys/class/gpio/unexport\00"
define i32 @unexportGPIOPin(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @clearLastError()
%5 = load i32, i32* %2
%6 = call i32 @pintoGPIO(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @writeIntValueToFile(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [25 x i8] c"/sys/class/gpio/unexport\00"
define i32 @unexportGPIOPin(i32 %0) {
%2 = tail call i32 (...) @clearLastError()
%3 = tail call i32 @pintoGPIO(i32 %0)
%4 = tail call i32 @writeIntValueToFile(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}
int fun1062() { return 1062; }


x86 assembly (clang, -O0):
<fun1062>:
push   %rbp
mov    %rsp,%rbp
mov    $0x426,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun1062() {
ret i32 1062
}

LLVM IR (-O2):
define i32 @fun1062() {
ret i32 1062
}
long get_page_size(void) { return 1; }


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

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

LLVM IR (-O0):
define i64 @get_page_size() {
ret i64 1
}

LLVM IR (-O2):
define i64 @get_page_size() {
ret i64 1
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char *p = malloc(2);
  p[0] = 'O';
  p[1] = 'i';
  p++;
  printf("%c\n", *p);
  printf("%p\n", p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x4f,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x69,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2,%edi
call   1040 <malloc@plt>
movw   $0x694f,(%rax)
lea    0x1(%rax),%rbx
lea    0xec5(%rip),%rdi
mov    $0x69,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
@.str.1 = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 2)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 79, i8* %4
%5 = load i8*, i8** %1
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 105, i8* %6
%7 = load i8*, i8** %1
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %1
%9 = load i8*, i8** %1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %1
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
@.str.1 = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
store i8 79, i8* %1
%2 = getelementptr inbounds i8, i8* %1, i64 1
store i8 105, i8* %2
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 105)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ callrts(char *);
ugt() { callrts("ccugt"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"ccugt\00"
define i32 @ugt() {
%1 = alloca i32
%2 = call i32 @callrts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccugt\00"
define i32 @ugt() {
%1 = tail call i32 @callrts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int checkzero(void *p, int len) {
  int is_zero;
  __asm__("cld\n"
          "xorb %%al, %%al\n"
          "repz scasb\n"
          : "=c"(is_zero)
          : "c"(len), "D"(p)
          : "eax", "cc");
  return !is_zero;
}


x86 assembly (clang, -O0):
<checkzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rdi
cld
xor    %al,%al
repz scas %es:(%rdi),%al
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkzero>:
mov    %esi,%ecx
cld
xor    %al,%al
repz scas %es:(%rdi),%al
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @checkzero(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 asm "cld\0Axorb %al, %al\0Arepz scasb\0A", "={cx},{cx},{di},~{eax},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @checkzero(i8* readnone %0, i32 %1) {
%3 = tail call i32 asm "cld\0Axorb %al, %al\0Arepz scasb\0A", "={cx},{cx},{di},~{eax},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %1, i8* %0)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *strtok(char *, char *);
char *getFileName(char *file) {
  char *temp, *returnName;
  temp = strtok(file, "/");
  while (temp != NULL) {
    returnName = temp;
    temp = strtok(NULL, "/");
  }
  return returnName;
}


x86 assembly (clang, -O0):
<getFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115c <getFileName+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xeb2(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
jmp    1130 <getFileName+0x20>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileName>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rsi
call   1030 <strtok@plt>
test   %rax,%rax
je     1144 <getFileName+0x34>
lea    0xed4(%rip),%r14
nopl   0x0(%rax)
mov    %rax,%rbx
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <strtok@plt>
test   %rax,%rax
jne    1130 <getFileName+0x20>
jmp    1144 <getFileName+0x34>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i8* @getFileName(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strtok(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %3
br label %7
7: ; preds = %10, %1
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i8*, i8** %3
store i8* %11, i8** %4
%12 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %12, i8** %3
br label %7
13: ; preds = %7
%14 = load i8*, i8** %4
ret i8* %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i8* @getFileName(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %2, %1 ]
%6 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %4
8: ; preds = %4, %1
%9 = phi i8* [ undef, %1 ], [ %5, %4 ]
ret i8* %9
}
int test_imm_A7uint16_reg(unsigned short val) {
  return ((val) & (0xA7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A7uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xa7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A7uint16_reg>:
test   $0xa7,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A7uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 167
%6 = icmp ne i32 %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_A7uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 167
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int vga_cons_open(__attribute__((unused)) void *private) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @vga_cons_open(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
bool open_blank_input_file(FILE *f, char *name) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @open_blank_input_file(i32* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
long double fdim(long double x, long double y) {
  long double z;
  z = x - y;
  return z;
}


x86 assembly (clang, -O0):
<fdim>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fsubrp %st,%st(1)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdim>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fsubp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @fdim(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%6 = load x86_fp80, x86_fp80* %3
%7 = load x86_fp80, x86_fp80* %4
%8 = fsub x86_fp80 %6, %7
store x86_fp80 %8, x86_fp80* %5
%9 = load x86_fp80, x86_fp80* %5
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @fdim(x86_fp80 %0, x86_fp80 %1) {
%3 = fsub x86_fp80 %0, %1
ret x86_fp80 %3
}
int uncalled(int i, int j) { return i * j; }


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

LLVM IR (-O0):
define i32 @uncalled(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 @uncalled(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
void _native_LED_GREEN_OFF(void) {}


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

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

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

LLVM IR (-O2):
define void @_native_LED_GREEN_OFF() {
ret void
}
/* Type definitions */
struct AMCStaticBstNode {
  int dummy;
};

/* Variables and functions */
int AMCMemPool_Free(struct AMCStaticBstNode *);
int _sTree_FreeNode(struct AMCStaticBstNode *node) {
  return AMCMemPool_Free(node);
}


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

x86 assembly (clang, -O2):
<_sTree_FreeNode>:
jmp    1030 <AMCMemPool_Free@plt>

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

LLVM IR (-O2):
%struct.AMCStaticBstNode = type { i32 }
define i32 @_sTree_FreeNode(%struct.AMCStaticBstNode* %0) {
%2 = tail call i32 @AMCMemPool_Free(%struct.AMCStaticBstNode* %0)
ret i32 %2
}
int getDigits(int errCnt) {
  int count = 0;
  while (errCnt > 0) {
    errCnt /= 10;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<getDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1134 <getDigits+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <getDigits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDigits>:
xor    %eax,%eax
test   %edi,%edi
jle    1124 <getDigits+0x24>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <getDigits+0x10>
ret

LLVM IR (-O0):
define i32 @getDigits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %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 = sdiv i32 %8, 10
store i32 %9, i32* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @getDigits(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
void DIST_POINT_new(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_add_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((always_)) __m128i add_128(__m128i a, __m128i b) {
  return _mm_add_epi32(a, b);
}


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

x86 assembly (clang, -O2):
<add_128>:
jmp    1030 <_mm_add_epi32@plt>

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

LLVM IR (-O2):
define i32 @add_128(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_add_epi32(i32 %0, i32 %1)
ret i32 %3
}
int findRootOfElement(int *forest, int element) {
  if (element != forest[element]) {
    forest[element] = findRootOfElement(forest, forest[element]);
  }
  return forest[element];
}


x86 assembly (clang, -O0):
<findRootOfElement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     1154 <findRootOfElement+0x44>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <findRootOfElement@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findRootOfElement>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%eax
movslq %esi,%rbx
mov    (%rdi,%rbx,4),%esi
cmp    %ebx,%esi
je     112c <findRootOfElement+0x1c>
mov    %rdi,%r14
call   1030 <findRootOfElement@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @findRootOfElement(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, %1
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @findRootOfElement(i32* %0, i32 %5)
store i32 %8, i32* %4
br label %9
9: ; preds = %7, %2
%10 = phi i32 [ %8, %7 ], [ %1, %2 ]
ret i32 %10
}
int omap_lcd_dma_running(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omap_lcd_dma_running() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void constant_expr_test() {
  int a;
  printf("constant_expr:\n");
  a = 3;
  printf("%d\n", a * 16);
  printf("%d\n", a * 1);
  printf("%d\n", a + 0);
}


x86 assembly (clang, -O0):
<constant_expr_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%esi
shl    $0x4,%esi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
shl    $0x0,%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
add    $0x0,%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<constant_expr_test>:
push   %rbx
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    $0x30,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [15 x i8] c"constant_expr:\00"
define void @constant_expr_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 48)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LSR_();
int /*<<< orphan*/ c64_memAbsoluteAddrX();
void LSR_absx(void) {
  c64_memAbsoluteAddrX();
  LSR_();
}


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

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

LLVM IR (-O0):
define void @LSR_absx() {
%1 = call i32 (...) @c64_memAbsoluteAddrX()
%2 = call i32 (...) @LSR_()
ret void
}

LLVM IR (-O2):
define void @LSR_absx() {
%1 = tail call i32 (...) @c64_memAbsoluteAddrX()
%2 = tail call i32 (...) @LSR_()
ret void
}
float baz(float x, float y) { return x * x * x * x * y * y * y * y; }


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
movaps %xmm0,%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm2,%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @baz(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 = load float, float* %3
%7 = fmul float %5, %6
%8 = load float, float* %3
%9 = fmul float %7, %8
%10 = load float, float* %3
%11 = fmul float %9, %10
%12 = load float, float* %4
%13 = fmul float %11, %12
%14 = load float, float* %4
%15 = fmul float %13, %14
%16 = load float, float* %4
%17 = fmul float %15, %16
%18 = load float, float* %4
%19 = fmul float %17, %18
ret float %19
}

LLVM IR (-O2):
define float @baz(float %0, float %1) {
%3 = fmul float %0, %0
%4 = fmul float %3, %0
%5 = fmul float %4, %0
%6 = fmul float %5, %1
%7 = fmul float %6, %1
%8 = fmul float %7, %1
%9 = fmul float %8, %1
ret float %9
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *mystrdup(const char *s) {
  char *b;
  if (!(b = malloc(strlen(s) + 1)))
    return NULL;
  strcpy(b, s);
  return b;
}


x86 assembly (clang, -O0):
<mystrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    116c <mystrdup+0x3c>
movq   $0x0,-0x8(%rbp)
jmp    1181 <mystrdup+0x51>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @mystrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
double Dirichlet_data(double x, double y) { return x * x - y * y; }


x86 assembly (clang, -O0):
<Dirichlet_data>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dirichlet_data>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Dirichlet_data(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = fneg double %9
%11 = call double @llvm.fmuladd.f64(double %5, double %6, double %10)
ret double %11
}

LLVM IR (-O2):
define double @Dirichlet_data(double %0, double %1) {
%3 = fneg double %1
%4 = fmul double %3, %1
%5 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %4)
ret double %5
}
/* Variables and functions */
int listen(int, int);
int unified_sockets__listen(int _sd) {
  int ret;
  ret = listen(_sd, 30);
  switch (ret) {
  case 0:
    break;
  default:
    ret = -1;
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<unified_sockets__listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1e,%esi
call   1030 <listen@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
test   %eax,%eax
jne    1140 <unified_sockets__listen+0x30>
jmp    113b <unified_sockets__listen+0x2b>
jmp    1147 <unified_sockets__listen+0x37>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unified_sockets__listen>:
push   %rax
mov    $0x1e,%esi
call   1030 <listen@plt>
neg    %eax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @unified_sockets__listen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @listen(i32 %4, i32 30)
store i32 %5, i32* %3
%6 = load i32, i32* %3
switch i32 %6, label %8 [
i32 0, label %7
]
7: ; preds = %1
br label %9
8: ; preds = %1
store i32 -1, i32* %3
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @unified_sockets__listen(i32 %0) {
%2 = tail call i32 @listen(i32 %0, i32 30)
%3 = icmp ne i32 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}