xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int x;
  int y;
  assume(x == y && y >= 0);
  while (x != 0) {
    x--;
    y--;
    if (x < 0 || y < 0)
      break;
  }
  assert(y == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jne    114a <main+0x2a>
cmpl   $0x0,-0xc(%rbp)
setge  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
cmpl   $0x0,-0x8(%rbp)
je     1191 <main+0x71>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1187 <main+0x67>
cmpl   $0x0,-0xc(%rbp)
jge    118c <main+0x6c>
jmp    1191 <main+0x71>
jmp    1157 <main+0x37>
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 0
br label %10
10: ; preds = %7, %0
%11 = phi i1 [ false, %0 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assume(i32 %12)
br label %14
14: ; preds = %28, %10
%15 = load i32, i32* %2
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %29
17: ; preds = %14
%18 = load i32, i32* %2
%19 = add nsw i32 %18, -1
store i32 %19, i32* %2
%20 = load i32, i32* %3
%21 = add nsw i32 %20, -1
store i32 %21, i32* %3
%22 = load i32, i32* %2
%23 = icmp slt i32 %22, 0
br i1 %23, label %27, label %24
24: ; preds = %17
%25 = load i32, i32* %3
%26 = icmp slt i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %24, %17
br label %29
28: ; preds = %24
br label %14
29: ; preds = %27, %14
%30 = load i32, i32* %3
%31 = icmp eq i32 %30, 0
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
scalar_t__ ppc_cpu_has_hwivor();
scalar_t__ ppc_cpu_has_ivor();
scalar_t__ ppc_cpu_has_ivpr();
unsigned ppc_cpu_has_ivpr_and_ivor() {
  return ppc_cpu_has_ivpr() && (ppc_cpu_has_ivor() || ppc_cpu_has_hwivor());
}


x86 assembly (clang, -O0):
<ppc_cpu_has_ivpr_and_ivor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ppc_cpu_has_ivpr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     1181 <ppc_cpu_has_ivpr_and_ivor+0x51>
mov    $0x0,%al
call   1040 <ppc_cpu_has_ivor@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    117b <ppc_cpu_has_ivpr_and_ivor+0x4b>
mov    $0x0,%al
call   1050 <ppc_cpu_has_hwivor@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppc_cpu_has_ivpr_and_ivor>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <ppc_cpu_has_ivpr@plt>
test   %rax,%rax
je     115f <ppc_cpu_has_ivpr_and_ivor+0x2f>
xor    %eax,%eax
call   1040 <ppc_cpu_has_ivor@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    115f <ppc_cpu_has_ivpr_and_ivor+0x2f>
xor    %eax,%eax
call   1050 <ppc_cpu_has_hwivor@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ppc_cpu_has_ivpr_and_ivor() {
%1 = call i64 (...) @ppc_cpu_has_ivpr()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %11
3: ; preds = %0
%4 = call i64 (...) @ppc_cpu_has_ivor()
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = call i64 (...) @ppc_cpu_has_hwivor()
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %6, %3
%10 = phi i1 [ true, %3 ], [ %8, %6 ]
br label %11
11: ; preds = %9, %0
%12 = phi i1 [ false, %0 ], [ %10, %9 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @ppc_cpu_has_ivpr_and_ivor() {
%1 = tail call i64 (...) @ppc_cpu_has_ivpr()
%2 = icmp eq i64 %1, 0
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i64 (...) @ppc_cpu_has_ivor()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 (...) @ppc_cpu_has_hwivor()
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %3, %6, %0
%11 = phi i32 [ 0, %0 ], [ 1, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          ("Usage: %s [-d debug_flags] [-f] [-v] "
           " device \n\n"),
          prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"Usage: %s [-d debug_flags] [-f] [-v] device \0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"Usage: %s [-d debug_flags] [-f] [-v] device \0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
char *skip_whitespace(char *p) {
  while ((*p == ' ') || (*p == '\t') || (*p == '\n'))
    p++;
  return p;
}


x86 assembly (clang, -O0):
<skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1142 <skip_whitespace+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     1142 <skip_whitespace+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <skip_whitespace+0x52>
jmp    1163 <skip_whitespace+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_whitespace+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_whitespace>:
mov    %rdi,%rax
movabs $0x100000600,%rcx
nopl   (%rax)
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1125 <skip_whitespace+0x25>
bt     %rdx,%rcx
jae    1125 <skip_whitespace+0x25>
add    $0x1,%rax
jmp    1110 <skip_whitespace+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_whitespace(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
i8 10, label %5
]
5: ; preds = %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ clif_GMmessage(int /*<<< orphan*/ *, char const *,
                                  scalar_t__, int /*<<< orphan*/);
char *msg_txt(int);
scalar_t__ strlen(char const *);
int chrif_maintenanceack(int maintenance) {
  const char *mes = (maintenance) ? msg_txt(82) : msg_txt(83);
  clif_GMmessage(NULL, mes, strlen(mes) + 1, 0);
  return 0;
}


x86 assembly (clang, -O0):
<chrif_maintenanceack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1158 <chrif_maintenanceack+0x28>
mov    $0x52,%edi
call   1050 <msg_txt@plt>
mov    %rax,-0x18(%rbp)
jmp    1166 <chrif_maintenanceack+0x36>
mov    $0x53,%edi
call   1050 <msg_txt@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
xor    %eax,%eax
mov    %eax,%edi
xor    %ecx,%ecx
call   1040 <clif_GMmessage@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chrif_maintenanceack>:
push   %rbx
xor    %eax,%eax
test   %edi,%edi
sete   %al
or     $0x52,%eax
mov    %eax,%edi
call   1050 <msg_txt@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
xor    %edi,%edi
mov    %rbx,%rsi
xor    %ecx,%ecx
call   1040 <clif_GMmessage@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @chrif_maintenanceack(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i8* @msg_txt(i32 82)
br label %10
8: ; preds = %1
%9 = call i8* @msg_txt(i32 83)
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ %7, %6 ], [ %9, %8 ]
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %3
%14 = call i64 @strlen(i8* %13)
%15 = add nsw i64 %14, 1
%16 = call i32 @clif_GMmessage(i32* null, i8* %12, i64 %15, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @chrif_maintenanceack(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 83, i32 82
%4 = tail call i8* @msg_txt(i32 %3)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %4)
%6 = add nsw i64 %5, 1
%7 = tail call i32 @clif_GMmessage(i32* null, i8* %4, i64 %6, i32 0)
ret i32 0
}
/* Variables and functions */
int pow257(int, int);
int mkoff_s_f(int i) {
  return (pow257(139, 127 * i) + pow257(139, 125 * i)) % 257;
}


x86 assembly (clang, -O0):
<mkoff_s_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x7f,-0x4(%rbp),%esi
mov    $0x8b,%edi
call   1030 <pow257@plt>
mov    %eax,-0x8(%rbp)
imul   $0x7d,-0x4(%rbp),%esi
mov    $0x8b,%edi
call   1030 <pow257@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
mov    $0x101,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkoff_s_f>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%esi
shl    $0x7,%esi
sub    %edi,%esi
mov    $0x8b,%edi
call   1030 <pow257@plt>
mov    %eax,%ebp
imul   $0x7d,%ebx,%esi
mov    $0x8b,%edi
call   1030 <pow257@plt>
add    %ebp,%eax
cltq
imul   $0x7f807f81,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x8,%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mkoff_s_f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 127, %3
%5 = call i32 @pow257(i32 139, i32 %4)
%6 = load i32, i32* %2
%7 = mul nsw i32 125, %6
%8 = call i32 @pow257(i32 139, i32 %7)
%9 = add nsw i32 %5, %8
%10 = srem i32 %9, 257
ret i32 %10
}

LLVM IR (-O2):
define i32 @mkoff_s_f(i32 %0) {
%2 = mul nsw i32 %0, 127
%3 = tail call i32 @pow257(i32 139, i32 %2)
%4 = mul nsw i32 %0, 125
%5 = tail call i32 @pow257(i32 139, i32 %4)
%6 = add nsw i32 %5, %3
%7 = srem i32 %6, 257
ret i32 %7
}
double do_fprem(void) {
  double res;
  __asm__ __volatile__("ffree %%st(0)\n\t"
                       "ffree %%st(1)\n\t"
                       "fldpi\n\t"
                       "fldln2\n\t"
                       "fprem\n\t"
                       "fstpl 0(%0)"
                       :
                       : "r"(&res));
  return res;
}


x86 assembly (clang, -O0):
<do_fprem>:
push   %rbp
mov    %rsp,%rbp
lea    -0x8(%rbp),%rax
ffree  %st(0)
ffree  %st(1)
fldpi
fldln2
fprem
fstpl  (%rax)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_fprem>:
lea    -0x8(%rsp),%rax
ffree  %st(0)
ffree  %st(1)
fldpi
fldln2
fprem
fstpl  (%rax)
movsd  -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @do_fprem() {
%1 = alloca double
%2 = load double, double* %1
ret double %2
}

LLVM IR (-O2):
define double @do_fprem() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = load double, double* %1
ret double %3
}
/* Variables and functions */
scalar_t__ so_recvtest(int);
int so_dataready(int fd) { return so_recvtest(fd) > 0; }


x86 assembly (clang, -O0):
<so_dataready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <so_recvtest@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @so_dataready(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @so_recvtest(i32 %3)
%5 = icmp sgt i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @so_dataready(i32 %0) {
%2 = tail call i64 @so_recvtest(i32 %0)
%3 = icmp sgt i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char const *,
                          char const *, int /*<<< orphan*/);
void SysError(const char *Module, const char *Fct) {
  syslog(LOG_ERR, "%s - %s - %s", Module, Fct, strerror(errno));
  exit(errno);
}


x86 assembly (clang, -O0):
<SysError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    %eax,%r8d
lea    0xe81(%rip),%rsi
call   1030 <syslog@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<SysError>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2e8c(%rip),%rax
mov    (%rax),%ebp
mov    0x2e93(%rip),%r15
mov    (%r15),%edi
call   1050 <strerror@plt>
lea    0xea4(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %eax,%r8d
call   1030 <syslog@plt>
mov    (%r15),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [13 x i8] c"%s - %s - %s\00"
@errno = global i32 0
define void @SysError(i8* %0, i8* %1) {
%3 = load i32, i32* @LOG_ERR
%4 = load i32, i32* @errno
%5 = tail call i32 @strerror(i32 %4)
%6 = tail call i32 @syslog(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %5)
%7 = load i32, i32* @errno
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;
typedef int /*<<< orphan*/ __CONST_SOCKADDR_ARG;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __bind(int fd, __CONST_SOCKADDR_ARG addr, socklen_t len) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bind>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__bind(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__bind(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ scanf(char *, char *, char *);
int main(void) {
  char pal1[100], pal2[100];
  scanf("%s %s", pal1, pal2);
  printf("%s - %s", pal1, pal2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
lea    -0x70(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    0xec3(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x70(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0xecf(%rip),%rdi
lea    0x70(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <scanf@plt>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [8 x i8] c"%s - %s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [8 x i8] c"%s - %s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/
UPnPResponse_ConnectionManager_GetCurrentConnectionIDs(void *, char *);
int /*<<< orphan*/ printf(char *);
void UPnPConnectionManager_GetCurrentConnectionIDs(void *upnptoken) {
  printf("Invoke: UPnPConnectionManager_GetCurrentConnectionIDs();\r\n");
  UPnPResponse_ConnectionManager_GetCurrentConnectionIDs(upnptoken,
                                                         "Sample String");
}


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

x86 assembly (clang, -O2):
<UPnPConnectionManager_GetCurrentConnectionIDs>:
push   %rbx
mov    %rdi,%rbx
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UPnPResponse_ConnectionManager_GetCurrentConnectionIDs@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"Invoke: UPnPConnectionManager_GetCurrentConnectionIDs();\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UPnPConnectionManager_GetCurrentConnectionIDs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @UPnPResponse_ConnectionManager_GetCurrentConnectionIDs(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"Sample String\00"
@str = [58 x i8] c"Invoke: UPnPConnectionManager_GetCurrentConnectionIDs();\0D\00"
define void @UPnPConnectionManager_GetCurrentConnectionIDs(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @UPnPResponse_ConnectionManager_GetCurrentConnectionIDs(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr_fd(char const *s, int fd) {
  int i;
  i = 0;
  while (s[i] != '\0') {
    write(fd, &s[i], 1);
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1161 <ft_putstr_fd+0x51>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
add    %rax,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ft_putstr_fd+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1139 <ft_putstr_fd+0x29>
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   (%rax)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_putstr_fd+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ft_putstr_fd(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = tail call i32 @write(i32 %1, i8* %7, i32 1)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
int cast_ushort_int(unsigned short int x) { return (int)x; }


x86 assembly (clang, -O0):
<cast_ushort_int>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_ushort_int>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @cast_ushort_int(i16 zeroext %0) {
%2 = zext i16 %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ AUDIO_STOP;
int ioctl(int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int audioStop(int fd, char *arg) {
  if (arg)
    return -1;
  if (ioctl(fd, AUDIO_STOP) == -1)
    perror("AUDIO_STOP");
  return 0;
}


x86 assembly (clang, -O0):
<audioStop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <audioStop+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <audioStop+0x53>
mov    -0x8(%rbp),%edi
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    116c <audioStop+0x4c>
lea    0xe99(%rip),%rdi
call   1040 <perror@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audioStop>:
push   %rbx
mov    $0xffffffff,%ebx
test   %rsi,%rsi
jne    1140 <audioStop+0x20>
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
je     1144 <audioStop+0x24>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeb5(%rip),%rdi
call   1040 <perror@plt>
jmp    1140 <audioStop+0x20>

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

LLVM IR (-O2):
@AUDIO_STOP = global i32 0
@.str = [11 x i8] c"AUDIO_STOP\00"
define i32 @audioStop(i32 %0, i8* readnone %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = load i32, i32* @AUDIO_STOP
%6 = tail call i32 @ioctl(i32 %0, i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %4, %8, %2
%11 = phi i32 [ -1, %2 ], [ 0, %8 ], [ 0, %4 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
uint32_t freertps_htonl(uint32_t u) { return htonl(u); }


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

x86 assembly (clang, -O2):
<freertps_htonl>:
jmp    1030 <htonl@plt>

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

LLVM IR (-O2):
define i32 @freertps_htonl(i32 %0) {
%2 = tail call i32 @htonl(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void outOfMemory(void) {
  fflush(stdout);
  fprintf(stderr, "\nout of memory\n");
}


x86 assembly (clang, -O0):
<outOfMemory>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<outOfMemory>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
pop    %rax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@.str = [16 x i8] c"\0Aout of memory\0A\00"
define void @outOfMemory() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [16 x i8] c"\0Aout of memory\0A\00"
define void @outOfMemory() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  unsigned char local1;
  {
    state[0UL] = (input[0UL] + 914778474UL) ^ (unsigned char)11;
    local1 = 0UL;
    while (local1 < (unsigned char)0) {
      state[local1] |= (state[local1] & (unsigned char)31) << 4UL;
      local1++;
    }
    output[0UL] = state[0UL] | (unsigned char)118;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x3686696a,%rax
xor    $0xb,%rax
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
cmp    $0x0,%eax
jge    115c <RandomFunc+0x5c>
movzbl -0x12(%rbp),%eax
movzbl -0x11(%rbp,%rax,1),%edx
and    $0x1f,%edx
shl    $0x4,%edx
movzbl -0x12(%rbp),%eax
movzbl -0x11(%rbp,%rax,1),%ecx
or     %edx,%ecx
mov    %cl,-0x11(%rbp,%rax,1)
mov    -0x12(%rbp),%al
add    $0x1,%al
mov    %al,-0x12(%rbp)
jmp    1124 <RandomFunc+0x24>
movzbl -0x11(%rbp),%eax
or     $0x76,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%al
add    $0x6a,%al
or     $0x76,%al
xor    $0x9,%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1 x i8]
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = add i64 %10, 914778474
%12 = xor i64 %11, 11
%13 = trunc i64 %12 to i8
%14 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %13, i8* %14
store i8 0, i8* %6
br label %15
15: ; preds = %19, %2
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %36
19: ; preds = %15
%20 = load i8, i8* %6
%21 = zext i8 %20 to i64
%22 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = and i32 %24, 31
%26 = shl i32 %25, 4
%27 = load i8, i8* %6
%28 = zext i8 %27 to i64
%29 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 %28
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = or i32 %31, %26
%33 = trunc i32 %32 to i8
store i8 %33, i8* %29
%34 = load i8, i8* %6
%35 = add i8 %34, 1
store i8 %35, i8* %6
br label %15
36: ; preds = %15
%37 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = or i32 %39, 118
%41 = trunc i32 %40 to i8
%42 = load i8*, i8** %4
%43 = getelementptr inbounds i8, i8* %42, i64 0
store i8 %41, i8* %43
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, 106
%5 = or i8 %4, 118
%6 = xor i8 %5, 9
store i8 %6, i8* %1
ret void
}
const char *Size_Description(void) {
  return "The `Size` class is a very important class in Cello because it gives "
         "the "
         "size in bytes you can expect an object of a given type to be. This "
         "is "
         "used by many methods to allocate, assign, or compare various objects."
         "\n\n"
         "By default this size is automatically found and recorded by the "
         "`Cello` "
         "macro, but if the type does it's own allocation, or the size cannot "
         "be "
         "found naturally then it may be necessary to override this method.";
}


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

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

LLVM IR (-O0):
@.str = [423 x i8] c"The `Size` class is a very important class in Cello because it gives the size in bytes you can expect an object of a given type to be. This is used by many methods to allocate, assign, or compare various objects.\0A\0ABy default this size is automatically found and recorded by the `Cello` macro, but if the type does it's own allocation, or the size cannot be found naturally then it may be necessary to override this method.\00"
define i8* @Size_Description() {
ret i8* getelementptr inbounds ([423 x i8], [423 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [423 x i8] c"The `Size` class is a very important class in Cello because it gives the size in bytes you can expect an object of a given type to be. This is used by many methods to allocate, assign, or compare various objects.\0A\0ABy default this size is automatically found and recorded by the `Cello` macro, but if the type does it's own allocation, or the size cannot be found naturally then it may be necessary to override this method.\00"
define i8* @Size_Description() {
ret i8* getelementptr inbounds ([423 x i8], [423 x i8]* @.str, i64 0, i64 0)
}
int fun997() { return 997; }


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

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

LLVM IR (-O0):
define i32 @fun997() {
ret i32 997
}

LLVM IR (-O2):
define i32 @fun997() {
ret i32 997
}
/* Variables and functions */
int test_minsym();
int main(void) {
  int val = test_minsym();
  if (val != 124)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_minsym@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x7c,-0x8(%rbp)
je     113f <main+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <main+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_minsym@plt>
xor    %ecx,%ecx
cmp    $0x7c,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @test_minsym()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 124
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_minsym()
%2 = icmp ne i32 %1, 124
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct cpufreq_stats {
  int dummy;
};

/* Variables and functions */
struct cpufreq_stats *sysfs_get_freq_stats(unsigned int, unsigned long long *);
struct cpufreq_stats *cpufreq_get_stats(unsigned int cpu,
                                        unsigned long long *total_time) {
  return sysfs_get_freq_stats(cpu, total_time);
}


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

x86 assembly (clang, -O2):
<cpufreq_get_stats>:
jmp    1030 <sysfs_get_freq_stats@plt>

LLVM IR (-O0):
%struct.cpufreq_stats = type { i32 }
define %struct.cpufreq_stats* @cpufreq_get_stats(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = load i64*, i64** %4
%7 = call %struct.cpufreq_stats* @sysfs_get_freq_stats(i32 %5, i64* %6)
ret %struct.cpufreq_stats* %7
}

LLVM IR (-O2):
%struct.cpufreq_stats = type { i32 }
define %struct.cpufreq_stats* @cpufreq_get_stats(i32 %0, i64* %1) {
%3 = tail call %struct.cpufreq_stats* @sysfs_get_freq_stats(i32 %0, i64* %1)
ret %struct.cpufreq_stats* %3
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int Xaccept(int s, struct sockaddr *a, int *l) {
  int rl;
  int code;
  rl = *l;
  code = accept(s, a, &rl);
  *l = rl;
  return code;
}


x86 assembly (clang, -O0):
<Xaccept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <accept@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xaccept>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    (%rdx),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdx
call   1030 <accept@plt>
mov    0xc(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @Xaccept(i32 %0, %struct.sockaddr* %1, i32* nocapture %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = load i32, i32* %2
store i32 %6, i32* %4
%7 = call i32 @accept(i32 %0, %struct.sockaddr* %1, i32* %4)
%8 = load i32, i32* %4
store i32 %8, i32* %2
ret i32 %7
}
/* Variables and functions */
void *check_nonnull(int /*<<< orphan*/);
int /*<<< orphan*/ realloc(void *, size_t);
void *checked_realloc(void *ptr, size_t size) {
  return check_nonnull(realloc(ptr, size ? size : 1));
}


x86 assembly (clang, -O0):
<checked_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <checked_realloc+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    115e <checked_realloc+0x3e>
mov    $0x1,%eax
mov    %rax,-0x20(%rbp)
jmp    115e <checked_realloc+0x3e>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <realloc@plt>
mov    %eax,%edi
call   1030 <check_nonnull@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_realloc>:
push   %rax
test   %rsi,%rsi
mov    $0x1,%eax
cmove  %rax,%rsi
call   1040 <realloc@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <check_nonnull@plt>

LLVM IR (-O0):
define i8* @checked_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %4
br label %11
10: ; preds = %2
br label %11
11: ; preds = %10, %8
%12 = phi i64 [ %9, %8 ], [ 1, %10 ]
%13 = call i32 @realloc(i8* %5, i64 %12)
%14 = call i8* @check_nonnull(i32 %13)
ret i8* %14
}

LLVM IR (-O2):
define i8* @checked_realloc(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = select i1 %3, i64 1, i64 %1
%5 = tail call i32 @realloc(i8* %0, i64 %4)
%6 = tail call i8* @check_nonnull(i32 %5)
ret i8* %6
}
char *okMessage(int id) { return "HTTP/1.1 200 OK\r\nContent-Length: "; }


x86 assembly (clang, -O0):
<okMessage>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"HTTP/1.1 200 OK\0D\0AContent-Length: \00"
define i8* @okMessage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [34 x i8] c"HTTP/1.1 200 OK\0D\0AContent-Length: \00"
define i8* @okMessage(i32 %0) {
ret i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct value {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
struct value *list_get(struct list *, int /*<<< orphan*/);
struct value *value_copy(struct value *);
struct value *value_new();
struct value *constant(struct list *args, struct value *in) {
  struct value *n = list_get(args, 0);
  if (n)
    return value_copy(n);
  else
    return value_new();
}


x86 assembly (clang, -O0):
<constant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <list_get@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     116c <constant+0x3c>
mov    -0x20(%rbp),%rdi
call   1040 <value_copy@plt>
mov    %rax,-0x8(%rbp)
jmp    1177 <constant+0x47>
mov    $0x0,%al
call   1050 <value_new@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<constant>:
push   %rax
xor    %esi,%esi
call   1030 <list_get@plt>
test   %rax,%rax
je     1146 <constant+0x16>
mov    %rax,%rdi
pop    %rax
jmp    1040 <value_copy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <value_new@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
%struct.value = type { i32 }
define %struct.value* @constant(%struct.list* %0, %struct.value* %1) {
%3 = alloca %struct.value*
%4 = alloca %struct.list*
%5 = alloca %struct.value*
%6 = alloca %struct.value*
store %struct.list* %0, %struct.list** %4
store %struct.value* %1, %struct.value** %5
%7 = load %struct.list*, %struct.list** %4
%8 = call %struct.value* @list_get(%struct.list* %7, i32 0)
store %struct.value* %8, %struct.value** %6
%9 = load %struct.value*, %struct.value** %6
%10 = icmp ne %struct.value* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load %struct.value*, %struct.value** %6
%13 = call %struct.value* @value_copy(%struct.value* %12)
store %struct.value* %13, %struct.value** %3
br label %16
14: ; preds = %2
%15 = call %struct.value* (...) @value_new()
store %struct.value* %15, %struct.value** %3
br label %16
16: ; preds = %14, %11
%17 = load %struct.value*, %struct.value** %3
ret %struct.value* %17
}

LLVM IR (-O2):
%struct.list = type { i32 }
%struct.value = type { i32 }
define %struct.value* @constant(%struct.list* %0, %struct.value* nocapture readnone %1) {
%3 = tail call %struct.value* @list_get(%struct.list* %0, i32 0)
%4 = icmp eq %struct.value* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call %struct.value* @value_copy(%struct.value* %3)
br label %9
7: ; preds = %2
%8 = tail call %struct.value* (...) @value_new()
br label %9
9: ; preds = %7, %5
%10 = phi %struct.value* [ %6, %5 ], [ %8, %7 ]
ret %struct.value* %10
}
int SDL_imageFilterAddUintMMX(unsigned char *Src1, unsigned char *Dest,
                              unsigned int SrcLength, unsigned int C,
                              unsigned int D) {
  return (-1);
}


x86 assembly (clang, -O0):
<SDL_imageFilterAddUintMMX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SDL_imageFilterAddUintMMX(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret i32 -1
}

LLVM IR (-O2):
define i32 @SDL_imageFilterAddUintMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3, i32 %4) {
ret i32 -1
}
void Timer1A_Enable(void) {
  (*((volatile unsigned long *)0x4003100C)) |= 0x00000001;
}


x86 assembly (clang, -O0):
<Timer1A_Enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4003100c,%eax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    $0x4003100c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Timer1A_Enable>:
orq    $0x1,0x4003100c
40 01
ret

LLVM IR (-O0):
define void @Timer1A_Enable() {
%1 = load volatile i64, i64* inttoptr (i64 1073942540 to i64*)
%2 = or i64 %1, 1
store volatile i64 %2, i64* inttoptr (i64 1073942540 to i64*)
ret void
}

LLVM IR (-O2):
define void @Timer1A_Enable() {
%1 = load volatile i64, i64* inttoptr (i64 1073942540 to i64*)
%2 = or i64 %1, 1
store volatile i64 %2, i64* inttoptr (i64 1073942540 to i64*)
ret void
}
int noarg(char *argv[]) { return 0; }


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

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

LLVM IR (-O0):
define i32 @noarg(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @noarg(i8** nocapture readnone %0) {
ret i32 0
}
char *next_line(char *p) {
  while (*p && *p != '\n')
    p++;
  if (*p == '\n')
    p++;
  return p;
}


x86 assembly (clang, -O0):
<next_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <next_line+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <next_line+0x3d>
jmp    114e <next_line+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <next_line+0x8>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    116a <next_line+0x6a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_line>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <next_line+0x22>
cmp    $0xa,%cl
je     1122 <next_line+0x22>
add    $0x1,%rax
jmp    1110 <next_line+0x10>
xor    %edx,%edx
cmp    $0xa,%cl
sete   %dl
add    %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @next_line(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 10, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
%8 = icmp eq i8 %4, 10
%9 = zext i1 %8 to i64
%10 = getelementptr i8, i8* %3, i64 %9
ret i8* %10
}