xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int closefn(void *handler) {
  free(handler);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @closefn(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __NR_seccomp;
scalar_t__ errno;
int syscall(int /*<<< orphan*/, unsigned int, unsigned int, void *);
int seccomp(unsigned int operation, unsigned int flags, void *args) {
  errno = 0;
  return syscall(__NR_seccomp, operation, flags, args);
}


x86 assembly (clang, -O0):
<seccomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
movq   $0x0,(%rax)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seccomp>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec2(%rip),%rax
movq   $0x0,(%rax)
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@errno = global i64 0
@__NR_seccomp = global i32 0
define i32 @seccomp(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store i64 0, i64* @errno
%7 = load i32, i32* @__NR_seccomp
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @syscall(i32 %7, i32 %8, i32 %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@errno = global i64 0
@__NR_seccomp = global i32 0
define i32 @seccomp(i32 %0, i32 %1, i8* %2) {
store i64 0, i64* @errno
%4 = load i32, i32* @__NR_seccomp
%5 = tail call i32 @syscall(i32 %4, i32 %0, i32 %1, i8* %2)
ret i32 %5
}
/* Variables and functions */
scalar_t__ Rand(int);
float Choose(float a, float b) {
  if (Rand(2) == 0)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<Choose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
mov    $0x2,%edi
call   1030 <Rand@plt>
cmp    $0x0,%rax
jne    1145 <Choose+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    114f <Choose+0x3f>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Choose>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
mov    $0x2,%edi
call   1030 <Rand@plt>
movss  0x4(%rsp),%xmm0
test   %rax,%rax
je     1136 <Choose+0x26>
movss  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @Choose(float %0, float %1) {
%3 = tail call i64 @Rand(i32 2)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, float %0, float %1
ret float %5
}
/* Variables and functions */
int charcount(char *str, int c) {
  char *cp;
  int i;
  for (i = 0, cp = str; *cp != '\0'; cp++)
    if (*cp == c)
      i++;
  return (i);
}


x86 assembly (clang, -O0):
<charcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1159 <charcount+0x59>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1143 <charcount+0x43>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1148 <charcount+0x48>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <charcount+0x1a>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charcount>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <charcount+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
xor    %edx,%edx
cmp    %esi,%ecx
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <charcount+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @charcount(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %13, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = icmp eq i32 %9, %1
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %7, %11
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %17
}
void swap(int *element1Ptr, int *element2Ptr) {
  int hold;
  hold = *element1Ptr;
  *element1Ptr = *element2Ptr;
  *element2Ptr = hold;
}


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

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

LLVM IR (-O0):
define void @swap(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* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
char *copys(s)
char *s;
{
  register int i;
  register char *cp;
  register char *result;
  i = 1;
  for (cp = s; *cp; cp++)
    i++;
  result = xmalloc((unsigned int)i);
  strcpy(result, s);
  return (result);
}


x86 assembly (clang, -O0):
<copys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <copys+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113b <copys+0x1b>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1040 <xmalloc@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copys>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     113c <copys+0x1c>
mov    $0x1,%edi
xchg   %ax,%ax
cmpb   $0x0,(%rbx,%rdi,1)
lea    0x1(%rdi),%rdi
jne    1130 <copys+0x10>
jmp    1141 <copys+0x21>
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <xmalloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define i8* @copys(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 1, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %7, %4 ]
%13 = tail call i32 (i32, ...) bitcast (i32 (...)* @xmalloc to i32 (i32, ...)*)(i32 %12)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
%16 = tail call i8* @strcpy(i8* dereferenceable(1) %15, i8* dereferenceable(1) %0)
ret i8* %15
}
/* Variables and functions */
void *debug_realloc_id(void *, size_t, char *, int /*<<< orphan*/);
void *debug_realloc(void *p, size_t k) {
  return debug_realloc_id(p, k, "<UNKNOWN>", 0);
}


x86 assembly (clang, -O0):
<debug_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
xor    %ecx,%ecx
call   1030 <debug_realloc_id@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_realloc>:
lea    0xee9(%rip),%rdx
xor    %ecx,%ecx
jmp    1030 <debug_realloc_id@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"<UNKNOWN>\00"
define i8* @debug_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @debug_realloc_id(i8* %5, i64 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
ret i8* %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"<UNKNOWN>\00"
define i8* @debug_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @debug_realloc_id(i8* %0, i64 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
ret i8* %3
}
void EC_GROUP_get_asn1_flag(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GROUP_get_asn1_flag() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
void w_set_nonblock(int fd) {
  fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<w_set_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %eax,%edx
mov    0x2e99(%rip),%rax
or     (%rax),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_set_nonblock>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ebc(%rip),%rax
mov    (%rax),%ebp
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2eb3(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @w_set_nonblock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* %2
%6 = load i32, i32* @F_GETFL
%7 = call i32 (i32, i32, ...) @fcntl(i32 %5, i32 %6)
%8 = load i32, i32* @O_NONBLOCK
%9 = or i32 %7, %8
%10 = call i32 (i32, i32, ...) @fcntl(i32 %3, i32 %4, i32 %9)
ret void
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @w_set_nonblock(i32 %0) {
%2 = load i32, i32* @F_SETFL
%3 = load i32, i32* @F_GETFL
%4 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %3)
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %4
%7 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2, i32 %6)
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  scalar_t__ tv_nsec;
};
typedef scalar_t__ int64_t;

/* Variables and functions */
int INT64_C(int);
int64_t ts_to_int64(struct timespec ts) {
  return ts.tv_sec * INT64_C(1000000000) + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<ts_to_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x3b9aca00,%edi
call   1030 <INT64_C@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
cltq
add    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_to_int64>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x3b9aca00,%edi
call   1030 <INT64_C@plt>
imul   %ebp,%eax
cltq
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i64 @ts_to_int64(i32 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to { i32, i64 }*
%5 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %4, i32 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @INT64_C(i32 1000000000)
%10 = mul nsw i32 %8, %9
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%13 = load i64, i64* %12
%14 = add nsw i64 %11, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @ts_to_int64(i32 %0, i64 %1) {
%3 = tail call i32 @INT64_C(i32 1000000000)
%4 = mul nsw i32 %3, %0
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, %1
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_stmt;
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
scalar_t__ SQLITE_ROW;
int /*<<< orphan*/ sqlite3_finalize(int /*<<< orphan*/ *);
int /*<<< orphan*/ sqlite3_prepare_v2(int /*<<< orphan*/ *, char *, int,
                                      int /*<<< orphan*/ **, char const **);
scalar_t__ sqlite3_step(int /*<<< orphan*/ *);
bool query_has_result(char *sql_text, sqlite3 *db) {
  sqlite3_stmt *stmt;
  const char *tail;
  sqlite3_prepare_v2(db, sql_text, 1000, &stmt, &tail);
  bool result = (sqlite3_step(stmt) == SQLITE_ROW);
  sqlite3_finalize(stmt);
  return result;
}


x86 assembly (clang, -O0):
<query_has_result>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x3e8,%edx
lea    -0x18(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1050 <sqlite3_prepare_v2@plt>
mov    -0x18(%rbp),%rdi
call   1030 <sqlite3_step@plt>
mov    0x2e76(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <sqlite3_finalize@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<query_has_result>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rax
mov    %rsp,%rcx
lea    0x8(%rsp),%r8
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x3e8,%edx
call   1050 <sqlite3_prepare_v2@plt>
mov    (%rsp),%rdi
call   1030 <sqlite3_step@plt>
mov    0x2e80(%rip),%rcx
xor    %ebx,%ebx
cmp    (%rcx),%rax
sete   %bl
mov    (%rsp),%rdi
call   1040 <sqlite3_finalize@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SQLITE_ROW = global i64 0
define i32 @query_has_result(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
%8 = load i32*, i32** %4
%9 = load i8*, i8** %3
%10 = call i32 @sqlite3_prepare_v2(i32* %8, i8* %9, i32 1000, i32** %5, i8** %6)
%11 = load i32*, i32** %5
%12 = call i64 @sqlite3_step(i32* %11)
%13 = load i64, i64* @SQLITE_ROW
%14 = icmp eq i64 %12, %13
%15 = zext i1 %14 to i32
store i32 %15, i32* %7
%16 = load i32*, i32** %5
%17 = call i32 @sqlite3_finalize(i32* %16)
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
@SQLITE_ROW = global i64 0
define i32 @query_has_result(i8* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = bitcast i32** %3 to i8*
%6 = bitcast i8** %4 to i8*
%7 = call i32 @sqlite3_prepare_v2(i32* %1, i8* %0, i32 1000, i32** %3, i8** %4)
%8 = load i32*, i32** %3
%9 = call i64 @sqlite3_step(i32* %8)
%10 = load i64, i64* @SQLITE_ROW
%11 = icmp eq i64 %9, %10
%12 = zext i1 %11 to i32
%13 = load i32*, i32** %3
%14 = call i32 @sqlite3_finalize(i32* %13)
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ PPCMMU(int, void *, void *, void *);
void MmuSetVsid(int start, int end, int vsid) {
  PPCMMU(0x103, (void *)start, (void *)end, (void *)vsid);
}


x86 assembly (clang, -O0):
<MmuSetVsid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movslq -0x4(%rbp),%rsi
movslq -0x8(%rbp),%rdx
movslq -0xc(%rbp),%rcx
mov    $0x103,%edi
call   1030 <PPCMMU@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MmuSetVsid>:
movslq %edi,%rax
movslq %esi,%r8
movslq %edx,%rcx
mov    $0x103,%edi
mov    %rax,%rsi
mov    %r8,%rdx
jmp    1030 <PPCMMU@plt>

LLVM IR (-O0):
define void @MmuSetVsid(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
%16 = call i32 @PPCMMU(i32 259, i8* %9, i8* %12, i8* %15)
ret void
}

LLVM IR (-O2):
define void @MmuSetVsid(i32 %0, i32 %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = inttoptr i64 %4 to i8*
%6 = sext i32 %1 to i64
%7 = inttoptr i64 %6 to i8*
%8 = sext i32 %2 to i64
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 @PPCMMU(i32 259, i8* %5, i8* %7, i8* %9)
ret void
}
/* Variables and functions */
int __memcmp(void const *, void const *, size_t);
__attribute__((optimize("0"))) int bcmp(const void *m1, const void *m2,
                                        size_t n) {
  return __memcmp(m1, m2, n);
}


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

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

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

LLVM IR (-O2):
define i32 @bcmp(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @__memcmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Type definitions */
struct opencl_x86_device_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned int);
void opencl_x86_device_mem_copy(struct opencl_x86_device_t *device,
                                void *device_dest_ptr, void *device_src_ptr,
                                unsigned int size) {
  memcpy(device_dest_ptr, device_src_ptr, size);
}


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

x86 assembly (clang, -O2):
<opencl_x86_device_mem_copy>:
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
%struct.opencl_x86_device_t = type { i32 }
define void @opencl_x86_device_mem_copy(%struct.opencl_x86_device_t* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca %struct.opencl_x86_device_t*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store %struct.opencl_x86_device_t* %0, %struct.opencl_x86_device_t** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @memcpy(i8* %9, i8* %10, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.opencl_x86_device_t = type { i32 }
define void @opencl_x86_device_mem_copy(%struct.opencl_x86_device_t* nocapture readnone %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @memcpy(i8* %1, i8* %2, i32 %3)
ret void
}
void __attribute__((force_align_arg_pointer)) f16(void) {}


x86 assembly (clang, -O0):
<f16>:
push   %rbp
mov    %rsp,%rbp
and    $0xfffffffffffffff8,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f16>:
push   %rbp
mov    %rsp,%rbp
and    $0xfffffffffffffff8,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O2):
define void @f16() {
ret void
}
/* Variables and functions */
int f395(int *);
int f396(int *p) { return f395(p); }


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

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

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

LLVM IR (-O2):
define i32 @f396(i32* %0) {
%2 = tail call i32 @f395(i32* %0)
ret i32 %2
}
/* Variables and functions */
long timezone;
int dummyfcn(void) {
  long dummy;
  dummy = timezone;
  return 0;
}


x86 assembly (clang, -O0):
<dummyfcn>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@timezone = global i64 0
define i32 @dummyfcn() {
%1 = alloca i64
%2 = load i64, i64* @timezone
store i64 %2, i64* %1
ret i32 0
}

LLVM IR (-O2):
@timezone = global i64 0
define i32 @dummyfcn() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(
      stderr,
      "Usage: dioddate [OPTIONS] [-s HOST[:PORT]]\n"
      "   -S,--set-time         set local time to match server's\n"
      "   -s,--server HOST:PORT server (default localhost:564)\n"
      "   -m,--msize            msize (default 65536)\n"
      "   -u,--uid              authenticate as uid (default is your euid)\n"
      "   -t,--timeout SECS     give up after specified seconds\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [330 x i8] c"Usage: dioddate [OPTIONS] [-s HOST[:PORT]]\0A -S,--set-time set local time to match server's\0A -s,--server HOST:PORT server (default localhost:564)\0A -m,--msize msize (default 65536)\0A -u,--uid authenticate as uid (default is your euid)\0A -t,--timeout SECS give up after specified seconds\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([330 x i8], [330 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [330 x i8] c"Usage: dioddate [OPTIONS] [-s HOST[:PORT]]\0A -S,--set-time set local time to match server's\0A -s,--server HOST:PORT server (default localhost:564)\0A -m,--msize msize (default 65536)\0A -u,--uid authenticate as uid (default is your euid)\0A -t,--timeout SECS give up after specified seconds\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([330 x i8], [330 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void b() {
  printf("Function b()\n");
  system("date");
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
push   %rax
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Function b()\0A\00"
@.str.1 = [5 x i8] c"date\00"
define void @b() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"date\00"
@str = [13 x i8] c"Function b()\00"
define void @b() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
float dloglaplace_scale(float, float, float, float);
float laplace(float, float, float, float);
float dlaplace_scale(float x, float loc, float sc, float logsc) {
  return laplace(x, loc, sc, logsc) * dloglaplace_scale(x, loc, sc, logsc);
}


x86 assembly (clang, -O0):
<dlaplace_scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
call   1030 <laplace@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
call   1040 <dloglaplace_scale@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlaplace_scale>:
sub    $0x18,%rsp
movss  %xmm3,0x10(%rsp)
movss  %xmm2,0xc(%rsp)
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0x4(%rsp)
call   1030 <laplace@plt>
movss  %xmm0,0x14(%rsp)
movss  0x4(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
movss  0x10(%rsp),%xmm3
call   1040 <dloglaplace_scale@plt>
mulss  0x14(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @dlaplace_scale(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = load float, float* %7
%12 = load float, float* %8
%13 = call float @laplace(float %9, float %10, float %11, float %12)
%14 = load float, float* %5
%15 = load float, float* %6
%16 = load float, float* %7
%17 = load float, float* %8
%18 = call float @dloglaplace_scale(float %14, float %15, float %16, float %17)
%19 = fmul float %13, %18
ret float %19
}

LLVM IR (-O2):
define float @dlaplace_scale(float %0, float %1, float %2, float %3) {
%5 = tail call float @laplace(float %0, float %1, float %2, float %3)
%6 = tail call float @dloglaplace_scale(float %0, float %1, float %2, float %3)
%7 = fmul float %5, %6
ret float %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int /*<<< orphan*/ mpack_store_u16(char *, int /*<<< orphan*/);
void mpack_store_i16(char *p, int16_t val) {
  mpack_store_u16(p, (uint16_t)val);
}


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

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

LLVM IR (-O0):
define void @mpack_store_i16(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = call i32 @mpack_store_u16(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @mpack_store_i16(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = tail call i32 @mpack_store_u16(i8* %0, i32 %3)
ret void
}
char valid(int x, int y) {
  if (x < 0 || x >= 8)
    return 0;
  if (y < 0 || y >= 8)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111e <valid+0x1e>
cmpl   $0x8,-0x8(%rbp)
jl     1127 <valid+0x27>
movb   $0x0,-0x1(%rbp)
jmp    1148 <valid+0x48>
cmpl   $0x0,-0xc(%rbp)
jl     113b <valid+0x3b>
cmpl   $0x8,-0xc(%rbp)
jl     1144 <valid+0x44>
movb   $0x0,-0x1(%rbp)
jmp    1148 <valid+0x48>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid>:
or     %esi,%edi
cmp    $0x8,%edi
setb   %al
ret

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

LLVM IR (-O2):
define signext i8 @valid(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp ult i32 %3, 8
%5 = zext i1 %4 to i8
ret i8 %5
}
void *getPeripheral(int bus_addr) {
  return (void *)(0xFF000000 | (bus_addr << 16));
}


x86 assembly (clang, -O0):
<getPeripheral>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
or     $0xff000000,%eax
mov    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPeripheral>:
mov    %edi,%eax
shl    $0x10,%eax
or     $0xff000000,%eax
ret

LLVM IR (-O0):
define i8* @getPeripheral(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 16
%5 = or i32 -16777216, %4
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @getPeripheral(i32 %0) {
%2 = shl i32 %0, 16
%3 = or i32 %2, -16777216
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ _appwarmstart(unsigned long);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
void mon_warmstart(unsigned long mask) {
  monLock();
  _appwarmstart(mask);
  monUnlock();
}


x86 assembly (clang, -O0):
<mon_warmstart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x8(%rbp),%rdi
call   1050 <_appwarmstart@plt>
mov    $0x0,%al
call   1040 <monUnlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_warmstart>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %rbx,%rdi
call   1050 <_appwarmstart@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <monUnlock@plt>

LLVM IR (-O0):
define void @mon_warmstart(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @monLock()
%4 = load i64, i64* %2
%5 = call i32 @_appwarmstart(i64 %4)
%6 = call i32 (...) @monUnlock()
ret void
}

LLVM IR (-O2):
define void @mon_warmstart(i64 %0) {
%2 = tail call i32 (...) @monLock()
%3 = tail call i32 @_appwarmstart(i64 %0)
%4 = tail call i32 (...) @monUnlock()
ret void
}
int test_imm_94uint16_reg(unsigned short val) {
  return ((val) & (0x94 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_94uint16_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, 148
%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_94uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 148
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int execute_prof() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_prof() {
ret i32 0
}
/* Variables and functions */
long GetBorderWidth65();
long getborderwidth() { return GetBorderWidth65(); }


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

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

LLVM IR (-O0):
define i64 @getborderwidth() {
%1 = call i64 (...) @GetBorderWidth65()
ret i64 %1
}

LLVM IR (-O2):
define i64 @getborderwidth() {
%1 = tail call i64 (...) @GetBorderWidth65()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ PWM4_0_DriverIRQHandler();
__attribute__((weak)) void PWM4_0_IRQHandler(void) {
  PWM4_0_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @PWM4_0_IRQHandler() {
%1 = call i32 (...) @PWM4_0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PWM4_0_IRQHandler() {
%1 = tail call i32 (...) @PWM4_0_DriverIRQHandler()
ret void
}
void debug() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct layout *);
void free_layout(struct layout *layout) { free(layout); }


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

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

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

LLVM IR (-O2):
%struct.layout = type { i32 }
define void @free_layout(%struct.layout* nocapture %0) {
%2 = tail call i32 @free(%struct.layout* %0)
ret void
}
double AT_test_fun(double a, double b) { return (a + b); }


x86 assembly (clang, -O0):
<AT_test_fun>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<AT_test_fun>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @AT_test_fun(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* %4
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @AT_test_fun(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
void UART6_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<UART6_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UART6_Handler+0x9>
jmp    1109 <UART6_Handler+0x9>

x86 assembly (clang, -O2):
<UART6_Handler>:
jmp    1100 <UART6_Handler>

LLVM IR (-O0):
define void @UART6_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @UART6_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ j64_null_encode(char *, int);
int /*<<< orphan*/ memset(char *, char, int);
scalar_t__ strcmp(char *, char *);
int test_null_encode_4(void) {
  char buf[4 + 1];
  memset(buf, '\0', sizeof(buf));
  j64_null_encode(buf, 4);
  return strcmp(buf, "null") == 0;
}


x86 assembly (clang, -O0):
<test_null_encode_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x5(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1030 <memset@plt>
lea    -0x5(%rbp),%rdi
mov    $0x4,%esi
call   1040 <j64_null_encode@plt>
lea    -0x5(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_null_encode_4>:
push   %rbx
sub    $0x10,%rsp
lea    0xb(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <j64_null_encode@plt>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"null\00"
define i32 @test_null_encode_4() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i8 signext 0, i32 5)
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%5 = call i32 @j64_null_encode(i8* %4, i32 4)
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"null\00"
define i32 @test_null_encode_4() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i8 signext 0, i32 5)
%4 = call i32 @j64_null_encode(i8* %2, i32 4)
%5 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
int test_imm_10int32_mem(int *val) {
  return ((*val) & (0x10 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_10int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 16
%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_10int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 16
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ puts(char *);
print_data(double data[], int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%g ", data[i]);
  puts("");
}


x86 assembly (clang, -O0):
<print_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1169 <print_data+0x49>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1136 <print_data+0x16>
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_data>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_data+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_data+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%g \00"
define i32 @print_data(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret i32 undef
}
void gtk_tree_model_sort_get_model() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_model_sort_get_model() {
ret void
}
int doubleincreasing(const void *a, const void *b) {
  double ta = *(double *)a;
  double tb = *(double *)b;
  return (ta > tb) - (ta < tb);
}


x86 assembly (clang, -O0):
<doubleincreasing>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubleincreasing>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @doubleincreasing(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to double*
%9 = load double, double* %8
store double %9, double* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to double*
%12 = load double, double* %11
store double %12, double* %6
%13 = load double, double* %5
%14 = load double, double* %6
%15 = fcmp ogt double %13, %14
%16 = zext i1 %15 to i32
%17 = load double, double* %5
%18 = load double, double* %6
%19 = fcmp olt double %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @doubleincreasing(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = zext i1 %7 to i32
%9 = fcmp olt double %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putchr_fd(char c, int fd) { write(fd, &c, 1); }


x86 assembly (clang, -O0):
<ft_putchr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putchr_fd>:
push   %rax
mov    %esi,%eax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @ft_putchr_fd(i8 signext %0, i32 %1) {
%3 = alloca i8
store i8 %0, i8* %3
%4 = call i32 @write(i32 %1, i8* %3, i32 1)
ret void
}