xunge/DecIR huggingface dataset:
const char *__malidrv_build_info(void) {
  return "malidrv:  CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL= "
         "REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Thu May  8 "
         "12:35:24 UTC 2014 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 "
         "USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 "
         "KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 "
         "USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y";
}


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

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

LLVM IR (-O0):
@.str = [427 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Thu May 8 12:35:24 UTC 2014 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([427 x i8], [427 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [427 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Thu May 8 12:35:24 UTC 2014 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([427 x i8], [427 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int syscall(int, int);
int fsync(int fd) { return syscall(118, fd); }


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

x86 assembly (clang, -O2):
<fsync>:
mov    %edi,%esi
mov    $0x76,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @fsync(i32 %0) {
%2 = tail call i32 @syscall(i32 118, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
char *malloc(size_t);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strndup(const char *s, size_t n) {
  char *r;
  if (s == 0)
    return 0;
  r = malloc(n + 1);
  assert(r);
  strncpy(r, s, n);
  r[n] = 0;
  return r;
}


x86 assembly (clang, -O0):
<strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1158 <strndup+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1197 <strndup+0x67>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1169 <strndup+0x39>
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rsi),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r14,1)
jmp    116b <strndup+0x3b>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strndup(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = add i64 %1, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = tail call i32 @assert(i8* %6)
%8 = tail call i32 @strncpy(i8* %6, i8* %0, i64 %1)
%9 = getelementptr inbounds i8, i8* %6, i64 %1
store i8 0, i8* %9
br label %10
10: ; preds = %2, %4
%11 = phi i8* [ %6, %4 ], [ null, %2 ]
ret i8* %11
}
int NAND_GET_BAD_BLOCK(unsigned int *pNum, unsigned int **ppBadBlock) {
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @NAND_GET_BAD_BLOCK(i32* nocapture readnone %0, i32** nocapture readnone %1) {
ret i32 -1
}
void push(void *arr, void *value) {
  ((void **)arr)[(((int *)arr)[-1])++] = value;
}


x86 assembly (clang, -O0):
<push>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rsi
mov    -0x4(%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,-0x4(%rsi)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<push>:
movslq -0x4(%rdi),%rax
lea    0x1(%rax),%ecx
mov    %ecx,-0x4(%rdi)
mov    %rsi,(%rdi,%rax,8)
ret

LLVM IR (-O0):
define void @push(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i8**
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 -1
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %10
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds i8*, i8** %7, i64 %13
store i8* %5, i8** %14
ret void
}

LLVM IR (-O2):
define void @push(i8* nocapture %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
%4 = getelementptr inbounds i8, i8* %0, i64 -4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1
store i32 %7, i32* %5
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i8*, i8** %3, i64 %8
store i8* %1, i8** %9
ret void
}
int test_imm_10uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x10 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_10uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 68719476736
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int distance = 100;
  printf("You are %d miles ways. ", distance);
  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)
movl   $0x64,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"You are %d miles ways. \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
store i32 100, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"You are %d miles ways. \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ set_MGW_fname(char *, char *, char *);
void set_MGW_depositfname(char *fname, char *NXTaddr) {
  set_MGW_fname(fname, "deposit", NXTaddr);
}


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

x86 assembly (clang, -O2):
<set_MGW_depositfname>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <set_MGW_fname@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"deposit\00"
define void @set_MGW_depositfname(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @set_MGW_fname(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"deposit\00"
define void @set_MGW_depositfname(i8* %0, i8* %1) {
%3 = tail call i32 @set_MGW_fname(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void console_cls(void) {
  putchar(0x1b);
  putchar('E');
}


x86 assembly (clang, -O0):
<console_cls>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <putchar@plt>
mov    $0x45,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_cls>:
push   %rax
mov    $0x1b,%edi
call   1030 <putchar@plt>
mov    $0x45,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @console_cls() {
%1 = call i32 @putchar(i8 signext 27)
%2 = call i32 @putchar(i8 signext 69)
ret void
}

LLVM IR (-O2):
define void @console_cls() {
%1 = tail call i32 @putchar(i8 signext 27)
%2 = tail call i32 @putchar(i8 signext 69)
ret void
}
unsigned short htons(unsigned short x) {
  return ((x & 0x00ff) << 8) | ((x & 0xff00) >> 8);
}


x86 assembly (clang, -O0):
<htons>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
movzwl -0x2(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<htons>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @htons(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, 255
%6 = shl i32 %5, 8
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = and i32 %8, 65280
%10 = ashr i32 %9, 8
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @htons(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void testTortureExecute(void) { foo(); }


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

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

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

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

/* Variables and functions */
uint32_t read_le32(const void *src) {
  const uint8_t *s = src;
  return (((uint32_t)s[3]) << 24) | (((uint32_t)s[2]) << 16) |
         (((uint32_t)s[1]) << 8) | (((uint32_t)s[0]) << 0);
}


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

x86 assembly (clang, -O2):
<read_le32>:
mov    0x18(%rdi),%ecx
shl    $0x18,%ecx
mov    0x8(%rdi),%eax
mov    0x10(%rdi),%edx
shl    $0x10,%edx
or     %ecx,%edx
shl    $0x8,%eax
or     %edx,%eax
or     (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @read_le32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = getelementptr inbounds i8, i8* %0, i64 24
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 24
%8 = getelementptr inbounds i8, i8* %0, i64 16
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %12, %7
%14 = getelementptr inbounds i8, i8* %0, i64 8
%15 = bitcast i8* %14 to i64*
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i64, i64* %2
%21 = trunc i64 %20 to i32
%22 = or i32 %19, %21
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ e_absy();
int /*<<< orphan*/ e_adc();
void e_adc_absy() {
  e_absy();
  e_adc();
}


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

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

LLVM IR (-O0):
define void @e_adc_absy() {
%1 = call i32 (...) @e_absy()
%2 = call i32 (...) @e_adc()
ret void
}

LLVM IR (-O2):
define void @e_adc_absy() {
%1 = tail call i32 (...) @e_absy()
%2 = tail call i32 (...) @e_adc()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prints(char *);
void printeol(void) { prints("\r\n"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define void @printeol() {
%1 = call i32 @prints(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @printeol() {
%1 = tail call i32 @prints(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, int *, int);
void int2intarray(int *i, char *inta) { memcpy(inta, i, 4); }


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

x86 assembly (clang, -O2):
<int2intarray>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x4,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @int2intarray(i32* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %1, i32* %0, i32 4)
ret void
}
int dispatch(int x(char)) { x('B'); }


x86 assembly (clang, -O0):
<dispatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x42,%edi
call   *-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispatch>:
mov    %rdi,%rax
mov    $0x42,%edi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @dispatch(i32 (i8)* nocapture %0) {
%2 = tail call i32 %0(i8 signext 66)
ret i32 undef
}
void blk_mq_debugfs_unregister_queue_rqos(struct request_queue *q) {}


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

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

LLVM IR (-O0):
%struct.request_queue = type opaque
define void @blk_mq_debugfs_unregister_queue_rqos(%struct.request_queue* %0) {
%2 = alloca %struct.request_queue*
store %struct.request_queue* %0, %struct.request_queue** %2
ret void
}

LLVM IR (-O2):
%struct.request_queue = type opaque
define void @blk_mq_debugfs_unregister_queue_rqos(%struct.request_queue* nocapture %0) {
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR92_set(void) { return U_WMRCORENONE_set("U_WMR92"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR92\00"
define i8* @U_WMR92_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR92\00"
define i8* @U_WMR92_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
struct lifo {
  int dummy;
};

/* Variables and functions */
double pop(struct lifo *);
double sqrt(double);
double opr_sqrt(struct lifo *stack) {
  double op = pop(stack);
  return sqrt(op);
}


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

x86 assembly (clang, -O2):
<opr_sqrt>:
push   %rax
call   1030 <pop@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1136 <opr_sqrt+0x16>
sqrtsd %xmm0,%xmm0
pop    %rax
ret
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
%struct.lifo = type { i32 }
define double @opr_sqrt(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
%3 = alloca double
store %struct.lifo* %0, %struct.lifo** %2
%4 = load %struct.lifo*, %struct.lifo** %2
%5 = call double @pop(%struct.lifo* %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = call double @sqrt(double %6)
ret double %7
}

LLVM IR (-O2):
%struct.lifo = type { i32 }
define double @opr_sqrt(%struct.lifo* %0) {
%2 = tail call double @pop(%struct.lifo* %0)
%3 = tail call double @sqrt(double %2)
ret double %3
}
int dramfreq_unregister_notifier(struct notifier_block *nb) { return 0; }


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

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

LLVM IR (-O0):
%struct.notifier_block = type opaque
define i32 @dramfreq_unregister_notifier(%struct.notifier_block* %0) {
%2 = alloca %struct.notifier_block*
store %struct.notifier_block* %0, %struct.notifier_block** %2
ret i32 0
}

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @dramfreq_unregister_notifier(%struct.notifier_block* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int btree_locate(int, int /*<<< orphan*/, char *);
int INTERNAL_find_object_file(int file_id, char *label) {
  return btree_locate(file_id, 0, label);
}


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

x86 assembly (clang, -O2):
<INTERNAL_find_object_file>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <btree_locate@plt>

LLVM IR (-O0):
define i32 @INTERNAL_find_object_file(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 = load i8*, i8** %4
%7 = call i32 @btree_locate(i32 %5, i32 0, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @INTERNAL_find_object_file(i32 %0, i8* %1) {
%3 = tail call i32 @btree_locate(i32 %0, i32 0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int *a, int p, int q) {
  if (p >= q)
    return;
  int m = partition(a, p, q);
  quick_sort(a, p, m - 1);
  quick_sort(a, m + 1, q);
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1143 <quick_sort+0x23>
jmp    1179 <quick_sort+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %25
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @partition(i32* %13, i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
br label %25
25: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ pageins;

/* Variables and functions */
scalar_t__ sysctlbyname(char *, int /*<<< orphan*/ *, size_t *,
                        int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ warnx(char *);
u_int get_pageins() {
  u_int pageins;
  size_t len;
  len = sizeof(pageins);
  if (sysctlbyname("vm.stats.vm.v_swappgsin", &pageins, &len, NULL, 0) != 0) {
    warnx("v_swappgsin");
    return (0);
  }
  return pageins;
}


x86 assembly (clang, -O0):
<get_pageins>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x4,-0x10(%rbp)
lea    0xec9(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1040 <sysctlbyname@plt>
cmp    $0x0,%rax
je     116d <get_pageins+0x4d>
lea    0xeb0(%rip),%rdi
call   1030 <warnx@plt>
movl   $0x0,-0x4(%rbp)
jmp    1173 <get_pageins+0x53>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pageins>:
push   %rbx
sub    $0x10,%rsp
movq   $0x4,0x8(%rsp)
lea    0xecb(%rip),%rdi
xor    %ebx,%ebx
lea    0x4(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <sysctlbyname@plt>
test   %rax,%rax
je     115e <get_pageins+0x3e>
lea    0xeb5(%rip),%rdi
call   1030 <warnx@plt>
jmp    1162 <get_pageins+0x42>
mov    0x4(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"vm.stats.vm.v_swappgsin\00"
@.str.1 = [12 x i8] c"v_swappgsin\00"
define i32 @get_pageins() {
%1 = alloca i32
%2 = alloca i64
%3 = bitcast i32* %1 to i8*
%4 = bitcast i64* %2 to i8*
store i64 4, i64* %2
%5 = call i64 @sysctlbyname(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* %1, i64* %2, i32* null, i32 0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 @warnx(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = load i32, i32* %1
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ 0, %7 ], [ %10, %9 ]
ret i32 %12
}
void rte_io_rmb(void) {}


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

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

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

LLVM IR (-O2):
define void @rte_io_rmb() {
ret void
}
/* Variables and functions */
size_t strspn(char const *, char const *);
int sr_skip_char_span(const char **input, const char *chars) {
  size_t count = strspn(*input, chars);
  if (0 == count)
    return count;
  *input += count;
  return count;
}


x86 assembly (clang, -O0):
<sr_skip_char_span>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strspn@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jne    114c <sr_skip_char_span+0x3c>
mov    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1161 <sr_skip_char_span+0x51>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sr_skip_char_span>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
mov    %rbx,%rdi
call   1030 <strspn@plt>
test   %rax,%rax
je     112f <sr_skip_char_span+0x1f>
add    %rax,%rbx
mov    %rbx,(%r14)
jmp    1131 <sr_skip_char_span+0x21>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @sr_skip_char_span(i8** nocapture %0, i8* nocapture %1) {
%3 = load i8*, i8** %0
%4 = tail call i64 @strspn(i8* %3, i8* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 %4
store i8* %7, i8** %0
%8 = trunc i64 %4 to i32
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ %8, %6 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ HibernateWriteComplete();
void HibernateLowBatSet(unsigned long ulLowBatFlags) {
  ;
  (*((volatile unsigned long *)(0x400FC010))) =
      (ulLowBatFlags | ((*((volatile unsigned long *)(0x400FC010))) &
                        ~(0x00006000 | 0x000000A0)));
  HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateLowBatSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fc010,%eax
mov    (%rax),%rax
and    $0xffffffffffff9f5f,%rax
or     %rax,%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateLowBatSet>:
mov    $0xffffffffffff9f5f,%rax
and    0x400fc010,%rax
40
or     %rdi,%rax
mov    %rax,0x400fc010
40
xor    %eax,%eax
jmp    1030 <HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateLowBatSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%5 = and i64 %4, -24737
%6 = or i64 %3, %5
store volatile i64 %6, i64* inttoptr (i64 1074774032 to i64*)
%7 = call i32 (...) @HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateLowBatSet(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%3 = and i64 %2, -24737
%4 = or i64 %3, %0
store volatile i64 %4, i64* inttoptr (i64 1074774032 to i64*)
%5 = tail call i32 (...) @HibernateWriteComplete()
ret void
}
double sense_amp_tag_delay(inrisetime, outrisetime)
double inrisetime, *outrisetime;
{
  *outrisetime = 7e-10;
  return (2.6e-10);
}


x86 assembly (clang, -O0):
<sense_amp_tag_delay>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,(%rax)
movsd  0xedb(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sense_amp_tag_delay>:
movabs $0x3e080d43de9cc603,%rax
0d 08 3e
mov    %rax,(%rdi)
movsd  0xeeb(%rip),%xmm0
ret

LLVM IR (-O0):
define double @sense_amp_tag_delay(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double*, double** %4
store double 0x3E080D43DE9CC603, double* %5
ret double 2.600000e-10
}

LLVM IR (-O2):
define double @sense_amp_tag_delay(double %0, double* nocapture writeonly %1) {
store double 0x3E080D43DE9CC603, double* %1
ret double 2.600000e-10
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int ip4_cmp(const void *m1, const void *m2) {
  const uint32_t *ip1 = m1;
  const uint32_t *ip2 = m2;
  if (*ip1 > *ip2) {
    return 1;
  } else {
    return (*ip1 < *ip2) ? -1 : 0;
  }
}


x86 assembly (clang, -O0):
<ip4_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jle    113c <ip4_cmp+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    115a <ip4_cmp+0x5a>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdx
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip4_cmp>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
xor    %edx,%edx
cmp    %rcx,%rax
setl   %dl
neg    %edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @ip4_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
%8 = icmp slt i64 %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
int MAX(int x, int y) { return x > y ? x : y; }


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

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

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

LLVM IR (-O2):
define i32 @MAX(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void destroyArray(int **arr) {
  free(*arr);
  free(arr);
}


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

x86 assembly (clang, -O2):
<destroyArray>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroyArray(i32** nocapture %0) {
%2 = bitcast i32** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast i32** %0 to i8*
tail call void @free(i8* %4)
ret void
}
void freeList(int *p) {
  int *q;
  while (p) {
    q = *(p + 1);
    free(p);
    p = q;
  }
}


x86 assembly (clang, -O0):
<freeList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <freeList+0x39>
mov    -0x8(%rbp),%rax
movslq 0x4(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    111c <freeList+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeList>:
push   %rbx
test   %rdi,%rdi
je     1131 <freeList+0x21>
cs nopw 0x0(%rax,%rax,1)
movslq 0x4(%rdi),%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
test   %rbx,%rbx
jne    1120 <freeList+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @freeList(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
br label %4
4: ; preds = %7, %1
%5 = load i32*, i32** %2
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %3
%13 = load i32*, i32** %2
%14 = bitcast i32* %13 to i8*
%15 = load i32*, i32** %3
store i32* %15, i32** %2
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @freeList(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32* [ %8, %3 ], [ %0, %1 ]
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = bitcast i32* %4 to i8*
tail call void @free(i8* %9)
%10 = icmp eq i32 %6, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
ret void
}
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int nthreads, tid;
#pragma omp parallel private(nthreads, tid)
  while (1) {
    tid = omp_get_thread_num();
    printf("Hello World from thread = %d\n", tid);
    if (tid == 0) {
      nthreads = omp_get_num_threads();
    }
  }
}


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   1030 <omp_get_thread_num@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0x18(%rbp)
jne    1173 <main+0x43>
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,-0x14(%rbp)
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rbx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
test   %ebp,%ebp
jne    1140 <main+0x10>
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
@.str = [30 x i8] c"Hello World from thread = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %2, %16
%9 = call i32 (...) @omp_get_thread_num()
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = call i32 (...) @omp_get_num_threads()
store i32 %15, i32* %6
br label %16
16: ; preds = %14, %8
br label %8
}

LLVM IR (-O2):
@.str = [30 x i8] c"Hello World from thread = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %9, %2
%4 = tail call i32 (...) @omp_get_thread_num()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 (...) @omp_get_num_threads()
br label %9
9: ; preds = %7, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int sysconf(int /*<<< orphan*/);
int get_number_of_cpu_cores() { return (sysconf(_SC_NPROCESSORS_ONLN)); }


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

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

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @get_number_of_cpu_cores() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = call i32 @sysconf(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @get_number_of_cpu_cores() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
void BIO_ctrl_pending(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ testforty_state_write_str(struct testforty_state *,
                                             char const *);
void testforty_state_push(const char *name, void *context) {
  struct testforty_state *s = context;
  testforty_state_write_str(s, name);
  testforty_state_write_str(s, " ");
}


x86 assembly (clang, -O0):
<testforty_state_push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <testforty_state_write_str@plt>
mov    -0x18(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1030 <testforty_state_write_str@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testforty_state_push>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1030 <testforty_state_write_str@plt>
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <testforty_state_write_str@plt>

LLVM IR (-O0):
%struct.testforty_state = type { i32 }
@.str = [2 x i8] c" \00"
define void @testforty_state_push(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.testforty_state*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.testforty_state*
store %struct.testforty_state* %7, %struct.testforty_state** %5
%8 = load %struct.testforty_state*, %struct.testforty_state** %5
%9 = load i8*, i8** %3
%10 = call i32 @testforty_state_write_str(%struct.testforty_state* %8, i8* %9)
%11 = load %struct.testforty_state*, %struct.testforty_state** %5
%12 = call i32 @testforty_state_write_str(%struct.testforty_state* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.testforty_state = type { i32 }
@.str = [2 x i8] c" \00"
define void @testforty_state_push(i8* %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.testforty_state*
%4 = tail call i32 @testforty_state_write_str(%struct.testforty_state* %3, i8* %0)
%5 = tail call i32 @testforty_state_write_str(%struct.testforty_state* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dnansumkbn(int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 0.0 / 0.0, 0.0 / 0.0};
  int64_t N = 5;
  int64_t stride = 2;
  double v = stdlib_strided_dnansumkbn(N, x, stride);
  printf("sum: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x50(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
movl   $0x5,-0x54(%rbp)
movl   $0x2,-0x58(%rbp)
mov    -0x54(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%edx
call   1040 <stdlib_strided_dnansumkbn@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_dnansumkbn@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [10 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00, double 0x7FF8000000000000, double 0x7FF8000000000000]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [10 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [10 x double]* %1 to i8*
store i32 5, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dnansumkbn(i32 %6, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [10 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00, double 0x7FF8000000000000, double 0x7FF8000000000000]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [10 x double]
%2 = bitcast [10 x double]* %1 to i8*
%3 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dnansumkbn(i32 5, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}