xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ mbstate_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
size_t mbsrtowcs(int /*<<< orphan*/ *, char const **, size_t,
                 int /*<<< orphan*/ *);
size_t mbsrtowcs_l(wchar_t *__restrict pwcs, const char **__restrict s,
                   size_t n, mbstate_t *__restrict ps, locale_t loc) {
  return mbsrtowcs(pwcs, s, n, ps);
}


x86 assembly (clang, -O0):
<mbsrtowcs_l>:
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
call   1030 <mbsrtowcs@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbsrtowcs_l>:
jmp    1030 <mbsrtowcs@plt>

LLVM IR (-O0):
define i64 @mbsrtowcs_l(i32* noalias %0, i8** noalias %1, i64 %2, i32* noalias %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i8**
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i32
store i32* %0, i32** %6
store i8** %1, i8*** %7
store i64 %2, i64* %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i8**, i8*** %7
%13 = load i64, i64* %8
%14 = load i32*, i32** %9
%15 = call i64 @mbsrtowcs(i32* %11, i8** %12, i64 %13, i32* %14)
ret i64 %15
}

LLVM IR (-O2):
define i64 @mbsrtowcs_l(i32* noalias %0, i8** noalias %1, i64 %2, i32* noalias %3, i32 %4) {
%6 = tail call i64 @mbsrtowcs(i32* %0, i8** %1, i64 %2, i32* %3)
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
int *fillArrayI(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ newArrayI_uninit(int /*<<< orphan*/);
int *newArrayI(uint sz, int val) {
  return fillArrayI(newArrayI_uninit(sz), sz, val);
}


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

x86 assembly (clang, -O2):
<newArrayI>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <newArrayI_uninit@plt>
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fillArrayI@plt>

LLVM IR (-O0):
define i32* @newArrayI(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 = call i32 @newArrayI_uninit(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32* @fillArrayI(i32 %6, i32 %7, i32 %8)
ret i32* %9
}

LLVM IR (-O2):
define i32* @newArrayI(i32 %0, i32 %1) {
%3 = tail call i32 @newArrayI_uninit(i32 %0)
%4 = tail call i32* @fillArrayI(i32 %3, i32 %0, i32 %1)
ret i32* %4
}
unsigned xrop3_26_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S & T;
  stk2 = D | stk3;
  stk1 = T ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_26_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_26_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
lea    (%rsi,%rcx,1),%edx
and    %eax,%ecx
or     %edi,%eax
or     $0xff,%ecx
xor    %edx,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_26_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %6
%9 = and i32 %7, %4
%10 = or i32 %9, 255
%11 = xor i32 %10, %8
%12 = xor i32 %5, -1
%13 = and i32 %11, %12
%14 = or i32 %13, %3
ret i32 %14
}
void bdecode_4(b, p) void *b;
void *p;
{ bcopy(b, p, 4); }


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

x86 assembly (clang, -O2):
<bdecode_4>:
mov    $0x4,%edx
xor    %eax,%eax
jmp    1030 <bcopy@plt>

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

LLVM IR (-O2):
define void @bdecode_4(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @bcopy to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 4)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
extern uint32_t cel_js_hash(const char *str) {
  register uint32_t h = 0;
  while (*str != '\0') {
    h ^= ((h << 5) + (*str++) + (h << 2));
  }
  return (h & 0x7FFFFFFF);
}


x86 assembly (clang, -O0):
<cel_js_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114c <cel_js_hash+0x4c>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <cel_js_hash+0xf>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cel_js_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112e <cel_js_hash+0x2e>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
movsbl %cl,%eax
lea    (%rdx,%rdx,8),%ecx
lea    (%rax,%rcx,4),%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <cel_js_hash+0x10>
and    $0x7fffffff,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @cel_js_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %4
%10 = load i32, i32* %3
%11 = shl i32 %10, 5
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
%16 = add nsw i32 %11, %15
%17 = load i32, i32* %3
%18 = shl i32 %17, 2
%19 = add nsw i32 %16, %18
%20 = load i32, i32* %3
%21 = xor i32 %20, %19
store i32 %21, i32* %3
br label %4
22: ; preds = %4
%23 = load i32, i32* %3
%24 = and i32 %23, 2147483647
ret i32 %24
}

LLVM IR (-O2):
define i32 @cel_js_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = mul i32 %6, 36
%11 = add i32 %10, %8
%12 = xor i32 %11, %6
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = and i32 %12, 2147483647
br label %17
17: ; preds = %15, %1
%18 = phi i32 [ 0, %1 ], [ %16, %15 ]
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned int, int);
void writeS9rec(FILE *objfile, unsigned tfraddr) {
  int chksum = (tfraddr & 0xff) + ((tfraddr >> 8) & 0xff) + 3;
  fprintf(objfile, "S903%04X%02X\n", tfraddr, 0xff - (chksum & 0xff));
}


