xunge/DecIR huggingface dataset:
/* Variables and functions */
bool is_caps_var_char(int ch) {
  return (ch >= 'A' && ch <= 'Z') || ch == '_' || (ch >= '0' && ch <= '9');
}


x86 assembly (clang, -O0):
<is_caps_var_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1120 <is_caps_var_char+0x20>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    114e <is_caps_var_char+0x4e>
mov    $0x1,%al
cmpl   $0x5f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114e <is_caps_var_char+0x4e>
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1148 <is_caps_var_char+0x48>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_caps_var_char>:
lea    -0x41(%rdi),%eax
cmp    $0x1a,%eax
setb   %al
cmp    $0x5f,%edi
sete   %cl
or     %al,%cl
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %al
or     %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @is_caps_var_char(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = icmp eq i32 %0, 95
%5 = or i1 %4, %3
%6 = add i32 %0, -48
%7 = icmp ult i32 %6, 10
%8 = or i1 %7, %5
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main(void) {
  sleep(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sleep(i32 1)
ret i32 0
}
void __automaton_fail() {
  goto error;
error:;
}


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

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

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

LLVM IR (-O2):
define void @__automaton_fail() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bingham_constants_init();
int /*<<< orphan*/ hypersphere_init();
void bingham_init() {
  bingham_constants_init();
  hypersphere_init();
}


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

x86 assembly (clang, -O2):
<bingham_init>:
push   %rax
xor    %eax,%eax
call   1040 <bingham_constants_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <hypersphere_init@plt>

LLVM IR (-O0):
define void @bingham_init() {
%1 = call i32 (...) @bingham_constants_init()
%2 = call i32 (...) @hypersphere_init()
ret void
}

LLVM IR (-O2):
define void @bingham_init() {
%1 = tail call i32 (...) @bingham_constants_init()
%2 = tail call i32 (...) @hypersphere_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ proc1();
int /*<<< orphan*/ proc2();
void e() {
  proc1();
  proc2();
  return;
}


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

x86 assembly (clang, -O2):
<e>:
push   %rax
xor    %eax,%eax
call   1040 <proc1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <proc2@plt>

LLVM IR (-O0):
define void @e() {
%1 = call i32 (...) @proc1()
%2 = call i32 (...) @proc2()
ret void
}

LLVM IR (-O2):
define void @e() {
%1 = tail call i32 (...) @proc1()
%2 = tail call i32 (...) @proc2()
ret void
}
/* Variables and functions */
size_t line_len(char *data_idx, char *data_end) {
  if (data_idx < data_end) {
    size_t len = data_end - data_idx;
    return (len > 16) ? 16 : len;
  }
  return 0;
}


x86 assembly (clang, -O0):
<line_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1157 <line_len+0x57>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x10,-0x20(%rbp)
jbe    1142 <line_len+0x42>
mov    $0x10,%eax
mov    %rax,-0x28(%rbp)
jmp    114a <line_len+0x4a>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115f <line_len+0x5f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_len>:
mov    %rsi,%rax
sub    %rdi,%rax
cmp    $0x10,%rax
mov    $0x10,%ecx
cmovb  %rax,%rcx
xor    %eax,%eax
cmp    %rdi,%rsi
cmova  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @line_len(i8* %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = icmp ult i8* %7, %8
br i1 %9, label %10, label %23
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
store i64 %15, i64* %6
%16 = load i64, i64* %6
%17 = icmp ugt i64 %16, 16
br i1 %17, label %18, label %19
18: ; preds = %10
br label %21
19: ; preds = %10
%20 = load i64, i64* %6
br label %21
21: ; preds = %19, %18
%22 = phi i64 [ 16, %18 ], [ %20, %19 ]
store i64 %22, i64* %3
br label %24
23: ; preds = %2
store i64 0, i64* %3
br label %24
24: ; preds = %23, %21
%25 = load i64, i64* %3
ret i64 %25
}

LLVM IR (-O2):
define i64 @line_len(i8* %0, i8* %1) {
%3 = icmp ult i8* %0, %1
%4 = ptrtoint i8* %1 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = icmp ult i64 %6, 16
%8 = select i1 %7, i64 %6, i64 16
%9 = select i1 %3, i64 %8, i64 0
ret i64 %9
}
void XtCallbackExclusive() {}


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

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

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

LLVM IR (-O2):
define void @XtCallbackExclusive() {
ret void
}
/* Type definitions */
struct blob_attr {
  int dummy;
};

/* Variables and functions */
int blob_pad_len(struct blob_attr const *);
struct blob_attr *blob_next(const struct blob_attr *attr) {
  return (struct blob_attr *)((char *)attr + blob_pad_len(attr));
}


x86 assembly (clang, -O0):
<blob_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <blob_pad_len@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blob_next>:
push   %rbx
mov    %rdi,%rbx
call   1030 <blob_pad_len@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.blob_attr = type { i32 }
define %struct.blob_attr* @blob_next(%struct.blob_attr* %0) {
%2 = alloca %struct.blob_attr*
store %struct.blob_attr* %0, %struct.blob_attr** %2
%3 = load %struct.blob_attr*, %struct.blob_attr** %2
%4 = bitcast %struct.blob_attr* %3 to i8*
%5 = load %struct.blob_attr*, %struct.blob_attr** %2
%6 = call i32 @blob_pad_len(%struct.blob_attr* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = bitcast i8* %8 to %struct.blob_attr*
ret %struct.blob_attr* %9
}

LLVM IR (-O2):
%struct.blob_attr = type { i32 }
define %struct.blob_attr* @blob_next(%struct.blob_attr* %0) {
%2 = bitcast %struct.blob_attr* %0 to i8*
%3 = tail call i32 @blob_pad_len(%struct.blob_attr* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %2, i64 %4
%6 = bitcast i8* %5 to %struct.blob_attr*
ret %struct.blob_attr* %6
}
void *vml_memset(void *dst, int c, unsigned int n) {
  char *d;
  if (dst && n) {
    d = dst;
    while (n--) {
      d[n] = c;
    }
  }
  return (dst);
}


x86 assembly (clang, -O0):
<vml_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1158 <vml_memset+0x58>
cmpl   $0x0,-0x10(%rbp)
je     1158 <vml_memset+0x58>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     1153 <vml_memset+0x53>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
jmp    112b <vml_memset+0x2b>
jmp    1158 <vml_memset+0x58>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vml_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1127 <vml_memset+0x17>
test   %edx,%edx
je     1127 <vml_memset+0x17>
mov    %edx,%edx
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @vml_memset(i8* returned writeonly %0, i32 %1, i32 %2) {
%4 = icmp ne i8* %0, null
%5 = icmp ne i32 %2, 0
%6 = and i1 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = trunc i32 %1 to i8
%9 = zext i32 %2 to i64
br label %10
10: ; preds = %7, %3
ret i8* %0
}
void RPI_ArmTimerInit(void) {}


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

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

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

LLVM IR (-O2):
define void @RPI_ArmTimerInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void default_message_handler(int level, const char *text) {
  fprintf(stderr, "%s", text);
}


x86 assembly (clang, -O0):
<default_message_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_message_handler>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @default_message_handler(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @default_message_handler(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
double fakd(int);
double mbincoeffd(const unsigned long int n, const unsigned long int k) {
  return fakd((int)n) / (fakd((int)k) * fakd((int)n - (int)k));
}


x86 assembly (clang, -O0):
<mbincoeffd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <fakd@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1030 <fakd@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rax
sub    %eax,%edi
call   1030 <fakd@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbincoeffd>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <fakd@plt>
movsd  %xmm0,0x10(%rsp)
mov    %r14d,%edi
call   1030 <fakd@plt>
movsd  %xmm0,0x8(%rsp)
sub    %r14d,%ebx
mov    %ebx,%edi
call   1030 <fakd@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @mbincoeffd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = call double @fakd(i32 %6)
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
%10 = call double @fakd(i32 %9)
%11 = load i64, i64* %3
%12 = trunc i64 %11 to i32
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = sub nsw i32 %12, %14
%16 = call double @fakd(i32 %15)
%17 = fmul double %10, %16
%18 = fdiv double %7, %17
ret double %18
}

LLVM IR (-O2):
define double @mbincoeffd(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = tail call double @fakd(i32 %3)
%5 = trunc i64 %1 to i32
%6 = tail call double @fakd(i32 %5)
%7 = sub nsw i32 %3, %5
%8 = tail call double @fakd(i32 %7)
%9 = fmul double %6, %8
%10 = fdiv double %4, %9
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void RB_XMLDB_Generate_EndSection(FILE *dest_doc, int depth, char *name) {
  (depth = depth);
  ;
  (name = name);
  ;
  fprintf(dest_doc, "%s", "</section>\n");
}


x86 assembly (clang, -O0):
<RB_XMLDB_Generate_EndSection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec4(%rip),%rsi
lea    0xec0(%rip),%rdx
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RB_XMLDB_Generate_EndSection>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [12 x i8] c"</section>\0A\00"
define void @RB_XMLDB_Generate_EndSection(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
store i32 %7, i32* %5
%8 = load i8*, i8** %6
store i8* %8, i8** %6
%9 = load i32*, i32** %4
%10 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"</section>\0A\00"
define void @RB_XMLDB_Generate_EndSection(i32* nocapture %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i64 11, i64 1, i32* %0)
ret void
}
void free2dCharArray(char **ptr, int rows) {
  int i;
  for (i = 0; i < rows; i++)
    free(ptr[i]);
  free(ptr);
}


x86 assembly (clang, -O0):
<free2dCharArray>:
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    1151 <free2dCharArray+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free2dCharArray+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free2dCharArray>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free2dCharArray+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free2dCharArray+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free2dCharArray(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
int next_string(char *buf) {
  int pos = 0;
  while (*buf != 0) {
    buf++;
    pos++;
  }
  return ++pos;
}


x86 assembly (clang, -O0):
<next_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <next_string+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <next_string+0xf>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_string>:
cmpb   $0x0,(%rdi)
je     111b <next_string+0x1b>
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <next_string+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @next_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int tcdrain(int);
int termios_tcdrain(int fd) { return tcdrain(fd); }


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

x86 assembly (clang, -O2):
<termios_tcdrain>:
jmp    1030 <tcdrain@plt>

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

LLVM IR (-O2):
define i32 @termios_tcdrain(i32 %0) {
%2 = tail call i32 @tcdrain(i32 %0)
ret i32 %2
}
/* Variables and functions */
float remainerf(float, float);
float remquof(float x, float y, int *quo) {
  *quo = (int)x / (int)y;
  return remainerf(x, y);
}


x86 assembly (clang, -O0):
<remquof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
cvttss2si -0x4(%rbp),%eax
cvttss2si -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <remainerf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remquof>:
cvttss2si %xmm0,%eax
cvttss2si %xmm1,%ecx
cltd
idiv   %ecx
mov    %eax,(%rdi)
jmp    1030 <remainerf@plt>

LLVM IR (-O0):
define float @remquof(float %0, float %1, i32* %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca i32*
store float %0, float* %4
store float %1, float* %5
store i32* %2, i32** %6
%7 = load float, float* %4
%8 = fptosi float %7 to i32
%9 = load float, float* %5
%10 = fptosi float %9 to i32
%11 = sdiv i32 %8, %10
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load float, float* %4
%14 = load float, float* %5
%15 = call float @remainerf(float %13, float %14)
ret float %15
}

LLVM IR (-O2):
define float @remquof(float %0, float %1, i32* nocapture writeonly %2) {
%4 = fptosi float %0 to i32
%5 = fptosi float %1 to i32
%6 = sdiv i32 %4, %5
store i32 %6, i32* %2
%7 = tail call float @remainerf(float %0, float %1)
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  char *s;
  printf("malloc: start, calling malloc ...\n");
  s = malloc(10);
  printf("malloc: called malloc, calling free ...\n");
  free(s);
  printf("malloc: called free, returning ...\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    0xed7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xee5(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"malloc: start, calling malloc ...\0A\00"
@.str.1 = [41 x i8] c"malloc: called malloc, calling free ...\0A\00"
@.str.2 = [36 x i8] c"malloc: called free, returning ...\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i8* @malloc(i32 10)
store i8* %4, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [34 x i8] c"malloc: start, calling malloc ...\00"
@str.3 = [40 x i8] c"malloc: called malloc, calling free ...\00"
@str.4 = [35 x i8] c"malloc: called free, returning ...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @free(i8* %2)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
void rotr(int *a, int *b, int *c) {
  int e;
  int d;
  e = *a;
  d = *b;
  *a = *c;
  *b = e;
  *c = d;
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    (%rdi),%r8d
mov    (%rsi),%ecx
mov    (%rdx),%eax
mov    %eax,(%rdi)
mov    %r8d,(%rsi)
mov    %ecx,(%rdx)
ret

LLVM IR (-O0):
define void @rotr(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
store i32 %12, i32* %8
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = load i32*, i32** %5
store i32 %16, i32* %17
%18 = load i32, i32* %8
%19 = load i32*, i32** %6
store i32 %18, i32* %19
ret void
}

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = load i32, i32* %2
store i32 %6, i32* %0
store i32 %4, i32* %1
store i32 %5, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ moveBackward();
int /*<<< orphan*/ moveForward();
int /*<<< orphan*/ stopMoving();
int /*<<< orphan*/ testDelay();
int /*<<< orphan*/ turnLeft();
int /*<<< orphan*/ turnRight();
void startupTest(void) {
  moveForward();
  testDelay();
  stopMoving();
  moveBackward();
  testDelay();
  stopMoving();
  turnRight();
  testDelay();
  stopMoving();
  turnLeft();
  testDelay();
  stopMoving();
}


x86 assembly (clang, -O0):
<startupTest>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <moveForward@plt>
mov    $0x0,%al
call   1070 <testDelay@plt>
mov    $0x0,%al
call   1080 <stopMoving@plt>
mov    $0x0,%al
call   1030 <moveBackward@plt>
mov    $0x0,%al
call   1070 <testDelay@plt>
mov    $0x0,%al
call   1080 <stopMoving@plt>
mov    $0x0,%al
call   1050 <turnRight@plt>
mov    $0x0,%al
call   1070 <testDelay@plt>
mov    $0x0,%al
call   1080 <stopMoving@plt>
mov    $0x0,%al
call   1060 <turnLeft@plt>
mov    $0x0,%al
call   1070 <testDelay@plt>
mov    $0x0,%al
call   1080 <stopMoving@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<startupTest>:
push   %rax
xor    %eax,%eax
call   1040 <moveForward@plt>
xor    %eax,%eax
call   1070 <testDelay@plt>
xor    %eax,%eax
call   1080 <stopMoving@plt>
xor    %eax,%eax
call   1030 <moveBackward@plt>
xor    %eax,%eax
call   1070 <testDelay@plt>
xor    %eax,%eax
call   1080 <stopMoving@plt>
xor    %eax,%eax
call   1050 <turnRight@plt>
xor    %eax,%eax
call   1070 <testDelay@plt>
xor    %eax,%eax
call   1080 <stopMoving@plt>
xor    %eax,%eax
call   1060 <turnLeft@plt>
xor    %eax,%eax
call   1070 <testDelay@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <stopMoving@plt>

LLVM IR (-O0):
define void @startupTest() {
%1 = call i32 (...) @moveForward()
%2 = call i32 (...) @testDelay()
%3 = call i32 (...) @stopMoving()
%4 = call i32 (...) @moveBackward()
%5 = call i32 (...) @testDelay()
%6 = call i32 (...) @stopMoving()
%7 = call i32 (...) @turnRight()
%8 = call i32 (...) @testDelay()
%9 = call i32 (...) @stopMoving()
%10 = call i32 (...) @turnLeft()
%11 = call i32 (...) @testDelay()
%12 = call i32 (...) @stopMoving()
ret void
}

LLVM IR (-O2):
define void @startupTest() {
%1 = tail call i32 (...) @moveForward()
%2 = tail call i32 (...) @testDelay()
%3 = tail call i32 (...) @stopMoving()
%4 = tail call i32 (...) @moveBackward()
%5 = tail call i32 (...) @testDelay()
%6 = tail call i32 (...) @stopMoving()
%7 = tail call i32 (...) @turnRight()
%8 = tail call i32 (...) @testDelay()
%9 = tail call i32 (...) @stopMoving()
%10 = tail call i32 (...) @turnLeft()
%11 = tail call i32 (...) @testDelay()
%12 = tail call i32 (...) @stopMoving()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_setname_np(char *);
int main() {
  pthread_setname_np("abc");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <pthread_setname_np@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @pthread_setname_np(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
define i32 @main() {
%1 = tail call i32 @pthread_setname_np(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef scalar_t__ u_int64_t;

/* Variables and functions */
double calc_pps(u_int64_t new_pkts, u_int64_t last_pkts, double interval) {
  double pps;
  pps = (double)(new_pkts - last_pkts) / interval;
  return (pps);
}


x86 assembly (clang, -O0):
<calc_pps>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
cvtsi2sd %rax,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_pps>:
sub    %rsi,%rdi
cvtsi2sd %rdi,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calc_pps(i64 %0, i64 %1, double %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca double
%7 = alloca double
store i64 %0, i64* %4
store i64 %1, i64* %5
store double %2, double* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = sub nsw i64 %8, %9
%11 = sitofp i64 %10 to double
%12 = load double, double* %6
%13 = fdiv double %11, %12
store double %13, double* %7
%14 = load double, double* %7
ret double %14
}

LLVM IR (-O2):
define double @calc_pps(i64 %0, i64 %1, double %2) {
%4 = sub nsw i64 %0, %1
%5 = sitofp i64 %4 to double
%6 = fdiv double %5, %2
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void test() {
  int arr[] = {1, 2, 3};
  int *pp = arr;
  printf("%d", pp[0]);
  printf("\n");
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@__const.test.arr = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @test() {
%1 = alloca [3 x i32]
%2 = alloca i32*
%3 = bitcast [3 x i32]* %1 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = 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 = [3 x i8] c"%d\00"
define void @test() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @putchar(i32 10)
ret void
}
void uart_putc(const char c) {
  while (!((*(volatile unsigned *)0x50000010) & 0x2))
    ;
  (*(volatile unsigned char *)0x50000020) = c;
  if (c == '\n')
    uart_putc('\r');
}


x86 assembly (clang, -O0):
<uart_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x50000010,%eax
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113d <uart_putc+0x2d>
jmp    1142 <uart_putc+0x32>
jmp    111e <uart_putc+0xe>
mov    -0x1(%rbp),%cl
mov    $0x50000020,%eax
mov    %cl,(%rax)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1163 <uart_putc+0x53>
mov    $0xd,%edi
call   1030 <uart_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_putc>:
testl  $0x2,0x50000010
je     1100 <uart_putc>
mov    %dil,0x50000020
50
cmp    $0xa,%dil
jne    1135 <uart_putc+0x35>
nopl   0x0(%rax,%rax,1)
testl  $0x2,0x50000010
je     1120 <uart_putc+0x20>
movb   $0xd,0x50000020
0d
ret

LLVM IR (-O0):
define void @uart_putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i32, i32* inttoptr (i64 1342177296 to i32*)
%5 = and i32 %4, 2
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i8, i8* %2
store volatile i8 %10, i8* inttoptr (i64 1342177312 to i8*)
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %14, label %15
14: ; preds = %9
br label %15
15: ; preds = %14, %9
ret void
}

LLVM IR (-O2):
define void @uart_putc(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 1342177296 to i32*)
%4 = and i32 %3, 2
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 1342177312 to i8*)
%7 = icmp eq i8 %0, 10
br i1 %7, label %8, label %13
8: ; preds = %6, %8
%9 = load volatile i32, i32* inttoptr (i64 1342177296 to i32*)
%10 = and i32 %9, 2
%11 = icmp eq i32 %10, 0
br i1 %11, label %8, label %12
12: ; preds = %8
store volatile i8 13, i8* inttoptr (i64 1342177312 to i8*)
br label %13
13: ; preds = %12, %6
ret void
}
int block_is_present(void) {
  return (*((volatile unsigned int *)((((0xf0000000)) + 0))) & 0x00000008) ? 1
                                                                           : 0;
}


x86 assembly (clang, -O0):
<block_is_present>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf0000000,%eax
mov    (%rax),%edx
and    $0x8,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_is_present>:
mov    $0xf0000000,%eax
mov    (%rax),%eax
shr    $0x3,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @block_is_present() {
%1 = load volatile i32, i32* inttoptr (i64 4026531840 to i32*)
%2 = and i32 %1, 8
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
ret i32 %5
}

LLVM IR (-O2):
define i32 @block_is_present() {
%1 = load volatile i32, i32* inttoptr (i64 4026531840 to i32*)
%2 = lshr i32 %1, 3
%3 = and i32 %2, 1
ret i32 %3
}
int tls13_client_certificate_verify_send(struct tls13_ctx *ctx) { return 1; }


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

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

LLVM IR (-O0):
%struct.tls13_ctx = type opaque
define i32 @tls13_client_certificate_verify_send(%struct.tls13_ctx* %0) {
%2 = alloca %struct.tls13_ctx*
store %struct.tls13_ctx* %0, %struct.tls13_ctx** %2
ret i32 1
}

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_client_certificate_verify_send(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ *BN_new();
int BN_rand(int /*<<< orphan*/ *, int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
BIGNUM *createRandomExponent(void) {
  BIGNUM *buf;
  buf = BN_new();
  int ret = BN_rand(buf, 192 * 8, 0, 0);
  if (ret < 0) {
    printf("createRandomExponent: BN_rand failed: %d", ret);
  }
  return buf;
}


x86 assembly (clang, -O0):
<createRandomExponent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <BN_new@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x600,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <BN_rand@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1171 <createRandomExponent+0x41>
mov    -0xc(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createRandomExponent>:
push   %rbx
xor    %eax,%eax
call   1040 <BN_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x600,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <BN_rand@plt>
test   %eax,%eax
jns    115e <createRandomExponent+0x2e>
lea    0xea9(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"createRandomExponent: BN_rand failed: %d\00"
define i32* @createRandomExponent() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* (...) @BN_new()
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @BN_rand(i32* %4, i32 1536, i32 0, i32 0)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %0
%12 = load i32*, i32** %1
ret i32* %12
}

LLVM IR (-O2):
@.str = [41 x i8] c"createRandomExponent: BN_rand failed: %d\00"
define i32* @createRandomExponent() {
%1 = tail call i32* (...) @BN_new()
%2 = tail call i32 @BN_rand(i32* %1, i32 1536, i32 0, i32 0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %6
6: ; preds = %4, %0
ret i32* %1
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *al_sdup(const char *str) {
  size_t len = strlen(str) + 1;
  char *dup = malloc(len);
  if (dup != NULL)
    memcpy(dup, str, len);
  return dup;
}


x86 assembly (clang, -O0):
<al_sdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1177 <al_sdup+0x47>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<al_sdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <al_sdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @al_sdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int strcoll_l(const char *str1, const char *str2, locale_t loc) { return 0; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @NSEEL_HOSTSTUB_EnterMutex() {
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int, int);
int pthread_self();
void sigint_handler(int args) {
  printf("Catch SIGINT signal...pid:%d, tid:%d\n", getpid(), pthread_self());
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigint_handler>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Catch SIGINT signal...pid:%d, tid:%d\0A\00"
define void @sigint_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = call i32 (...) @pthread_self()
%5 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Catch SIGINT signal...pid:%d, tid:%d\0A\00"
define void @sigint_handler(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (...) @pthread_self()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret void
}
void gendaddu() {}


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

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

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

LLVM IR (-O2):
define void @gendaddu() {
ret void
}
unsigned int _hill(long long src) { return (unsigned int)(src >> 32); }


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

x86 assembly (clang, -O2):
<_hill>:
mov    %rdi,%rax
shr    $0x20,%rax
ret

LLVM IR (-O0):
define i32 @_hill(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @_hill(i64 %0) {
%2 = lshr i64 %0, 32
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ lum(int, int, int);
int /*<<< orphan*/ setlum(int, int, int, int /*<<< orphan*/, int *, int *,
                          int *);
void fz_luminosity_rgb(int *bdr, int *bdg, int *bdb, int sr, int sg, int sb) {
  setlum(*bdr, *bdg, *bdb, lum(sr, sg, sb), bdr, bdg, bdb);
}


x86 assembly (clang, -O0):
<fz_luminosity_rgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
call   1040 <lum@plt>
mov    -0x30(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    %eax,%ecx
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    -0x18(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <setlum@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz_luminosity_rgb>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    (%rdi),%ebp
mov    (%rsi),%r12d
mov    (%rdx),%r13d
mov    %ecx,%edi
mov    %r8d,%esi
mov    %r9d,%edx
call   1040 <lum@plt>
mov    %rbx,(%rsp)
mov    %ebp,%edi
mov    %r12d,%esi
mov    %r13d,%edx
mov    %eax,%ecx
mov    %r15,%r8
mov    %r14,%r9
call   1030 <setlum@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @fz_luminosity_rgb(i32* %0, i32* %1, i32* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = load i32*, i32** %9
%18 = load i32, i32* %17
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = call i32 @lum(i32 %19, i32 %20, i32 %21)
%23 = load i32*, i32** %7
%24 = load i32*, i32** %8
%25 = load i32*, i32** %9
%26 = call i32 @setlum(i32 %14, i32 %16, i32 %18, i32 %22, i32* %23, i32* %24, i32* %25)
ret void
}

LLVM IR (-O2):
define void @fz_luminosity_rgb(i32* %0, i32* %1, i32* %2, i32 %3, i32 %4, i32 %5) {
%7 = load i32, i32* %0
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = tail call i32 @lum(i32 %3, i32 %4, i32 %5)
%11 = tail call i32 @setlum(i32 %7, i32 %8, i32 %9, i32 %10, i32* %0, i32* %1, i32* %2)
ret void
}