xunge/DecIR huggingface dataset:
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ stSafeCErr(char *, size_t);
void *stSafeCMalloc(size_t size) {
  void *mem = malloc(size);
  if (mem == NULL) {
    stSafeCErr("can't allocate %zd bytes of memory", size);
  }
  return mem;
}


x86 assembly (clang, -O0):
<stSafeCMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <stSafeCMalloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <stSafeCErr@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stSafeCMalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <stSafeCMalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <stSafeCErr@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [35 x i8] c"can't allocate %zd bytes of memory\00"
define i8* @stSafeCMalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @stSafeCErr(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [35 x i8] c"can't allocate %zd bytes of memory\00"
define noalias i8* @stSafeCMalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @stSafeCErr(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int O_APPEND;
int O_WRONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dprintf(int, char *, char *);
int open(char *, int);
void return_pos(void) {
  int fd;
  int value;
  fd = open("/sys/class/dothat/st7036/cursor_position", O_WRONLY | O_APPEND);
  if (fd > 0) {
    dprintf(fd, "%s", "0 0");
    close(fd);
  }
}


x86 assembly (clang, -O0):
<return_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
mov    0x2e88(%rip),%rax
or     (%rax),%esi
lea    0xeaf(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1181 <return_pos+0x51>
mov    -0x4(%rbp),%edi
lea    0xebc(%rip),%rsi
lea    0xeb8(%rip),%rdx
call   1040 <dprintf@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_pos>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    0x2e91(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xeb6(%rip),%rdi
call   1050 <open@plt>
test   %eax,%eax
jle    1172 <return_pos+0x42>
mov    %eax,%ebx
lea    0xecd(%rip),%rsi
lea    0xec9(%rip),%rdx
mov    %eax,%edi
call   1040 <dprintf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"/sys/class/dothat/st7036/cursor_position\00"
@O_WRONLY = global i32 0
@O_APPEND = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"0 0\00"
define void @return_pos() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_WRONLY
%4 = load i32, i32* @O_APPEND
%5 = or i32 %3, %4
%6 = call i32 @open(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %0
%10 = load i32, i32* %1
%11 = call i32 @dprintf(i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32, i32* %1
%13 = call i32 @close(i32 %12)
br label %14
14: ; preds = %9, %0
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"/sys/class/dothat/st7036/cursor_position\00"
@O_WRONLY = global i32 0
@O_APPEND = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"0 0\00"
define void @return_pos() {
%1 = load i32, i32* @O_WRONLY
%2 = load i32, i32* @O_APPEND
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = tail call i32 @dprintf(i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @close(i32 %4)
br label %9
9: ; preds = %6, %0
ret void
}
void oh_display_close() {}


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

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

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

LLVM IR (-O2):
define void @oh_display_close() {
ret void
}
/* Variables and functions */
int sprintf(char *, char *, int, int, int);
int sprint_time_classic(char *buffer, float value) {
  int seconds = (int)value;
  int minutes = seconds / 60;
  int hours = minutes / 60;
  seconds = (int)value % 60;
  return sprintf(buffer, "%d:%02d:%02d", hours, minutes, seconds);
}


x86 assembly (clang, -O0):
<sprint_time_classic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
cvttss2si -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
cvttss2si -0xc(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xe96(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_time_classic>:
cvttss2si %xmm0,%eax
movslq %eax,%r8
imul   $0xffffffff91a2b3c5,%r8,%rdx
shr    $0x20,%rdx
add    %r8d,%edx
mov    %edx,%eax
shr    $0x1f,%eax
sar    $0xb,%edx
add    %eax,%edx
imul   $0xffffffff88888889,%r8,%rcx
shr    $0x20,%rcx
add    %r8d,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x5,%ecx
add    %eax,%ecx
imul   $0x3c,%ecx,%eax
sub    %eax,%r8d
lea    0xeac(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%d:%02d:%02d\00"
define i32 @sprint_time_classic(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store float %1, float* %4
%8 = load float, float* %4
%9 = fptosi float %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = sdiv i32 %10, 60
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = sdiv i32 %12, 60
store i32 %13, i32* %7
%14 = load float, float* %4
%15 = fptosi float %14 to i32
%16 = srem i32 %15, 60
store i32 %16, i32* %5
%17 = load i8*, i8** %3
%18 = load i32, i32* %7
%19 = load i32, i32* %6
%20 = load i32, i32* %5
%21 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %19, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d:%02d:%02d\00"
define i32 @sprint_time_classic(i8* nocapture writeonly %0, float %1) {
%3 = fptosi float %1 to i32
%4 = sdiv i32 %3, 60
%5 = sdiv i32 %3, 3600
%6 = srem i32 %3, 60
%7 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %4, i32 %6)
ret i32 %7
}
long _wait(long EV_waitTime) {
  while ((EV_waitTime > 0)) {
    EV_waitTime = (EV_waitTime - 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1124 <_wait+0x24>
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <_wait+0x8>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @_wait(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %6, %1
%4 = load i64, i64* %2
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i64, i64* %2
%8 = sub nsw i64 %7, 1
store i64 %8, i64* %2
br label %3
9: ; preds = %3
ret i64 0
}

LLVM IR (-O2):
define i64 @_wait(i64 %0) {
ret i64 0
}
void current_off() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
void lock_wrap(pthread_mutex_t *p) {
  pthread_mutex_lock(p);
  return;
}


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

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

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

LLVM IR (-O2):
define void @lock_wrap(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
ret void
}
int power_supply_is_system_supplied(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @power_supply_is_system_supplied() {
ret i32 1
}

LLVM IR (-O2):
define i32 @power_supply_is_system_supplied() {
ret i32 1
}
float vec2_length_squared(float *a) { return a[0] * a[0] + a[1] * a[1]; }


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

x86 assembly (clang, -O2):
<vec2_length_squared>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @vec2_length_squared(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = call float @llvm.fmuladd.f32(float %5, float %8, float %15)
ret float %16
}

LLVM IR (-O2):
define float @vec2_length_squared(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
ret float %6
}
/* Type definitions */
struct hash {
  int dummy;
};

/* Variables and functions */
scalar_t__ malloc(int);
struct hash **initHashMapTable(void) {
  struct hash **hashTable =
      (struct hash **)malloc(2069 * sizeof(struct hash *));
  for (int i = 0; i < 2069; i++) {
    hashTable[i] = (struct hash *)0;
  }
  return hashTable;
}


x86 assembly (clang, -O0):
<initHashMapTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x40a8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x815,-0xc(%rbp)
jge    1158 <initHashMapTable+0x48>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <initHashMapTable+0x1d>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initHashMapTable>:
push   %rbx
mov    $0x40a8,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0x40a8,%edx
mov    %rax,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.hash = type { i32 }
define %struct.hash** @initHashMapTable() {
%1 = alloca %struct.hash**
%2 = alloca i32
%3 = call i64 @malloc(i32 16552)
%4 = inttoptr i64 %3 to %struct.hash**
store %struct.hash** %4, %struct.hash*** %1
store i32 0, i32* %2
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 2069
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load %struct.hash**, %struct.hash*** %1
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds %struct.hash*, %struct.hash** %9, i64 %11
store %struct.hash* null, %struct.hash** %12
br label %13
13: ; preds = %8
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %5
16: ; preds = %5
%17 = load %struct.hash**, %struct.hash*** %1
ret %struct.hash** %17
}

LLVM IR (-O2):
%struct.hash = type { i32 }
define %struct.hash** @initHashMapTable() {
%1 = tail call i64 @malloc(i32 16552)
%2 = inttoptr i64 %1 to %struct.hash**
%3 = inttoptr i64 %1 to i8*
ret %struct.hash** %2
}
void printPath(int dest, int prev[]) {
  if (prev[dest] != -1)
    printPath(prev[dest], prev);
}


x86 assembly (clang, -O0):
<printPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     1145 <printPath+0x35>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x10(%rbp),%rsi
call   1030 <printPath@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPath>:
movslq %edi,%rax
mov    (%rsi,%rax,4),%edi
cmp    $0xffffffff,%edi
jne    1100 <printPath>
ret

LLVM IR (-O0):
define void @printPath(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, -1
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i32*, i32** %4
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = load i32*, i32** %4
br label %18
18: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
define void @printPath(i32 %0, i32* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %7, %3 ]
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %3
9: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void memcpy1() {
  char src[] = {1, 2, 3, 4};
  char dst[10];
  memcpy(dst, src, 5);
}


x86 assembly (clang, -O0):
<memcpy1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x5,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy1>:
sub    $0x18,%rsp
movl   $0x4030201,0x8(%rsp)
04
lea    0xe(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x5,%edx
call   1030 <memcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.memcpy1.src = [4 x i8] c"\01\02\03\04"
define void @memcpy1() {
%1 = alloca [4 x i8]
%2 = alloca [10 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = call i32 @memcpy(i8* %4, i8* %5, i32 5)
ret void
}

LLVM IR (-O2):
define void @memcpy1() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = bitcast i32* %1 to i8*
store i32 67305985, i32* %1
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @memcpy(i8* %4, i8* %3, i32 5)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int vec_ui32_asc_compare(const void *p1, const void *p2) {
  const uint32_t *pp1 = (const uint32_t *)p1;
  const uint32_t *pp2 = (const uint32_t *)p2;
  if (*pp1 < *pp2)
    return -1;
  if (*pp1 > *pp2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<vec_ui32_asc_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jge    113c <vec_ui32_asc_compare+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <vec_ui32_asc_compare+0x63>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jle    115c <vec_ui32_asc_compare+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <vec_ui32_asc_compare+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @vec_ui32_asc_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = icmp sgt i64 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void print_error(char *msg) { perror(msg); }


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

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

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

LLVM IR (-O2):
define void @print_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
void _XlcDbg_printValue(const char *str, char **value, int num) {}


x86 assembly (clang, -O0):
<_XlcDbg_printValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_XlcDbg_printValue(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @_XlcDbg_printValue(i8* nocapture %0, i8** nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
float floorf(float);
float get_fractional_part_positivef(float f) { return f - floorf(f); }


x86 assembly (clang, -O0):
<get_fractional_part_positivef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <floorf@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fractional_part_positivef>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <floorf@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @get_fractional_part_positivef(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call float @llvm.floor.f32(float %4)
%6 = fsub float %3, %5
ret float %6
}

LLVM IR (-O2):
define float @get_fractional_part_positivef(float %0) {
%2 = tail call float @llvm.floor.f32(float %0)
%3 = fsub float %0, %2
ret float %3
}
void invlpg(void *pointer) { __asm__ volatile("invlpg (%0)" : : "r"(pointer)); }


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

x86 assembly (clang, -O2):
<invlpg>:
invlpg (%rdi)
ret

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

LLVM IR (-O2):
define void @invlpg(i8* %0) {
tail call void asm sideeffect "invlpg ($0)", "r,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ infix_to_postfix();
int /*<<< orphan*/ postfix_eval();
int main(int argc, char *argv[]) {
  while (1) {
    infix_to_postfix();
    postfix_eval();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <infix_to_postfix@plt>
mov    $0x0,%al
call   1040 <postfix_eval@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <infix_to_postfix@plt>
xor    %eax,%eax
call   1040 <postfix_eval@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %2, %6
%7 = call i32 (...) @infix_to_postfix()
%8 = call i32 (...) @postfix_eval()
br label %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 (...) @infix_to_postfix()
%5 = tail call i32 (...) @postfix_eval()
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ skytraq_flush(int);
int skytraq_waitstatus(int, char const *, int);
int /*<<< orphan*/ skytraq_write(int, char const *, int);
int skytraq_cmd_wait(int fd, const char *message, int len, const char *status,
                     int timeout) {
  skytraq_flush(fd);
  skytraq_write(fd, message, len);
  return skytraq_waitstatus(fd, status, timeout);
}


x86 assembly (clang, -O0):
<skytraq_cmd_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <skytraq_flush@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <skytraq_write@plt>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1040 <skytraq_waitstatus@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skytraq_cmd_wait>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %edx,%r12d
mov    %rsi,%rbx
mov    %edi,%ebp
call   1050 <skytraq_flush@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r12d,%edx
call   1030 <skytraq_write@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <skytraq_waitstatus@plt>

LLVM IR (-O0):
define i32 @skytraq_cmd_wait(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = call i32 @skytraq_flush(i32 %11)
%13 = load i32, i32* %6
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @skytraq_write(i32 %13, i8* %14, i32 %15)
%17 = load i32, i32* %6
%18 = load i8*, i8** %9
%19 = load i32, i32* %10
%20 = call i32 @skytraq_waitstatus(i32 %17, i8* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
define i32 @skytraq_cmd_wait(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @skytraq_flush(i32 %0)
%7 = tail call i32 @skytraq_write(i32 %0, i8* %1, i32 %2)
%8 = tail call i32 @skytraq_waitstatus(i32 %0, i8* %3, i32 %4)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ ABDAY_5;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_abday_5() { return nl_langinfo(ABDAY_5); }


x86 assembly (clang, -O0):
<langinfo_abday_5>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_abday_5>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@ABDAY_5 = global i32 0
define i8* @langinfo_abday_5() {
%1 = load i32, i32* @ABDAY_5
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@ABDAY_5 = global i32 0
define i8* @langinfo_abday_5() {
%1 = load i32, i32* @ABDAY_5
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ writeLongcard(unsigned long);
void writeAddress(void *a) { writeLongcard((long unsigned int)(a)); }


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

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

LLVM IR (-O0):
define void @writeAddress(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = call i32 @writeLongcard(i64 %4)
ret void
}

LLVM IR (-O2):
define void @writeAddress(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @writeLongcard(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int is_valid_d(int *, int);
int *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *p;
  p = malloc(10 * sizeof(int));
  printf("is_valid : %d\n", is_valid_d(p, sizeof(*p)));
  free(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x28,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1040 <is_valid_d@plt>
mov    %eax,%esi
lea    0xe8c(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x28,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x4,%esi
call   1040 <is_valid_d@plt>
lea    0xe9e(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"is_valid : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @malloc(i32 40)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @is_valid_d(i32* %4, i32 4)
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @free(i32* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"is_valid : %d\0A\00"
define i32 @main() {
%1 = tail call i32* @malloc(i32 40)
%2 = tail call i32 @is_valid_d(i32* %1, i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @free(i32* %1)
ret i32 0
}
double ls_cost_nm4_sq(double x) { return x * x; }


x86 assembly (clang, -O0):
<ls_cost_nm4_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm4_sq>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @ls_cost_nm4_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
int av_pause_video(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @av_pause_video() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv0) {
  fprintf(stderr, "Usage: %s {input file 1} {input file 2} {output file}\n",
          argv0);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"Usage: %s {input file 1} {input file 2} {output file}\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"Usage: %s {input file 1} {input file 2} {output file}\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int getTicks();
int /*<<< orphan*/ printf(char *, int);
void callback(void *p) { printf("callback %d\n", getTicks()); }


x86 assembly (clang, -O0):
<callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getTicks@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback>:
push   %rax
xor    %eax,%eax
call   1030 <getTicks@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"callback %d\0A\00"
define void @callback(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @getTicks()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char const *);
void test(const char *input) {
  int x;
  char buf[10];
  strcpy(buf, input);
  printf("%s \n", buf);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x16(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x16(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s \0A\00"
define void @test(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [10 x i8]
store i8* %0, i8** %2
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s \0A\00"
define void @test(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ box_char_string(char *);
int /*<<< orphan*/ dpop();
int /*<<< orphan*/ snprintf(char *, int, char *, double);
double untag_float(int /*<<< orphan*/);
void primitive_float_to_str_impl(void) {
  char tmp[33];
  snprintf(tmp, 32, "%.16g", untag_float(dpop()));
  tmp[32] = '\0';
  box_char_string(tmp);
}


x86 assembly (clang, -O0):
<primitive_float_to_str_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float@plt>
mov    -0x38(%rbp),%rdi
mov    $0x20,%esi
lea    0xe92(%rip),%rdx
call   1040 <snprintf@plt>
movb   $0x0,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
call   1060 <box_char_string@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_float_to_str_impl>:
push   %rbx
sub    $0x30,%rsp
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float@plt>
lea    0xea6(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1040 <snprintf@plt>
movb   $0x0,0x20(%rsp)
mov    %rbx,%rdi
call   1060 <box_char_string@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.16g\00"
define void @primitive_float_to_str_impl() {
%1 = alloca [33 x i8]
%2 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%3 = call i32 (...) @dpop()
%4 = call double @untag_float(i32 %3)
%5 = call i32 @snprintf(i8* %2, i32 32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %4)
%6 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 32
store i8 0, i8* %6
%7 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%8 = call i32 @box_char_string(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.16g\00"
define void @primitive_float_to_str_impl() {
%1 = alloca [33 x i8]
%2 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @dpop()
%4 = tail call double @untag_float(i32 %3)
%5 = call i32 @snprintf(i8* %2, i32 32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %4)
%6 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 32
store i8 0, i8* %6
%7 = call i32 @box_char_string(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putbyte(int);
void putword(int w) {
  {
    putbyte(w);
    putbyte(w >> 8);
    return;
  }
}


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

x86 assembly (clang, -O2):
<putword>:
push   %rbx
mov    %edi,%ebx
call   1030 <putbyte@plt>
sar    $0x8,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <putbyte@plt>

LLVM IR (-O0):
define void @putword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @putbyte(i32 %3)
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = call i32 @putbyte(i32 %6)
ret void
}

LLVM IR (-O2):
define void @putword(i32 %0) {
%2 = tail call i32 @putbyte(i32 %0)
%3 = ashr i32 %0, 8
%4 = tail call i32 @putbyte(i32 %3)
ret void
}
void INT_Excep_RTC_CUP(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RTC_CUP() {
ret void
}
int c_close_(FileDescriptor)
int *FileDescriptor;
{
  int rc;
  rc = close(*FileDescriptor);
  return rc;
}


x86 assembly (clang, -O0):
<c_close_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <close@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_close_>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <close@plt>

LLVM IR (-O0):
define i32 @c_close_(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @c_close_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %2)
ret i32 %3
}
/* Type definitions */
struct digest_ctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ digest_destroy(struct digest_ctx *);
void auth_destroy(struct digest_ctx *ctx) { digest_destroy(ctx); }


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

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

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

LLVM IR (-O2):
%struct.digest_ctx = type { i32 }
define void @auth_destroy(%struct.digest_ctx* %0) {
%2 = tail call i32 @digest_destroy(%struct.digest_ctx* %0)
ret void
}
double boundBetween(double min, double max, double val) {
  if (val < min)
    return min;
  if (val > max)
    return max;
  return val;
}


x86 assembly (clang, -O0):
<boundBetween>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <boundBetween+0x36>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <boundBetween+0x5f>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1155 <boundBetween+0x55>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <boundBetween+0x5f>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<boundBetween>:
minsd  %xmm2,%xmm1
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @boundBetween(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %7
%9 = load double, double* %5
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %5
store double %12, double* %4
br label %21
13: ; preds = %3
%14 = load double, double* %7
%15 = load double, double* %6
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %6
store double %18, double* %4
br label %21
19: ; preds = %13
%20 = load double, double* %7
store double %20, double* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @boundBetween(double %0, double %1, double %2) {
%4 = fcmp olt double %2, %0
%5 = fcmp ogt double %2, %1
%6 = select i1 %5, double %1, double %2
%7 = select i1 %4, double %0, double %6
ret double %7
}
void RGB24ToUVRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @RGB24ToUVRow_NEON() {
ret void
}
/* Variables and functions */
double Slater_2S_5S(double, double, double);
double Slater_5S_2S(double rij, double xii, double xij) {
  return Slater_2S_5S(rij, xij, xii);
}


x86 assembly (clang, -O0):
<Slater_5S_2S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
call   1030 <Slater_2S_5S@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Slater_5S_2S>:
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <Slater_2S_5S@plt>

LLVM IR (-O0):
define double @Slater_5S_2S(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = load double, double* %5
%10 = call double @Slater_2S_5S(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @Slater_5S_2S(double %0, double %1, double %2) {
%4 = tail call double @Slater_2S_5S(double %0, double %2, double %1)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ RS485_CTS_RestoreConfig();
void RS485_CTS_Wakeup(void) { RS485_CTS_RestoreConfig(); }


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

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

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

LLVM IR (-O2):
define void @RS485_CTS_Wakeup() {
%1 = tail call i32 (...) @RS485_CTS_RestoreConfig()
ret void
}
void backtrace_sigill(void) {}


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

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

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

LLVM IR (-O2):
define void @backtrace_sigill() {
ret void
}
void gt_print_stack_trace() {}


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

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

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

LLVM IR (-O2):
define void @gt_print_stack_trace() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  char name[10];
  printf("Please enter a maximum 10 char name\n");
  gets(name);
  printf("Hi %s!\n", name);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1a(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x1a(%rbp),%rsi
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Please enter a maximum 10 char name\0A\00"
@.str.1 = [8 x i8] c"Hi %s!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [10 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%8 = call i32 @gets(i8* %7)
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"Hi %s!\0A\00"
@str = [36 x i8] c"Please enter a maximum 10 char name\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%6 = call i32 @gets(i8* %4)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int UINT32_MAX;
bool clk_val_is_valid(uint32_t val) {
  return (val & 0xffff) == ((val >> 16) & 0xffff) && val != 0 &&
         val != UINT32_MAX;
}


x86 assembly (clang, -O0):
<clk_val_is_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xffff,%ecx
mov    -0x4(%rbp),%edx
sar    $0x10,%edx
and    $0xffff,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x5(%rbp)
jne    114a <clk_val_is_valid+0x4a>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114a <clk_val_is_valid+0x4a>
mov    -0x4(%rbp),%eax
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clk_val_is_valid>:
movzwl %di,%eax
mov    %edi,%ecx
shr    $0x10,%ecx
cmp    %ecx,%eax
sete   %al
test   %edi,%edi
setne  %cl
and    %al,%cl
mov    0x2edd(%rip),%rax
cmp    %edi,(%rax)
setne  %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
@UINT32_MAX = global i32 0
define i32 @clk_val_is_valid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = load i32, i32* %2
%6 = ashr i32 %5, 16
%7 = and i32 %6, 65535
%8 = icmp eq i32 %4, %7
br i1 %8, label %9, label %16
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %2
%14 = load i32, i32* @UINT32_MAX
%15 = icmp ne i32 %13, %14
br label %16
16: ; preds = %12, %9, %1
%17 = phi i1 [ false, %9 ], [ false, %1 ], [ %15, %12 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
@UINT32_MAX = global i32 0
define i32 @clk_val_is_valid(i32 %0) {
%2 = and i32 %0, 65535
%3 = lshr i32 %0, 16
%4 = icmp eq i32 %2, %3
%5 = icmp ne i32 %0, 0
%6 = and i1 %5, %4
%7 = load i32, i32* @UINT32_MAX
%8 = icmp ne i32 %7, %0
%9 = select i1 %6, i1 %8, i1 false
%10 = zext i1 %9 to i32
ret i32 %10
}
void network_read_buffer(int *var) {}


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

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

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

LLVM IR (-O2):
define void @network_read_buffer(i32* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ proc_find_cmdline(char *);
int pia_running() { return proc_find_cmdline("openvpn") >= 0; }


x86 assembly (clang, -O0):
<pia_running>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <proc_find_cmdline@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pia_running>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <proc_find_cmdline@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"openvpn\00"
define i32 @pia_running() {
%1 = call i64 @proc_find_cmdline(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = icmp sge i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
@.str = [8 x i8] c"openvpn\00"
define i32 @pia_running() {
%1 = tail call i64 @proc_find_cmdline(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = lshr i64 %1, 63
%3 = trunc i64 %2 to i32
%4 = xor i32 %3, 1
ret i32 %4
}