xunge/DecIR huggingface dataset:
unsigned xrop3_69_0_1(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;
  stk2 = T & stk3;
  stk1 = D | stk2;
  stk1 = ~stk1;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_69_0_1>:
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
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_69_0_1>:
mov    %esi,%eax
not    %eax
or     %edi,%eax
not    %edi
shl    $0x8,%eax
and    %esi,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_69_0_1(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 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = or i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = xor i32 %31, -1
store i32 %32, i32* %8
%33 = load i32, i32* %8
%34 = load i32, i32* %6
%35 = and i32 %33, %34
%36 = load i32, i32* %8
%37 = load i32, i32* %7
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = or i32 %35, %39
%41 = load i32, i32* %7
%42 = load i32, i32* %6
%43 = xor i32 %42, -1
%44 = and i32 %41, %43
%45 = load i32, i32* %5
%46 = and i32 %44, %45
%47 = or i32 %40, %46
ret i32 %47
}

LLVM IR (-O2):
define i32 @xrop3_69_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = xor i32 %3, -1
%6 = xor i32 %4, -1
%7 = or i32 %6, %3
%8 = shl nsw i32 %7, 8
%9 = and i32 %5, %4
%10 = or i32 %8, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int posix_memalign(void **, size_t, size_t);
void *xmalloc_aligned(size_t size, size_t alignment) {
  int ret;
  void *ptr;
  assert(size != 0);
  ret = posix_memalign(&ptr, alignment, size);
  assert(ret == 0);
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc_aligned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    -0x20(%rbp),%rdi
call   1040 <posix_memalign@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc_aligned>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rsp,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <posix_memalign@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    (%rsp),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xmalloc_aligned(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i64, i64* %4
%12 = load i64, i64* %3
%13 = call i32 @posix_memalign(i8** %6, i64 %11, i64 %12)
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i8*, i8** %6
ret i8* %18
}

LLVM IR (-O2):
define i8* @xmalloc_aligned(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = icmp ne i64 %0, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = call i32 @posix_memalign(i8** %3, i64 %1, i64 %0)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8*, i8** %3
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_MultiplyVec4f_init(void) {
  _hmt_register_covercase("HMM_MultiplyVec4f", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_MultiplyVec4f_init>:
lea    0xee9(%rip),%rdi
lea    0xef4(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"HMM_MultiplyVec4f\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_MultiplyVec4f_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute__((no, noclone)) void foo(long long int x) {
  if (x != -1220975898975746LL)
    __builtin_abort();
  asm volatile("" : : : "memory");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0xfffba987654321fe,%rax
a9 fb ff
cmp    %rax,-0x8(%rbp)
je     1135 <foo+0x25>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
movabs $0xfffba987654321fe,%rax
a9 fb ff
cmp    %rax,%rdi
jne    1122 <foo+0x12>
pop    %rax
ret
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @foo(i64 %0) {
%2 = icmp eq i64 %0, -1220975898975746
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @abort()
unreachable
4: ; preds = %1
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
extern int link(char *old, char *_new) {
  (void)old, (void)_new;
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @link(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
ret i32 -1
}

LLVM IR (-O2):
define i32 @link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void LogClose(void) { closelog(); }


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

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

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

LLVM IR (-O2):
define void @LogClose() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void strcpymax(char *s1, char *s2, int max) {
  if (strlen(s2) > max) {
    memcpy(s1, s2, max);
    *(s1 + max) = 0;
  } else
    strcpy(s1, s2);
}


x86 assembly (clang, -O0):
<strcpymax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    -0x14(%rbp),%eax
jle    1176 <strcpymax+0x46>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1183 <strcpymax+0x53>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpymax>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
cmp    %ebp,%eax
jle    1162 <strcpymax+0x32>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1050 <memcpy@plt>
movslq %ebp,%rax
movb   $0x0,(%r14,%rax,1)
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define void @strcpymax(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp sgt i32 %4, %2
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 0, i8* %9
br label %12
10: ; preds = %3
%11 = tail call i32 @strcpy(i8* %0, i8* %1)
br label %12
12: ; preds = %10, %6
ret void
}
void DBGFR3AddrFromSelOff(void) {}


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

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

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

LLVM IR (-O2):
define void @DBGFR3AddrFromSelOff() {
ret void
}
/* Variables and functions */
int TRUE;
bool lock_sc() { return TRUE; }


x86 assembly (clang, -O0):
<lock_sc>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_sc>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@TRUE = global i32 0
define i32 @lock_sc() {
%1 = load i32, i32* @TRUE
ret i32 %1
}

LLVM IR (-O2):
@TRUE = global i32 0
define i32 @lock_sc() {
%1 = load i32, i32* @TRUE
ret i32 %1
}
/* Type definitions */
struct petp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct petp *);
void t1_tp_destroy(struct petp *tp) { kfree(tp); }


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

x86 assembly (clang, -O2):
<t1_tp_destroy>:
jmp    1030 <kfree@plt>

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

LLVM IR (-O2):
%struct.petp = type { i32 }
define void @t1_tp_destroy(%struct.petp* %0) {
%2 = tail call i32 @kfree(%struct.petp* %0)
ret void
}
/* Variables and functions */
int error(int, char *);
int b_bg(int argc, char *argv[]) {
  if (argc > 1)
    return error(1, argv[0]);
  return error(49, argv[0]);
}


x86 assembly (clang, -O0):
<b_bg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1142 <b_bg+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x1,%edi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
jmp    1156 <b_bg+0x46>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x31,%edi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_bg>:
cmp    $0x2,%edi
mov    (%rsi),%rsi
mov    $0x1,%eax
mov    $0x31,%edi
cmovge %eax,%edi
jmp    1030 <error@plt>

LLVM IR (-O0):
define i32 @b_bg(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @error(i32 1, i8* %11)
store i32 %12, i32* %3
br label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i32 @error(i32 49, i8* %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @b_bg(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
%4 = load i8*, i8** %1
%5 = select i1 %3, i32 1, i32 49
%6 = tail call i32 @error(i32 %5, i8* %4)
ret i32 %6
}
/* Type definitions */
struct ENV {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ env_new_null(struct ENV *);
void env_new_level(struct ENV *env) { env_new_null(env); }


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

x86 assembly (clang, -O2):
<env_new_level>:
jmp    1030 <env_new_null@plt>

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

LLVM IR (-O2):
%struct.ENV = type { i32 }
define void @env_new_level(%struct.ENV* %0) {
%2 = tail call i32 @env_new_null(%struct.ENV* %0)
ret void
}
void enable_page_protection(long unsigned int value) {
  asm volatile("mov %%cr0,%0" : "=r"(value));
  if (!(value & 0x00010000)) {
    value |= 0x00010000;
    asm volatile("mov %0,%%cr0" : : "r"(value));
  }
}


x86 assembly (clang, -O0):
<enable_page_protection>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %cr0,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x10000,%rax
cmp    $0x0,%rax
jne    1138 <enable_page_protection+0x38>
mov    -0x8(%rbp),%rax
or     $0x10000,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%cr0
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_page_protection>:
mov    %cr0,%rax
test   $0x10000,%eax
jne    1113 <enable_page_protection+0x13>
or     $0x10000,%rax
mov    %rax,%cr0
ret

LLVM IR (-O0):
define void @enable_page_protection(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 asm sideeffect "mov %cr0,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = and i64 %4, 65536
%6 = icmp ne i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i64, i64* %2
%9 = or i64 %8, 65536
store i64 %9, i64* %2
%10 = load i64, i64* %2
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @enable_page_protection(i64 %0) {
%2 = tail call i64 asm sideeffect "mov %cr0,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
%3 = and i64 %2, 65536
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = or i64 %2, 65536
tail call void asm sideeffect "mov $0,%cr0", "r,~{dirflag},~{fpsr},~{flags}"(i64 %6)
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Heapify(int *, int, int);
void Build_Heap(int array[], int size) {
  for (int i = (size - 1) / 2; i >= 0; i--)
    Heapify(array, i, size);
}


x86 assembly (clang, -O0):
<Build_Heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1157 <Build_Heap+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <Heapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <Build_Heap+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Build_Heap>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
js     1141 <Build_Heap+0x31>
mov    %esi,%ebx
mov    %rdi,%r14
lea    -0x1(%rbx),%eax
shr    $0x1f,%eax
lea    (%rbx,%rax,1),%ebp
add    $0xffffffff,%ebp
sar    %ebp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <Heapify@plt>
add    $0xffffffff,%ebp
jb     1130 <Build_Heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @Build_Heap(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 = sub nsw i32 %6, 1
%8 = sdiv i32 %7, 2
store i32 %8, i32* %5
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = call i32 @Heapify(i32* %13, i32 %14, i32 %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %5
%19 = add nsw i32 %18, -1
store i32 %19, i32* %5
br label %9
20: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @Build_Heap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = sdiv i32 %5, 2
br label %8
7: ; preds = %8, %2
ret void
8: ; preds = %4, %8
%9 = phi i32 [ %11, %8 ], [ %6, %4 ]
%10 = tail call i32 @Heapify(i32* %0, i32 %9, i32 %1)
%11 = add nsw i32 %9, -1
%12 = icmp eq i32 %9, 0
br i1 %12, label %7, label %8
}
int lookup_variable_or_env_int(const char *szKey, int valueDefault) {
  return valueDefault;
}


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

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

LLVM IR (-O0):
define i32 @lookup_variable_or_env_int(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
ret i32 %5
}

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


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

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

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

LLVM IR (-O2):
define void @settings_init() {
ret void
}
/* Type definitions */
struct stat {
  scalar_t__ st_mtime;
};

/* Variables and functions */
unsigned long long stat_mstamp(const struct stat *st) {
  return (unsigned long long)st->st_mtime;
}


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

x86 assembly (clang, -O2):
<stat_mstamp>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @stat_mstamp(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i64, i64* %2
ret i64 %3
}
double OP_LessThanEqual(double op1, double op2) { return op1 <= op2; }


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

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

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

LLVM IR (-O2):
define double @OP_LessThanEqual(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int arr[], int len) {
  for (int i = 0; i < len; i++) {
    printf("%-3d", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
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    1159 <print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%-3d\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%-3d\00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
void g_list_sort() {}


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

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

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

LLVM IR (-O2):
define void @g_list_sort() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void die(char *msg, int index) {
  fprintf(stderr, msg, index);
  abort();
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @die(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* %6, i32 %7)
%9 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @die(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* %0, i32 %1)
%5 = tail call i32 (...) @abort()
unreachable
}
char *ltrim(char *p) {
  for (; *p == ' ' || *p == '\t'; p++)
    ;
  return p;
}


x86 assembly (clang, -O0):
<ltrim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <ltrim+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <ltrim+0x3d>
jmp    1153 <ltrim+0x53>
jmp    1142 <ltrim+0x42>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <ltrim+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltrim>:
mov    %rdi,%rax
jmp    1114 <ltrim+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <ltrim+0x10>
cmp    $0x9,%cl
je     1110 <ltrim+0x10>
ret

LLVM IR (-O0):
define i8* @ltrim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 9
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ true, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %19
15: ; preds = %13
br label %16
16: ; preds = %15
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %13
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @ltrim(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
double reduceDouble(double left, double right, unsigned char op) {
  switch (op) {
  case 0x0E:
    return left + right;
  case 0x0F:
    return left - right;
  case 0x10:
    return left * right;
  case 0x11:
    return left / right;
  }
  return 0;
}


x86 assembly (clang, -O0):
<reduceDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %al,-0x19(%rbp)
movzbl -0x19(%rbp),%eax
add    $0xfffffff2,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x3,%eax
ja     118e <reduceDouble+0x8e>
mov    -0x28(%rbp),%rax
lea    0xecb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1196 <reduceDouble+0x96>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1196 <reduceDouble+0x96>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1196 <reduceDouble+0x96>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1196 <reduceDouble+0x96>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<reduceDouble>:
add    $0xf2,%dil
cmp    $0x3,%dil
ja     1123 <reduceDouble+0x23>
movzbl %dil,%eax
lea    0xeeb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
addsd  %xmm1,%xmm0
ret
xorps  %xmm0,%xmm0
ret
subsd  %xmm1,%xmm0
ret
mulsd  %xmm1,%xmm0
ret
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @reduceDouble(double %0, double %1, i8 zeroext %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i8
store double %0, double* %5
store double %1, double* %6
store i8 %2, i8* %7
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
switch i32 %9, label %26 [
i32 14, label %10
i32 15, label %14
i32 16, label %18
i32 17, label %22
]
10: ; preds = %3
%11 = load double, double* %5
%12 = load double, double* %6
%13 = fadd double %11, %12
store double %13, double* %4
br label %27
14: ; preds = %3
%15 = load double, double* %5
%16 = load double, double* %6
%17 = fsub double %15, %16
store double %17, double* %4
br label %27
18: ; preds = %3
%19 = load double, double* %5
%20 = load double, double* %6
%21 = fmul double %19, %20
store double %21, double* %4
br label %27
22: ; preds = %3
%23 = load double, double* %5
%24 = load double, double* %6
%25 = fdiv double %23, %24
store double %25, double* %4
br label %27
26: ; preds = %3
store double 0.000000e+00, double* %4
br label %27
27: ; preds = %26, %22, %18, %14, %10
%28 = load double, double* %4
ret double %28
}

LLVM IR (-O2):
define double @reduceDouble(double %0, double %1, i8 zeroext %2) {
switch i8 %2, label %12 [
i8 14, label %4
i8 15, label %6
i8 16, label %8
i8 17, label %10
]
4: ; preds = %3
%5 = fadd double %0, %1
br label %12
6: ; preds = %3
%7 = fsub double %0, %1
br label %12
8: ; preds = %3
%9 = fmul double %0, %1
br label %12
10: ; preds = %3
%11 = fdiv double %0, %1
br label %12
12: ; preds = %3, %10, %8, %6, %4
%13 = phi double [ %11, %10 ], [ %9, %8 ], [ %7, %6 ], [ %5, %4 ], [ 0.000000e+00, %3 ]
ret double %13
}
char ordinaryf(float x) { return 1 / x != 0 && x == x; }


x86 assembly (clang, -O0):
<ordinaryf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
mov    %al,-0x5(%rbp)
jne    1132 <ordinaryf+0x32>
jp     1132 <ordinaryf+0x32>
jmp    1146 <ordinaryf+0x46>
movss  -0x4(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ordinaryf>:
movss  0xef8(%rip),%xmm1
divss  %xmm0,%xmm1
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
setp   %al
setne  %cl
or     %al,%cl
ucomiss %xmm0,%xmm0
setnp  %al
and    %cl,%al
ret

LLVM IR (-O0):
define signext i8 @ordinaryf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float 1.000000e+00, %3
%5 = fcmp une float %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load float, float* %2
%8 = load float, float* %2
%9 = fcmp oeq float %7, %8
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @ordinaryf(float %0) {
%2 = fdiv float 1.000000e+00, %0
%3 = fcmp une float %2, 0.000000e+00
%4 = fcmp ord float %0, 0.000000e+00
%5 = and i1 %4, %3
%6 = zext i1 %5 to i8
ret i8 %6
}
void kvmppc_uvmem_free(void) {}


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

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

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

LLVM IR (-O2):
define void @kvmppc_uvmem_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void __attribute__((noreturn)) _abort(void) { __coverity_panic__(); }


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

x86 assembly (clang, -O2):
<_abort>:
push   %rax
xor    %eax,%eax
call   1030 <__coverity_panic__@plt>

LLVM IR (-O0):
define void @_abort() {
%1 = call i32 (...) @__coverity_panic__()
unreachable
}

LLVM IR (-O2):
define void @_abort() {
%1 = tail call i32 (...) @__coverity_panic__()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void main() { write(1, "Hello world\n", 12); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0xc,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0xc,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
define void @main() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world\0A\00"
define void @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
ret void
}
int is_boot_from_nor_flash(void) {
  volatile int *p = (volatile int *)0;
  int val;
  val = *p;
  *p = 0x12345678;
  if (*p == 0x12345678) {
    *p = val;
    return 0;
  } else
    return 1;
}


x86 assembly (clang, -O0):
<is_boot_from_nor_flash>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x12345678,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    $0x12345678,%eax
jne    1145 <is_boot_from_nor_flash+0x45>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    114c <is_boot_from_nor_flash+0x4c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_boot_from_nor_flash>:
mov    0x0,%ecx
movl   $0x12345678,0x0
78 56 34 12
mov    0x0,%edx
mov    $0x1,%eax
cmp    $0x12345678,%edx
jne    112f <is_boot_from_nor_flash+0x2f>
mov    %ecx,0x0
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_boot_from_nor_flash() {
%1 = load volatile i32, i32* null
store volatile i32 305419896, i32* null
%2 = load volatile i32, i32* null
%3 = icmp eq i32 %2, 305419896
br i1 %3, label %4, label %5
4: ; preds = %0
store volatile i32 %1, i32* null
br label %5
5: ; preds = %0, %4
%6 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ wait_1ms(int);
void wait_10ms(unsigned int cnt) {
  unsigned int i;
  for (i = 0; i < cnt; i++)
    wait_1ms(10);
}


x86 assembly (clang, -O0):
<wait_10ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1146 <wait_10ms+0x36>
mov    $0xa,%edi
call   1030 <wait_1ms@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <wait_10ms+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_10ms>:
push   %rbx
test   %edi,%edi
je     112f <wait_10ms+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <wait_1ms@plt>
add    $0xffffffff,%ebx
jne    1120 <wait_10ms+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @wait_10ms(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp ult i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @wait_1ms(i32 10)
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @wait_10ms(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @wait_1ms(i32 10)
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
void RealMainP$Boot$booted(void) { TestAppP$Boot$booted(); }


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

x86 assembly (clang, -O2):
<RealMainP$Boot$booted>:
xor    %eax,%eax
jmp    1030 <TestAppP$Boot$booted@plt>

LLVM IR (-O0):
define void @"RealMainP$Boot$booted"() {
%1 = call i32 (...) @"TestAppP$Boot$booted"()
ret void
}

LLVM IR (-O2):
define void @"RealMainP$Boot$booted"() {
%1 = tail call i32 (...) @"TestAppP$Boot$booted"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BDA_INIT();
void bda_init() { BDA_INIT(); }


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

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

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

LLVM IR (-O2):
define void @bda_init() {
%1 = tail call i32 (...) @BDA_INIT()
ret void
}
/* Type definitions */
struct stat {
  int st_nlink;
};

/* Variables and functions */
int myls_get_nlink(struct stat *filename_stat) {
  return filename_stat->st_nlink;
}


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

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @myls_get_nlink(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @myls_get_nlink(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
int foo_system_value(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @foo_system_value() {
ret i32 42
}

LLVM IR (-O2):
define i32 @foo_system_value() {
ret i32 42
}
void fn00000000004015A0() { return; }


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @fn00000000004015A0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_at_clr(char const *, int, int, unsigned char);
void print_clr(const char *message, unsigned char color) {
  print_at_clr(message, -1, -1, color);
}


x86 assembly (clang, -O0):
<print_clr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%edx
mov    %edx,%esi
movzbl -0x9(%rbp),%ecx
call   1030 <print_at_clr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_clr>:
mov    %esi,%ecx
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
jmp    1030 <print_at_clr@plt>

LLVM IR (-O0):
define void @print_clr(i8* %0, i8 zeroext %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 @print_at_clr(i8* %5, i32 -1, i32 -1, i8 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @print_clr(i8* %0, i8 zeroext %1) {
%3 = tail call i32 @print_at_clr(i8* %0, i32 -1, i32 -1, i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPIO1_INT7_DriverIRQHandler();
__attribute__((weak)) void GPIO1_INT7_IRQHandler(void) {
  GPIO1_INT7_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @GPIO1_INT7_IRQHandler() {
%1 = call i32 (...) @GPIO1_INT7_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @GPIO1_INT7_IRQHandler() {
%1 = tail call i32 (...) @GPIO1_INT7_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int gc_refs(void *ptr) {
  int *ref = (int *)(ptr - sizeof(int));
  if ((*ref) <= 0) {
    error("esh: refcount is corrupted in gc_refs.");
    exit(EXIT_FAILURE);
  }
  return (*ref);
}


x86 assembly (clang, -O0):
<gc_refs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jg     115f <gc_refs+0x3f>
lea    0xeb4(%rip),%rdi
call   1030 <error@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gc_refs>:
push   %rax
mov    -0x4(%rdi),%eax
test   %eax,%eax
jle    112a <gc_refs+0xa>
pop    %rcx
ret
lea    0xecf(%rip),%rdi
call   1030 <error@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"esh: refcount is corrupted in gc_refs.\00"
@EXIT_FAILURE = global i32 0
define i32 @gc_refs(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr i8, i8* %4, i64 -4
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = call i32 @error(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
%15 = load i32*, i32** %3
%16 = load i32, i32* %15
ret i32 %16
}

LLVM IR (-O2):
@.str = [39 x i8] c"esh: refcount is corrupted in gc_refs.\00"
@EXIT_FAILURE = global i32 0
define i32 @gc_refs(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 -4
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = tail call i32 @error(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret i32 %4
}
/* Variables and functions */
scalar_t__ find(int, int *);
int connected(int x, int y, int *parents) {
  return find(x, parents) == find(y, parents);
}


x86 assembly (clang, -O0):
<connected>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <find@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <find@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connected>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdx,%rsi
call   1030 <find@plt>
mov    %rax,%rbp
mov    %r14d,%edi
mov    %rbx,%rsi
call   1030 <find@plt>
xor    %ecx,%ecx
cmp    %rax,%rbp
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @connected(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
%7 = load i32, i32* %4
%8 = load i32*, i32** %6
%9 = call i64 @find(i32 %7, i32* %8)
%10 = load i32, i32* %5
%11 = load i32*, i32** %6
%12 = call i64 @find(i32 %10, i32* %11)
%13 = icmp eq i64 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @connected(i32 %0, i32 %1, i32* %2) {
%4 = tail call i64 @find(i32 %0, i32* %2)
%5 = tail call i64 @find(i32 %1, i32* %2)
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
int to_dlx_col(const int type, const int a, const int b) {
  return (((type * 9) + a) * 9) + b;
}


x86 assembly (clang, -O0):
<to_dlx_col>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x9,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
imul   $0x9,%eax,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_dlx_col>:
lea    (%rdi,%rdi,8),%eax
add    %esi,%eax
lea    (%rax,%rax,8),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @to_dlx_col(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
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 9
%9 = load i32, i32* %5
%10 = add nsw i32 %8, %9
%11 = mul nsw i32 %10, 9
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @to_dlx_col(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 9
%5 = add nsw i32 %4, %1
%6 = mul nsw i32 %5, 9
%7 = add nsw i32 %6, %2
ret i32 %7
}