xunge/DecIR huggingface dataset:
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ xalloc_die();
void *xmalloc(size_t n) {
  void *p;
  p = malloc(n);
  if (p == 0)
    xalloc_die();
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xmalloc+0x2b>
mov    $0x0,%al
call   1030 <xalloc_die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xmalloc+0x15>
xor    %eax,%eax
call   1030 <xalloc_die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @xalloc_die()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @xalloc_die()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int sum(int x, int y) { return x = y; }


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

x86 assembly (clang, -O2):
<sum>:
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
scalar_t__ Malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *Strdup(char *s) {
  char *p = (char *)Malloc(strlen(s) + 1);
  strcpy(p, s);
  return (p);
}


x86 assembly (clang, -O0):
<Strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1030 <Malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1030 <Malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @Strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @Malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @Strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @Malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
int test_imm_DBuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xDB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DBuint64_highword_reg>:
movabs $0xdb00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_DBuint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 219
%6 = icmp ne i64 %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_DBuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 940597837824
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void RGMhidecur(void) {}


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

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

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

LLVM IR (-O2):
define void @RGMhidecur() {
ret void
}
/* Variables and functions */
int jffs2_compressor_Xable(char const *, int);
int jffs2_disable_compressor_name(const char *name) {
  return jffs2_compressor_Xable(name, 1);
}


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

x86 assembly (clang, -O2):
<jffs2_disable_compressor_name>:
mov    $0x1,%esi
jmp    1030 <jffs2_compressor_Xable@plt>

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

LLVM IR (-O2):
define i32 @jffs2_disable_compressor_name(i8* %0) {
%2 = tail call i32 @jffs2_compressor_Xable(i8* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
__attribute__((no)) void call_and_print(const char *(*fun)()) {
  printf("%s\n", fun());
}


x86 assembly (clang, -O0):
<call_and_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
mov    %rax,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_and_print>:
push   %rax
xor    %eax,%eax
call   *%rdi
lea    0xee4(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @call_and_print(i8* (...)* nocapture %0) {
%2 = tail call i8* (...) %0()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
int max(int one, int two) {
  if (one > two) {
    return one;
  }
  return two;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%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
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ reportAnswer(int, int);
void reverseAdd(int x) { reportAnswer(1, x - 1); }


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

x86 assembly (clang, -O2):
<reverseAdd>:
lea    -0x1(%rdi),%esi
mov    $0x1,%edi
jmp    1030 <reportAnswer@plt>

LLVM IR (-O0):
define void @reverseAdd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = call i32 @reportAnswer(i32 1, i32 %4)
ret void
}

LLVM IR (-O2):
define void @reverseAdd(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = tail call i32 @reportAnswer(i32 1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
int _mm256_cvtsi256_si32(int /*<<< orphan*/);
int test_mm256_cvtsi256_si32(__m256i __a) { return _mm256_cvtsi256_si32(__a); }


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

x86 assembly (clang, -O2):
<test_mm256_cvtsi256_si32>:
jmp    1030 <_mm256_cvtsi256_si32@plt>

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

LLVM IR (-O2):
define i32 @test_mm256_cvtsi256_si32(i32 %0) {
%2 = tail call i32 @_mm256_cvtsi256_si32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int TIOCM_CTS;
int get_mlines(int);
int get_cts(int fd) {
  if (get_mlines(fd) & TIOCM_CTS)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<get_cts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <get_mlines@plt>
mov    0x2eb6(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1141 <get_cts+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <get_cts+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cts>:
push   %rax
call   1030 <get_mlines@plt>
mov    0x2ec3(%rip),%rdx
xor    %ecx,%ecx
test   %eax,(%rdx)
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@TIOCM_CTS = global i32 0
define i32 @get_cts(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @get_mlines(i32 %4)
%6 = load i32, i32* @TIOCM_CTS
%7 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@TIOCM_CTS = global i32 0
define i32 @get_cts(i32 %0) {
%2 = tail call i32 @get_mlines(i32 %0)
%3 = load i32, i32* @TIOCM_CTS
%4 = and i32 %3, %2
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ int_fast16_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_int_fast16_t(int_fast16_t const k1,
                                         int_fast16_t const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_LESS_int_fast16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_LESS_int_fast16_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_LESS_int_fast16_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_int_fast16_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int mpic_setup_error_int(struct mpic *mpic, int intvec) { return -1; }


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

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

LLVM IR (-O0):
%struct.mpic = type opaque
define i32 @mpic_setup_error_int(%struct.mpic* %0, i32 %1) {
%3 = alloca %struct.mpic*
%4 = alloca i32
store %struct.mpic* %0, %struct.mpic** %3
store i32 %1, i32* %4
ret i32 -1
}

LLVM IR (-O2):
%struct.mpic = type opaque
define i32 @mpic_setup_error_int(%struct.mpic* nocapture readnone %0, i32 %1) {
ret i32 -1
}
int maxof(int x, int y) { return (x > y ? x : y); }


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

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

LLVM IR (-O0):
define i32 @maxof(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 @maxof(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ GenPrintInstr3Operands(int, int /*<<< orphan*/, int,
                                          int /*<<< orphan*/, int,
                                          int /*<<< orphan*/, int, int);
int /*<<< orphan*/ printf2(char *);
void GenJumpIfZero(int label) {
  printf2(" # JumpIfZero\n");
  GenPrintInstr3Operands(0x21, 0, 0x02, 0, 0x00, 0, 0x82, label);
}


x86 assembly (clang, -O0):
<GenJumpIfZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf2@plt>
mov    -0x4(%rbp),%eax
mov    $0x21,%edi
xor    %r9d,%r9d
mov    $0x2,%edx
mov    %r9d,%esi
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x82,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <GenPrintInstr3Operands@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenJumpIfZero>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <printf2@plt>
mov    $0x21,%edi
xor    %esi,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rbx
push   $0x82
call   1040 <GenPrintInstr3Operands@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c" # JumpIfZero\0A\00"
define void @GenJumpIfZero(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf2(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @GenPrintInstr3Operands(i32 33, i32 0, i32 2, i32 0, i32 0, i32 0, i32 130, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c" # JumpIfZero\0A\00"
define void @GenJumpIfZero(i32 %0) {
%2 = tail call i32 @printf2(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @GenPrintInstr3Operands(i32 33, i32 0, i32 2, i32 0, i32 0, i32 0, i32 130, i32 %0)
ret void
}
void g_strv_length() {}


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

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

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

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

/* Variables and functions */
float atan2f(float, int /*<<< orphan*/);
float __ratn2d(float x, float_t y) {
  return (atan2f(x, y) * 57.29577951308232F);
}


x86 assembly (clang, -O0):
<__ratn2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1030 <atan2f@plt>
movss  0xecb(%rip),%xmm1
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ratn2d>:
push   %rax
call   1030 <atan2f@plt>
mulss  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @__ratn2d(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = call float @atan2f(float %5, i32 %6)
%8 = fmul float %7, 0x404CA5DC20000000
ret float %8
}

LLVM IR (-O2):
define float @__ratn2d(float %0, i32 %1) {
%3 = tail call float @atan2f(float %0, i32 %1)
%4 = fmul float %3, 0x404CA5DC20000000
ret float %4
}
double vde_chain_nm3_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<vde_chain_nm3_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <vde_chain_nm3_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <vde_chain_nm3_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <vde_chain_nm3_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <vde_chain_nm3_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm3_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @vde_chain_nm3_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
void _Jv_AllocObject() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_AllocObject() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *prog) {
  printf("Usage: %s [OPTIONS] DIRECTORY\n\nOPTIONS are:\n  -h, --help ....... "
         "usage\n  -u, --user ....... userame\n  -n, --new-user ... new "
         "username\n",
         prog);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [135 x i8] c"Usage: %s [OPTIONS] DIRECTORY\0A\0AOPTIONS are:\0A -h, --help ....... usage\0A -u, --user ....... userame\0A -n, --new-user ... new username\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [135 x i8] c"Usage: %s [OPTIONS] DIRECTORY\0A\0AOPTIONS are:\0A -h, --help ....... usage\0A -u, --user ....... userame\0A -n, --new-user ... new username\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int gimme_three(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @gimme_three() {
ret i32 3
}

LLVM IR (-O2):
define i32 @gimme_three() {
ret i32 3
}
/* Type definitions */
struct http_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buffered_send(struct http_connection *, char const *,
                                 int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void send_str(struct http_connection *conn, const char *str) {
  buffered_send(conn, str, strlen(str));
}


x86 assembly (clang, -O0):
<send_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <buffered_send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_str>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <buffered_send@plt>

LLVM IR (-O0):
%struct.http_connection = type { i32 }
define void @send_str(%struct.http_connection* %0, i8* %1) {
%3 = alloca %struct.http_connection*
%4 = alloca i8*
store %struct.http_connection* %0, %struct.http_connection** %3
store i8* %1, i8** %4
%5 = load %struct.http_connection*, %struct.http_connection** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @buffered_send(%struct.http_connection* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.http_connection = type { i32 }
define void @send_str(%struct.http_connection* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @buffered_send(%struct.http_connection* %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void gprsharp_free() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<gprsharp_free>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @gprsharp_free() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @gprsharp_free() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
__attribute__((no, noclone)) void bar(int x, int y) {
  asm volatile("" ::"g"(x), "g"(y) : "memory");
  if (y == 0)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
mov    %ecx,-0xc(%rbp)
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1139 <bar+0x29>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
mov    %esi,(%rsp)
mov    %edi,0x4(%rsp)
test   %esi,%esi
je     111e <bar+0xe>
pop    %rax
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define void @bar(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 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
unreachable
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0, i32 %1) {
tail call void asm sideeffect "", "imr,imr,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %2
tail call void @abort()
unreachable
5: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void extern_c_1_func(void) { printf("extern_c_1_func!\n"); }


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"extern_c_1_func!\00"
define void @extern_c_1_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
int ti_ad_start(double const *options) {
  (void)options;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ti_ad_start(double* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int ResExistFile(char *fileName) {
  int retval = 0;
  FILE *tmpFile;
  tmpFile = fopen(fileName, "r");
  if (tmpFile) {
    fclose(tmpFile);
    retval = 1;
  }
  return retval;
}


x86 assembly (clang, -O0):
<ResExistFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1162 <ResExistFile+0x42>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ResExistFile>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <ResExistFile+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @ResExistFile(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
unsigned int strlen(char *);
void chomp(char *str) {
  for (unsigned int i = 0; i < strlen(str); i++) {
    if (str[i] <= 0x0d) {
      str[i] = '\0';
    }
  }
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jae    1171 <chomp+0x61>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0xd,%eax
jg     115e <chomp+0x4e>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
jmp    1163 <chomp+0x53>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <chomp+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
je     1151 <chomp+0x41>
xor    %ebx,%ebx
jmp    1143 <chomp+0x33>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%eax
cmp    %rax,%rbx
jae    1151 <chomp+0x41>
cmpb   $0xd,(%r14,%rbx,1)
jg     1130 <chomp+0x20>
movb   $0x0,(%r14,%rbx,1)
jmp    1130 <chomp+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @chomp(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %11, %1
ret void
5: ; preds = %1, %11
%6 = phi i64 [ %12, %11 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp slt i8 %8, 14
br i1 %9, label %10, label %11
10: ; preds = %5
store i8 0, i8* %7
br label %11
11: ; preds = %5, %10
%12 = add nuw nsw i64 %6, 1
%13 = tail call i32 @strlen(i8* %0)
%14 = zext i32 %13 to i64
%15 = icmp ult i64 %12, %14
br i1 %15, label %5, label %4
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ perrordie(char *);
void *safe_calloc(size_t nm, size_t s) {
  void *r = calloc(nm, s);
  if (r == NULL)
    perrordie("calloc");
  return r;
}


x86 assembly (clang, -O0):
<safe_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <safe_calloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <perrordie@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_calloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <safe_calloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <perrordie@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"calloc\00"
define noalias i8* @safe_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perrordie(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t h265hvcc_array_get_num_nalus(const uint8_t *p) {
  return (p[1] << 8) | p[2];
}


x86 assembly (clang, -O0):
<h265hvcc_array_get_num_nalus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x8(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_array_get_num_nalus>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
or     0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @h265hvcc_array_get_num_nalus(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @h265hvcc_array_get_num_nalus(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "usage: %s <-l> [datafile]\n", progname);
  fprintf(stderr, "options: -l output logarithmic scale\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"usage: %s <-l> [datafile]\0A\00"
@.str.1 = [38 x i8] c"options: -l output logarithmic scale\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"usage: %s <-l> [datafile]\0A\00"
@.str.1 = [38 x i8] c"options: -l output logarithmic scale\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct sys_thread {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sched_yield();
int /*<<< orphan*/ sys_vm2_enter(struct sys_thread *);
int /*<<< orphan*/ sys_vm2_leave(struct sys_thread *);
void sys_thread_switch(struct sys_thread *td) {
  sys_vm2_leave(td);
  sched_yield();
  sys_vm2_enter(td);
}


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

x86 assembly (clang, -O2):
<sys_thread_switch>:
push   %rbx
mov    %rdi,%rbx
call   1050 <sys_vm2_leave@plt>
xor    %eax,%eax
call   1040 <sched_yield@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <sys_vm2_enter@plt>

LLVM IR (-O0):
%struct.sys_thread = type { i32 }
define void @sys_thread_switch(%struct.sys_thread* %0) {
%2 = alloca %struct.sys_thread*
store %struct.sys_thread* %0, %struct.sys_thread** %2
%3 = load %struct.sys_thread*, %struct.sys_thread** %2
%4 = call i32 @sys_vm2_leave(%struct.sys_thread* %3)
%5 = call i32 (...) @sched_yield()
%6 = load %struct.sys_thread*, %struct.sys_thread** %2
%7 = call i32 @sys_vm2_enter(%struct.sys_thread* %6)
ret void
}

LLVM IR (-O2):
%struct.sys_thread = type { i32 }
define void @sys_thread_switch(%struct.sys_thread* %0) {
%2 = tail call i32 @sys_vm2_leave(%struct.sys_thread* %0)
%3 = tail call i32 (...) @sched_yield()
%4 = tail call i32 @sys_vm2_enter(%struct.sys_thread* %0)
ret void
}
int qsort_cmp_uchar(const void *x, const void *y) {
  if (*((unsigned char *)x) < *((unsigned char *)y))
    return (-1);
  else
    return (*((unsigned char *)x) > *((unsigned char *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jge    112e <qsort_cmp_uchar+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1149 <qsort_cmp_uchar+0x49>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp_uchar>:
mov    (%rdi),%al
xor    %ecx,%ecx
cmp    (%rsi),%al
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @qsort_cmp_uchar(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ult i8 %3, %4
%6 = icmp ugt i8 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
void RAWToRGBARow_Any_NEON() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ WAIT_ANY;
int WNOHANG;
int WUNTRACED;
int /*<<< orphan*/ mark_process_status(int /*<<< orphan*/, int);
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int *, int);
void update_status(void) {
  int status;
  pid_t pid;
  do
    pid = waitpid(WAIT_ANY, &status, WUNTRACED | WNOHANG);
  while (!mark_process_status(pid, status));
}


x86 assembly (clang, -O0):
<update_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    0x2e98(%rip),%rax
mov    (%rax),%edx
mov    0x2ea7(%rip),%rax
or     (%rax),%edx
lea    -0x4(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <mark_process_status@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1128 <update_status+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_status>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2eb1(%rip),%r14
mov    0x2e9a(%rip),%r15
mov    0x2eab(%rip),%r12
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%edi
mov    (%r12),%edx
or     (%r15),%edx
mov    %rbx,%rsi
call   1040 <waitpid@plt>
mov    0x4(%rsp),%esi
mov    %eax,%edi
call   1030 <mark_process_status@plt>
test   %eax,%eax
je     1150 <update_status+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@WAIT_ANY = global i32 0
@WUNTRACED = global i32 0
@WNOHANG = global i32 0
define void @update_status() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* @WAIT_ANY
%5 = load i32, i32* @WUNTRACED
%6 = load i32, i32* @WNOHANG
%7 = or i32 %5, %6
%8 = call i32 @waitpid(i32 %4, i32* %1, i32 %7)
store i32 %8, i32* %2
br label %9
9: ; preds = %3
%10 = load i32, i32* %2
%11 = load i32, i32* %1
%12 = call i32 @mark_process_status(i32 %10, i32 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br i1 %14, label %3, label %15
15: ; preds = %9
ret void
}

LLVM IR (-O2):
@WAIT_ANY = global i32 0
@WUNTRACED = global i32 0
@WNOHANG = global i32 0
define void @update_status() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = load i32, i32* @WAIT_ANY
%5 = load i32, i32* @WUNTRACED
%6 = load i32, i32* @WNOHANG
%7 = or i32 %6, %5
%8 = call i32 @waitpid(i32 %4, i32* %1, i32 %7)
%9 = load i32, i32* %1
%10 = call i32 @mark_process_status(i32 %8, i32 %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %3, label %12
12: ; preds = %3
ret void
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
char tokencmp(char **pnt, char *token) {
  int n = strlen(token);
  if (!strncmp(*pnt, token, n)) {
    *pnt += n;
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<tokencmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1174 <tokencmp+0x54>
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
movb   $0x1,-0x1(%rbp)
jmp    1178 <tokencmp+0x58>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tokencmp>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    (%r14),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1149 <tokencmp+0x29>
xor    %eax,%eax
jmp    1151 <tokencmp+0x31>
movslq %ebp,%rax
add    %rax,(%r14)
mov    $0x1,%al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @tokencmp(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** %5
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %6
%9 = load i8**, i8*** %4
%10 = load i8*, i8** %9
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @strncmp(i8* %10, i8* %11, i32 %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %21, label %15
15: ; preds = %2
%16 = load i32, i32* %6
%17 = load i8**, i8*** %4
%18 = load i8*, i8** %17
%19 = sext i32 %16 to i64
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8* %20, i8** %17
store i8 1, i8* %3
br label %22
21: ; preds = %2
store i8 0, i8* %3
br label %22
22: ; preds = %21, %15
%23 = load i8, i8* %3
ret i8 %23
}

LLVM IR (-O2):
define signext i8 @tokencmp(i8** nocapture %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = load i8*, i8** %0
%5 = tail call i32 @strncmp(i8* %4, i8* %1, i32 %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %0
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds i8, i8* %8, i64 %9
store i8* %10, i8** %0
br label %11
11: ; preds = %2, %7
%12 = phi i8 [ 1, %7 ], [ 0, %2 ]
ret i8 %12
}
/* Type definitions */
typedef int uint8_t;
typedef int const int8_t;

/* Variables and functions */
int8_t le_to_i8(const uint8_t *buf) {
  return *buf < 0x80 ? *buf : -((int8_t)(0xff - *buf)) - 1;
}


x86 assembly (clang, -O0):
<le_to_i8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x80,(%rax)
jge    1126 <le_to_i8+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    113b <le_to_i8+0x3b>
mov    -0x8(%rbp),%rax
mov    $0xff,%ecx
sub    (%rax),%ecx
xor    %eax,%eax
sub    %ecx,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_to_i8>:
mov    (%rdi),%ecx
lea    -0x100(%rcx),%eax
cmp    $0x80,%ecx
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @le_to_i8(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 128
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
br label %15
9: ; preds = %1
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = sub nsw i32 255, %11
%13 = sub nsw i32 0, %12
%14 = sub nsw i32 %13, 1
br label %15
15: ; preds = %9, %6
%16 = phi i32 [ %8, %6 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @le_to_i8(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp slt i32 %2, 128
%4 = add i32 %2, -256
%5 = select i1 %3, i32 %2, i32 %4
ret i32 %5
}
/* Variables and functions */
int random_num(int);
int random_n(int min, int max) { return random_num(max - min) + min; }


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

x86 assembly (clang, -O2):
<random_n>:
push   %rbx
mov    %edi,%ebx
sub    %edi,%esi
mov    %esi,%edi
call   1030 <random_num@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random_n(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
%8 = call i32 @random_num(i32 %7)
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @random_n(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = tail call i32 @random_num(i32 %3)
%5 = add nsw i32 %4, %0
ret i32 %5
}
int fix_tri(int *pnV, double *vertex, int *pnF, int *face) {
  (void)pnV, (void)vertex, (void)pnF, (void)face;
  return 0;
}


x86 assembly (clang, -O0):
<fix_tri>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fix_tri(i32* %0, double* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca double*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store double* %1, double** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load double*, double** %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @fix_tri(i32* nocapture readnone %0, double* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
ret i32 0
}
unsigned int too_big(unsigned int *p) { return *(p + 0x400); }


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

x86 assembly (clang, -O2):
<too_big>:
mov    0x1000(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @too_big(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1024
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @too_big(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1024
%3 = load i32, i32* %2
ret i32 %3
}