x86 assembly (clang, -O0):
<writeS9rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    -0xc(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff,%ecx
add    %ecx,%eax
add    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    $0xff,%ecx
sub    %eax,%ecx
lea    0xea8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeS9rec>:
mov    %esi,%edx
mov    %esi,%eax
shr    $0x8,%eax
add    %edx,%eax
add    $0x3,%eax
not    %eax
movzbl %al,%ecx
lea    0xed8(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"S903%04X%02X\0A\00"
define void @writeS9rec(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = and i32 %6, 255
%8 = load i32, i32* %4
%9 = lshr i32 %8, 8
%10 = and i32 %9, 255
%11 = add i32 %7, %10
%12 = add i32 %11, 3
store i32 %12, i32* %5
%13 = load i32*, i32** %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = and i32 %15, 255
%17 = sub nsw i32 255, %16
%18 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"S903%04X%02X\0A\00"
define void @writeS9rec(i32* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = add i32 %1, 3
%5 = add i32 %4, %3
%6 = and i32 %5, 255
%7 = xor i32 %6, 255
%8 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %7)
ret void
}
void getBytesFloat(float d, char *out) {
  unsigned char *da = (unsigned char *)&d;
  out[0] = da[0];
  out[1] = da[1];
  out[2] = da[2];
  out[3] = da[3];
}


x86 assembly (clang, -O0):
<getBytesFloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBytesFloat>:
movss  %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @getBytesFloat(float %0, i8* nocapture writeonly %1) {
%3 = bitcast float %0 to i32
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
%5 = lshr i32 %3, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %3, 16
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %9, i8* %10
%11 = lshr i32 %3, 24
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %12, i8* %13
ret void
}
void logrec(int s, unsigned short n) {}


x86 assembly (clang, -O0):
<logrec>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @logrec(i32 %0, i16 zeroext %1) {
ret void
}
int test_imm_EFint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xEF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EFint64_highword_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, 32
%6 = and i64 %5, 239
%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_EFint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1026497183744
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void handle_sig(int sig) { printf("handle sig: %d\n", sig); }


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

x86 assembly (clang, -O2):
<handle_sig>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"handle sig: %d\0A\00"
define void @handle_sig(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void COMP_B3_intr(void) {}


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

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

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

LLVM IR (-O2):
define void @COMP_B3_intr() {
ret void
}
void _M2_macroObjects_finish(__attribute__((unused)) int argc,
                             __attribute__((unused)) char *argv[]) {}


x86 assembly (clang, -O0):
<_M2_macroObjects_finish>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @_M2_macroObjects_finish(i32 %0, i8** nocapture %1) {
ret void
}
int check_fa_work(const char *c, const char *f) {
  const char d = 0;
  if (c >= &d)
    return c >= f && f >= &d;
  else
    return c <= f && f <= &d;
}


x86 assembly (clang, -O0):
<check_fa_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movb   $0x0,-0x19(%rbp)
lea    -0x19(%rbp),%rax
cmp    %rax,-0x10(%rbp)
jb     114f <check_fa_work+0x4f>
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x18(%rbp),%rcx
mov    %al,-0x1a(%rbp)
jb     113f <check_fa_work+0x3f>
lea    -0x19(%rbp),%rax
cmp    %rax,-0x18(%rbp)
setae  %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    117b <check_fa_work+0x7b>
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x18(%rbp),%rcx
mov    %al,-0x1b(%rbp)
ja     1170 <check_fa_work+0x70>
lea    -0x19(%rbp),%rax
cmp    %rax,-0x18(%rbp)
setbe  %al
mov    %al,-0x1b(%rbp)
mov    -0x1b(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_fa_work>:
lea    -0x1(%rsp),%rax
cmp    %rdi,%rax
jbe    1118 <check_fa_work+0x18>
cmp    %rsi,%rdi
setbe  %cl
cmp    %rsi,%rax
setae  %al
jmp    1124 <check_fa_work+0x24>
cmp    %rsi,%rdi
setae  %cl
cmp    %rsi,%rax
setbe  %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @check_fa_work(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 0, i8* %6
%7 = load i8*, i8** %4
%8 = icmp uge i8* %7, %6
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = icmp uge i8* %10, %11
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = icmp uge i8* %14, %6
br label %16
16: ; preds = %13, %9
%17 = phi i1 [ false, %9 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
store i32 %18, i32* %3
br label %29
19: ; preds = %2
%20 = load i8*, i8** %4
%21 = load i8*, i8** %5
%22 = icmp ule i8* %20, %21
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i8*, i8** %5
%25 = icmp ule i8* %24, %6
br label %26
26: ; preds = %23, %19
%27 = phi i1 [ false, %19 ], [ %25, %23 ]
%28 = zext i1 %27 to i32
store i32 %28, i32* %3
br label %29
29: ; preds = %26, %16
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @check_fa_work(i8* readnone %0, i8* readnone %1) {
%3 = alloca i8
%4 = icmp ugt i8* %3, %0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = icmp uge i8* %0, %1
%7 = icmp ule i8* %3, %1
%8 = and i1 %6, %7
br label %13
9: ; preds = %2
%10 = icmp ule i8* %0, %1
%11 = icmp uge i8* %3, %1
%12 = and i1 %10, %11
br label %13
13: ; preds = %9, %5
%14 = phi i1 [ %8, %5 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int pow(int, double);
double erb2hz(double erb) { return ((pow(10, erb / 21.4) - 1.) * 229.); }


x86 assembly (clang, -O0):
<erb2hz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee6(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  0xec4(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeb0(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erb2hz>:
push   %rax
divsd  0xee7(%rip),%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xed6(%rip),%xmm0
mulsd  0xed6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @erb2hz(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 2.140000e+01
%5 = call i32 @pow(i32 10, double %4)
%6 = sitofp i32 %5 to double
%7 = fsub double %6, 1.000000e+00
%8 = fmul double %7, 2.290000e+02
ret double %8
}

LLVM IR (-O2):
define double @erb2hz(double %0) {
%2 = fdiv double %0, 2.140000e+01
%3 = tail call i32 @pow(i32 10, double %2)
%4 = sitofp i32 %3 to double
%5 = fadd double %4, -1.000000e+00
%6 = fmul double %5, 2.290000e+02
ret double %6
}
void AssetDestroyController(struct _Asset *asset) {}


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

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

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

LLVM IR (-O2):
%struct._Asset = type opaque
define void @AssetDestroyController(%struct._Asset* nocapture %0) {
ret void
}
void strength_test6(int *data) {
  int j = data[0];
  int i = data[1];
  do {
    data[data[2]] = 2;
    i = i + j;
  } while (21 * i < data[3]);
}


x86 assembly (clang, -O0):
<strength_test6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
imul   $0x15,-0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0xc(%rcx),%eax
jl     111b <strength_test6+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_test6>:
mov    (%rdi),%ecx
mov    0x4(%rdi),%eax
lea    (%rax,%rax,4),%edx
lea    (%rax,%rdx,4),%eax
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,4),%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    %ecx,%eax
movslq 0x8(%rdi),%rdx
movl   $0x2,(%rdi,%rdx,4)
cmp    0xc(%rdi),%eax
jl     1120 <strength_test6+0x20>
ret

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

LLVM IR (-O2):
define void @strength_test6(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = getelementptr inbounds i32, i32* %0, i64 3
br label %7
7: ; preds = %7, %1
%8 = phi i32 [ %4, %1 ], [ %12, %7 ]
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
store i32 2, i32* %11
%12 = add nsw i32 %8, %2
%13 = mul nsw i32 %12, 21
%14 = load i32, i32* %6
%15 = icmp slt i32 %13, %14
br i1 %15, label %7, label %16
16: ; preds = %7
ret void
}
int fun(int x) {
  int i;
  int count = 0;
  for (i = 0; i < 100; i++) {
    count = count + 2;
    ;
  }
  return count + x;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1136 <fun+0x36>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <fun+0x15>
mov    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
lea    0xc8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @fun(i32 %0) {
%2 = add nsw i32 %0, 200
ret i32 %2
}
int subs_si_test2(int a, int b, int c) {
  int d = a - 0xff;
  if (d == 0)
    return a + c;
  else
    return d;
}


x86 assembly (clang, -O0):
<subs_si_test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0xff,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1130 <subs_si_test2+0x30>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <subs_si_test2+0x36>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<subs_si_test2>:
lea    (%rdx,%rdi,1),%eax
lea    -0xff(%rdi),%ecx
test   %ecx,%ecx
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @subs_si_test2(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, -255
%5 = icmp eq i32 %4, 0
%6 = add nsw i32 %2, %0
%7 = select i1 %5, i32 %6, i32 %4
ret i32 %7
}
/* Variables and functions */
float sqrt(float);
float FastSqrt(float square) { return sqrt(square); }


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

x86 assembly (clang, -O2):
<FastSqrt>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <FastSqrt+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define float @FastSqrt(float %0) {
%2 = tail call float @sqrt(float %0)
ret float %2
}
int main(void) {
#pragma acc parallel
#pragma acc loop
  for (int i = 1; i < 10; i++)
    for (;;)
      ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1126 <main+0x26>
jmp    1121 <main+0x21>
jmp    1121 <main+0x21>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %3
br label %7
7: ; preds = %7, %6
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
br label %1
}
int hvt_dumpcore_supported() { return -1; }


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

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

LLVM IR (-O0):
define i32 @hvt_dumpcore_supported() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @hvt_dumpcore_supported() {
ret i32 -1
}
void dladdr() {}


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

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

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

LLVM IR (-O2):
define void @dladdr() {
ret void
}
/* Variables and functions */
char *getenv(char *);
int getCipherStrength() {
  char *aes256 = getenv("AES256");
  return (aes256 != NULL) ? 256 : 128;
}


x86 assembly (clang, -O0):
<getCipherStrength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x80,%eax
mov    $0x100,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCipherStrength>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
shl    $0x7,%ecx
sub    $0xffffff80,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"AES256\00"
define i32 @getCipherStrength() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 256, i32 128
ret i32 %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"AES256\00"
define i32 @getCipherStrength() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i32 128, i32 256
ret i32 %3
}
const char *Tuple_Definition(void) {
  return "struct Tuple {\n"
         "  var* items;\n"
         "};\n";
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"struct Tuple {\0A var* items;\0A};\0A\00"
define i8* @Tuple_Definition() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [33 x i8] c"struct Tuple {\0A var* items;\0A};\0A\00"
define i8* @Tuple_Definition() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char *, int /*<<< orphan*/);
int open_fwlog(int fp_fwlog, char *file_path) {
  if (fp_fwlog == -1) {
    fp_fwlog = open(file_path, O_RDONLY);
  }
  return fp_fwlog;
}


x86 assembly (clang, -O0):
<open_fwlog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    113e <open_fwlog+0x2e>
mov    -0x10(%rbp),%rdi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_fwlog>:
cmp    $0xffffffff,%edi
je     1118 <open_fwlog+0x8>
mov    %edi,%eax
ret
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %rsi,%rdi
mov    %eax,%esi
jmp    1030 <open@plt>

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

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @open_fwlog(i32 %0, i8* nocapture %1) {
%3 = icmp eq i32 %0, -1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @O_RDONLY
%6 = tail call i32 @open(i8* %1, i32 %5)
br label %7
7: ; preds = %4, %2
%8 = phi i32 [ %6, %4 ], [ %0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void catch_sig(int sig) { printf("sig: %d\n", sig); }


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

x86 assembly (clang, -O2):
<catch_sig>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"sig: %d\0A\00"
define void @catch_sig(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
double f4_sum_pre_double_double_double_double_double_double_double_double_int(
    double v0, double v1, double v2, double v3, double v4, double v5, double v6,
    double v7, int v) {
  return v0 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_double_double_double_double_double_double_double_double_int>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
mov    %edi,-0x44(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
cvtsi2sdl -0x44(%rbp),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_double_double_double_double_double_double_double_double_int>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
addsd  %xmm5,%xmm0
addsd  %xmm6,%xmm0
addsd  %xmm7,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_double_double_double_double_double_double_double_double_int(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, i32 %8) {
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca i32
store double %0, double* %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store double %5, double* %15
store double %6, double* %16
store double %7, double* %17
store i32 %8, i32* %18
%19 = load double, double* %10
%20 = load double, double* %11
%21 = fadd double %19, %20
%22 = load double, double* %12
%23 = fadd double %21, %22
%24 = load double, double* %13
%25 = fadd double %23, %24
%26 = load double, double* %14
%27 = fadd double %25, %26
%28 = load double, double* %15
%29 = fadd double %27, %28
%30 = load double, double* %16
%31 = fadd double %29, %30
%32 = load double, double* %17
%33 = fadd double %31, %32
%34 = load i32, i32* %18
%35 = sitofp i32 %34 to double
%36 = fadd double %33, %35
ret double %36
}

LLVM IR (-O2):
define double @f4_sum_pre_double_double_double_double_double_double_double_double_int(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, i32 %8) {
%10 = fadd double %0, %1
%11 = fadd double %10, %2
%12 = fadd double %11, %3
%13 = fadd double %12, %4
%14 = fadd double %13, %5
%15 = fadd double %14, %6
%16 = fadd double %15, %7
%17 = sitofp i32 %8 to double
%18 = fadd double %16, %17
ret double %18
}
/* Type definitions */
struct gfarm_hash_iterator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
gfarm_hash_iterator_valid_entry(struct gfarm_hash_iterator *);
int gfarm_hash_iterator_is_end(struct gfarm_hash_iterator *iterator) {
  return (!gfarm_hash_iterator_valid_entry(iterator));
}


x86 assembly (clang, -O0):
<gfarm_hash_iterator_is_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gfarm_hash_iterator_valid_entry@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfarm_hash_iterator_is_end>:
push   %rax
call   1030 <gfarm_hash_iterator_valid_entry@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.gfarm_hash_iterator = type { i32 }
define i32 @gfarm_hash_iterator_is_end(%struct.gfarm_hash_iterator* %0) {
%2 = alloca %struct.gfarm_hash_iterator*
store %struct.gfarm_hash_iterator* %0, %struct.gfarm_hash_iterator** %2
%3 = load %struct.gfarm_hash_iterator*, %struct.gfarm_hash_iterator** %2
%4 = call i32 @gfarm_hash_iterator_valid_entry(%struct.gfarm_hash_iterator* %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.gfarm_hash_iterator = type { i32 }
define i32 @gfarm_hash_iterator_is_end(%struct.gfarm_hash_iterator* %0) {
%2 = tail call i32 @gfarm_hash_iterator_valid_entry(%struct.gfarm_hash_iterator* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void lisys_memstats() {}


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

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

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

LLVM IR (-O2):
define void @lisys_memstats() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
long time(int /*<<< orphan*/ *);
int main() {
  long firstTimeStamp = time(NULL);
  for (int i = 0; i < 100000; i++) {
    time(NULL);
  }
  long lastTimeStamp = time(NULL);
  if (lastTimeStamp < firstTimeStamp) {
    abort();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x186a0,-0x14(%rbp)
jge    1167 <main+0x47>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1143 <main+0x23>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1189 <main+0x69>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,%rbx
mov    $0x186a0,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %edi,%edi
call   1040 <time@plt>
add    $0xffffffff,%ebp
jne    1140 <main+0x20>
xor    %edi,%edi
call   1040 <time@plt>
cmp    %rbx,%rax
jl     1161 <main+0x41>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @time(i32* null)
br label %5
2: ; preds = %5
%3 = tail call i64 @time(i32* null)
%4 = icmp slt i64 %3, %1
br i1 %4, label %10, label %12
5: ; preds = %0, %5
%6 = phi i32 [ 0, %0 ], [ %8, %5 ]
%7 = tail call i64 @time(i32* null)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, 100000
br i1 %9, label %2, label %5
10: ; preds = %2
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %2
ret i32 0
}
/* Variables and functions */
scalar_t__ write(int, char *, int);
void PUTC(char ch) {
  if (write(1, &ch, 1) < 0)
    ;
}


x86 assembly (clang, -O0):
<PUTC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
cmp    $0x0,%rax
jge    113d <PUTC+0x2d>
jmp    113d <PUTC+0x2d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PUTC>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @PUTC(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i64 @write(i32 1, i8* %2, i32 1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @PUTC(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i64 @write(i32 1, i8* %2, i32 1)
ret void
}
void Sys_FreeFileList(char **list) {
  int i;
  if (!list) {
    return;
  }
  for (i = 0; list[i]; i++) {
    free(list[i]);
  }
  free(list);
}


x86 assembly (clang, -O0):
<Sys_FreeFileList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <Sys_FreeFileList+0x1c>
jmp    116e <Sys_FreeFileList+0x5e>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1165 <Sys_FreeFileList+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <Sys_FreeFileList+0x23>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_FreeFileList>:
test   %rdi,%rdi
je     1150 <Sys_FreeFileList+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <Sys_FreeFileList+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <Sys_FreeFileList+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @Sys_FreeFileList(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %11, %6 ], [ %4, %3 ]
tail call void @free(i8* %8)
%9 = add nuw nsw i64 %7, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
br label %15
15: ; preds = %1, %13
ret void
}
/* Variables and functions */
void file_dontneed(int fd, size_t pos, size_t *last_advise) {
  if (pos - *last_advise > (8 << 20)) {
    *last_advise = pos;
  }
}


x86 assembly (clang, -O0):
<file_dontneed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%rax
cmp    $0x800000,%rax
jbe    1131 <file_dontneed+0x31>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_dontneed>:
mov    %rsi,%rax
sub    (%rdx),%rax
cmp    $0x800001,%rax
jb     1111 <file_dontneed+0x11>
mov    %rsi,(%rdx)
ret

LLVM IR (-O0):
define void @file_dontneed(i32 %0, i64 %1, i64* %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64*
store i32 %0, i32* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64, i64* %5
%8 = load i64*, i64** %6
%9 = load i64, i64* %8
%10 = sub i64 %7, %9
%11 = icmp ugt i64 %10, 8388608
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i64, i64* %5
%14 = load i64*, i64** %6
store i64 %13, i64* %14
br label %15
15: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
define void @file_dontneed(i32 %0, i64 %1, i64* nocapture %2) {
%4 = load i64, i64* %2
%5 = sub i64 %1, %4
%6 = icmp ugt i64 %5, 8388608
br i1 %6, label %7, label %8
7: ; preds = %3
store i64 %1, i64* %2
br label %8
8: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tester_teardown_complete();
void teardown_timeout(void *user_data) { tester_teardown_complete(); }


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

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

LLVM IR (-O0):
define void @teardown_timeout(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @tester_teardown_complete()
ret void
}

LLVM IR (-O2):
define void @teardown_timeout(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @tester_teardown_complete()
ret void
}
int d_bgt_rc1(double a1) { return (__builtin_isgreater(a1, 100)); }


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

x86 assembly (clang, -O2):
<d_bgt_rc1>:
xor    %eax,%eax
ucomisd 0xef6(%rip),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @d_bgt_rc1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 1.000000e+02
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @d_bgt_rc1(double %0) {
%2 = fcmp ogt double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long long strtoll(char *, int /*<<< orphan*/ *, int);
void test4(char *array, char *endptr) {
  long long r = strtoll(array + 3, NULL, 1);
  assert(r == 0);
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x3,%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <strtoll@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
push   %rax
add    $0x3,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <strtoll@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @test4(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 3
%8 = call i64 @strtoll(i8* %7, i32* null, i32 1)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret void
}

LLVM IR (-O2):
define void @test4(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = tail call i64 @strtoll(i8* nocapture %3, i32* null, i32 1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret void
}