xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uLong;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, scalar_t__);
scalar_t__ zlibCompileFlags();
void testzlibCompileFlags(void) {
  uLong ret;
  ret = zlibCompileFlags();
  if (ret == 0)
    printf("zlibCompileFlags(): Error: %lu\n", ret);
  printf("zlibCompileFlags: %lu\n", ret);
}


x86 assembly (clang, -O0):
<testzlibCompileFlags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <zlibCompileFlags@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114e <testzlibCompileFlags+0x2e>
mov    -0x8(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testzlibCompileFlags>:
push   %rbx
xor    %eax,%eax
call   1040 <zlibCompileFlags@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113e <testzlibCompileFlags+0x1e>
lea    0xec9(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"zlibCompileFlags(): Error: %lu\0A\00"
@.str.1 = [23 x i8] c"zlibCompileFlags: %lu\0A\00"
define void @testzlibCompileFlags() {
%1 = alloca i64
%2 = call i64 (...) @zlibCompileFlags()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i64, i64* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %6)
br label %8
8: ; preds = %5, %0
%9 = load i64, i64* %1
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 %9)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"zlibCompileFlags(): Error: %lu\0A\00"
@.str.1 = [23 x i8] c"zlibCompileFlags: %lu\0A\00"
define void @testzlibCompileFlags() {
%1 = tail call i64 (...) @zlibCompileFlags()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 0)
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 %1)
ret void
}
int test_imm_36uint8_reg(unsigned char val) {
  return ((val) & (0x36 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_36uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x36,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_36uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 54
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_42uint32_mem(unsigned int *val) {
  return ((*val) & (0x42 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_42uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 66
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned long b_file_write(unsigned long handle, const void *buf,
                           unsigned int count) {
  unsigned long tlong;
  asm volatile("call *0x00100088"
               : "=c"(tlong)
               : "a"(handle), "S"(buf), "c"(count));
  return tlong;
}


x86 assembly (clang, -O0):
<b_file_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
call   *0x100088
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_file_write>:
mov    %edx,%ecx
mov    %rdi,%rax
call   *0x100088
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @b_file_write(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i64 asm sideeffect "call *0x00100088", "={cx},{ax},{si},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %8, i8* %9, i32 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
ret i64 %12
}

LLVM IR (-O2):
define i64 @b_file_write(i64 %0, i8* %1, i32 %2) {
%4 = tail call i64 asm sideeffect "call *0x00100088", "={cx},{ax},{si},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i8* %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ gui_ungetch(char const);
int strlen(char const *const);
void gui_queue(const char *const s) {
  const char *p;
  for (p = s + strlen(s) - 1; p >= s; p--)
    gui_ungetch(*p);
}


x86 assembly (clang, -O0):
<gui_queue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jb     117c <gui_queue+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <gui_ungetch@plt>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1151 <gui_queue+0x31>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_queue>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
cltq
lea    (%r14,%rax,1),%rbx
add    $0xffffffffffffffff,%rbx
cmp    %r14,%rbx
jb     1151 <gui_queue+0x31>
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1040 <gui_ungetch@plt>
add    $0xffffffffffffffff,%rbx
cmp    %r14,%rbx
jae    1140 <gui_queue+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @gui_queue(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = getelementptr inbounds i8, i8* %8, i64 -1
store i8* %9, i8** %3
br label %10
10: ; preds = %18, %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = icmp uge i8* %11, %12
br i1 %13, label %14, label %21
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = call i32 @gui_ungetch(i8 signext %16)
br label %18
18: ; preds = %14
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 -1
store i8* %20, i8** %3
br label %10
21: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @gui_queue(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = icmp ult i8* %5, %0
br i1 %6, label %13, label %7
7: ; preds = %1, %7
%8 = phi i8* [ %11, %7 ], [ %5, %1 ]
%9 = load i8, i8* %8
%10 = tail call i32 @gui_ungetch(i8 signext %9)
%11 = getelementptr inbounds i8, i8* %8, i64 -1
%12 = icmp ult i8* %11, %0
br i1 %12, label %13, label %7
13: ; preds = %7, %1
ret void
}
double foo009(double a, float b, double c) { return (a + b * c); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @foo009(double %0, float %1, double %2) {
%4 = alloca double
%5 = alloca float
%6 = alloca double
store double %0, double* %4
store float %1, float* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load float, float* %5
%9 = fpext float %8 to double
%10 = load double, double* %6
%11 = call double @llvm.fmuladd.f64(double %9, double %10, double %7)
ret double %11
}

LLVM IR (-O2):
define double @foo009(double %0, float %1, double %2) {
%4 = fpext float %1 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double %2, double %0)
ret double %5
}
void smbd_destroy(struct smbd_connection *info) {}


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

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

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

LLVM IR (-O2):
%struct.smbd_connection = type opaque
define void @smbd_destroy(%struct.smbd_connection* nocapture %0) {
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int __syscall(int, char const *, struct stat *);
int errno;
int _stat(const char *filename, struct stat *st) {
  int err;
  err = __syscall(38, filename, st);
  if (err < 0) {
    errno = -err;
    return -1;
  }
  return err;
}


x86 assembly (clang, -O0):
<_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x26,%edi
call   1030 <__syscall@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1159 <_stat+0x49>
xor    %ecx,%ecx
sub    -0x1c(%rbp),%ecx
mov    0x2e95(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <_stat+0x4f>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_stat>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x26,%edi
call   1030 <__syscall@plt>
test   %eax,%eax
js     1127 <_stat+0x17>
pop    %rcx
ret
neg    %eax
mov    0x2eb0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@errno = global i32 0
define i32 @_stat(i8* %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.stat*
%6 = alloca i32
store i8* %0, i8** %4
store %struct.stat* %1, %struct.stat** %5
%7 = load i8*, i8** %4
%8 = load %struct.stat*, %struct.stat** %5
%9 = call i32 @__syscall(i32 38, i8* %7, %struct.stat* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %6
%14 = sub nsw i32 0, %13
store i32 %14, i32* @errno
store i32 -1, i32* %3
br label %17
15: ; preds = %2
%16 = load i32, i32* %6
store i32 %16, i32* %3
br label %17
17: ; preds = %15, %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@errno = global i32 0
define i32 @_stat(i8* %0, %struct.stat* %1) {
%3 = tail call i32 @__syscall(i32 38, i8* %0, %struct.stat* %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = sub nsw i32 0, %3
store i32 %6, i32* @errno
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %5 ], [ %3, %2 ]
ret i32 %8
}
/* Variables and functions */
char *binary_search(int /*<<< orphan*/, int, int);
int populate_movie_catalog();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sort_by_year(int);
int main() {
  int length;
  length = populate_movie_catalog();
  sort_by_year(length);
  printf("The movie released in 2014 is: %s\n",
         binary_search(0, length - 1, 2005));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <populate_movie_catalog@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <sort_by_year@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
xor    %edi,%edi
mov    $0x7d5,%edx
call   1050 <binary_search@plt>
mov    %rax,%rsi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <populate_movie_catalog@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1060 <sort_by_year@plt>
add    $0xffffffff,%ebx
xor    %edi,%edi
mov    %ebx,%esi
mov    $0x7d5,%edx
call   1050 <binary_search@plt>
lea    0xe97(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"The movie released in 2014 is: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @populate_movie_catalog()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @sort_by_year(i32 %4)
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
%8 = call i8* @binary_search(i32 0, i32 %7, i32 2005)
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"The movie released in 2014 is: %s\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @populate_movie_catalog()
%2 = tail call i32 @sort_by_year(i32 %1)
%3 = add nsw i32 %1, -1
%4 = tail call i8* @binary_search(i32 0, i32 %3, i32 2005)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ XConfigureRequestEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XConfigureRequestEvent(void *_p) {
  if (_p == NULL)
    abort();
  free((XConfigureRequestEvent *)_p);
}


x86 assembly (clang, -O0):
<free_XConfigureRequestEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XConfigureRequestEvent+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XConfigureRequestEvent>:
test   %rdi,%rdi
je     112a <free_XConfigureRequestEvent+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XConfigureRequestEvent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XConfigureRequestEvent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abc();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ xyz();
void func1(int x) {
  printf("Called func1\n");
  xyz();
  abc();
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <xyz@plt>
mov    $0x0,%al
call   1040 <abc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <xyz@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <abc@plt>

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

LLVM IR (-O2):
@str = [13 x i8] c"Called func1\00"
define void @func1(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @xyz()
%4 = tail call i32 (...) @abc()
ret void
}
/* Variables and functions */
double strtod(char const *, int /*<<< orphan*/);
double mc_double_value(const char *value) {
  return (NULL != value) ? strtod(value, 0) : 0.0;
}


x86 assembly (clang, -O0):
<mc_double_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     113d <mc_double_value+0x2d>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <strtod@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    114a <mc_double_value+0x3a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114a <mc_double_value+0x3a>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mc_double_value>:
test   %rdi,%rdi
je     111c <mc_double_value+0xc>
xor    %esi,%esi
jmp    1030 <strtod@plt>
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @mc_double_value(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* null, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call double @strtod(i8* %6, i32 0)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi double [ %7, %5 ], [ 0.000000e+00, %8 ]
ret double %10
}

LLVM IR (-O2):
define double @mc_double_value(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call double @strtod(i8* %0, i32 0)
br label %5
5: ; preds = %1, %3
%6 = phi double [ %4, %3 ], [ 0.000000e+00, %1 ]
ret double %6
}
void NAME() {}


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

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

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

LLVM IR (-O2):
define void @NAME() {
ret void
}
/* Variables and functions */
int syscall(int, char const *, char const *);
int removexattr(const char *path, const char *name) {
  return syscall(197, path, name);
}


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

x86 assembly (clang, -O2):
<removexattr>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xc5,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @removexattr(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 @syscall(i32 197, i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @removexattr(i8* %0, i8* %1) {
%3 = tail call i32 @syscall(i32 197, i8* %0, i8* %1)
ret i32 %3
}
double power4(double x) { return x * x * x * x; }


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

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

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

LLVM IR (-O2):
define double @power4(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
%4 = fmul double %3, %0
ret double %4
}
/* Variables and functions */
int nresources_(double *, double *, long *, long *, long *, long *, long *,
                long *);
int NRESOURCES(double *ut, double *st, long *mem, long *par, long *paf,
               long *swa, long *dr, long *dw) {
  return nresources_(ut, st, mem, par, paf, swa, dr, dw);
}


x86 assembly (clang, -O0):
<NRESOURCES>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <nresources_@plt>
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @NRESOURCES(double* %0, double* %1, i64* %2, i64* %3, i64* %4, i64* %5, i64* %6, i64* %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca i64*
%12 = alloca i64*
%13 = alloca i64*
%14 = alloca i64*
%15 = alloca i64*
%16 = alloca i64*
store double* %0, double** %9
store double* %1, double** %10
store i64* %2, i64** %11
store i64* %3, i64** %12
store i64* %4, i64** %13
store i64* %5, i64** %14
store i64* %6, i64** %15
store i64* %7, i64** %16
%17 = load double*, double** %9
%18 = load double*, double** %10
%19 = load i64*, i64** %11
%20 = load i64*, i64** %12
%21 = load i64*, i64** %13
%22 = load i64*, i64** %14
%23 = load i64*, i64** %15
%24 = load i64*, i64** %16
%25 = call i32 @nresources_(double* %17, double* %18, i64* %19, i64* %20, i64* %21, i64* %22, i64* %23, i64* %24)
ret i32 %25
}

LLVM IR (-O2):
define i32 @NRESOURCES(double* %0, double* %1, i64* %2, i64* %3, i64* %4, i64* %5, i64* %6, i64* %7) {
%9 = tail call i32 @nresources_(double* %0, double* %1, i64* %2, i64* %3, i64* %4, i64* %5, i64* %6, i64* %7)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("usage : ./webcrver [-d] [dir or not]\n"); }


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"usage : ./webcrver [-d] [dir or not]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"usage : ./webcrver [-d] [dir or not]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
void __DELETE_java_lang_Exception(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_lang_Exception(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int is_down(int key) { return key == 0x425b1b; }


x86 assembly (clang, -O0):
<is_down>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x425b1b,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_down>:
xor    %eax,%eax
cmp    $0x425b1b,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_down(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 4348699
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_down(i32 %0) {
%2 = icmp eq i32 %0, 4348699
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void err_sys(char *str) {
  perror(str);
  exit(errno);
}


x86 assembly (clang, -O0):
<err_sys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_sys>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
define void @err_sys(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @errno
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
define void @err_sys(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @errno
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int calc_hTiles(int height) {
  return ((((height) + (32 - 1)) & ~(32 - 1)) / 32);
}


x86 assembly (clang, -O0):
<calc_hTiles>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1f,%eax
and    $0xffffffe0,%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_hTiles>:
lea    0x1f(%rdi),%ecx
and    $0xffffffe0,%ecx
lea    0x1f(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @calc_hTiles(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 31
%5 = and i32 %4, -32
%6 = sdiv i32 %5, 32
ret i32 %6
}

LLVM IR (-O2):
define i32 @calc_hTiles(i32 %0) {
%2 = add nsw i32 %0, 31
%3 = and i32 %2, -32
%4 = sdiv i32 %3, 32
ret i32 %4
}
/* Variables and functions */
scalar_t__ is_space(char *);
char *consume_spaces(char *c) {
  while (is_space(c)) {
    c++;
  }
  return c;
}


x86 assembly (clang, -O0):
<consume_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_space@plt>
cmp    $0x0,%rax
je     1140 <consume_spaces+0x30>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <consume_spaces+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consume_spaces>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <is_space@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <consume_spaces+0x10>
add    $0xffffffffffffffff,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @consume_spaces(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = call i64 @is_space(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
br label %3
10: ; preds = %3
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @consume_spaces(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = tail call i64 @is_space(i8* %3)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
unsigned char *_EncodeData(unsigned char *, char const *, unsigned int);
unsigned char *SEGGER_SYSVIEW_EncodeData(unsigned char *pPayload,
                                         const char *pSrc,
                                         unsigned int NumBytes) {
  return _EncodeData(pPayload, pSrc, NumBytes);
}


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

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

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

LLVM IR (-O2):
define i8* @SEGGER_SYSVIEW_EncodeData(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @_EncodeData(i8* %0, i8* %1, i32 %2)
ret i8* %4
}
int main(void) {
  int i = 0 + 1;
  if (i != 0)
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1135 <main+0x25>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
tail call void @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void calc() { printf("calc\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"calc\00"
define void @calc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
double lt_double(double a, double b) { return a < b; }


x86 assembly (clang, -O0):
<lt_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt_double>:
cmpltsd %xmm1,%xmm0
movsd  0xef3(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @lt_double(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @lt_double(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
/* Type definitions */
struct readbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_readbuf(struct readbuf *);
void putblock(struct readbuf *rbuf) { free_readbuf(rbuf); }


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

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

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

LLVM IR (-O2):
%struct.readbuf = type { i32 }
define void @putblock(%struct.readbuf* %0) {
%2 = tail call i32 @free_readbuf(%struct.readbuf* %0)
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void error(char *err) {
  fprintf(stderr, "%s errno=%d (%s)\n", err, errno, strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    %rax,%r8
lea    0xe82(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x2ea2(%rip),%rax
mov    (%rax),%ebp
mov    0x2e91(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1050 <strerror@plt>
lea    0xea9(%rip),%rsi
mov    %ebp,%edi
mov    %r14,%rdx
mov    %ebx,%ecx
mov    %rax,%r8
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"%s errno=%d (%s)\0A\00"
@errno = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = load i32, i32* @errno
%7 = call i8* @strerror(i32 %6)
%8 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %5, i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"%s errno=%d (%s)\0A\00"
@errno = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3, i8* %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
int test_andonell(unsigned long long c) { return __builtin_popcountll(c & 1); }


x86 assembly (clang, -O0):
<test_andonell>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
and    $0x1,%rcx
mov    %rcx,%rax
shr    %rax
movabs $0x5555555555555555,%rdx
55 55 55
and    %rdx,%rax
sub    %rax,%rcx
movabs $0x3333333333333333,%rdx
33 33 33
mov    %rcx,%rax
and    %rdx,%rax
shr    $0x2,%rcx
and    %rdx,%rcx
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
add    %rcx,%rax
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
and    %rcx,%rax
movabs $0x101010101010101,%rcx
01 01 01
imul   %rcx,%rax
shr    $0x38,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_andonell>:
mov    %rdi,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_andonell(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 1
%5 = call i64 @llvm.ctpop.i64(i64 %4)
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_andonell(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ sort3(int *, int *, int *);
int main(void) {
  int x = 5, y = 2, z = 7;
  printf("%d, %d, %d: ", x, y, z);
  sort3(&x, &y, &z);
  printf("%d, %d, %d\n", x, y, z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x7,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <sort3@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x5,0x14(%rsp)
movl   $0x2,0x10(%rsp)
movl   $0x7,0xc(%rsp)
lea    0xebd(%rip),%rdi
mov    $0x5,%esi
mov    $0x2,%edx
mov    $0x7,%ecx
call   1030 <printf@plt>
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1040 <sort3@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"%d, %d, %d: \00"
@.str.1 = [12 x i8] c"%d, %d, %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 7, i32* %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 5, i32 2, i32 7)
%8 = call i32 @sort3(i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char *, char const *);
int has_timestamp(const char *fmt) {
  if (strcmp("%s", fmt) == 0 || strcmp("%f", fmt) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<has_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1150 <has_timestamp+0x40>
mov    -0x10(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115c <has_timestamp+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <has_timestamp+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_timestamp>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1144 <has_timestamp+0x34>
lea    0xed4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @has_timestamp(i8* %0) {
%2 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
char is_str_prefix(char *str, char *prefix) {
  int len;
  if (str == NULL || prefix == NULL)
    return 0;
  len = strlen(prefix);
  return (strncmp(str, prefix, len) == 0);
}


x86 assembly (clang, -O0):
<is_str_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <is_str_prefix+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    114f <is_str_prefix+0x2f>
movb   $0x0,-0x1(%rbp)
jmp    117a <is_str_prefix+0x5a>
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_str_prefix>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
je     1151 <is_str_prefix+0x31>
mov    %rsi,%rbx
test   %rsi,%rsi
je     1151 <is_str_prefix+0x31>
mov    %rdi,%r14
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define signext i8 @is_str_prefix(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = tail call i32 @strlen(i8* %1)
%8 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i8
br label %11
11: ; preds = %2, %6
%12 = phi i8 [ %10, %6 ], [ 0, %2 ]
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ use_stuff(int);
int g(int b, int c) {
  int i;
  for (i = 0; i < b; i++)
    use_stuff(c);
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1147 <g+0x37>
mov    -0xc(%rbp),%edi
call   1030 <use_stuff@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1125 <g+0x15>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    112c <g+0x1c>
mov    %esi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <use_stuff@plt>
add    $0xffffffff,%ebp
jne    1120 <g+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @g(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %14, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i32, i32* %5
%13 = call i32 @use_stuff(i32 %12)
br label %14
14: ; preds = %11
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 1
store i32 %16, i32* %6
br label %7
17: ; preds = %7
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @use_stuff(i32 %1)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, long long);
extern void mem_cpy(void *dest, const void *src, long long size) {
  memcpy(dest, src, size);
}


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

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

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

LLVM IR (-O2):
define void @mem_cpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
unsigned long blz_workmem_size(unsigned long src_size) {
  (void)src_size;
  return ((1UL << 17) * sizeof(const unsigned char *));
}


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

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

LLVM IR (-O0):
define i64 @blz_workmem_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 1048576
}

LLVM IR (-O2):
define i64 @blz_workmem_size(i64 %0) {
ret i64 1048576
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  int i;
  for (i = 0; i > 10; i++) {
    puts("Hello world!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jle    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void foo443() {}


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

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

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

LLVM IR (-O2):
define void @foo443() {
ret void
}
__attribute__((always_)) void serialise(void) {
  __asm__ __volatile__("				\n"
                       "	movl	$0, %%eax	\n"
                       "	cpuid			\n"
                       :
                       :
                       : "cc", "memory", "rax", "rbx", "rcx", "rdx");
}


x86 assembly (clang, -O0):
<serialise>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x0,%eax
cpuid
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialise>:
push   %rbx
mov    $0x0,%eax
cpuid
pop    %rbx
ret

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

LLVM IR (-O2):
define void @serialise() {
tail call void asm sideeffect "\09\09\09\09\0A\09movl\09$$0, %eax\09\0A\09cpuid\09\09\09\0A", "~{cc},~{memory},~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"()
ret void
}