xunge/DecIR huggingface dataset:
void foo754() {}


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

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

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

LLVM IR (-O2):
define void @foo754() {
ret void
}
int __float_encoded_array_size(const float *p, int elements) {
  return sizeof(float) * elements;
}


x86 assembly (clang, -O0):
<__float_encoded_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__float_encoded_array_size>:
lea    0x0(,%rsi,4),%eax
ret

LLVM IR (-O0):
define i32 @__float_encoded_array_size(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = mul i64 4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @__float_encoded_array_size(float* nocapture readnone %0, i32 %1) {
%3 = shl i32 %1, 2
ret i32 %3
}
int bar(x) { return identity(x); }


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

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

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @identity to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @identity to i32 (i32, ...)*)(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int kill(int /*<<< orphan*/, int);
__attribute__((weak, unused)) int raise(int signal) {
  return kill(getpid(), signal);
}


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1040 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raise>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <kill@plt>

LLVM IR (-O0):
define weak i32 @raise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = load i32, i32* %2
%5 = call i32 @kill(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define weak i32 @raise(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @kill(i32 %2, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ reversesub(char *, int /*<<< orphan*/, size_t);
int strlen(char *);
void reverse(char s[]) {
  size_t i = (strlen(s) - 1);
  reversesub(s, 0, (s[i] == '\n') ? --i : i);
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1170 <reverse+0x50>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x20(%rbp)
jmp    1178 <reverse+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
xor    %esi,%esi
call   1040 <reversesub@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
xor    %ecx,%ecx
cmpb   $0xa,-0x1(%rbx,%rax,1)
lea    -0x1(%rax),%rdx
sete   %cl
sub    %rcx,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1040 <reversesub@plt>

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

LLVM IR (-O2):
define void @reverse(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
%8 = sext i1 %7 to i64
%9 = add nsw i64 %8, %4
%10 = tail call i32 @reversesub(i8* %0, i32 0, i64 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int strnpos(char *, char *, int /*<<< orphan*/);
int strpos(char *s, char *ch) { return strnpos(s, ch, strlen(s)); }


x86 assembly (clang, -O0):
<strpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <strnpos@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strnpos@plt>

LLVM IR (-O0):
define i32 @strpos(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strnpos(i8* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @strpos(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strnpos(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
float blendVividLight(float, float);
float blendHardMix(float base, float blend) {
  return (blendVividLight(base, blend) < 0.5f) ? 0.0f : 1.0f;
}


x86 assembly (clang, -O0):
<blendHardMix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <blendVividLight@plt>
xorps  %xmm3,%xmm3
movss  0xec4(%rip),%xmm2
movss  0xec0(%rip),%xmm1
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm1
andps  %xmm3,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blendHardMix>:
push   %rax
call   1030 <blendVividLight@plt>
cmpltss 0xee1(%rip),%xmm0
movss  0xedd(%rip),%xmm1
andnps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @blendHardMix(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @blendVividLight(float %5, float %6)
%8 = fcmp olt float %7, 5.000000e-01
%9 = zext i1 %8 to i64
%10 = select i1 %8, float 0.000000e+00, float 1.000000e+00
ret float %10
}

LLVM IR (-O2):
define float @blendHardMix(float %0, float %1) {
%3 = tail call float @blendVividLight(float %0, float %1)
%4 = fcmp olt float %3, 5.000000e-01
%5 = select i1 %4, float 0.000000e+00, float 1.000000e+00
ret float %5
}
/* Type definitions */
struct aatree_node {
  int dummy;
};

/* Variables and functions */
struct aatree_node *__aatree_iterate(struct aatree_node const *, int);
struct aatree_node *aatree_next(const struct aatree_node *node) {
  return __aatree_iterate(node, 1);
}


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

x86 assembly (clang, -O2):
<aatree_next>:
mov    $0x1,%esi
jmp    1030 <__aatree_iterate@plt>

LLVM IR (-O0):
%struct.aatree_node = type { i32 }
define %struct.aatree_node* @aatree_next(%struct.aatree_node* %0) {
%2 = alloca %struct.aatree_node*
store %struct.aatree_node* %0, %struct.aatree_node** %2
%3 = load %struct.aatree_node*, %struct.aatree_node** %2
%4 = call %struct.aatree_node* @__aatree_iterate(%struct.aatree_node* %3, i32 1)
ret %struct.aatree_node* %4
}

LLVM IR (-O2):
%struct.aatree_node = type { i32 }
define %struct.aatree_node* @aatree_next(%struct.aatree_node* %0) {
%2 = tail call %struct.aatree_node* @__aatree_iterate(%struct.aatree_node* %0, i32 1)
ret %struct.aatree_node* %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *dyn_top_alloc(long, int);
void *ztmalloc(long size) {
  void *res = dyn_top_alloc(size, 8);
  assert(res);
  return res;
}


x86 assembly (clang, -O0):
<ztmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
call   1030 <dyn_top_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ztmalloc>:
push   %rbx
mov    $0x8,%esi
call   1030 <dyn_top_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ztmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @dyn_top_alloc(i64 %4, i32 8)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @assert(i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @ztmalloc(i64 %0) {
%2 = tail call i8* @dyn_top_alloc(i64 %0, i32 8)
%3 = tail call i32 @assert(i8* %2)
ret i8* %2
}
int heap_parentIndex(int index) {
  if ((index % 2) == 0)
    index -= 2;
  return index / 2;
}


x86 assembly (clang, -O0):
<heap_parentIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1124 <heap_parentIndex+0x24>
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_parentIndex>:
lea    -0x2(%rdi),%ecx
test   $0x1,%dil
cmovne %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @heap_parentIndex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 2
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
%11 = sdiv i32 %10, 2
ret i32 %11
}

LLVM IR (-O2):
define i32 @heap_parentIndex(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = add nsw i32 %0, -2
%5 = select i1 %3, i32 %4, i32 %0
%6 = sdiv i32 %5, 2
ret i32 %6
}
int __attribute__((weak)) _link() { return -1; }


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

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

LLVM IR (-O0):
define weak i32 @_link() {
ret i32 -1
}

LLVM IR (-O2):
define weak i32 @_link() {
ret i32 -1
}
/* Type definitions */
struct netasync_socket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ netasync_socks_handler(struct netasync_socket *);
void netasync_sock_send_cb(struct netasync_socket *sock, void *clientData,
                           int err) {
  netasync_socks_handler(sock);
}


x86 assembly (clang, -O0):
<netasync_sock_send_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <netasync_socks_handler@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netasync_sock_send_cb>:
jmp    1030 <netasync_socks_handler@plt>

LLVM IR (-O0):
%struct.netasync_socket = type { i32 }
define void @netasync_sock_send_cb(%struct.netasync_socket* %0, i8* %1, i32 %2) {
%4 = alloca %struct.netasync_socket*
%5 = alloca i8*
%6 = alloca i32
store %struct.netasync_socket* %0, %struct.netasync_socket** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.netasync_socket*, %struct.netasync_socket** %4
%8 = call i32 @netasync_socks_handler(%struct.netasync_socket* %7)
ret void
}

LLVM IR (-O2):
%struct.netasync_socket = type { i32 }
define void @netasync_sock_send_cb(%struct.netasync_socket* %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @netasync_socks_handler(%struct.netasync_socket* %0)
ret void
}
double getSigma(const unsigned particlesType1, const unsigned row,
                const unsigned col) {
  if (row < particlesType1 && col < particlesType1)
    return 1;
  else if (row >= particlesType1 && col >= particlesType1)
    return 1.4;
  return 1.2;
}


x86 assembly (clang, -O0):
<getSigma>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1137 <getSigma+0x37>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1137 <getSigma+0x37>
movsd  0xee3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1173 <getSigma+0x73>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jb     1161 <getSigma+0x61>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jb     1161 <getSigma+0x61>
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1173 <getSigma+0x73>
jmp    1166 <getSigma+0x66>
movsd  0xe92(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSigma>:
xor    %eax,%eax
cmp    %edi,%edx
setb   %cl
cmp    %edi,%esi
jb     112b <getSigma+0x2b>
mov    %cl,%al
lea    0xeec(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm1
cmp    %edi,%edx
jae    1137 <getSigma+0x37>
movsd  0xef3(%rip),%xmm0
cmp    %edi,%esi
jae    113e <getSigma+0x3e>
jmp    1141 <getSigma+0x41>
movsd  0xedd(%rip),%xmm1
cmp    %edi,%edx
jb     111d <getSigma+0x1d>
movaps %xmm1,%xmm0
cmp    %edi,%esi
jb     1141 <getSigma+0x41>
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @getSigma(i32 %0, i32 %1, i32 %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = icmp ult i32 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32, i32* %7
%13 = load i32, i32* %5
%14 = icmp ult i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
store double 1.000000e+00, double* %4
br label %27
16: ; preds = %11, %3
%17 = load i32, i32* %6
%18 = load i32, i32* %5
%19 = icmp uge i32 %17, %18
br i1 %19, label %20, label %25
20: ; preds = %16
%21 = load i32, i32* %7
%22 = load i32, i32* %5
%23 = icmp uge i32 %21, %22
br i1 %23, label %24, label %25
24: ; preds = %20
store double 1.400000e+00, double* %4
br label %27
25: ; preds = %20, %16
br label %26
26: ; preds = %25
store double 1.200000e+00, double* %4
br label %27
27: ; preds = %26, %24, %15
%28 = load double, double* %4
ret double %28
}

LLVM IR (-O2):
define double @getSigma(i32 %0, i32 %1, i32 %2) {
%4 = icmp ult i32 %1, %0
%5 = icmp ult i32 %2, %0
%6 = and i1 %4, %5
%7 = or i1 %4, %5
%8 = select i1 %7, double 1.200000e+00, double 1.400000e+00
%9 = select i1 %6, double 1.000000e+00, double %8
ret double %9
}
/* Type definitions */
struct obs_output {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_output_signal(struct obs_output *, char *);
void signal_reconnect_success(struct obs_output *output) {
  do_output_signal(output, "reconnect_success");
}


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

x86 assembly (clang, -O2):
<signal_reconnect_success>:
lea    0xee9(%rip),%rsi
jmp    1030 <do_output_signal@plt>

LLVM IR (-O0):
%struct.obs_output = type { i32 }
@.str = [18 x i8] c"reconnect_success\00"
define void @signal_reconnect_success(%struct.obs_output* %0) {
%2 = alloca %struct.obs_output*
store %struct.obs_output* %0, %struct.obs_output** %2
%3 = load %struct.obs_output*, %struct.obs_output** %2
%4 = call i32 @do_output_signal(%struct.obs_output* %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.obs_output = type { i32 }
@.str = [18 x i8] c"reconnect_success\00"
define void @signal_reconnect_success(%struct.obs_output* %0) {
%2 = tail call i32 @do_output_signal(%struct.obs_output* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ getpid();
long GETPID() { return ((long)getpid()); }


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

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

LLVM IR (-O0):
define i64 @GETPID() {
%1 = call i64 (...) @getpid()
ret i64 %1
}

LLVM IR (-O2):
define i64 @GETPID() {
%1 = tail call i64 (...) @getpid()
ret i64 %1
}
char *kvm_geterr(void *kd) { return (0); }


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

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

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

LLVM IR (-O2):
define noalias i8* @kvm_geterr(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ fb(int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/);
int main() {
  fb(0, 0, 0, 0, 0, 0, 0);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <fb@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fb(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 0
}
void bplus(int x, int y, int *res) { *res = x + y; }


x86 assembly (clang, -O0):
<bplus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bplus>:
add    %esi,%edi
mov    %edi,(%rdx)
ret

LLVM IR (-O0):
define void @bplus(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32*, i32** %6
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @bplus(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = add nsw i32 %1, %0
store i32 %4, i32* %2
ret void
}
int main(int argc, char *argv[]) {
  int i = atoi(argv[1]);
  char a[][6] = {
      "zero", "one", "two",   "three", "four",
      "five", "six", "seven", "eight", "nine",
  };
  printf("%s\n", a[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xe9d(%rip),%rsi
mov    $0x3c,%edx
call   1040 <memcpy@plt>
movslq -0x14(%rbp),%rax
lea    -0x50(%rbp),%rsi
imul   $0x6,%rax,%rax
add    %rax,%rsi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
mov    0x8(%rsi),%rdi
xor    %eax,%eax
call   1040 <atoi@plt>
movups 0xef6(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xede(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea6(%rip),%xmm0
movaps %xmm0,(%rsp)
cltq
lea    (%rax,%rax,2),%rax
lea    (%rsp,%rax,2),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [10 x [6 x i8]] [[6 x i8] c"zero\00\00", [6 x i8] c"one\00\00\00", [6 x i8] c"two\00\00\00", [6 x i8] c"three\00", [6 x i8] c"four\00\00", [6 x i8] c"five\00\00", [6 x i8] c"six\00\00\00", [6 x i8] c"seven\00", [6 x i8] c"eight\00", [6 x i8] c"nine\00\00"]
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [10 x [6 x i8]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %10)
store i32 %11, i32* %6
%12 = bitcast [10 x [6 x i8]]* %7 to i8*
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [10 x [6 x i8]], [10 x [6 x i8]]* %7, i64 0, i64 %14
%16 = getelementptr inbounds [6 x i8], [6 x i8]* %15, i64 0, i64 0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [10 x [6 x i8]] [[6 x i8] c"zero\00\00", [6 x i8] c"one\00\00\00", [6 x i8] c"two\00\00\00", [6 x i8] c"three\00", [6 x i8] c"four\00\00", [6 x i8] c"five\00\00", [6 x i8] c"six\00\00\00", [6 x i8] c"seven\00", [6 x i8] c"eight\00", [6 x i8] c"nine\00\00"]
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x [6 x i8]]
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %5)
%7 = getelementptr inbounds [10 x [6 x i8]], [10 x [6 x i8]]* %3, i64 0, i64 0, i64 0
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds [10 x [6 x i8]], [10 x [6 x i8]]* %3, i64 0, i64 %8, i64 0
%10 = call i32 @puts(i8* %9)
ret i32 0
}
int vde_chain_nm3_n_out(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @vde_chain_nm3_n_out() {
ret i32 3
}

LLVM IR (-O2):
define i32 @vde_chain_nm3_n_out() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ srandom(unsigned int);
void our_srandom(unsigned int x) { srandom(x); }


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

x86 assembly (clang, -O2):
<our_srandom>:
jmp    1030 <srandom@plt>

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

LLVM IR (-O2):
define void @our_srandom(i32 %0) {
%2 = tail call i32 @srandom(i32 %0)
ret void
}
/* Type definitions */
struct hashEl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ slFreeList(struct hashEl **);
void hashElFreeList(struct hashEl **pList) { slFreeList(pList); }


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

x86 assembly (clang, -O2):
<hashElFreeList>:
jmp    1030 <slFreeList@plt>

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

LLVM IR (-O2):
%struct.hashEl = type { i32 }
define void @hashElFreeList(%struct.hashEl** %0) {
%2 = tail call i32 @slFreeList(%struct.hashEl** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void printAns(float a) { printf("Ans: %.2f \n", a); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Ans: %.2f \0A\00"
define void @printAns(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int yeni_proses() {
  printf("Yeni prosesim\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<yeni_proses>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Yeni prosesim\0A\00"
define i32 @yeni_proses() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [14 x i8] c"Yeni prosesim\00"
define i32 @yeni_proses() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 1
}
void printstack(int *stack, int soffset) {
  int i;
  for (i = 0; i <= soffset; i++) {
    printf("0x%x: %u\n", (stack + i), *(stack + i));
  }
}


x86 assembly (clang, -O0):
<printstack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1168 <printstack+0x58>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printstack+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printstack>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
js     1149 <printstack+0x39>
mov    %esi,%r14d
mov    %rdi,%rbx
add    $0x1,%r14d
lea    0xed6(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r14
jne    1130 <printstack+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"0x%x: %u\0A\00"
define void @printstack(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = add nuw i32 %1, 1
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %9, i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret void
}
double get_dynamical_diff_other(double JD) {
  double TD;
  double a;
  a = (JD - 2382148);
  a *= a;
  TD = -15 + a / 41048480;
  return (TD);
}


x86 assembly (clang, -O0):
<get_dynamical_diff_other>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefa(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  0xecd(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeb9(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dynamical_diff_other>:
addsd  0xef8(%rip),%xmm0
mulsd  %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @get_dynamical_diff_other(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fsub double %5, 0x41422CA200000000
store double %6, double* %4
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %8, %7
store double %9, double* %4
%10 = load double, double* %4
%11 = fdiv double %10, 0x418392CD00000000
%12 = fadd double -1.500000e+01, %11
store double %12, double* %3
%13 = load double, double* %3
ret double %13
}

LLVM IR (-O2):
define double @get_dynamical_diff_other(double %0) {
%2 = fadd double %0, 0xC1422CA200000000
%3 = fmul double %2, %2
%4 = fdiv double %3, 0x418392CD00000000
%5 = fadd double %4, -1.500000e+01
ret double %5
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *allocateAndConcatStrings(const char *str1, const char *str2) {
  char *str = (char *)malloc(strlen(str1) + strlen(str2) + 2);
  strcpy(str, str1);
  strcat(str, str2);
  return str;
}


x86 assembly (clang, -O0):
<allocateAndConcatStrings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x2,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocateAndConcatStrings>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x2,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @allocateAndConcatStrings(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
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 2
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %5
%18 = load i8*, i8** %4
%19 = call i32 @strcat(i8* %17, i8* %18)
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
define i8* @allocateAndConcatStrings(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 2
%6 = add i64 %5, %4
%7 = tail call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @strcpy(i8* %8, i8* %0)
%10 = tail call i32 @strcat(i8* %8, i8* %1)
ret i8* %8
}
char *fstr_save(s)
char const *s;
{ return strcpy(((char *)ftestalloc(sizeof(char) * (strlen(s) + 1))), s); }


x86 assembly (clang, -O0):
<fstr_save>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
shl    $0x0,%rdi
mov    $0x0,%al
call   1040 <ftestalloc@plt>
movslq %eax,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstr_save>:
push   %rbx
mov    %rdi,%rbx
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %eax,%eax
call   1040 <ftestalloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @fstr_save(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add i64 %4, 1
%6 = mul i64 1, %5
%7 = call i32 (i64, ...) bitcast (i32 (...)* @ftestalloc to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = load i8*, i8** %2
%11 = call i8* @strcpy(i8* %9, i8* %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @fstr_save(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @ftestalloc to i32 (i64, ...)*)(i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}
const char *GC_Name(void) { return "GC"; }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"GC\00"
define i8* @GC_Name() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [3 x i8] c"GC\00"
define i8* @GC_Name() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ unresolved_detected_at_runtime_not_at_linktime();
void call_unresolved(void) { unresolved_detected_at_runtime_not_at_linktime(); }


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

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

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

LLVM IR (-O2):
define void @call_unresolved() {
%1 = tail call i32 (...) @unresolved_detected_at_runtime_not_at_linktime()
ret void
}
int main(void) {
  int x = 0;
  return 1 % x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1,%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 poison
}
/* Variables and functions */
char const *weak_l2();
const char *__attribute__((section(".test.b"))) call_weak_l2(void) {
  return weak_l2() + 1;
}


x86 assembly (clang, -O0):
<call_weak_l2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <weak_l2@plt>
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_weak_l2>:
push   %rax
xor    %eax,%eax
call   1030 <weak_l2@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @call_weak_l2() section ".test.b" {
%1 = call i8* (...) @weak_l2()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}

LLVM IR (-O2):
define i8* @call_weak_l2() section ".test.b" {
%1 = tail call i8* (...) @weak_l2()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}
int do_215() { return 215; }


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

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

LLVM IR (-O0):
define i32 @do_215() {
ret i32 215
}

LLVM IR (-O2):
define i32 @do_215() {
ret i32 215
}
double Phi_1(double x) {
  double s;
  int n;
  s = x;
  for (n = 42; n >= 1; n--)
    s = x + n / s;
  return s;
}


x86 assembly (clang, -O0):
<Phi_1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x2a,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     114a <Phi_1+0x4a>
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    111a <Phi_1+0x1a>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Phi_1>:
mov    $0x2a,%eax
movapd %xmm0,%xmm1
nopl   0x0(%rax)
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
divsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
lea    -0x1(%rax),%ecx
xorps  %xmm3,%xmm3
cvtsi2sd %ecx,%xmm3
divsd  %xmm2,%xmm3
addsd  %xmm0,%xmm3
lea    -0x2(%rax),%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
divsd  %xmm3,%xmm1
addsd  %xmm0,%xmm1
add    $0xfffffffd,%eax
cmp    $0x1,%ecx
ja     1110 <Phi_1+0x10>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Phi_1(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double %0, double* %2
%5 = load double, double* %2
store double %5, double* %3
store i32 42, i32* %4
br label %6
6: ; preds = %16, %1
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 1
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load double, double* %2
%11 = load i32, i32* %4
%12 = sitofp i32 %11 to double
%13 = load double, double* %3
%14 = fdiv double %12, %13
%15 = fadd double %10, %14
store double %15, double* %3
br label %16
16: ; preds = %9
%17 = load i32, i32* %4
%18 = add nsw i32 %17, -1
store i32 %18, i32* %4
br label %6
19: ; preds = %6
%20 = load double, double* %3
ret double %20
}

LLVM IR (-O2):
define double @Phi_1(double %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 42, %1 ], [ %16, %2 ]
%4 = phi double [ %0, %1 ], [ %15, %2 ]
%5 = sitofp i32 %3 to double
%6 = fdiv double %5, %4
%7 = fadd double %6, %0
%8 = add nsw i32 %3, -1
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, %7
%11 = fadd double %10, %0
%12 = add nsw i32 %3, -2
%13 = sitofp i32 %12 to double
%14 = fdiv double %13, %11
%15 = fadd double %14, %0
%16 = add nsw i32 %3, -3
%17 = icmp ugt i32 %12, 1
br i1 %17, label %2, label %18
18: ; preds = %2
ret double %15
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, unsigned int, unsigned int,
                          unsigned int);
void RNDResponseSink_ContentDirectory_Search(struct UPnPService *Service,
                                             int ErrorCode, void *User,
                                             char *Result,
                                             unsigned int NumberReturned,
                                             unsigned int TotalMatches,
                                             unsigned int UpdateID) {
  printf("RND Invoke Response: "
         "ContentDirectory/Search[ErrorCode:%d](%s,%u,%u,%u)\r\n",
         ErrorCode, Result, NumberReturned, TotalMatches, UpdateID);
}


x86 assembly (clang, -O0):
<RNDResponseSink_ContentDirectory_Search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    0x10(%rbp),%r9d
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNDResponseSink_ContentDirectory_Search>:
mov    %r9d,%eax
mov    0x8(%rsp),%r9d
lea    0xee1(%rip),%rdi
mov    %rcx,%rdx
mov    %r8d,%ecx
mov    %eax,%r8d
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [74 x i8] c"RND Invoke Response: ContentDirectory/Search[ErrorCode:%d](%s,%u,%u,%u)\0D\0A\00"
define void @RNDResponseSink_ContentDirectory_Search(%struct.UPnPService* %0, i32 %1, i8* %2, i8* %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca %struct.UPnPService*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store %struct.UPnPService* %0, %struct.UPnPService** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %9
%16 = load i8*, i8** %11
%17 = load i32, i32* %12
%18 = load i32, i32* %13
%19 = load i32, i32* %14
%20 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %15, i8* %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [74 x i8] c"RND Invoke Response: ContentDirectory/Search[ErrorCode:%d](%s,%u,%u,%u)\0D\0A\00"
define void @RNDResponseSink_ContentDirectory_Search(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %3, i32 %4, i32 %5, i32 %6)
ret void
}
/* Variables and functions */
char *getenv(char *);
char *xlosGetEnv(char *name) { return getenv(name); }


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

x86 assembly (clang, -O2):
<xlosGetEnv>:
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
define i8* @xlosGetEnv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
__attribute__((always_)) void cl_prefetch_t2(void *p) {
  asm volatile("prefetcht2 (%0)\n\t" : : "r"(p) : "memory");
}


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

x86 assembly (clang, -O2):
<cl_prefetch_t2>:
prefetcht2 (%rdi)
ret

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

LLVM IR (-O2):
define void @cl_prefetch_t2(i8* %0) {
tail call void asm sideeffect "prefetcht2 ($0)\0A\09", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
lckhello() {}


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

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

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

LLVM IR (-O2):
define i32 @lckhello() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ udp_send();
main() { udp_send(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @udp_send()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @udp_send()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int read(int /*<<< orphan*/, char *, int);
void read_canon_mode(void) {
  char buf[32] = {0};
  int r;
  printf("Regular read in canonical mode\n");
  r = read(0, buf, 32);
  printf("read(%d): %s", r, buf);
}


x86 assembly (clang, -O0):
<read_canon_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
xor    %edi,%edi
mov    $0x20,%edx
call   1050 <read@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    -0x20(%rbp),%rdx
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_canon_mode>:
push   %rbx
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x20,%edx
call   1050 <read@plt>
lea    0xe9a(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Regular read in canonical mode\0A\00"
@.str.1 = [13 x i8] c"read(%d): %s\00"
define void @read_canon_mode() {
%1 = alloca [32 x i8]
%2 = alloca i32
%3 = bitcast [32 x i8]* %1 to i8*
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%6 = call i32 @read(i32 0, i8* %5, i32 32)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"read(%d): %s\00"
@str = [31 x i8] c"Regular read in canonical mode\00"
define void @read_canon_mode() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%4 = call i32 @read(i32 0, i8* %2, i32 32)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %4, i8* %2)
ret void
}
int disp_init_feat(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @disp_init_feat() {
ret i32 0
}
/* Variables and functions */
float sqrtf(float);
float module2f(float vx, float vy) { return sqrtf((vx * vx) + (vy * vy)); }


x86 assembly (clang, -O0):
<module2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<module2f>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1129 <module2f+0x19>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @module2f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %3
%7 = load float, float* %4
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = call float @llvm.fmuladd.f32(float %5, float %6, float %9)
%11 = call float @sqrtf(float %10)
ret float %11
}

LLVM IR (-O2):
define float @module2f(float %0, float %1) {
%3 = fmul float %1, %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %3)
%5 = tail call float @sqrtf(float %4)
ret float %5
}