xunge/DecIR huggingface dataset:
/* Type definitions */
struct sc_stack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ windup(struct sc_stack *);
void sc_clear(struct sc_stack *stp) { windup(stp); }


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

x86 assembly (clang, -O2):
<sc_clear>:
jmp    1030 <windup@plt>

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

LLVM IR (-O2):
%struct.sc_stack = type { i32 }
define void @sc_clear(%struct.sc_stack* %0) {
%2 = tail call i32 @windup(%struct.sc_stack* %0)
ret void
}
/* Type definitions */
struct DATA {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ structdata_done(struct DATA *);
void database_done(struct DATA *p) {
  structdata_done(p);
  return;
}


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

x86 assembly (clang, -O2):
<database_done>:
jmp    1030 <structdata_done@plt>

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

LLVM IR (-O2):
%struct.DATA = type { i32 }
define void @database_done(%struct.DATA* %0) {
%2 = tail call i32 @structdata_done(%struct.DATA* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  float remainder;
  scanf("%d", &number);
  remainder = number % 2;
  if (remainder == 0) {
    printf("The number is even.\n");
  } else {
    printf("The number is odd.\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    117b <main+0x5b>
jp     117b <main+0x5b>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
jmp    1187 <main+0x67>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xed8(%rip),%rax
lea    0xebe(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [21 x i8] c"The number is even.\0A\00"
@.str.2 = [20 x i8] c"The number is odd.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 2
%7 = sitofp i32 %6 to float
store float %7, float* %3
%8 = load float, float* %3
%9 = fcmp oeq float %8, 0.000000e+00
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [19 x i8] c"The number is odd.\00"
@str.3 = [20 x i8] c"The number is even.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
/* Type definitions */
struct AMCThreadPool {
  int dummy;
};

/* Variables and functions */
size_t _pool_free_thread_count(struct AMCThreadPool *);
size_t AMCThreadPool_freeThreadCount(struct AMCThreadPool *pool) {
  if (pool) {
    return _pool_free_thread_count(pool);
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<AMCThreadPool_freeThreadCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1139 <AMCThreadPool_freeThreadCount+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <_pool_free_thread_count@plt>
mov    %rax,-0x8(%rbp)
jmp    1141 <AMCThreadPool_freeThreadCount+0x31>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AMCThreadPool_freeThreadCount>:
test   %rdi,%rdi
je     111a <AMCThreadPool_freeThreadCount+0xa>
jmp    1030 <_pool_free_thread_count@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.AMCThreadPool = type { i32 }
define i64 @AMCThreadPool_freeThreadCount(%struct.AMCThreadPool* %0) {
%2 = alloca i64
%3 = alloca %struct.AMCThreadPool*
store %struct.AMCThreadPool* %0, %struct.AMCThreadPool** %3
%4 = load %struct.AMCThreadPool*, %struct.AMCThreadPool** %3
%5 = icmp ne %struct.AMCThreadPool* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.AMCThreadPool*, %struct.AMCThreadPool** %3
%8 = call i64 @_pool_free_thread_count(%struct.AMCThreadPool* %7)
store i64 %8, i64* %2
br label %10
9: ; preds = %1
store i64 0, i64* %2
br label %10
10: ; preds = %9, %6
%11 = load i64, i64* %2
ret i64 %11
}

LLVM IR (-O2):
%struct.AMCThreadPool = type { i32 }
define i64 @AMCThreadPool_freeThreadCount(%struct.AMCThreadPool* %0) {
%2 = icmp eq %struct.AMCThreadPool* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @_pool_free_thread_count(%struct.AMCThreadPool* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
int ft_toupper(int c) {
  if (c >= 'a' && c <= 'z')
    return (c - ' ');
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1129 <ft_toupper+0x29>
cmpl   $0x7a,-0x8(%rbp)
jg     1129 <ft_toupper+0x29>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <ft_toupper+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 32
store i32 %11, i32* %2
br label %14
12: ; preds = %6, %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memory_error(size_t);
void *malloc_checked(size_t size) {
  void *memory = malloc(size);
  if (!memory)
    memory_error(size);
  return memory;
}


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

x86 assembly (clang, -O2):
<malloc_checked>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <malloc_checked+0x1c>
mov    %r14,%rdi
call   1040 <memory_error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @malloc_checked(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @memory_error(i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
h(x) {}


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

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

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

LLVM IR (-O2):
define i32 @h(i32 %0) {
ret i32 undef
}
int intcmp(const void *a, const void *b) {
  if (*(const int *)a < *(const int *)b)
    return -1;
  if (*(const int *)a > *(const int *)b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<intcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    112a <intcmp+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <intcmp+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    1148 <intcmp+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <intcmp+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @intcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int test_imm_69uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x69 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_69uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 6881280
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ tictactoe();
int main(void) {
  tictactoe();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @tictactoe()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @tictactoe()
ret i32 0
}
/* Variables and functions */
void *cmemset(void *dst, int c, size_t n) {
  if (n != 0) {
    unsigned char *d = dst;
    do
      *d++ = (unsigned char)c;
    while (--n != 0);
  }
  return (dst);
}


x86 assembly (clang, -O0):
<cmemset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1153 <cmemset+0x53>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1122 <cmemset+0x22>
jmp    1153 <cmemset+0x53>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmemset>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <cmemset+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @cmemset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
void gtk_frame_get_label_align() {}


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

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

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

LLVM IR (-O2):
define void @gtk_frame_get_label_align() {
ret void
}
void mem_manage(void) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<mem_manage>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <mem_manage+0x9>
jmp    1109 <mem_manage+0x9>

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

LLVM IR (-O0):
define void @mem_manage() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @mem_manage() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ CallBack1(int, void *);
int /*<<< orphan*/ CheckRunningInMainThread(char *);
void HandCursor(void) {
  if (!CheckRunningInMainThread("HandCursor"))
    return;
  CallBack1(33, (void *)4);
}


x86 assembly (clang, -O0):
<HandCursor>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    113e <HandCursor+0x1e>
jmp    114d <HandCursor+0x2d>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <CallBack1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HandCursor>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     1141 <HandCursor+0x21>
mov    $0x4,%esi
mov    $0x21,%edi
pop    %rax
jmp    1030 <CallBack1@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"HandCursor\00"
define void @HandCursor() {
%1 = call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0
br label %6
4: ; preds = %0
%5 = call i32 @CallBack1(i32 33, i8* inttoptr (i64 4 to i8*))
br label %6
6: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"HandCursor\00"
define void @HandCursor() {
%1 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @CallBack1(i32 33, i8* inttoptr (i64 4 to i8*))
br label %5
5: ; preds = %0, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RamWrite32A(int, int);
unsigned char RdStatus(int);
void SetRec(void) {
  unsigned char UcStRd = 1;
  RamWrite32A(0xF013, 0x00000000);
  while (UcStRd) {
    UcStRd = RdStatus(1);
  }
}


x86 assembly (clang, -O0):
<SetRec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x1,-0x1(%rbp)
mov    $0xf013,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
cmpb   $0x0,-0x1(%rbp)
je     1154 <SetRec+0x34>
mov    $0x1,%edi
call   1040 <RdStatus@plt>
mov    %al,-0x1(%rbp)
jmp    1138 <SetRec+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetRec>:
push   %rax
mov    $0xf013,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
nopl   (%rax)
mov    $0x1,%edi
call   1040 <RdStatus@plt>
test   %al,%al
jne    1130 <SetRec+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @SetRec() {
%1 = alloca i8
store i8 1, i8* %1
%2 = call i32 @RamWrite32A(i32 61459, i32 0)
br label %3
3: ; preds = %6, %0
%4 = load i8, i8* %1
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call zeroext i8 @RdStatus(i32 1)
store i8 %7, i8* %1
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @SetRec() {
%1 = tail call i32 @RamWrite32A(i32 61459, i32 0)
br label %2
2: ; preds = %0, %2
%3 = tail call zeroext i8 @RdStatus(i32 1)
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void verify(int shouldBeTrue, const char *msg) {
  if (!shouldBeTrue) {
    fprintf(stderr, "%s", msg);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    115c <verify+0x3c>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify>:
test   %edi,%edi
je     1125 <verify+0x5>
ret
push   %rax
mov    %rsi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @verify(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 ne i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %4
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @verify(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void sub_m32_imm32(void *_m32, unsigned long imm32) {
  unsigned long *m32 = (unsigned long *)_m32;
  put8(0x81);
  put8(0x2D);
  put32((unsigned long)(m32));
  put32(imm32);
}


x86 assembly (clang, -O0):
<sub_m32_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x81,%edi
call   1030 <put8@plt>
mov    $0x2d,%edi
call   1030 <put8@plt>
mov    -0x18(%rbp),%rdi
call   1040 <put32@plt>
mov    -0x10(%rbp),%rdi
call   1040 <put32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_m32_imm32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x81,%edi
call   1030 <put8@plt>
mov    $0x2d,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
call   1040 <put32@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @sub_m32_imm32(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = call i32 @put8(i32 129)
%9 = call i32 @put8(i32 45)
%10 = load i64*, i64** %5
%11 = ptrtoint i64* %10 to i64
%12 = call i32 @put32(i64 %11)
%13 = load i64, i64* %4
%14 = call i32 @put32(i64 %13)
ret void
}

LLVM IR (-O2):
define void @sub_m32_imm32(i8* %0, i64 %1) {
%3 = tail call i32 @put8(i32 129)
%4 = tail call i32 @put8(i32 45)
%5 = ptrtoint i8* %0 to i64
%6 = tail call i32 @put32(i64 %5)
%7 = tail call i32 @put32(i64 %1)
ret void
}
void byte_reverse_double(double *dnum) {
  union {
    double d;
    char c[sizeof(double)];
  } dc;
  int i;
  char tmp;
  dc.d = *dnum;
  for (i = 0; i < sizeof(double) / 2; i++) {
    tmp = dc.c[i];
    dc.c[i] = dc.c[sizeof(double) - 1 - i];
    dc.c[sizeof(double) - 1 - i] = tmp;
  }
  *dnum = dc.d;
}


x86 assembly (clang, -O0):
<byte_reverse_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x4,%rax
jae    116e <byte_reverse_double+0x6e>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp,%rax,1),%al
mov    %al,-0x15(%rbp)
movslq -0x14(%rbp),%rcx
mov    $0x7,%eax
sub    %rcx,%rax
mov    -0x10(%rbp,%rax,1),%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0x10(%rbp,%rax,1)
mov    -0x15(%rbp),%cl
movslq -0x14(%rbp),%rdx
mov    $0x7,%eax
sub    %rdx,%rax
mov    %cl,-0x10(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <byte_reverse_double+0x1c>
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { double }
define void @byte_reverse_double(double* %0) {
%2 = alloca double*
%3 = alloca %union.anon
%4 = alloca i32
%5 = alloca i8
store double* %0, double** %2
%6 = load double*, double** %2
%7 = load double, double* %6
%8 = bitcast %union.anon* %3 to double*
store double %7, double* %8
store i32 0, i32* %4
br label %9
9: ; preds = %35, %1
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = icmp ult i64 %11, 4
br i1 %12, label %13, label %38
13: ; preds = %9
%14 = bitcast %union.anon* %3 to [8 x i8]*
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [8 x i8], [8 x i8]* %14, i64 0, i64 %16
%18 = load i8, i8* %17
store i8 %18, i8* %5
%19 = bitcast %union.anon* %3 to [8 x i8]*
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = sub i64 7, %21
%23 = getelementptr inbounds [8 x i8], [8 x i8]* %19, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = bitcast %union.anon* %3 to [8 x i8]*
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [8 x i8], [8 x i8]* %25, i64 0, i64 %27
store i8 %24, i8* %28
%29 = load i8, i8* %5
%30 = bitcast %union.anon* %3 to [8 x i8]*
%31 = load i32, i32* %4
%32 = sext i32 %31 to i64
%33 = sub i64 7, %32
%34 = getelementptr inbounds [8 x i8], [8 x i8]* %30, i64 0, i64 %33
store i8 %29, i8* %34
br label %35
35: ; preds = %13
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %9
38: ; preds = %9
%39 = bitcast %union.anon* %3 to double*
%40 = load double, double* %39
%41 = load double*, double** %2
store double %40, double* %41
ret void
}

LLVM IR (-O2):
define void @byte_reverse_double(double* nocapture %0) {
%2 = bitcast double* %0 to i64*
%3 = load i64, i64* %2
%4 = call i64 @llvm.bswap.i64(i64 %3)
%5 = bitcast double* %0 to i64*
store i64 %4, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printn(int);
void main() {
  int x = 65;
  int y = 0;
  int z;
  z = (x - y) / 2;
  printn(z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x41,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <printn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x20,%edi
jmp    1030 <printn@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 65, i32* %1
store i32 0, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = sub nsw i32 %4, %5
%7 = sdiv i32 %6, 2
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @printn(i32 %8)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @printn(i32 32)
ret void
}
void cmdHelp() {}


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

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

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

LLVM IR (-O2):
define void @cmdHelp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *);
void ferr(const char *msg, const char *filename) {
  char buf[(128)];
  sprintf(buf, "%s %s", msg, filename);
  perror(buf);
  exit(1);
}


x86 assembly (clang, -O0):
<ferr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xea7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<ferr>:
push   %rbx
sub    $0x80,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xebb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s %s\00"
define void @ferr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [128 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%11 = call i32 @perror(i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
define void @ferr(i8* %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @perror(i8* %4)
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int strcasecmp(char const *, char const *);
int cgi_cmp_str(const char **aa, const char **bb) {
  assert(*aa != NULL);
  assert(*bb != NULL);
  return (strcasecmp((*aa), (*bb)));
}


x86 assembly (clang, -O0):
<cgi_cmp_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcasecmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgi_cmp_str>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmpq   $0x0,(%rbx)
setne  %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpq   $0x0,(%r14)
setne  %dil
call   1040 <assert@plt>
mov    (%rbx),%rdi
mov    (%r14),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @cgi_cmp_str(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** %5
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8**, i8*** %4
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8**, i8*** %3
%16 = load i8*, i8** %15
%17 = load i8**, i8*** %4
%18 = load i8*, i8** %17
%19 = call i32 @strcasecmp(i8* %16, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @cgi_cmp_str(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i8*, i8** %1
%8 = icmp ne i8* %7, null
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = load i8*, i8** %0
%12 = load i8*, i8** %1
%13 = tail call i32 @strcasecmp(i8* %11, i8* %12)
ret i32 %13
}
/* Variables and functions */
int SIM_power_draincap(double, int, int);
double SIM_array_comp_bit_match_cap(void) {
  return (2 * (SIM_power_draincap((20.0 * 0.0875), 1, 1) +
               SIM_power_draincap((20.0 * 0.0875), 1, 2)));
}


x86 assembly (clang, -O0):
<SIM_array_comp_bit_match_cap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee0(%rip),%xmm0
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <SIM_power_draincap@plt>
mov    %eax,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <SIM_power_draincap@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_array_comp_bit_match_cap>:
push   %rbx
movsd  0xee7(%rip),%xmm0
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <SIM_power_draincap@plt>
mov    %eax,%ebx
movsd  0xece(%rip),%xmm0
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <SIM_power_draincap@plt>
add    %ebx,%eax
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @SIM_array_comp_bit_match_cap() {
%1 = call i32 @SIM_power_draincap(double 1.750000e+00, i32 1, i32 1)
%2 = call i32 @SIM_power_draincap(double 1.750000e+00, i32 1, i32 2)
%3 = add nsw i32 %1, %2
%4 = mul nsw i32 2, %3
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @SIM_array_comp_bit_match_cap() {
%1 = tail call i32 @SIM_power_draincap(double 1.750000e+00, i32 1, i32 1)
%2 = tail call i32 @SIM_power_draincap(double 1.750000e+00, i32 1, i32 2)
%3 = add nsw i32 %2, %1
%4 = shl nsw i32 %3, 1
%5 = sitofp i32 %4 to double
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void io_delay(void) {
  outb(0x0, 0x80);
  outb(0x0, 0x80);
}


x86 assembly (clang, -O0):
<io_delay>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x80,%esi
call   1030 <outb@plt>
xor    %edi,%edi
mov    $0x80,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_delay>:
push   %rax
xor    %edi,%edi
mov    $0x80,%esi
call   1030 <outb@plt>
xor    %edi,%edi
mov    $0x80,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @io_delay() {
%1 = call i32 @outb(i32 0, i32 128)
%2 = call i32 @outb(i32 0, i32 128)
ret void
}

LLVM IR (-O2):
define void @io_delay() {
%1 = tail call i32 @outb(i32 0, i32 128)
%2 = tail call i32 @outb(i32 0, i32 128)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void exit_echo() { printf("this is exit_echo\n"); }


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"this is exit_echo\00"
define void @exit_echo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
struct timespec *calloc(int, int);
int clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ free(struct timespec *);
struct timespec *flu_now() {
  struct timespec *r = calloc(1, sizeof(struct timespec));
  int i = clock_gettime(CLOCK_REALTIME, r);
  if (i != 0) {
    free(r);
    return NULL;
  }
  return r;
}


x86 assembly (clang, -O0):
<flu_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1,%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1180 <flu_now+0x50>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    1188 <flu_now+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flu_now>:
push   %rbx
mov    $0x1,%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1040 <clock_gettime@plt>
test   %eax,%eax
je     1162 <flu_now+0x32>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define %struct.timespec* @flu_now() {
%1 = alloca %struct.timespec*
%2 = alloca %struct.timespec*
%3 = alloca i32
%4 = call %struct.timespec* @calloc(i32 1, i32 4)
store %struct.timespec* %4, %struct.timespec** %2
%5 = load i32, i32* @CLOCK_REALTIME
%6 = load %struct.timespec*, %struct.timespec** %2
%7 = call i32 @clock_gettime(i32 %5, %struct.timespec* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = load %struct.timespec*, %struct.timespec** %2
%12 = call i32 @free(%struct.timespec* %11)
store %struct.timespec* null, %struct.timespec** %1
br label %15
13: ; preds = %0
%14 = load %struct.timespec*, %struct.timespec** %2
store %struct.timespec* %14, %struct.timespec** %1
br label %15
15: ; preds = %13, %10
%16 = load %struct.timespec*, %struct.timespec** %1
ret %struct.timespec* %16
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define %struct.timespec* @flu_now() {
%1 = tail call %struct.timespec* @calloc(i32 1, i32 4)
%2 = load i32, i32* @CLOCK_REALTIME
%3 = tail call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @free(%struct.timespec* %1)
br label %7
7: ; preds = %0, %5
%8 = phi %struct.timespec* [ null, %5 ], [ %1, %0 ]
ret %struct.timespec* %8
}
/* Variables and functions */
char *strrchr(char *, char);
void COM_StripFilename(char *filename) {
  char *p;
  p = strrchr(filename, '/');
  if (!p)
    p = filename;
  *p = 0;
}


x86 assembly (clang, -O0):
<COM_StripFilename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1141 <COM_StripFilename+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<COM_StripFilename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
cmove  %rbx,%rax
movb   $0x0,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @COM_StripFilename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
store i8* %9, i8** %3
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
store i8 0, i8* %11
ret void
}

LLVM IR (-O2):
define void @COM_StripFilename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* %0, i8* %2
store i8 0, i8* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void package_get_device_description(char *buffer) {
  memset(buffer, 0, 17 - 1);
  buffer[0x00] = 0x5a;
  buffer[0x01] = 0x42;
}


x86 assembly (clang, -O0):
<package_get_device_description>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movb   $0x5a,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x42,0x1(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<package_get_device_description>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
movw   $0x425a,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @package_get_device_description(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memset(i8* %3, i32 0, i32 16)
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 90, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 66, i8* %8
ret void
}

LLVM IR (-O2):
define void @package_get_device_description(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i32 0, i32 16)
store i8 90, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 66, i8* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_mullo_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test51(__m64 a, __m64 b) { return _mm_mullo_pi16(a, b); }


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

x86 assembly (clang, -O2):
<test51>:
jmp    1030 <_mm_mullo_pi16@plt>

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

LLVM IR (-O2):
define i32 @test51(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_mullo_pi16(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int fibb(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("fib %d\n", fibb(30));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1e,%edi
call   1030 <fibb@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1e,%edi
call   1030 <fibb@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"fib %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fibb(i32 30)
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"fib %d\0A\00"
define i32 @main() {
%1 = tail call i32 @fibb(i32 30)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ KAPI_save_as_header_String_array_always(int /*<<< orphan*/ *,
                                                           char **, int);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
void KAPI_save_as_header_String_array_list_always(FILE *fp, char **ppch,
                                                  int number_of_elements) {
  FILE *fpTmp = fp;
  KAPI_save_as_header_String_array_always(fp, ppch, number_of_elements);
  fwrite(",", sizeof(char), 1, fpTmp);
}


x86 assembly (clang, -O0):
<KAPI_save_as_header_String_array_list_always>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <KAPI_save_as_header_String_array_always@plt>
mov    -0x20(%rbp),%rcx
lea    0xeaa(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KAPI_save_as_header_String_array_list_always>:
push   %rbx
mov    %rdi,%rbx
call   1030 <KAPI_save_as_header_String_array_always@plt>
mov    $0x2c,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <fputc@plt>

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

LLVM IR (-O2):
define void @KAPI_save_as_header_String_array_list_always(i32* %0, i8** %1, i32 %2) {
%4 = tail call i32 @KAPI_save_as_header_String_array_always(i32* %0, i8** %1, i32 %2)
%5 = tail call i32 @fputc(i32 44, i32* %0)
ret void
}
int len_str(char *str) {
  int i;
  for (i = 0; str[i] != '\0'; i++) {
  }
  return i;
}


x86 assembly (clang, -O0):
<len_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <len_str+0x37>
jmp    1129 <len_str+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <len_str+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<len_str>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <len_str+0x10>
ret

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

LLVM IR (-O2):
define i32 @len_str(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdout;
void print_equation(char *callSign) {
  printf(":%-9s:EQNS.0,0.16016,-40,0,0,0,0,0,0,0,0,0,0,0,0\n", callSign);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print_equation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_equation>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [50 x i8] c":%-9s:EQNS.0,0.16016,-40,0,0,0,0,0,0,0,0,0,0,0,0\0A\00"
@stdout = global i32 0
define void @print_equation(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c":%-9s:EQNS.0,0.16016,-40,0,0,0,0,0,0,0,0,0,0,0,0\0A\00"
@stdout = global i32 0
define void @print_equation(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
void RTSemPingPongInit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemPingPongInit() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XButtonPressedEvent;

/* Variables and functions */
void set_XButtonPressedEvent_send_event(void *_p, int _v) {
  ((XButtonPressedEvent *)_p)->send_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XButtonPressedEvent_send_event>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XButtonPressedEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void beginSerial(long baud) { printf("beginSerial %ld\n", baud); }


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"beginSerial %ld\0A\00"
define void @beginSerial(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
void cxa_criticalSection_exit(void) {}


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

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

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

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