xunge/DecIR huggingface dataset:
void rop3_189_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk1 = S ^ *D;
  stk2 = T ^ *D;
  stk1 = stk1 & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_189_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_189_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %sil,%cl
xor    %al,%dl
and    %cl,%dl
or     %sil,%dl
not    %dl
and    %sil,%al
or     %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_189_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = xor i32 %10, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %7
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = xor i32 %17, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %7
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = and i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_189_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = xor i8 %4, %2
%7 = and i8 %5, %6
%8 = or i8 %7, %1
%9 = xor i8 %8, -1
%10 = and i8 %4, %1
%11 = or i8 %10, %9
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
char *xrindex(char *, char);
int test_xrindex(void) {
  char *p = "pippo";
  if (xrindex(p, 'p') == p + 3)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<test_xrindex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x70,%esi
call   1030 <xrindex@plt>
mov    -0x10(%rbp),%rcx
add    $0x3,%rcx
cmp    %rcx,%rax
jne    114e <test_xrindex+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <test_xrindex+0x45>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_xrindex>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x70,%esi
call   1030 <xrindex@plt>
lea    0xeda(%rip),%rdx
xor    %ecx,%ecx
cmp    %rdx,%rax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"pippo\00"
define i32 @test_xrindex() {
%1 = tail call i8* @xrindex(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 112)
%2 = icmp ne i8* %1, getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 3)
%3 = sext i1 %2 to i32
ret i32 %3
}
void av_content_light_metadata_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_content_light_metadata_alloc() {
ret void
}
int QUARK_Bit_Get(unsigned char *set, int number) {
  set += number / 8;
  return (*set & (1 << (7 - (number % 8)))) != 0;
}


