xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ loff_t;

/* Variables and functions */
loff_t __VERIFIER_nondet_loff_t() { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p256_to_bytes(uintptr_t, uintptr_t);
void fiat_p256_to_bytes(uint8_t out1[32], const uint32_t arg1[8]) {
  internal_fiat_p256_to_bytes((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p256_to_bytes>:
jmp    1030 <internal_fiat_p256_to_bytes@plt>

LLVM IR (-O0):
define void @fiat_p256_to_bytes(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p256_to_bytes(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p256_to_bytes(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p256_to_bytes(i64 %3, i64 %4)
ret void
}
void(CONSUME4)() {}


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

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

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

LLVM IR (-O2):
define void @CONSUME4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void baselineLE(unsigned a) {
  char *b = ((void *)0);
  if (a <= 0)
    b = malloc(1);
  if (a == 0)
    free(b);
  return;
}


x86 assembly (clang, -O0):
<baselineLE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
ja     114b <baselineLE+0x2b>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    115e <baselineLE+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baselineLE>:
test   %edi,%edi
je     1125 <baselineLE+0x5>
ret
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @baselineLE(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = load i32, i32* %2
%5 = icmp ule i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i8* @malloc(i32 1)
store i8* %7, i8** %3
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
br label %14
14: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
define void @baselineLE(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %1, %3
ret void
}
void noop() { return; }


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

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

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

LLVM IR (-O2):
define void @noop() {
ret void
}
void d2i_PKCS7_ENVELOPE(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_PKCS7_ENVELOPE() {
ret void
}
int bitstream_read_bit(char **b, unsigned int *bit_pos) {
  unsigned int byte_offset = (*bit_pos - *bit_pos % 8) / 8;
  unsigned int bit_offset = *bit_pos % 8;
  unsigned char *ptr = (unsigned char *)*b + byte_offset;
  unsigned char val = *ptr;
  val <<= bit_offset;
  val >>= 8 - 1;
  *bit_pos += 1;
  return val == 1;
}


x86 assembly (clang, -O0):
<bitstream_read_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
and    $0x7,%ecx
sub    %ecx,%eax
shr    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x7,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x14(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x21(%rbp)
mov    -0x18(%rbp),%ecx
movzbl -0x21(%rbp),%eax
shl    %cl,%eax
mov    %al,-0x21(%rbp)
movzbl -0x21(%rbp),%eax
sar    $0x7,%eax
mov    %al,-0x21(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
movzbl -0x21(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitstream_read_bit>:
mov    (%rsi),%ecx
mov    %rcx,%rax
shr    $0x3,%rax
mov    (%rdi),%rdx
movzbl (%rdx,%rax,1),%eax
lea    0x1(%rcx),%edx
and    $0x7,%cl
shl    %cl,%eax
mov    %edx,(%rsi)
movzbl %al,%eax
shr    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @bitstream_read_bit(i8** %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8
store i8** %0, i8*** %3
store i32* %1, i32** %4
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = urem i32 %12, 8
%14 = sub i32 %10, %13
%15 = udiv i32 %14, 8
store i32 %15, i32* %5
%16 = load i32*, i32** %4
%17 = load i32, i32* %16
%18 = urem i32 %17, 8
store i32 %18, i32* %6
%19 = load i8**, i8*** %3
%20 = load i8*, i8** %19
%21 = load i32, i32* %5
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8* %23, i8** %7
%24 = load i8*, i8** %7
%25 = load i8, i8* %24
store i8 %25, i8* %8
%26 = load i32, i32* %6
%27 = load i8, i8* %8
%28 = zext i8 %27 to i32
%29 = shl i32 %28, %26
%30 = trunc i32 %29 to i8
store i8 %30, i8* %8
%31 = load i8, i8* %8
%32 = zext i8 %31 to i32
%33 = ashr i32 %32, 7
%34 = trunc i32 %33 to i8
store i8 %34, i8* %8
%35 = load i32*, i32** %4
%36 = load i32, i32* %35
%37 = add i32 %36, 1
store i32 %37, i32* %35
%38 = load i8, i8* %8
%39 = zext i8 %38 to i32
%40 = icmp eq i32 %39, 1
%41 = zext i1 %40 to i32
ret i32 %41
}

LLVM IR (-O2):
define i32 @bitstream_read_bit(i8** nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = and i32 %3, 7
%5 = lshr i32 %3, 3
%6 = load i8*, i8** %0
%7 = zext i32 %5 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = add i32 %3, 1
store i32 %11, i32* %1
%12 = lshr i32 128, %4
%13 = and i32 %12, %10
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ R_FDL_IFct_WriteMemoryU16(int, int);
void R_FDL_FCUFct_Suspend(void) {
  R_FDL_IFct_WriteMemoryU16((0xFFA20000uL), (0xB0u));
}


x86 assembly (clang, -O0):
<R_FDL_FCUFct_Suspend>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffa20000,%edi
mov    $0xb0,%esi
call   1030 <R_FDL_IFct_WriteMemoryU16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_FDL_FCUFct_Suspend>:
mov    $0xffa20000,%edi
mov    $0xb0,%esi
jmp    1030 <R_FDL_IFct_WriteMemoryU16@plt>

LLVM IR (-O0):
define void @R_FDL_FCUFct_Suspend() {
%1 = call i32 @R_FDL_IFct_WriteMemoryU16(i32 -6160384, i32 176)
ret void
}

LLVM IR (-O2):
define void @R_FDL_FCUFct_Suspend() {
%1 = tail call i32 @R_FDL_IFct_WriteMemoryU16(i32 -6160384, i32 176)
ret void
}
/* Variables and functions */
int genrand64_int64();
__attribute__((unused)) double genrand64_real2(void) {
  return (genrand64_int64() >> 11) * (1.0 / 9007199254740992.0);
}


x86 assembly (clang, -O0):
<genrand64_real2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <genrand64_int64@plt>
sar    $0xb,%eax
cvtsi2sd %eax,%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand64_real2>:
push   %rax
xor    %eax,%eax
call   1030 <genrand64_int64@plt>
sar    $0xb,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xed9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @genrand64_real2() {
%1 = call i32 (...) @genrand64_int64()
%2 = ashr i32 %1, 11
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3CA0000000000000
ret double %4
}

LLVM IR (-O2):
define double @genrand64_real2() {
%1 = tail call i32 (...) @genrand64_int64()
%2 = ashr i32 %1, 11
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3CA0000000000000
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ Linux_Start();
int main(int argc, const char *argv[]) {
  Linux_Start();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <Linux_Start@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @Linux_Start()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Linux_Start()
ret i32 0
}
/* Variables and functions */
scalar_t__ wMalloc(int);
char *wCharMalloc(int length) {
  char *buffer;
  buffer = (char *)wMalloc(length);
  buffer[0] = '\0';
  return buffer;
}


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

x86 assembly (clang, -O2):
<wCharMalloc>:
push   %rax
call   1030 <wMalloc@plt>
movb   $0x0,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @wCharMalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @wMalloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 0, i8* %8
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @wCharMalloc(i32 %0) {
%2 = tail call i64 @wMalloc(i32 %0)
%3 = inttoptr i64 %2 to i8*
store i8 0, i8* %3
ret i8* %3
}
/* Type definitions */
typedef long uint8_t;
typedef long uint32_t;

/* Variables and functions */
long get_millisecond_timer();
uint8_t hours8(void) {
  uint32_t ms = get_millisecond_timer();
  uint8_t h8;
  h8 = (ms / (3600000L)) & 0xFF;
  return h8;
}


x86 assembly (clang, -O0):
<hours8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_millisecond_timer@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x36ee80,%ecx
cqto
idiv   %rcx
and    $0xff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hours8>:
push   %rax
xor    %eax,%eax
call   1030 <get_millisecond_timer@plt>
movabs $0x4a90be587de6e565,%rcx
be 90 4a
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x14,%edx
add    %eax,%edx
movzbl %dl,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @hours8() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @get_millisecond_timer()
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = sdiv i64 %4, 3600000
%6 = and i64 %5, 255
store i64 %6, i64* %2
%7 = load i64, i64* %2
ret i64 %7
}

LLVM IR (-O2):
define i64 @hours8() {
%1 = tail call i64 (...) @get_millisecond_timer()
%2 = sdiv i64 %1, 3600000
%3 = and i64 %2, 255
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ init_bitboard();
int /*<<< orphan*/ init_magic();
int /*<<< orphan*/ init_pst();
int /*<<< orphan*/ init_zobrist();
int /*<<< orphan*/ print_pst();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ test_perft();
int main() {
  init_magic();
  init_bitboard();
  init_zobrist();
  init_pst();
  print_pst();
  if (!test_perft())
    puts("incorrect perft");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1090 <init_magic@plt>
mov    $0x0,%al
call   1060 <init_bitboard@plt>
mov    $0x0,%al
call   1030 <init_zobrist@plt>
mov    $0x0,%al
call   1070 <init_pst@plt>
mov    $0x0,%al
call   1050 <print_pst@plt>
mov    $0x0,%al
call   1080 <test_perft@plt>
cmp    $0x0,%eax
jne    11be <main+0x4e>
lea    0xe47(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1090 <init_magic@plt>
xor    %eax,%eax
call   1060 <init_bitboard@plt>
xor    %eax,%eax
call   1030 <init_zobrist@plt>
xor    %eax,%eax
call   1070 <init_pst@plt>
xor    %eax,%eax
call   1050 <print_pst@plt>
xor    %eax,%eax
call   1080 <test_perft@plt>
test   %eax,%eax
jne    11ab <main+0x3b>
lea    0xe5a(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"incorrect perft\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init_magic()
%3 = call i32 (...) @init_bitboard()
%4 = call i32 (...) @init_zobrist()
%5 = call i32 (...) @init_pst()
%6 = call i32 (...) @print_pst()
%7 = call i32 (...) @test_perft()
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"incorrect perft\00"
define i32 @main() {
%1 = tail call i32 (...) @init_magic()
%2 = tail call i32 (...) @init_bitboard()
%3 = tail call i32 (...) @init_zobrist()
%4 = tail call i32 (...) @init_pst()
%5 = tail call i32 (...) @print_pst()
%6 = tail call i32 (...) @test_perft()
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
ret i32 0
}
const char *gg_libgadu_version() { return "CVS"; }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"CVS\00"
define i8* @gg_libgadu_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"CVS\00"
define i8* @gg_libgadu_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
int addTwoNumbers(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<addTwoNumbers>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @addTwoNumbers(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @addTwoNumbers(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
char *cvt(long double, int, int *, int *, int /*<<< orphan*/);
char *_fcvt(long double value, int ndigit, int *decpt, int *sign) {
  return (cvt(value, ndigit, decpt, sign, 0));
}


x86 assembly (clang, -O0):
<_fcvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
fldt   -0x10(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    %rsp,%rax
fstpt  (%rax)
xor    %ecx,%ecx
call   1030 <cvt@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fcvt>:
xor    %ecx,%ecx
jmp    1030 <cvt@plt>

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

LLVM IR (-O2):
define i8* @_fcvt(x86_fp80 %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i8* @cvt(x86_fp80 %0, i32 %1, i32* %2, i32* %3, i32 0)
ret i8* %5
}
int isalpha(int c) {
  return (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')));
}


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <isalpha+0x20>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113f <isalpha+0x3f>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1139 <isalpha+0x39>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int tar(int);
void bug(int q, int bcount) {
  int j = 0;
  int outgo = 0;
  while (j != -1) {
    outgo++;
    if (outgo > q - 1)
      outgo = q - 1;
    j = tar(outgo * bcount);
  }
}


x86 assembly (clang, -O0):
<bug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
je     116d <bug+0x5d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jle    1159 <bug+0x49>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
imul   -0x8(%rbp),%edi
call   1030 <tar@plt>
mov    %eax,-0xc(%rbp)
jmp    112c <bug+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bug>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
add    $0xffffffff,%ebp
xor    %ecx,%ecx
xchg   %ax,%ax
lea    0x1(%rcx),%ebx
cmp    %ebp,%ecx
cmovge %ebp,%ebx
mov    %ebx,%edi
imul   %r14d,%edi
call   1030 <tar@plt>
mov    %ebx,%ecx
cmp    $0xffffffff,%eax
jne    1120 <bug+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @bug(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %8, %4 ]
%6 = add nsw i32 %5, 1
%7 = icmp slt i32 %5, %3
%8 = select i1 %7, i32 %6, i32 %3
%9 = mul nsw i32 %8, %1
%10 = tail call i32 @tar(i32 %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %4
12: ; preds = %4
ret void
}
/* Type definitions */
typedef float uint32_t;

/* Variables and functions */
float byteswap4(float);
int /*<<< orphan*/ memcpy(float *, float *, int);
float byteswap_float(float num) {
  uint32_t answer = 0;
  memcpy(&answer, &num, 4);
  answer = byteswap4(answer);
  memcpy(&num, &answer, 4);
  return num;
}


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

x86 assembly (clang, -O2):
<byteswap_float>:
push   %r14
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
movl   $0x0,(%rsp)
mov    %rsp,%r14
lea    0x4(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
movss  (%rsp),%xmm0
call   1030 <byteswap4@plt>
movss  %xmm0,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
movss  0x4(%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float @byteswap_float(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0.000000e+00, float* %3
%4 = call i32 @memcpy(float* %3, float* %2, i32 4)
%5 = load float, float* %3
%6 = call float @byteswap4(float %5)
store float %6, float* %3
%7 = call i32 @memcpy(float* %2, float* %3, i32 4)
%8 = load float, float* %2
ret float %8
}

LLVM IR (-O2):
define float @byteswap_float(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = bitcast float* %3 to i8*
store float 0.000000e+00, float* %3
%5 = call i32 @memcpy(float* %3, float* %2, i32 4)
%6 = load float, float* %3
%7 = call float @byteswap4(float %6)
store float %7, float* %3
%8 = call i32 @memcpy(float* %2, float* %3, i32 4)
%9 = load float, float* %2
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
char *malloc(int);
int /*<<< orphan*/ stdin;
int strlen(char *);
unsigned char *req_linha() {
  char *l = malloc(sizeof(char) * 256);
  while (!fgets(l, 256, stdin))
    ;
  l[strlen(l) - 1] = '\0';
  return (unsigned char *)l;
}


x86 assembly (clang, -O0):
<req_linha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x100,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1040 <fgets@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1172 <req_linha+0x42>
jmp    1177 <req_linha+0x47>
jmp    1146 <req_linha+0x16>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<req_linha>:
push   %r14
push   %rbx
push   %rax
mov    $0x100,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    0x2ea0(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <fgets@plt>
test   %eax,%eax
je     1150 <req_linha+0x20>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
define i8* @req_linha() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 256)
store i8* %2, i8** %1
br label %3
3: ; preds = %9, %0
%4 = load i8*, i8** %1
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 256, i32 %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
%11 = load i8*, i8** %1
%12 = load i8*, i8** %1
%13 = call i32 @strlen(i8* %12)
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %11, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %1
ret i8* %17
}

LLVM IR (-O2):
@stdin = global i32 0
define i8* @req_linha() {
%1 = tail call dereferenceable_or_null(256) i8* @malloc(i32 256)
br label %2
2: ; preds = %2, %0
%3 = load i32, i32* @stdin
%4 = tail call i32 @fgets(i8* %1, i32 256, i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = tail call i32 @strlen(i8* %1)
%8 = add nsw i32 %7, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 %9
store i8 0, i8* %10
ret i8* %1
}
void test_PTHREAD_PRIO_NONE(void) { int dummy = "PTHREAD_PRIO_NONE"; }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"PTHREAD_PRIO_NONE\00"
define void @test_PTHREAD_PRIO_NONE() {
%1 = alloca i32
store i32 ptrtoint ([18 x i8]* @.str to i32), i32* %1
ret void
}

LLVM IR (-O2):
define void @test_PTHREAD_PRIO_NONE() {
ret void
}
int atflags_bsd_to_linux(int flags) {
  int linux_flags = 0;
  if (flags & 0x20)
    linux_flags |= 0x100;
  if (flags & 0x80)
    linux_flags |= 0x200;
  if (flags & 0x40)
    linux_flags |= 0x400;
  return linux_flags;
}


x86 assembly (clang, -O0):
<atflags_bsd_to_linux>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1128 <atflags_bsd_to_linux+0x28>
mov    -0x8(%rbp),%eax
or     $0x100,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1144 <atflags_bsd_to_linux+0x44>
mov    -0x8(%rbp),%eax
or     $0x200,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     115e <atflags_bsd_to_linux+0x5e>
mov    -0x8(%rbp),%eax
or     $0x400,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atflags_bsd_to_linux>:
mov    %edi,%eax
and    $0x20,%eax
shl    $0x3,%eax
mov    %edi,%ecx
and    $0x80,%ecx
lea    (%rax,%rcx,4),%eax
and    $0x40,%edi
shl    $0x4,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @atflags_bsd_to_linux(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = and i32 %4, 32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = or i32 %8, 256
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %2
%12 = and i32 %11, 128
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %3
%16 = or i32 %15, 512
store i32 %16, i32* %3
br label %17
17: ; preds = %14, %10
%18 = load i32, i32* %2
%19 = and i32 %18, 64
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i32, i32* %3
%23 = or i32 %22, 1024
store i32 %23, i32* %3
br label %24
24: ; preds = %21, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @atflags_bsd_to_linux(i32 %0) {
%2 = shl i32 %0, 3
%3 = and i32 %2, 256
%4 = shl i32 %0, 2
%5 = and i32 %4, 512
%6 = or i32 %5, %3
%7 = shl i32 %0, 4
%8 = and i32 %7, 1024
%9 = or i32 %6, %8
ret i32 %9
}
int func(int i) {
  if (i == 0)
    return 1;
  else
    return (i / func(i - 1));
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <func+0x21>
movl   $0x1,-0x4(%rbp)
jmp    114d <func+0x3d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <func@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
test   %edi,%edi
je     1128 <func+0x18>
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1030 <func@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @func(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %8, %5 ], [ 1, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @func(i32 %6)
%8 = sdiv i32 %0, %7
br label %3
}
struct bwb_line *bwb_CSAVE(struct bwb_line *l) {
  bwx_DEBUG(__FUNCTION__);
  return bwb_SAVE(l);
}


x86 assembly (clang, -O0):
<bwb_CSAVE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <bwx_DEBUG@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <bwb_SAVE@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwb_CSAVE>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <bwx_DEBUG@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <bwb_SAVE@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_CSAVE = [10 x i8] c"bwb_CSAVE\00"
define %struct.bwb_line* @bwb_CSAVE(%struct.bwb_line* %0) {
%2 = alloca %struct.bwb_line*
store %struct.bwb_line* %0, %struct.bwb_line** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.bwb_CSAVE, i64 0, i64 0))
%4 = load %struct.bwb_line*, %struct.bwb_line** %2
%5 = call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_SAVE to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.bwb_line*
ret %struct.bwb_line* %7
}

LLVM IR (-O2):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_CSAVE = [10 x i8] c"bwb_CSAVE\00"
define %struct.bwb_line* @bwb_CSAVE(%struct.bwb_line* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.bwb_CSAVE, i64 0, i64 0))
%3 = tail call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_SAVE to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %0)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to %struct.bwb_line*
ret %struct.bwb_line* %5
}
/* Type definitions */
struct timespec {
  int dummy;
};
struct aiocb64 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int aio_suspend64(const struct aiocb64 *const list[], int nent,
                  const struct timespec *timeout) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<aio_suspend64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aio_suspend64>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.aiocb64 = type { i32 }
%struct.timespec = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @aio_suspend64(%struct.aiocb64** %0, i32 %1, %struct.timespec* %2) {
%4 = alloca %struct.aiocb64**
%5 = alloca i32
%6 = alloca %struct.timespec*
store %struct.aiocb64** %0, %struct.aiocb64*** %4
store i32 %1, i32* %5
store %struct.timespec* %2, %struct.timespec** %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.aiocb64 = type { i32 }
%struct.timespec = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @aio_suspend64(%struct.aiocb64** nocapture readnone %0, i32 %1, %struct.timespec* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ switch_off_bits(unsigned char *, int);
int /*<<< orphan*/ switch_on_bits(unsigned char *, int);
void CTRL_REGSC_BITSET_BW1000(unsigned char *data) {
  switch_on_bits(data, (0x80));
  switch_off_bits(data, (0x40 | 0x20));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x80,%esi
call   1030 <switch_on_bits@plt>
mov    -0x8(%rbp),%rdi
mov    $0x60,%esi
call   1040 <switch_off_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %rdi,%rbx
mov    $0x80,%esi
call   1030 <switch_on_bits@plt>
mov    %rbx,%rdi
mov    $0x60,%esi
pop    %rbx
jmp    1040 <switch_off_bits@plt>

LLVM IR (-O0):
define void @CTRL_REGSC_BITSET_BW1000(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @switch_on_bits(i8* %3, i32 128)
%5 = load i8*, i8** %2
%6 = call i32 @switch_off_bits(i8* %5, i32 96)
ret void
}

LLVM IR (-O2):
define void @CTRL_REGSC_BITSET_BW1000(i8* %0) {
%2 = tail call i32 @switch_on_bits(i8* %0, i32 128)
%3 = tail call i32 @switch_off_bits(i8* %0, i32 96)
ret void
}
void foo(int *p, int a) {
  __atomic_fetch_add(&p, a, 0);
  __atomic_add_fetch(&p, a, 0);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
lock xadd %rax,-0x8(%rbp)
mov    %rax,-0x20(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    %rcx,%rax
lock xadd %rax,-0x8(%rbp)
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %rdi,-0x8(%rsp)
movslq %esi,%rax
lock add %rax,-0x8(%rsp)
lock add %rax,-0x8(%rsp)
ret

LLVM IR (-O0):
define void @foo(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
store i64 %10, i64* %5
%11 = bitcast i32** %3 to i64*
%12 = bitcast i32** %6 to i64*
%13 = load i64, i64* %5
%14 = atomicrmw add i64* %11, i64 %13 monotonic
store i64 %14, i64* %12
%15 = bitcast i64* %12 to i32**
%16 = load i32*, i32** %15
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
store i64 %18, i64* %7
%19 = bitcast i32** %3 to i64*
%20 = bitcast i32** %8 to i64*
%21 = load i64, i64* %7
%22 = atomicrmw add i64* %19, i64 %21 monotonic
%23 = add i64 %22, %21
store i64 %23, i64* %20
%24 = bitcast i64* %20 to i32**
%25 = load i32*, i32** %24
ret void
}

LLVM IR (-O2):
define void @foo(i32* %0, i32 %1) {
%3 = alloca i32*
store i32* %0, i32** %3
%4 = sext i32 %1 to i64
%5 = bitcast i32** %3 to i64*
%6 = atomicrmw add i64* %5, i64 %4 monotonic
%7 = atomicrmw add i64* %5, i64 %4 monotonic
ret void
}
double fy(double t, double y) { return 1.0; }


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

x86 assembly (clang, -O2):
<fy>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @fy(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @fy(double %0, double %1) {
ret double 1.000000e+00
}
int main() {
  int z = 0;
  __asm__("subq $16, %rsp\n\t"
          "movl $2, -8(%rbp)\n\t"
          "movl $4, -12(%rbp)\n\t"
          "movl -8(%rbp), %eax\n\t"
          "movl -12(%rbp), %edx\n\t"
          "addl %eax, %edx\n\t"
          "movl %edx, -4(%rbp)\n\t");
  printf("Assembly added value of z is %d\n", z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
sub    $0x10,%rsp
movl   $0x2,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%edx
add    %eax,%edx
mov    %edx,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x10,%rsp
movl   $0x2,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%edx
add    %eax,%edx
mov    %edx,-0x4(%rbp)
lea    0xecb(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Assembly added value of z is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Assembly added value of z is %d\0A\00"
define i32 @main() {
tail call void asm sideeffect "subq $$16, %rsp\0A\09movl $$2, -8(%rbp)\0A\09movl $$4, -12(%rbp)\0A\09movl -8(%rbp), %eax\0A\09movl -12(%rbp), %edx\0A\09addl %eax, %edx\0A\09movl %edx, -4(%rbp)\0A\09", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int p();
int main() { return p() != 0x1234; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <p@plt>
cmp    $0x1234,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <p@plt>
xor    %ecx,%ecx
cmp    $0x1234,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @p()
%3 = icmp ne i32 %2, 4660
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @p()
%2 = icmp ne i32 %1, 4660
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fb_hRtExit();
void fb_hDoExit(void) { fb_hRtExit(); }


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

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

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

LLVM IR (-O2):
define void @fb_hDoExit() {
%1 = tail call i32 (...) @fb_hRtExit()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long background_pixmap;
};
typedef TYPE_1__ XSetWindowAttributes;

/* Variables and functions */
void set_XSetWindowAttributes_background_pixmap(void *_p, unsigned long _v) {
  ((XSetWindowAttributes *)_p)->background_pixmap = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XSetWindowAttributes_background_pixmap(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XSetWindowAttributes_background_pixmap(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_srai_epi32(int /*<<< orphan*/, int);
__m128i test_mm_srai_epi32_2(__m128i A, int B) { return _mm_srai_epi32(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_srai_epi32_2>:
jmp    1030 <_mm_srai_epi32@plt>

LLVM IR (-O0):
define i32 @test_mm_srai_epi32_2(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 = call i32 @_mm_srai_epi32(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_srai_epi32_2(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_srai_epi32(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ probability(int);
int /*<<< orphan*/ probability_mc(int, int);
double round(int /*<<< orphan*/);
int test_23() {
  return 0.50 == round(probability(23)) &&
         0.50 == round(probability_mc(23, 100000));
}


x86 assembly (clang, -O0):
<test_23>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x17,%edi
call   1030 <probability@plt>
mov    %eax,%edi
call   1050 <round@plt>
movaps %xmm0,%xmm1
xor    %eax,%eax
movsd  0xeaa(%rip),%xmm0
ucomisd %xmm1,%xmm0
mov    %al,-0x1(%rbp)
jne    1199 <test_23+0x69>
jp     1199 <test_23+0x69>
mov    $0x17,%edi
mov    $0x186a0,%esi
call   1040 <probability_mc@plt>
mov    %eax,%edi
call   1050 <round@plt>
movaps %xmm0,%xmm1
movsd  0xe76(%rip),%xmm0
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_23>:
push   %rax
mov    $0x17,%edi
call   1030 <probability@plt>
mov    %eax,%edi
call   1050 <round@plt>
ucomisd 0xeb6(%rip),%xmm0
jne    1177 <test_23+0x47>
jp     1177 <test_23+0x47>
mov    $0x17,%edi
mov    $0x186a0,%esi
call   1040 <probability_mc@plt>
mov    %eax,%edi
call   1050 <round@plt>
cmpeqsd 0xe93(%rip),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_23() {
%1 = call i32 @probability(i32 23)
%2 = call double @round(i32 %1)
%3 = fcmp oeq double 5.000000e-01, %2
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = call i32 @probability_mc(i32 23, i32 100000)
%6 = call double @round(i32 %5)
%7 = fcmp oeq double 5.000000e-01, %6
br label %8
8: ; preds = %4, %0
%9 = phi i1 [ false, %0 ], [ %7, %4 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_23() {
%1 = tail call i32 @probability(i32 23)
%2 = tail call double @round(i32 %1)
%3 = fcmp oeq double %2, 5.000000e-01
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = tail call i32 @probability_mc(i32 23, i32 100000)
%6 = tail call double @round(i32 %5)
%7 = fcmp oeq double %6, 5.000000e-01
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %0
%10 = phi i32 [ 0, %0 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sample_size() {
  printf("NOT IMPLEMENTED:"
         "pa_sample_size"
         "\n");
}


x86 assembly (clang, -O0):
<pa_sample_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"NOT IMPLEMENTED:pa_sample_size\0A\00"
define i32 @pa_sample_size() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_sample_size\00"
define i32 @pa_sample_size() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void blast_dcache(void) { return; }


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

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

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

LLVM IR (-O2):
define void @blast_dcache() {
ret void
}
/* Variables and functions */
int source_peekn(char *, int /*<<< orphan*/);
int source_peek(char *c) { return source_peekn(c, 0); }


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

x86 assembly (clang, -O2):
<source_peek>:
xor    %esi,%esi
jmp    1030 <source_peekn@plt>

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

LLVM IR (-O2):
define i32 @source_peek(i8* %0) {
%2 = tail call i32 @source_peekn(i8* %0, i32 0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int pthread_rwlock_wrlock(int /*<<< orphan*/ *);
void __safe_p_rwlock_wrlock(pthread_rwlock_t *rw) {
  int en = pthread_rwlock_wrlock(rw);
  if (en) {
    abort();
  }
}


x86 assembly (clang, -O0):
<__safe_p_rwlock_wrlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_rwlock_wrlock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1149 <__safe_p_rwlock_wrlock+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__safe_p_rwlock_wrlock>:
push   %rax
call   1040 <pthread_rwlock_wrlock@plt>
test   %eax,%eax
jne    112c <__safe_p_rwlock_wrlock+0xc>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @__safe_p_rwlock_wrlock(i32* %0) {
%2 = tail call i32 @pthread_rwlock_wrlock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}