xunge/DecIR huggingface dataset:
double fabs(double x) {
  return ({
    extern __typeof__(fabs) module_libc_fabs;
    &module_libc_fabs;
  })(x);
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ecc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  -0x8(%rbp),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
jmp    1030 <module_libc_fabs@plt>

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
%3 = alloca double (double)*
store double %0, double* %2
store double (double)* @module_libc_fabs, double (double)** %3
%4 = load double (double)*, double (double)** %3
%5 = load double, double* %2
%6 = call double %4(double %5)
ret double %6
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = tail call double @module_libc_fabs(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
size_t uint16PackSize(const uint16_t *data) { return sizeof(*data); }


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

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

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

LLVM IR (-O2):
define i64 @uint16PackSize(i32* nocapture readnone %0) {
ret i64 4
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int t1();
int t2();
int main(int argc, char *argv[]) {
  int result = 0;
  result |= t1();
  result |= t2();
  result |= fflush(stdout) == EOF;
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <t1@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <t2@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e6c(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <t1@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <t2@plt>
mov    %eax,%ebp
or     %ebx,%ebp
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e8c(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
or     %ebp,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32 0
@EOF = global i64 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 (...) @t1()
%8 = load i32, i32* %6
%9 = or i32 %8, %7
store i32 %9, i32* %6
%10 = call i32 (...) @t2()
%11 = load i32, i32* %6
%12 = or i32 %11, %10
store i32 %12, i32* %6
%13 = load i32, i32* @stdout
%14 = call i64 @fflush(i32 %13)
%15 = load i64, i64* @EOF
%16 = icmp eq i64 %14, %15
%17 = zext i1 %16 to i32
%18 = load i32, i32* %6
%19 = or i32 %18, %17
store i32 %19, i32* %6
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
@stdout = global i32 0
@EOF = global i64 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @t1()
%4 = tail call i32 (...) @t2()
%5 = or i32 %4, %3
%6 = load i32, i32* @stdout
%7 = tail call i64 @fflush(i32 %6)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
%10 = zext i1 %9 to i32
%11 = or i32 %5, %10
ret i32 %11
}
int get_command() { return 0; }


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

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

LLVM IR (-O0):
define i32 @get_command() {
ret i32 0
}

LLVM IR (-O2):
define i32 @get_command() {
ret i32 0
}
/* Type definitions */
struct rtattr {
  int dummy;
};
typedef int /*<<< orphan*/ __u16;

/* Variables and functions */
__u16 rta_getattr_u16(const struct rtattr *rta) {
  return *(__u16 *)((
      void *)(((char *)(rta)) +
              ((((sizeof(struct rtattr)) + 4U - 1) & ~(4U - 1)) + (0))));
}


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

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

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

LLVM IR (-O2):
%struct.rtattr = type { i32 }
define i32 @rta_getattr_u16(%struct.rtattr* nocapture %0) {
%2 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %0, i64 1, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int PRIO_PGRP;
int PRIO_PROCESS;
int PRIO_USER;
int /*<<< orphan*/ setpriority(int, int, int);
int main() {
  setpriority(PRIO_PROCESS, 0, 2);
  setpriority(-1, 0, 2);
  setpriority(PRIO_PGRP, -1, 2);
  setpriority(PRIO_USER, 0, 0);
  setpriority(PRIO_PROCESS, 0, -1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <setpriority@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <setpriority@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1030 <setpriority@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <setpriority@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
call   1030 <setpriority@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rbx
mov    (%rbx),%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <setpriority@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <setpriority@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1030 <setpriority@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <setpriority@plt>
mov    (%rbx),%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
call   1030 <setpriority@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@PRIO_PROCESS = global i32 0
@PRIO_PGRP = global i32 0
@PRIO_USER = global i32 0
define i32 @main() {
%1 = load i32, i32* @PRIO_PROCESS
%2 = call i32 @setpriority(i32 %1, i32 0, i32 2)
%3 = call i32 @setpriority(i32 -1, i32 0, i32 2)
%4 = load i32, i32* @PRIO_PGRP
%5 = call i32 @setpriority(i32 %4, i32 -1, i32 2)
%6 = load i32, i32* @PRIO_USER
%7 = call i32 @setpriority(i32 %6, i32 0, i32 0)
%8 = load i32, i32* @PRIO_PROCESS
%9 = call i32 @setpriority(i32 %8, i32 0, i32 -1)
ret i32 0
}

LLVM IR (-O2):
@PRIO_PROCESS = global i32 0
@PRIO_PGRP = global i32 0
@PRIO_USER = global i32 0
define i32 @main() {
%1 = load i32, i32* @PRIO_PROCESS
%2 = tail call i32 @setpriority(i32 %1, i32 0, i32 2)
%3 = tail call i32 @setpriority(i32 -1, i32 0, i32 2)
%4 = load i32, i32* @PRIO_PGRP
%5 = tail call i32 @setpriority(i32 %4, i32 -1, i32 2)
%6 = load i32, i32* @PRIO_USER
%7 = tail call i32 @setpriority(i32 %6, i32 0, i32 0)
%8 = load i32, i32* @PRIO_PROCESS
%9 = tail call i32 @setpriority(i32 %8, i32 0, i32 -1)
ret i32 0
}
int Power_to_2(int n) {
  int res, i;
  if (n == 0)
    return 1;
  else {
    res = 1;
    for (i = 1; i <= n; i++)
      res *= 2;
  }
  return res;
}


x86 assembly (clang, -O0):
<Power_to_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <Power_to_2+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1159 <Power_to_2+0x59>
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     114e <Power_to_2+0x4e>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <Power_to_2+0x2b>
jmp    1153 <Power_to_2+0x53>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Power_to_2>:
test   %edi,%edi
jle    1118 <Power_to_2+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <Power_to_2+0x1e>
mov    $0x1,%eax
jmp    1138 <Power_to_2+0x38>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%eax
add    $0xfffffff8,%edi
jne    1130 <Power_to_2+0x30>
test   %ecx,%ecx
je     1147 <Power_to_2+0x47>
nopl   0x0(%rax)
add    %eax,%eax
add    $0xffffffff,%ecx
jne    1140 <Power_to_2+0x40>
ret

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

LLVM IR (-O2):
define i32 @Power_to_2(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %25, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 1, %7 ], [ %12, %9 ]
%11 = phi i32 [ 0, %7 ], [ %13, %9 ]
%12 = shl i32 %10, 8
%13 = add i32 %11, 8
%14 = icmp eq i32 %13, %8
br i1 %14, label %15, label %9
15: ; preds = %9, %3
%16 = phi i32 [ undef, %3 ], [ %12, %9 ]
%17 = phi i32 [ 1, %3 ], [ %12, %9 ]
%18 = icmp eq i32 %5, 0
br i1 %18, label %25, label %19
19: ; preds = %15, %19
%20 = phi i32 [ %22, %19 ], [ %17, %15 ]
%21 = phi i32 [ %23, %19 ], [ 0, %15 ]
%22 = shl nsw i32 %20, 1
%23 = add i32 %21, 1
%24 = icmp eq i32 %23, %5
br i1 %24, label %25, label %19
25: ; preds = %15, %19, %1
%26 = phi i32 [ 1, %1 ], [ %16, %15 ], [ %22, %19 ]
ret i32 %26
}
void SIO1registerCallback(void (*callback)(void)) {}


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

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

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

LLVM IR (-O2):
define void @SIO1registerCallback(void ()* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLsizei;
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glCopyTexSubImage1D(int /*<<< orphan*/, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int /*<<< orphan*/);
void CopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x,
                       GLint y, GLsizei width) {
  glCopyTexSubImage1D(target, level, xoffset, x, y, width);
}


x86 assembly (clang, -O0):
<CopyTexSubImage1D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1030 <glCopyTexSubImage1D@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyTexSubImage1D>:
jmp    1030 <glCopyTexSubImage1D@plt>

LLVM IR (-O0):
define void @CopyTexSubImage1D(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* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call i32 @glCopyTexSubImage1D(i32 %13, i32 %14, i32 %15, i32 %16, i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @CopyTexSubImage1D(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @glCopyTexSubImage1D(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ncpus() {
  printf("NOT IMPLEMENTED:"
         "pa_ncpus"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"NOT IMPLEMENTED:pa_ncpus\0A\00"
define i32 @pa_ncpus() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [25 x i8] c"NOT IMPLEMENTED:pa_ncpus\00"
define i32 @pa_ncpus() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void gtk_action_group_add_radio_actions() {}


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

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

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

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

/* Variables and functions */
scalar_t__ AF_INET;
scalar_t__ ndm_ip_sockaddr_family(struct ndm_ip_sockaddr_t const *const);
bool ndm_ip_sockaddr_is_v4(const struct ndm_ip_sockaddr_t *const sa) {
  return (ndm_ip_sockaddr_family(sa) == AF_INET) ? true : false;
}


x86 assembly (clang, -O0):
<ndm_ip_sockaddr_is_v4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ndm_ip_sockaddr_family@plt>
mov    %rax,%rdx
mov    0x2eb9(%rip),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndm_ip_sockaddr_is_v4>:
push   %rax
call   1030 <ndm_ip_sockaddr_family@plt>
mov    0x2ecb(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ndm_ip_sockaddr_t = type { i32 }
@AF_INET = global i64 0
define i32 @ndm_ip_sockaddr_is_v4(%struct.ndm_ip_sockaddr_t* %0) {
%2 = alloca %struct.ndm_ip_sockaddr_t*
store %struct.ndm_ip_sockaddr_t* %0, %struct.ndm_ip_sockaddr_t** %2
%3 = load %struct.ndm_ip_sockaddr_t*, %struct.ndm_ip_sockaddr_t** %2
%4 = call i64 @ndm_ip_sockaddr_family(%struct.ndm_ip_sockaddr_t* %3)
%5 = load i64, i64* @AF_INET
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
ret i32 %8
}

LLVM IR (-O2):
%struct.ndm_ip_sockaddr_t = type { i32 }
@AF_INET = global i64 0
define i32 @ndm_ip_sockaddr_is_v4(%struct.ndm_ip_sockaddr_t* %0) {
%2 = tail call i64 @ndm_ip_sockaddr_family(%struct.ndm_ip_sockaddr_t* %0)
%3 = load i64, i64* @AF_INET
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
char *skipwd(p)
char *p;
{
  while (*p != ' ' && *p != '\t' && *p != '\r' && *p != '\n' && *p != '\0')
    ++p;
  return (p);
}


x86 assembly (clang, -O0):
<skipwd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     116c <skipwd+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     116c <skipwd+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0x9(%rbp)
je     116c <skipwd+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
je     116c <skipwd+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    117c <skipwd+0x7c>
jmp    118d <skipwd+0x8d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skipwd+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipwd>:
mov    %rdi,%rax
movabs $0x100002601,%rcx
jmp    1114 <skipwd+0x14>
nop
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1110 <skipwd+0x10>
bt     %rdx,%rcx
jae    1110 <skipwd+0x10>
ret

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

LLVM IR (-O2):
define i8* @skipwd(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 32, label %7
i8 9, label %7
i8 13, label %7
i8 10, label %7
i8 0, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2, %2, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void usage() {
  {
    fprintf(stdout, "Usage: "
                    "\n");
    fflush(stdout);
  };
  {
    fprintf(stdout, "  spawn <stdin pipe fd> <stdout pipe fd> <stderr pipe fd>"
                    "\n");
    fflush(stdout);
  };
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    (%rbx),%edi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [9 x i8] c"Usage: \0A\00"
@.str.1 = [59 x i8] c" spawn <stdin pipe fd> <stdout pipe fd> <stderr pipe fd>\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [9 x i8] c"Usage: \0A\00"
@.str.1 = [59 x i8] c" spawn <stdin pipe fd> <stdout pipe fd> <stderr pipe fd>\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
ret void
}
/* Type definitions */
struct map_node {
  int dummy;
};
struct map {
  int dummy;
};

/* Variables and functions */
struct map_node *map_begin(struct map *);
int /*<<< orphan*/ map_remove(struct map *, struct map_node *);
void map_clear(struct map *map) {
  struct map_node *mn;
  while ((mn = map_begin(map)) != NULL) {
    map_remove(map, mn);
  }
}


x86 assembly (clang, -O0):
<map_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <map_begin@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1155 <map_clear+0x35>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <map_remove@plt>
jmp    112c <map_clear+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_clear>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1040 <map_begin@plt>
test   %rax,%rax
je     114a <map_clear+0x2a>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <map_remove@plt>
mov    %rbx,%rdi
jmp    1130 <map_clear+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.map = type { i32 }
%struct.map_node = type { i32 }
define void @map_clear(%struct.map* %0) {
%2 = tail call %struct.map_node* @map_begin(%struct.map* %0)
%3 = icmp eq %struct.map_node* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi %struct.map_node* [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @map_remove(%struct.map* %0, %struct.map_node* %5)
%7 = tail call %struct.map_node* @map_begin(%struct.map* %0)
%8 = icmp eq %struct.map_node* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, unsigned int);
void *realloc(void *, unsigned int);
void *reallocX(void *ptr, unsigned int nbytes) {
  ptr = realloc(ptr, nbytes);
  if (ptr == NULL) {
    printf("Socorro! realloc devolveu NULL! (%d)\n", nbytes);
    exit(EXIT_FAILURE);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<reallocX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1177 <reallocX+0x47>
mov    -0xc(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocX>:
push   %rbx
mov    %esi,%ebx
call   1040 <realloc@plt>
test   %rax,%rax
je     113f <reallocX+0xf>
pop    %rbx
ret
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Socorro! realloc devolveu NULL! (%d)\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @reallocX(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i8* @realloc(i8* %5, i32 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [38 x i8] c"Socorro! realloc devolveu NULL! (%d)\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @reallocX(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %1)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i8* %3
}
unsigned char f48(unsigned char x, long int y) {
  return (x >> y) | (x << (8 * sizeof(unsigned char) - y));
}


x86 assembly (clang, -O0):
<f48>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
sar    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    $0x8,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f48>:
mov    %rsi,%rcx
mov    %edi,%eax
ror    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @f48(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = ashr i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i64, i64* %4
%13 = sub i64 8, %12
%14 = trunc i64 %13 to i32
%15 = shl i32 %11, %14
%16 = or i32 %9, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @f48(i8 zeroext %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = tail call i8 @llvm.fshr.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ IntEnable(unsigned long);
int /*<<< orphan*/ IntRegister(unsigned long, void (*)());
unsigned long UARTIntNumberGet(unsigned long);
void UARTIntRegister(unsigned long ulBase, void (*pfnHandler)(void)) {
  unsigned long ulInt;
  ;
  ulInt = UARTIntNumberGet(ulBase);
  IntRegister(ulInt, pfnHandler);
  IntEnable(ulInt);
}


x86 assembly (clang, -O0):
<UARTIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTIntNumberGet@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <IntRegister@plt>
mov    -0x18(%rbp),%rdi
call   1030 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIntRegister>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <UARTIntNumberGet@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <IntRegister@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @UARTIntRegister(i64 %0, void ()* %1) {
%3 = alloca i64
%4 = alloca void ()*
%5 = alloca i64
store i64 %0, i64* %3
store void ()* %1, void ()** %4
%6 = load i64, i64* %3
%7 = call i64 @UARTIntNumberGet(i64 %6)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = load void ()*, void ()** %4
%10 = bitcast void ()* %9 to void (...)*
%11 = call i32 @IntRegister(i64 %8, void (...)* %10)
%12 = load i64, i64* %5
%13 = call i32 @IntEnable(i64 %12)
ret void
}

LLVM IR (-O2):
define void @UARTIntRegister(i64 %0, void ()* %1) {
%3 = tail call i64 @UARTIntNumberGet(i64 %0)
%4 = bitcast void ()* %1 to void (...)*
%5 = tail call i32 @IntRegister(i64 %3, void (...)* %4)
%6 = tail call i32 @IntEnable(i64 %3)
ret void
}
int kiGetImage(int cameraID, int *videoTexture) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @kiGetImage(i32 %0, i32* nocapture readnone %1) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ *gopen(char *, char const *);
char *unixname_to_riscos(char const *);
FILE *fopen(const char *unix_filename, const char *mode) {
  char *riscos_filename = unixname_to_riscos(unix_filename);
  FILE *handle = gopen(riscos_filename, mode);
  free(riscos_filename);
  return handle;
}


x86 assembly (clang, -O0):
<fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <unixname_to_riscos@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <gopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1050 <unixname_to_riscos@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <gopen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @fopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i8* @unixname_to_riscos(i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %4
%11 = call i32* @gopen(i8* %9, i8* %10)
store i32* %11, i32** %6
%12 = load i8*, i8** %5
%13 = call i32 @free(i8* %12)
%14 = load i32*, i32** %6
ret i32* %14
}

LLVM IR (-O2):
define i32* @fopen(i8* %0, i8* %1) {
%3 = tail call i8* @unixname_to_riscos(i8* %0)
%4 = tail call i32* @gopen(i8* %3, i8* %1)
%5 = tail call i32 @free(i8* %3)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void serverFinish(int fd_cl) { close(fd_cl); }


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

x86 assembly (clang, -O2):
<serverFinish>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @serverFinish(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ calltrap(int);
int DebugFunc(void) { calltrap(15); }


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

x86 assembly (clang, -O2):
<DebugFunc>:
mov    $0xf,%edi
jmp    1030 <calltrap@plt>

LLVM IR (-O0):
define i32 @DebugFunc() {
%1 = alloca i32
%2 = call i32 @calltrap(i32 15)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @DebugFunc() {
%1 = tail call i32 @calltrap(i32 15)
ret i32 undef
}
char *my_strcpy(char *destination, const char *source) {
  char *p = destination;
  while (*source != '\0') {
    *p++ = *source++;
  }
  *p = '\0';
  return destination;
}


x86 assembly (clang, -O0):
<my_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114b <my_strcpy+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1114 <my_strcpy+0x14>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <my_strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <my_strcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @my_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Type definitions */
typedef int uint32_t;
typedef int int16_t;

/* Variables and functions */
int16_t read16bitLE(unsigned char *buf) {
  int i;
  uint32_t value = 0;
  for (i = 1; i >= 0; i--) {
    value <<= 8;
    value |= buf[i];
  }
  return value;
}


x86 assembly (clang, -O0):
<read16bitLE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1149 <read16bitLE+0x49>
mov    -0x10(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <read16bitLE+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read16bitLE>:
movzwl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @read16bitLE(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = or i32 %5, %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
void __cleanup_closedir_func(DIR **d) {
  if (*d)
    closedir(*d);
}


x86 assembly (clang, -O0):
<__cleanup_closedir_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <__cleanup_closedir_func+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <closedir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cleanup_closedir_func>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <__cleanup_closedir_func+0xd>
jmp    1030 <closedir@plt>
ret

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

LLVM IR (-O2):
define void @__cleanup_closedir_func(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @closedir(i32* %2)
br label %6
6: ; preds = %4, %1
ret void
}
void gtk_adjustment_value_changed() {}


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

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

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

LLVM IR (-O2):
define void @gtk_adjustment_value_changed() {
ret void
}
/* Variables and functions */
double strtod(char *, int /*<<< orphan*/);
double cos() { return strtod("nan", 0); }


x86 assembly (clang, -O0):
<cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xedc(%rip),%rdi
xor    %esi,%esi
call   1030 <strtod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <strtod@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"nan\00"
define double @cos(double %0) {
%2 = tail call double @strtod(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ SDL_ultoa(long, char *, int);
char *SDL_ltoa(long value, char *string, int radix) {
  char *bufp = string;
  if (value < 0) {
    *bufp++ = '-';
    SDL_ultoa(-value, bufp, radix);
  } else {
    SDL_ultoa(value, bufp, radix);
  }
  return string;
}


x86 assembly (clang, -O0):
<SDL_ltoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1161 <SDL_ltoa+0x51>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x2d,(%rax)
xor    %eax,%eax
mov    %eax,%edi
sub    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <SDL_ultoa@plt>
jmp    1171 <SDL_ltoa+0x61>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <SDL_ultoa@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDL_ltoa>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
js     111e <SDL_ltoa+0xe>
mov    %rbx,%rsi
jmp    1128 <SDL_ltoa+0x18>
lea    0x1(%rbx),%rsi
movb   $0x2d,(%rbx)
neg    %rdi
call   1030 <SDL_ultoa@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @SDL_ltoa(i64 %0, i8* returned %1, i32 %2) {
%4 = icmp slt i64 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 45, i8* %1
%7 = sub nsw i64 0, %0
%8 = tail call i32 @SDL_ultoa(i64 %7, i8* %6, i32 %2)
br label %11
9: ; preds = %3
%10 = tail call i32 @SDL_ultoa(i64 %0, i8* %1, i32 %2)
br label %11
11: ; preds = %9, %5
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int main(void) {
  int i;
  for (i = 0; i < 10; i++)
    close(-11);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1148 <main+0x38>
mov    $0xfffffff5,%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @close(i32 -11)
%2 = tail call i32 @close(i32 -11)
%3 = tail call i32 @close(i32 -11)
%4 = tail call i32 @close(i32 -11)
%5 = tail call i32 @close(i32 -11)
%6 = tail call i32 @close(i32 -11)
%7 = tail call i32 @close(i32 -11)
%8 = tail call i32 @close(i32 -11)
%9 = tail call i32 @close(i32 -11)
%10 = tail call i32 @close(i32 -11)
ret i32 0
}
/* Variables and functions */
scalar_t__ is_perfect(unsigned long);
int /*<<< orphan*/ printf(char *, unsigned long);
int main(int argc, char **argv) {
  unsigned long i;
  for (i = 0; i < 100000; i++) {
    if (is_perfect(i)) {
      printf("%lu\n", i);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x186a0,-0x18(%rbp)
jae    1185 <main+0x65>
mov    -0x18(%rbp),%rdi
call   1030 <is_perfect@plt>
cmp    $0x0,%rax
je     116f <main+0x4f>
mov    -0x18(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
jmp    1174 <main+0x54>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113e <main+0x1e>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
jmp    113d <main+0x1d>
nop
add    $0x1,%rbx
cmp    $0x186a0,%rbx
je     1157 <main+0x37>
mov    %rbx,%rdi
call   1030 <is_perfect@plt>
test   %rax,%rax
je     1130 <main+0x10>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %9
%4 = phi i64 [ 0, %2 ], [ %10, %9 ]
%5 = tail call i64 @is_perfect(i64 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
br label %9
9: ; preds = %3, %7
%10 = add nuw nsw i64 %4, 1
%11 = icmp eq i64 %10, 100000
br i1 %11, label %12, label %3
12: ; preds = %9
ret i32 0
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  int i, c;
  while ((c = getchar()) != EOF) {
    if (i % 20 == 0) {
      putchar('\n');
    }
    putchar(c);
    ++i;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     117c <main+0x5c>
mov    -0x8(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1166 <main+0x46>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%eax
jne    113e <main+0x1e>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %eax,%ebx
jmp    1168 <main+0x48>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%eax
je     1137 <main+0x17>
imul   $0xcccccccd,%ebp,%eax
add    $0x19999998,%eax
ror    $0x2,%eax
cmp    $0xccccccc,%eax
ja     1150 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1150 <main+0x30>

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %17, label %4
4: ; preds = %0, %11
%5 = phi i32 [ %14, %11 ], [ %1, %0 ]
%6 = phi i32 [ %13, %11 ], [ undef, %0 ]
%7 = srem i32 %6, 20
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @putchar(i32 10)
br label %11
11: ; preds = %9, %4
%12 = tail call i32 @putchar(i32 %5)
%13 = add nsw i32 %6, 1
%14 = tail call i32 (...) @getchar()
%15 = load i32, i32* @EOF
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %4
17: ; preds = %11, %0
ret i32 0
}