xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, int);
void strncat_test(void) {
  char buf[10] = {
      0,
  };
  strncat(buf, "1234567890", 9);
  printf("strlen(buf):%u, buf:%s\n", strlen(buf), buf);
}


x86 assembly (clang, -O0):
<strncat_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xa(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <memset@plt>
lea    -0xa(%rbp),%rdi
lea    0xe9d(%rip),%rsi
mov    $0x9,%edx
call   1060 <strncat@plt>
lea    -0xa(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    -0xa(%rbp),%rdx
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncat_test>:
push   %rbx
sub    $0x10,%rsp
movw   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
lea    0xeb5(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x9,%edx
call   1050 <strncat@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"1234567890\00"
@.str.1 = [24 x i8] c"strlen(buf):%u, buf:%s\0A\00"
define void @strncat_test() {
%1 = alloca [10 x i8]
%2 = bitcast [10 x i8]* %1 to i8*
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 @strncat(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 9)
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%6 = call i32 @strlen(i8* %5)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"1234567890\00"
@.str.1 = [24 x i8] c"strlen(buf):%u, buf:%s\0A\00"
define void @strncat_test() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @strncat(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 9)
%4 = call i32 @strlen(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %4, i8* %2)
ret void
}
/* Variables and functions */
size_t stmin(size_t a, size_t b) { return (a < b ? a : b); }


x86 assembly (clang, -O0):
<stmin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <stmin+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <stmin+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stmin>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @stmin(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @stmin(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void v4d_(vec) double vec[4];
{
  float v[4];
  v[0] = vec[0];
  v[1] = vec[1];
  v[2] = vec[2];
  v[3] = vec[3];
  vcall(v, 4);
}


x86 assembly (clang, -O0):
<v4d_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <vcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4d_>:
sub    $0x18,%rsp
movupd (%rdi),%xmm0
movupd 0x10(%rdi),%xmm1
cvtpd2ps %xmm1,%xmm1
cvtpd2ps %xmm0,%xmm0
unpcklpd %xmm1,%xmm0
movapd %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <vcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @v4d_(double* %0) {
%2 = alloca double*
%3 = alloca [4 x float]
store double* %0, double** %2
%4 = load double*, double** %2
%5 = getelementptr inbounds double, double* %4, i64 0
%6 = load double, double* %5
%7 = fptrunc double %6 to float
%8 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
store float %7, float* %8
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = fptrunc double %11 to float
%13 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 1
store float %12, float* %13
%14 = load double*, double** %2
%15 = getelementptr inbounds double, double* %14, i64 2
%16 = load double, double* %15
%17 = fptrunc double %16 to float
%18 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 2
store float %17, float* %18
%19 = load double*, double** %2
%20 = getelementptr inbounds double, double* %19, i64 3
%21 = load double, double* %20
%22 = fptrunc double %21 to float
%23 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 3
store float %22, float* %23
%24 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
%25 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %24, i32 4)
ret void
}

LLVM IR (-O2):
define void @v4d_(double* nocapture %0) {
%2 = alloca <4 x float>
%3 = bitcast <4 x float>* %2 to i8*
%4 = getelementptr inbounds <4 x float>, <4 x float>* %2, i64 0, i64 0
%5 = bitcast double* %0 to <4 x double>*
%6 = load <4 x double>, <4 x double>* %5
%7 = fptrunc <4 x double> %6 to <4 x float>
store <4 x float> %7, <4 x float>* %2
%8 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %4, i32 4)
ret void
}
/* Type definitions */
struct ifreq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SIOCGIFADDR;
int /*<<< orphan*/ die(int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int ioctl(int, int /*<<< orphan*/, struct ifreq *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void get_ifr_addr(int fd, struct ifreq *ifr) {
  if (ioctl(fd, SIOCGIFADDR, ifr) == -1) {
    die(strerror(errno));
  }
}


x86 assembly (clang, -O0):
<get_ifr_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    1172 <get_ifr_addr+0x42>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edi
call   1040 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ifr_addr>:
push   %rax
mov    %rsi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
je     1149 <get_ifr_addr+0x19>
pop    %rax
ret
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <die@plt>

LLVM IR (-O0):
%struct.ifreq = type { i32 }
@SIOCGIFADDR = global i32 0
@errno = global i32 0
define void @get_ifr_addr(i32 %0, %struct.ifreq* %1) {
%3 = alloca i32
%4 = alloca %struct.ifreq*
store i32 %0, i32* %3
store %struct.ifreq* %1, %struct.ifreq** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @SIOCGIFADDR
%7 = load %struct.ifreq*, %struct.ifreq** %4
%8 = call i32 @ioctl(i32 %5, i32 %6, %struct.ifreq* %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* @errno
%12 = call i32 @strerror(i32 %11)
%13 = call i32 @die(i32 %12)
br label %14
14: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.ifreq = type { i32 }
@SIOCGIFADDR = global i32 0
@errno = global i32 0
define void @get_ifr_addr(i32 %0, %struct.ifreq* %1) {
%3 = load i32, i32* @SIOCGIFADDR
%4 = tail call i32 @ioctl(i32 %0, i32 %3, %struct.ifreq* %1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @errno
%8 = tail call i32 @strerror(i32 %7)
%9 = tail call i32 @die(i32 %8)
br label %10
10: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ logDebug(char *);
int threadClose(void **context) {
  logDebug("The Sample plugin thread context is closing ...");
  *context = NULL;
  return 1;
}


x86 assembly (clang, -O0):
<threadClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <logDebug@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threadClose>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <logDebug@plt>
movq   $0x0,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"The Sample plugin thread context is closing ...\00"
define i32 @threadClose(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @logDebug(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%4 = load i8**, i8*** %2
store i8* null, i8** %4
ret i32 1
}

LLVM IR (-O2):
@.str = [48 x i8] c"The Sample plugin thread context is closing ...\00"
define i32 @threadClose(i8** nocapture writeonly %0) {
%2 = tail call i32 @logDebug(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %0
ret i32 1
}
void foo(int c, int *x) {
  if (c)
    return;
  *x = 5;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111a <foo+0x1a>
jmp    1124 <foo+0x24>
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
je     1105 <foo+0x5>
ret
movl   $0x5,(%rsi)
ret

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

LLVM IR (-O2):
define void @foo(i32 %0, i32* nocapture writeonly %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %5
4: ; preds = %2
store i32 5, i32* %1
br label %5
5: ; preds = %2, %4
ret void
}
unsigned long d_getul(const unsigned char *ptr) {
  return (((unsigned long)ptr[0] << 24) | ((unsigned long)ptr[1] << 16) |
          ((unsigned long)ptr[2] << 8) | ((unsigned long)ptr[3] << 0));
}


x86 assembly (clang, -O0):
<d_getul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x0,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_getul>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

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

LLVM IR (-O2):
define i64 @d_getul(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = shl nuw nsw i64 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %7, 16
%9 = or i64 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = shl nuw nsw i64 %12, 8
%14 = or i64 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = or i64 %14, %17
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *spalloc(size_t);
void *memdup(const void *src, size_t bytes) {
  void *result = spalloc(bytes);
  if (result) {
    memcpy(result, src, bytes);
  }
  return result;
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <spalloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <memdup+0x39>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <spalloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <memdup+0x29>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @memdup(i8* %0, i64 %1) {
%3 = tail call i8* @spalloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void logcb(int level, const char *log) {
  if (level > 3)
    return;
  fputs(log, stdout);
  fputc('\n', stdout);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<logcb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
jle    114e <logcb+0x1e>
jmp    1181 <logcb+0x51>
mov    -0x10(%rbp),%rdi
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logcb>:
cmp    $0x3,%edi
jle    1136 <logcb+0x6>
ret
push   %rbx
mov    0x2ea2(%rip),%rbx
mov    (%rbx),%eax
mov    %rsi,%rdi
mov    %eax,%esi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @logcb(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 3
br i1 %6, label %7, label %8
7: ; preds = %2
br label %16
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i32, i32* @stdout
%11 = call i32 @fputs(i8* %9, i32 %10)
%12 = load i32, i32* @stdout
%13 = call i32 @fputc(i8 signext 10, i32 %12)
%14 = load i32, i32* @stdout
%15 = call i32 @fflush(i32 %14)
br label %16
16: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @logcb(i32 %0, i8* %1) {
%3 = icmp sgt i32 %0, 3
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = load i32, i32* @stdout
%6 = tail call i32 @fputs(i8* %1, i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fputc(i8 signext 10, i32 %7)
%9 = load i32, i32* @stdout
%10 = tail call i32 @fflush(i32 %9)
br label %11
11: ; preds = %2, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test_solib(void) {
  printf("This is a \"solib\" target.\n");
  return 0;
}


x86 assembly (clang, -O0):
<test_solib>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"This is a \22solib\22 target.\0A\00"
define i32 @test_solib() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"This is a \22solib\22 target.\00"
define i32 @test_solib() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int runner_start(int (*func)(void)) { return func(); }


x86 assembly (clang, -O0):
<runner_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runner_start>:
jmp    *%rdi

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

LLVM IR (-O2):
define i32 @runner_start(i32 ()* nocapture %0) {
%2 = tail call i32 %0()
ret i32 %2
}
int onebit(int num) {
  int ones = 0, i;
  for (i = 0; i < 4; i++) {
    if (num & 1)
      ones++;
    num = num >> 1;
  }
  if (ones == 1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<onebit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    114e <onebit+0x4e>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1137 <onebit+0x37>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <onebit+0x15>
cmpl   $0x1,-0xc(%rbp)
jne    1164 <onebit+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <onebit+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<onebit>:
mov    %edi,%eax
and    $0x1,%eax
mov    %edi,%ecx
shr    %ecx
and    $0x1,%ecx
add    %eax,%ecx
mov    %edi,%eax
shr    $0x2,%eax
and    $0x1,%eax
add    %ecx,%eax
shr    $0x3,%edi
and    $0x1,%edi
add    %eax,%edi
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @onebit(i32 %0) {
%2 = and i32 %0, 1
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1
%5 = add nuw nsw i32 %2, %4
%6 = lshr i32 %0, 2
%7 = and i32 %6, 1
%8 = add nuw nsw i32 %5, %7
%9 = lshr i32 %0, 3
%10 = and i32 %9, 1
%11 = add nuw nsw i32 %8, %10
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ reread();
void sighup(int signo) { reread(); }


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

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

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

LLVM IR (-O2):
define void @sighup(i32 %0) {
%2 = tail call i32 (...) @reread()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dectobin(unsigned long, int *);
long rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void random_bitfill(bool X[64]) {
  srand(time(NULL));
  unsigned long int x = (long int)rand() << 32 | rand();
  dectobin(x, X);
}


x86 assembly (clang, -O0):
<random_bitfill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
shl    $0x20,%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <dectobin@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_bitfill>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
mov    %rax,%rbx
shl    $0x20,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
or     %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <dectobin@plt>

LLVM IR (-O0):
define void @random_bitfill(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
%6 = call i64 (...) @rand()
%7 = shl i64 %6, 32
%8 = call i64 (...) @rand()
%9 = or i64 %7, %8
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = load i32*, i32** %2
%12 = call i32 @dectobin(i64 %10, i32* %11)
ret void
}

LLVM IR (-O2):
define void @random_bitfill(i32* %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i64 (...) @rand()
%5 = shl i64 %4, 32
%6 = tail call i64 (...) @rand()
%7 = or i64 %5, %6
%8 = tail call i32 @dectobin(i64 %7, i32* %0)
ret void
}
int max2(int a, int b) {
  if (a > b)
    return a;
  return b;
}


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

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

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

LLVM IR (-O2):
define i32 @max2(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int conditional(int x, int y, int z) { return 2; }


x86 assembly (clang, -O0):
<conditional>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @conditional(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
ret i32 2
}

LLVM IR (-O2):
define i32 @conditional(i32 %0, i32 %1, i32 %2) {
ret i32 2
}
int clean_recordsuite(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @clean_recordsuite() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t u16_lo(uint16_t value) { return (uint8_t)(value & 0x00FF); }


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

x86 assembly (clang, -O2):
<u16_lo>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @u16_lo(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
/* Variables and functions */
scalar_t__ rint(double);
unsigned int registrarRoundDistance(const unsigned int distance,
                                    const unsigned int step) {
  const unsigned int d = (unsigned int)rint((double)distance / step) * step;
  return (d);
}


x86 assembly (clang, -O0):
<registrarRoundDistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
mov    -0x8(%rbp),%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
call   1030 <rint@plt>
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<registrarRoundDistance>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
mov    %esi,%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
call   1030 <rint@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @registrarRoundDistance(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 = uitofp i32 %6 to double
%8 = load i32, i32* %4
%9 = uitofp i32 %8 to double
%10 = fdiv double %7, %9
%11 = call i64 @rint(double %10)
%12 = trunc i64 %11 to i32
%13 = load i32, i32* %4
%14 = mul i32 %12, %13
store i32 %14, i32* %5
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @registrarRoundDistance(i32 %0, i32 %1) {
%3 = uitofp i32 %0 to double
%4 = uitofp i32 %1 to double
%5 = fdiv double %3, %4
%6 = tail call i64 @rint(double %5)
%7 = trunc i64 %6 to i32
%8 = mul i32 %7, %1
ret i32 %8
}
int test_imm_AFint64_lowword_reg(long long val) {
  return ((val) & (0xAF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_AFint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 175
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct gcc_trampoline {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __thinthin_destroy_trampoline(struct gcc_trampoline *);
void __wasm_destroy_trampoline(struct gcc_trampoline *m_tramp) {
  __thinthin_destroy_trampoline(m_tramp);
}


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

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

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

LLVM IR (-O2):
%struct.gcc_trampoline = type { i32 }
define void @__wasm_destroy_trampoline(%struct.gcc_trampoline* %0) {
%2 = tail call i32 @__thinthin_destroy_trampoline(%struct.gcc_trampoline* %0)
ret void
}
void ECParameters_print_fp(void) {}


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

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

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

LLVM IR (-O2):
define void @ECParameters_print_fp() {
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ si_signo;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ psignal(int /*<<< orphan*/, char const *);
void psiginfo(const siginfo_t *si, const char *s) { psignal(si->si_signo, s); }


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

x86 assembly (clang, -O2):
<psiginfo>:
mov    (%rdi),%edi
jmp    1030 <psignal@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define void @psiginfo(%struct.TYPE_3__* %0, i8* %1) {
%3 = alloca %struct.TYPE_3__*
%4 = alloca i8*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %3
store i8* %1, i8** %4
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = call i32 @psignal(i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define void @psiginfo(%struct.TYPE_3__* nocapture %0, i8* %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i32 @psignal(i32 %4, i8* %1)
ret void
}
/* Variables and functions */
int dune_init_and_enter();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_pgflt();
int /*<<< orphan*/ test_syscall();
int main(int argc, char *argv[]) {
  int ret;
  ret = dune_init_and_enter();
  if (ret) {
    printf("failed to initialize DUNE\n");
    return ret;
  }
  test_pgflt();
  test_syscall();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <dune_init_and_enter@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1181 <main+0x41>
lea    0xe8f(%rip),%rdi
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1196 <main+0x56>
mov    $0x0,%al
call   1040 <test_pgflt@plt>
mov    $0x0,%al
call   1030 <test_syscall@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <dune_init_and_enter@plt>
mov    %eax,%ebx
test   %eax,%eax
je     115c <main+0x1c>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
jmp    116a <main+0x2a>
xor    %eax,%eax
call   1050 <test_pgflt@plt>
xor    %eax,%eax
call   1040 <test_syscall@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"failed to initialize DUNE\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @dune_init_and_enter()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %6
store i32 %12, i32* %3
br label %16
13: ; preds = %2
%14 = call i32 (...) @test_pgflt()
%15 = call i32 (...) @test_syscall()
store i32 0, i32* %3
br label %16
16: ; preds = %13, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@str = [26 x i8] c"failed to initialize DUNE\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @dune_init_and_enter()
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %10
7: ; preds = %2
%8 = tail call i32 (...) @test_pgflt()
%9 = tail call i32 (...) @test_syscall()
br label %10
10: ; preds = %7, %5
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ERANGE;
scalar_t__ isinf(double);
double with_errno(double, int /*<<< orphan*/);
__attribute__((__visibility__("hidden"))) double __math_check_oflow(double y) {
  return isinf(y) ? with_errno(y, ERANGE) : y;
}


x86 assembly (clang, -O0):
<__math_check_oflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <isinf@plt>
cmp    $0x0,%rax
je     115e <__math_check_oflow+0x3e>
movsd  -0x8(%rbp),%xmm0
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1030 <with_errno@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1168 <__math_check_oflow+0x48>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__math_check_oflow>:
push   %rax
movsd  %xmm0,(%rsp)
call   1040 <isinf@plt>
test   %rax,%rax
je     1144 <__math_check_oflow+0x24>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
movsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <with_errno@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@ERANGE = global i32 0
define hidden double @__math_check_oflow(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @isinf(double %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %2
%8 = load i32, i32* @ERANGE
%9 = call double @with_errno(double %7, i32 %8)
br label %12
10: ; preds = %1
%11 = load double, double* %2
br label %12
12: ; preds = %10, %6
%13 = phi double [ %9, %6 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
@ERANGE = global i32 0
define hidden double @__math_check_oflow(double %0) {
%2 = tail call i64 @isinf(double %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @ERANGE
%6 = tail call double @with_errno(double %0, i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi double [ %6, %4 ], [ %0, %1 ]
ret double %8
}
/* Variables and functions */
int get_rand(int, int);
int rand_percent(int percentage) { return (get_rand(1, 100) <= percentage); }


x86 assembly (clang, -O0):
<rand_percent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x64,%esi
call   1030 <get_rand@plt>
cmp    -0x4(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_percent>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
mov    $0x64,%esi
call   1030 <get_rand@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setle  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rand_percent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @get_rand(i32 1, i32 100)
%4 = load i32, i32* %2
%5 = icmp sle i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @rand_percent(i32 %0) {
%2 = tail call i32 @get_rand(i32 1, i32 100)
%3 = icmp sle i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void SPDIF_RX_IRQHandler() { default_handler(); }


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

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

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

LLVM IR (-O2):
define weak void @SPDIF_RX_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t __local_bswap32(uint32_t x) {
  return ((x << 24) & 0xff000000) | ((x << 8) & 0x00ff0000) |
         ((x >> 8) & 0x0000ff00) | ((x >> 24) & 0x000000ff);
}


x86 assembly (clang, -O0):
<__local_bswap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
and    $0xff000000,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__local_bswap32>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @__local_bswap32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = and i32 %4, -16777216
%6 = load i32, i32* %2
%7 = shl i32 %6, 8
%8 = and i32 %7, 16711680
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = ashr i32 %10, 8
%12 = and i32 %11, 65280
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = ashr i32 %14, 24
%16 = and i32 %15, 255
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @__local_bswap32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
long int random(void) {
  _exit(-1);
  return 0L;
}


x86 assembly (clang, -O0):
<random>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<random>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i64 @random() {
%1 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define i64 @random() {
%1 = tail call i32 @_exit(i32 -1)
unreachable
}
int fastfloor(double x) { return x > 0 ? (int)x : (int)x - 1; }


x86 assembly (clang, -O0):
<fastfloor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1128 <fastfloor+0x28>
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <fastfloor+0x33>
cvttsd2si -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastfloor>:
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
setbe  %cl
cvttsd2si %xmm0,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fastfloor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fptosi double %6 to i32
br label %12
8: ; preds = %1
%9 = load double, double* %2
%10 = fptosi double %9 to i32
%11 = sub nsw i32 %10, 1
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ %7, %5 ], [ %11, %8 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @fastfloor(double %0) {
%2 = fcmp ule double %0, 0.000000e+00
%3 = fptosi double %0 to i32
%4 = sext i1 %2 to i32
%5 = add nsw i32 %4, %3
ret i32 %5
}
int minInArray(int arr[], int n) { return 1337; }


x86 assembly (clang, -O0):
<minInArray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x539,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @minInArray(i32* nocapture readnone %0, i32 %1) {
ret i32 1337
}
void XGetKeyboardMapping() {}


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

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

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

LLVM IR (-O2):
define void @XGetKeyboardMapping() {
ret void
}
void drawString(ix, iy, temp) int ix, iy;
char *temp;
{ 0; }


x86 assembly (clang, -O0):
<drawString>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @drawString(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
ret void
}

LLVM IR (-O2):
define void @drawString(i32 %0, i32 %1, i8* nocapture %2) {
ret void
}
void s5pv210_pm_init(void) {}


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

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

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

LLVM IR (-O2):
define void @s5pv210_pm_init() {
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
scalar_t__ sendton(int, void const *, size_t, int, struct sockaddr const *,
                   int /*<<< orphan*/);
void Sendton(int sockfd, const void *buf, size_t len, int flags,
             const struct sockaddr *dest_addr, socklen_t addrlen) {
  if (sendton(sockfd, buf, len, flags, dest_addr, addrlen) < 0)
    err_sys("sendton error");
}


x86 assembly (clang, -O0):
<Sendton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1030 <sendton@plt>
cmp    $0x0,%rax
jge    116f <Sendton+0x4f>
lea    0xe96(%rip),%rdi
call   1040 <err_sys@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sendton>:
push   %rax
call   1030 <sendton@plt>
test   %rax,%rax
js     112d <Sendton+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <err_sys@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [14 x i8] c"sendton error\00"
define void @Sendton(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca %struct.sockaddr*
%12 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i32 %3, i32* %10
store %struct.sockaddr* %4, %struct.sockaddr** %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i64, i64* %9
%16 = load i32, i32* %10
%17 = load %struct.sockaddr*, %struct.sockaddr** %11
%18 = load i32, i32* %12
%19 = call i64 @sendton(i32 %13, i8* %14, i64 %15, i32 %16, %struct.sockaddr* %17, i32 %18)
%20 = icmp slt i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %6
%22 = call i32 @err_sys(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %21, %6
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [14 x i8] c"sendton error\00"
define void @Sendton(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = tail call i64 @sendton(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @err_sys(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
char *allocTokenBuffer() {
  char *tokenBuffer = (char *)malloc(100 + 1);
  if (tokenBuffer == NULL) {
    fputs("Could not allocate heap memory for token buffer.", stderr);
  }
  return tokenBuffer;
}


x86 assembly (clang, -O0):
<allocTokenBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x65,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <allocTokenBuffer+0x36>
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
lea    0xeaf(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocTokenBuffer>:
push   %rbx
mov    $0x65,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <allocTokenBuffer+0x28>
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
lea    0xebd(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Could not allocate heap memory for token buffer.\00"
@stderr = global i32 0
define i8* @allocTokenBuffer() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 101)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 @fputs(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %0
%10 = load i8*, i8** %1
ret i8* %10
}

LLVM IR (-O2):
@.str = [49 x i8] c"Could not allocate heap memory for token buffer.\00"
@stderr = global i32 0
define i8* @allocTokenBuffer() {
%1 = tail call i64 @malloc(i32 101)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputs(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %3, %0
%7 = inttoptr i64 %1 to i8*
ret i8* %7
}
/* Variables and functions */
unsigned long __hpte_page_size(unsigned long, unsigned long,
                               int /*<<< orphan*/);
unsigned long hpte_page_size(unsigned long h, unsigned long l) {
  return __hpte_page_size(h, l, 0);
}


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

x86 assembly (clang, -O2):
<hpte_page_size>:
xor    %edx,%edx
jmp    1030 <__hpte_page_size@plt>

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

LLVM IR (-O2):
define i64 @hpte_page_size(i64 %0, i64 %1) {
%3 = tail call i64 @__hpte_page_size(i64 %0, i64 %1, i32 0)
ret i64 %3
}
int yapl$main(char **argc, int argv) { return 0; }


x86 assembly (clang, -O0):
<yapl$main>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yapl$main>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @"yapl$main"(i8** nocapture readnone %0, i32 %1) {
ret i32 0
}