x86 assembly (clang, -O0):
<QUARK_Bit_Get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
mov    $0x7,%ecx
sub    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QUARK_Bit_Get>:
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
mov    %ecx,%eax
sar    $0x3,%eax
cltq
movzbl (%rdi,%rax,1),%eax
and    $0xfffffff8,%ecx
sub    %ecx,%esi
mov    $0x7,%cl
sub    %sil,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @QUARK_Bit_Get(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 8
%7 = load i8*, i8** %3
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i32, i32* %4
%14 = srem i32 %13, 8
%15 = sub nsw i32 7, %14
%16 = shl i32 1, %15
%17 = and i32 %12, %16
%18 = icmp ne i32 %17, 0
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @QUARK_Bit_Get(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = srem i32 %1, 8
%9 = sub nsw i32 7, %8
%10 = lshr i32 %7, %9
%11 = and i32 %10, 1
ret i32 %11
}
int sync_test_and_set_bit(long nr, volatile unsigned long *addr) {
  int oldbit;
  asm volatile("lock; bts %2,%1\n\tsbbl %0,%0"
               : "=r"(oldbit), "+m"((*(volatile long *)addr))
               : "Ir"(nr)
               : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<sync_test_and_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
lock bts %rcx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_test_and_set_bit>:
lock bts %rdi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sync_test_and_set_bit(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i32
store i64 %0, i64* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i64, i64* %3
%8 = call i32 asm sideeffect "lock; bts $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i64 %7, i64* elementtype(i64) %6)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @sync_test_and_set_bit(i64 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "lock; bts $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i64 %0, i64* elementtype(i64) %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ mpq_t;
typedef int /*<<< orphan*/ mpf_t;

/* Variables and functions */
int /*<<< orphan*/ gmp_sscanf(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ mpf_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpf_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpq_set_f(int /*<<< orphan*/, int /*<<< orphan*/);
void str2mpq(mpq_t mp_rational, char *str) {
  mpf_t mp_float;
  mpf_init(mp_float);
  gmp_sscanf(str, "%Ff", mp_float);
  mpq_set_f(mp_rational, mp_float);
  mpf_clear(mp_float);
}


x86 assembly (clang, -O0):
<str2mpq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <mpf_init@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe9b(%rip),%rsi
call   1060 <gmp_sscanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <mpq_set_f@plt>
mov    -0x14(%rbp),%edi
call   1050 <mpf_clear@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2mpq>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <mpf_init@plt>
lea    0xeac(%rip),%rsi
mov    %rbx,%rdi
call   1060 <gmp_sscanf@plt>
mov    %ebp,%edi
call   1030 <mpq_set_f@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <mpf_clear@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%Ff\00"
define void @str2mpq(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %5
%7 = call i32 @mpf_init(i32 %6)
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @gmp_sscanf(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = call i32 @mpq_set_f(i32 %11, i32 %12)
%14 = load i32, i32* %5
%15 = call i32 @mpf_clear(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%Ff\00"
define void @str2mpq(i32 %0, i8* %1) {
%3 = tail call i32 @mpf_init(i32 undef)
%4 = tail call i32 @gmp_sscanf(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 undef)
%5 = tail call i32 @mpq_set_f(i32 %0, i32 undef)
%6 = tail call i32 @mpf_clear(i32 undef)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ hexdump_data(int /*<<< orphan*/, int /*<<< orphan*/ const *,
                                size_t);
void dump_unknown(uint8_t type, const uint8_t *data, size_t n) {
  (void)type;
  hexdump_data(0, data, n);
}


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

x86 assembly (clang, -O2):
<dump_unknown>:
xor    %edi,%edi
jmp    1030 <hexdump_data@plt>

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

LLVM IR (-O2):
define void @dump_unknown(i32 %0, i32* %1, i64 %2) {
%4 = tail call i32 @hexdump_data(i32 0, i32* %1, i64 %2)
ret void
}
int main(int argc, char **argv) {
  int i;
  int j = 0;
  for (i = 0; i < 8; i++) {
    j += j + i * i;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    114a <main+0x4a>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    %ecx,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1120 <main+0x20>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo620() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_PMF_SERIAL_get(char const **, int *, int, int, int);
int U_PMF_LEN_FLOATDATA(const char *contents) {
  int Size;
  U_PMF_SERIAL_get(&contents, &Size, 4, 1, 1);
  Size = 4 * Size + 4;
  return (Size);
}


x86 assembly (clang, -O0):
<U_PMF_LEN_FLOATDATA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1030 <U_PMF_SERIAL_get@plt>
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_PMF_LEN_FLOATDATA>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
call   1030 <U_PMF_SERIAL_get@plt>
mov    0xc(%rsp),%eax
lea    0x4(,%rax,4),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @U_PMF_LEN_FLOATDATA(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @U_PMF_SERIAL_get(i8** %2, i32* %3, i32 4, i32 1, i32 1)
%5 = load i32, i32* %3
%6 = mul nsw i32 4, %5
%7 = add nsw i32 %6, 4
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @U_PMF_LEN_FLOATDATA(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = bitcast i32* %3 to i8*
%5 = call i32 @U_PMF_SERIAL_get(i8** %2, i32* %3, i32 4, i32 1, i32 1)
%6 = load i32, i32* %3
%7 = shl nsw i32 %6, 2
%8 = add nsw i32 %7, 4
ret i32 %8
}
newbase(base) long base;
{ warning(".base ignored"); }


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

x86 assembly (clang, -O2):
<newbase>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <warning@plt>

LLVM IR (-O0):
@.str = [14 x i8] c".base ignored\00"
define i32 @newbase(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @warning to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [14 x i8] c".base ignored\00"
define i32 @newbase(i64 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @warning to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void junk() { printf("lower case, "); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"lower case, \00"
define void @junk() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
void dump(char *fname, int len, char *buf) {
  FILE *f;
  f = fopen(fname, "w");
  if (f) {
    fwrite(buf, 1, len, f);
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1180 <dump+0x50>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
lea    0xebf(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     116d <dump+0x3d>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fclose@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @dump(i8* nocapture %0, i32 %1, i8* nocapture %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @fwrite(i8* %2, i32 1, i32 %1, i32* %4)
%8 = tail call i32 @fclose(i32* %4)
br label %9
9: ; preds = %6, %3
ret void
}
int main(int argc, char **argv) {
  const char *fn1 = "file1";
  const char *fn2 = "file2";
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xee7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xee2(%rip),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"file1\00"
@.str.1 = [6 x i8] c"file2\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int __test_and_clear_bit(int nr, volatile unsigned long *addr) {
  int oldbit;
  __asm__("btrl %2,%1\n\tsbbl %0,%0"
          : "=r"(oldbit), "=m"((*(volatile long *)addr))
          : "Ir"(nr));
  return oldbit;
}


x86 assembly (clang, -O0):
<__test_and_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
btr    %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_and_clear_bit>:
btr    %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @__test_and_clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i32, i32* %3
%8 = call i32 asm "btrl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @__test_and_clear_bit(i32 %0, i64* %1) {
%3 = tail call i32 asm "btrl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int _read(int32_t file, uint8_t *ptr, int32_t len) { return 0; }


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_read(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @_read(i32 %0, i32* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ imprimir_menu(int, char **);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc <= 1) {
    printf("No ha introducio argumentos a imprimir, pruebe con ./ejecutable "
           "argumento1 argumento2 ...\n");
    return 0;
  }
  imprimir_menu(argc, argv);
}


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)
cmpl   $0x1,-0x8(%rbp)
jg     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1164 <main+0x44>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <imprimir_menu@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1134 <main+0x14>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
jmp    1139 <main+0x19>
call   1040 <imprimir_menu@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [91 x i8] c"No ha introducio argumentos a imprimir, pruebe con ./ejecutable argumento1 argumento2 ...\0A\00"
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 = load i32, i32* %4
%7 = icmp sle i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %14
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @imprimir_menu(i32 %11, i8** %12)
br label %14
14: ; preds = %10, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@str = [90 x i8] c"No ha introducio argumentos a imprimir, pruebe con ./ejecutable argumento1 argumento2 ...\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([90 x i8], [90 x i8]* @str, i64 0, i64 0))
br label %8
6: ; preds = %2
%7 = tail call i32 @imprimir_menu(i32 %0, i8** %1)
br label %8
8: ; preds = %6, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ who_wc();
int main(int argc, char *argv[]) {
  who_wc();
  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 <who_wc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <who_wc@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 (...) @who_wc()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @who_wc()
ret i32 0
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
void e_1_12() {
  int c;
  while ((c = getchar()) != EOF) {
    if (c == ' ' || c == '\n' || c == '\t') {
      putchar('\n');
    } else {
      putchar(c);
    }
  }
}


x86 assembly (clang, -O0):
<e_1_12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    0x2eaf(%rip),%rcx
cmp    (%rcx),%eax
je     117b <e_1_12+0x5b>
cmpl   $0x20,-0x4(%rbp)
je     115f <e_1_12+0x3f>
cmpl   $0xa,-0x4(%rbp)
je     115f <e_1_12+0x3f>
cmpl   $0x9,-0x4(%rbp)
jne    116e <e_1_12+0x4e>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1176 <e_1_12+0x56>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
jmp    1128 <e_1_12+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_1_12>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%rbx
cmp    (%rbx),%eax
jne    113e <e_1_12+0x1e>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
movabs $0x100000600,%r14
jmp    1162 <e_1_12+0x42>
nopw   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     1136 <e_1_12+0x16>
cmp    $0x20,%eax
ja     1150 <e_1_12+0x30>
mov    $0xa,%edi
mov    %eax,%ecx
bt     %rcx,%r14
jb     1152 <e_1_12+0x32>
jmp    1150 <e_1_12+0x30>

LLVM IR (-O0):
@EOF = global i32 0
define void @e_1_12() {
%1 = alloca i32
br label %2
2: ; preds = %20, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %21
6: ; preds = %2
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 32
br i1 %8, label %15, label %9
9: ; preds = %6
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 10
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %1
%14 = icmp eq i32 %13, 9
br i1 %14, label %15, label %17
15: ; preds = %12, %9, %6
%16 = call i32 @putchar(i32 10)
br label %20
17: ; preds = %12
%18 = load i32, i32* %1
%19 = call i32 @putchar(i32 %18)
br label %20
20: ; preds = %17, %15
br label %2
21: ; preds = %2
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @e_1_12() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %7
%5 = phi i32 [ %10, %7 ], [ %1, %0 ]
switch i32 %5, label %6 [
i32 32, label %7
i32 10, label %7
i32 9, label %7
]
6: ; preds = %4
br label %7
7: ; preds = %4, %4, %4, %6
%8 = phi i32 [ %5, %6 ], [ 10, %4 ], [ 10, %4 ], [ 10, %4 ]
%9 = tail call i32 @putchar(i32 %8)
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %7, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata) {
  ((void)(userdata), free(bitmap));
}


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

x86 assembly (clang, -O2):
<stbtt_FreeBitmap>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @stbtt_FreeBitmap(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int bitn(int, int);
int fb(unsigned int i) { return bitn(0x6671, (int)i); }


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

x86 assembly (clang, -O2):
<fb>:
mov    %edi,%esi
mov    $0x6671,%edi
jmp    1030 <bitn@plt>

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

LLVM IR (-O2):
define i32 @fb(i32 %0) {
%2 = tail call i32 @bitn(i32 26225, i32 %0)
ret i32 %2
}
int test_imm_87int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x87 << 0)) ? -20 : -40;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ CircularBitBuffer_Ctor(struct CircularBitBuffer *);
void CircularBitBuffer_Clear(struct CircularBitBuffer *pThis) {
  CircularBitBuffer_Ctor(pThis);
}


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

x86 assembly (clang, -O2):
<CircularBitBuffer_Clear>:
jmp    1030 <CircularBitBuffer_Ctor@plt>

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

LLVM IR (-O2):
%struct.CircularBitBuffer = type { i32 }
define void @CircularBitBuffer_Clear(%struct.CircularBitBuffer* %0) {
%2 = tail call i32 @CircularBitBuffer_Ctor(%struct.CircularBitBuffer* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar5(int);
void test5(void) { bar5(1); }


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <bar5@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
mov    $0x1,%edi
jmp    1030 <bar5@plt>

LLVM IR (-O0):
define void @test5() {
%1 = call i32 @bar5(i32 1)
ret void
}

LLVM IR (-O2):
define void @test5() {
%1 = tail call i32 @bar5(i32 1)
ret void
}
/* Variables and functions */
int getNumericValue(unsigned char *, int, int);
unsigned long getFirstBlock(unsigned char *in) {
  return (getNumericValue(in, 20, 2) << 16) | getNumericValue(in, 26, 2);
}


x86 assembly (clang, -O0):
<getFirstBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x14,%esi
mov    $0x2,%edx
call   1030 <getNumericValue@plt>
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1a,%esi
mov    $0x2,%edx
call   1030 <getNumericValue@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFirstBlock>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x14,%esi
mov    $0x2,%edx
call   1030 <getNumericValue@plt>
mov    %eax,%ebp
shl    $0x10,%ebp
mov    %rbx,%rdi
mov    $0x1a,%esi
mov    $0x2,%edx
call   1030 <getNumericValue@plt>
or     %ebp,%eax
cltq
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @getFirstBlock(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @getNumericValue(i8* %3, i32 20, i32 2)
%5 = shl i32 %4, 16
%6 = load i8*, i8** %2
%7 = call i32 @getNumericValue(i8* %6, i32 26, i32 2)
%8 = or i32 %5, %7
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @getFirstBlock(i8* %0) {
%2 = tail call i32 @getNumericValue(i8* %0, i32 20, i32 2)
%3 = shl i32 %2, 16
%4 = tail call i32 @getNumericValue(i8* %0, i32 26, i32 2)
%5 = or i32 %3, %4
%6 = sext i32 %5 to i64
ret i64 %6
}
/* Variables and functions */
int rand();
void fill_dp_vector(double *vec, int size) {
  int ind;
  for (ind = 0; ind < size; ind++)
    vec[ind] = rand() % 10;
}


x86 assembly (clang, -O0):
<fill_dp_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1160 <fill_dp_vector+0x50>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <fill_dp_vector+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_dp_vector>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    116a <fill_dp_vector+0x5a>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <fill_dp_vector+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @fill_dp_vector(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 10
%13 = sitofp i32 %12 to double
%14 = load double*, double** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
store double %13, double* %17
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @fill_dp_vector(double* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 10
%10 = sitofp i32 %9 to double
%11 = getelementptr inbounds double, double* %0, i64 %7
store double %10, double* %11
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Type definitions */
struct yaffs_obj {
  int dummy;
};

/* Variables and functions */
int yaffs_do_getxattr_reldir(struct yaffs_obj *, char const *, char const *,
                             void *, int, int /*<<< orphan*/);
int yaffs_lgetxattr_reldir(struct yaffs_obj *reldir, const char *path,
                           const char *name, void *data, int size) {
  return yaffs_do_getxattr_reldir(reldir, path, name, data, size, 0);
}


x86 assembly (clang, -O0):
<yaffs_lgetxattr_reldir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
xor    %r9d,%r9d
call   1030 <yaffs_do_getxattr_reldir@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaffs_lgetxattr_reldir>:
xor    %r9d,%r9d
jmp    1030 <yaffs_do_getxattr_reldir@plt>

LLVM IR (-O0):
%struct.yaffs_obj = type { i32 }
define i32 @yaffs_lgetxattr_reldir(%struct.yaffs_obj* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca %struct.yaffs_obj*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store %struct.yaffs_obj* %0, %struct.yaffs_obj** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load %struct.yaffs_obj*, %struct.yaffs_obj** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = load i32, i32* %10
%16 = call i32 @yaffs_do_getxattr_reldir(%struct.yaffs_obj* %11, i8* %12, i8* %13, i8* %14, i32 %15, i32 0)
ret i32 %16
}

LLVM IR (-O2):
%struct.yaffs_obj = type { i32 }
define i32 @yaffs_lgetxattr_reldir(%struct.yaffs_obj* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = tail call i32 @yaffs_do_getxattr_reldir(%struct.yaffs_obj* %0, i8* %1, i8* %2, i8* %3, i32 %4, i32 0)
ret i32 %6
}
int test_imm_14uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x14 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_14uint64_midword_reg>:
test   $0x140000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_14uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 20
%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_14uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 1310720
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int GLUT_VISIBLE;
int /*<<< orphan*/ printf(char *, char *);
void visible(int status) {
  printf("visible: %s\n", status == GLUT_VISIBLE ? "YES" : "no");
}


x86 assembly (clang, -O0):
<visible>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edx
lea    0xee3(%rip),%rsi
lea    0xed8(%rip),%rax
cmp    %edx,%ecx
cmove  %rax,%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<visible>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
lea    0xeed(%rip),%rax
lea    0xeea(%rip),%rsi
cmove  %rax,%rsi
lea    0xece(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"visible: %s\0A\00"
@GLUT_VISIBLE = global i32 0
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"no\00"
define void @visible(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @GLUT_VISIBLE
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"visible: %s\0A\00"
@GLUT_VISIBLE = global i32 0
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"no\00"
define void @visible(i32 %0) {
%2 = load i32, i32* @GLUT_VISIBLE
%3 = icmp eq i32 %2, %0
%4 = select i1 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
void bar1(void) {
#pragma omp parallel
  {}
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ abort();
int pthread_sigmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                    int /*<<< orphan*/ *);
void signal_restore(sigset_t oldset) {
  int ret;
  ret = pthread_sigmask(SIG_SETMASK, &oldset, NULL);
  if (ret)
    abort();
}


x86 assembly (clang, -O0):
<signal_restore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <pthread_sigmask@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1155 <signal_restore+0x35>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_restore>:
push   %rax
mov    %edi,0x4(%rsp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rsi
xor    %edx,%edx
call   1040 <pthread_sigmask@plt>
test   %eax,%eax
jne    1140 <signal_restore+0x20>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@SIG_SETMASK = global i32 0
define void @signal_restore(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @SIG_SETMASK
%5 = call i32 @pthread_sigmask(i32 %4, i32* %2, i32* null)
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):
@SIG_SETMASK = global i32 0
define void @signal_restore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIG_SETMASK
%4 = call i32 @pthread_sigmask(i32 %3, i32* %2, i32* null)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, void **);
void *thread3_func(void *arg) {
  pthread_t t1 = (pthread_t)arg;
  void *result;
  pthread_join(t1, &result);
  printf("thread3 received code %08x from thread1\n", (int)result);
  return NULL;
}


x86 assembly (clang, -O0):
<thread3_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1040 <pthread_join@plt>
mov    -0x18(%rbp),%rax
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread3_func>:
push   %rax
mov    %rsp,%rsi
call   1040 <pthread_join@plt>
mov    (%rsp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"thread3 received code %08x from thread1\0A\00"
define i8* @thread3_func(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = ptrtoint i8* %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @pthread_join(i32 %7, i8** %4)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i8* null
}

LLVM IR (-O2):
@.str = [41 x i8] c"thread3 received code %08x from thread1\0A\00"
define noalias i8* @thread3_func(i8* %0) {
%2 = alloca i8*
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = bitcast i8** %2 to i8*
%6 = call i32 @pthread_join(i32 %4, i8** %2)
%7 = load i8*, i8** %2
%8 = ptrtoint i8* %7 to i64
%9 = trunc i64 %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
scalar_t__ ENOENT;
int /*<<< orphan*/ assert(int);
scalar_t__ errno;
int /*<<< orphan*/ *opendir(char *);
void test_nonexistent(void) {
  DIR *dir = opendir("tests/invalid");
  assert(dir == NULL);
  assert(errno == ENOENT);
}


x86 assembly (clang, -O0):
<test_nonexistent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%rax
mov    0x2e75(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nonexistent>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <opendir@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%rax
mov    0x2e84(%rip),%rcx
xor    %edi,%edi
cmp    (%rcx),%rax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"tests/invalid\00"
@errno = global i64 0
@ENOENT = global i64 0
define void @test_nonexistent() {
%1 = alloca i32*
%2 = call i32* @opendir(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp eq i32* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i64, i64* @errno
%8 = load i64, i64* @ENOENT
%9 = icmp eq i64 %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"tests/invalid\00"
@errno = global i64 0
@ENOENT = global i64 0
define void @test_nonexistent() {
%1 = tail call i32* @opendir(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32* %1, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i64, i64* @errno
%6 = load i64, i64* @ENOENT
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LZ4_compressBound(int);
int LZ4_compress_default(char const *, char *, int, int /*<<< orphan*/);
int LZ4_compress(const char *source, char *dest, int inputSize) {
  return LZ4_compress_default(source, dest, inputSize,
                              LZ4_compressBound(inputSize));
}


x86 assembly (clang, -O0):
<LZ4_compress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <LZ4_compressBound@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
call   1040 <LZ4_compress_default@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_compress>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%edi
call   1030 <LZ4_compressBound@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <LZ4_compress_default@plt>

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

LLVM IR (-O2):
define i32 @LZ4_compress(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @LZ4_compressBound(i32 %2)
%5 = tail call i32 @LZ4_compress_default(i8* %0, i8* %1, i32 %2, i32 %4)
ret i32 %5
}