#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ memoryCheck();
float *convertLong2Float(unsigned long int *dataIn, int n) {
  int i;
  float *dataOut;
  if ((dataOut = (float *)calloc(n, sizeof(float))) == NULL)
    memoryCheck();
  for (i = 0; i < n; i++)
    *(dataOut + i) = (float)*(dataIn + i);
  return dataOut;
}


x86 assembly (clang, -O0):
<convertLong2Float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1151 <convertLong2Float+0x31>
mov    $0x0,%al
call   1040 <memoryCheck@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c9 <convertLong2Float+0xa9>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x20(%rbp)
test   %rax,%rax
movss  %xmm0,-0x1c(%rbp)
js     11a9 <convertLong2Float+0x89>
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1158 <convertLong2Float+0x38>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertLong2Float>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1144 <convertLong2Float+0x24>
xor    %eax,%eax
call   1040 <memoryCheck@plt>
test   %ebp,%ebp
jle    1226 <convertLong2Float+0x106>
mov    %ebp,%r9d
cmp    $0x1,%ebp
jne    115b <convertLong2Float+0x3b>
xor    %ecx,%ecx
jmp    1246 <convertLong2Float+0x126>
mov    %r9d,%ecx
and    $0xfffffffe,%ecx
lea    -0x2(%rcx),%rdx
mov    %rdx,%rsi
shr    %rsi
add    $0x1,%rsi
mov    %esi,%r8d
and    $0x3,%r8d
cmp    $0x6,%rdx
jae    1269 <convertLong2Float+0x149>
xor    %edi,%edi
test   %r8,%r8
je     1221 <convertLong2Float+0x101>
lea    (%rbx,%rdi,4),%rsi
lea    (%r14,%rdi,8),%rdi
shl    $0x3,%r8
xor    %ebp,%ebp
jmp    11b8 <convertLong2Float+0x98>
nopl   0x0(%rax,%rax,1)
xorps  %xmm1,%xmm1
cvtsi2ss %rdx,%xmm1
unpcklps %xmm1,%xmm0
movlps %xmm0,(%rsi,%rbp,1)
add    $0x8,%rbp
cmp    %rbp,%r8
je     1221 <convertLong2Float+0x101>
movdqu (%rdi,%rbp,2),%xmm1
movq   %xmm1,%rdx
test   %rdx,%rdx
js     11e0 <convertLong2Float+0xc0>
xorps  %xmm0,%xmm0
cvtsi2ss %rdx,%xmm0
jmp    11f8 <convertLong2Float+0xd8>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rdx,%rax
shr    %rax
and    $0x1,%edx
or     %rax,%rdx
xorps  %xmm0,%xmm0
cvtsi2ss %rdx,%xmm0
addss  %xmm0,%xmm0
pshufd $0xee,%xmm1,%xmm1
movq   %xmm1,%rdx
test   %rdx,%rdx
jns    11a0 <convertLong2Float+0x80>
mov    %rdx,%rax
shr    %rax
and    $0x1,%edx
or     %rax,%rdx
xorps  %xmm1,%xmm1
cvtsi2ss %rdx,%xmm1
addss  %xmm1,%xmm1
jmp    11a8 <convertLong2Float+0x88>
cmp    %r9,%rcx
jne    1246 <convertLong2Float+0x126>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret
xchg   %ax,%ax
xorps  %xmm0,%xmm0
cvtsi2ss %rdx,%xmm0
movss  %xmm0,(%rbx,%rcx,4)
add    $0x1,%rcx
cmp    %rcx,%r9
je     1226 <convertLong2Float+0x106>
mov    (%r14,%rcx,8),%rdx
test   %rdx,%rdx
jns    1230 <convertLong2Float+0x110>
mov    %rdx,%rax
shr    %rax
and    $0x1,%edx
or     %rax,%rdx
xorps  %xmm0,%xmm0
cvtsi2ss %rdx,%xmm0
addss  %xmm0,%xmm0
jmp    1238 <convertLong2Float+0x118>
and    $0xfffffffffffffffc,%rsi
xor    %edi,%edi
jmp    129e <convertLong2Float+0x17e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xorps  %xmm1,%xmm1
cvtsi2ss %rbp,%xmm1
unpcklps %xmm1,%xmm0
movlps %xmm0,0x18(%rbx,%rdi,4)
add    $0x8,%rdi
add    $0xfffffffffffffffc,%rsi
je     1182 <convertLong2Float+0x62>
movdqu (%r14,%rdi,8),%xmm1
movq   %xmm1,%rbp
test   %rbp,%rbp
js     12c0 <convertLong2Float+0x1a0>
xorps  %xmm0,%xmm0
cvtsi2ss %rbp,%xmm0
jmp    12d8 <convertLong2Float+0x1b8>
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdx
shr    %rdx
and    $0x1,%ebp
or     %rdx,%rbp
xorps  %xmm0,%xmm0
cvtsi2ss %rbp,%xmm0
addss  %xmm0,%xmm0
pshufd $0xee,%xmm1,%xmm1
movq   %xmm1,%rbp
test   %rbp,%rbp
js     1300 <convertLong2Float+0x1e0>
xorps  %xmm1,%xmm1
cvtsi2ss %rbp,%xmm1
jmp    1318 <convertLong2Float+0x1f8>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdx
shr    %rdx
and    $0x1,%ebp
or     %rdx,%rbp
xorps  %xmm1,%xmm1
cvtsi2ss %rbp,%xmm1
addss  %xmm1,%xmm1
unpcklps %xmm1,%xmm0
movlps %xmm0,(%rbx,%rdi,4)
movdqu 0x10(%r14,%rdi,8),%xmm1
movq   %xmm1,%rbp
test   %rbp,%rbp
js     1340 <convertLong2Float+0x220>
xorps  %xmm0,%xmm0
cvtsi2ss %rbp,%xmm0
jmp    1358 <convertLong2Float+0x238>
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdx
shr    %rdx
and    $0x1,%ebp
or     %rdx,%rbp
xorps  %xmm0,%xmm0
cvtsi2ss %rbp,%xmm0
addss  %xmm0,%xmm0
pshufd $0xee,%xmm1,%xmm1
movq   %xmm1,%rbp
test   %rbp,%rbp
js     1380 <convertLong2Float+0x260>
xorps  %xmm1,%xmm1
cvtsi2ss %rbp,%xmm1
jmp    1398 <convertLong2Float+0x278>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdx
shr    %rdx
and    $0x1,%ebp
or     %rdx,%rbp
xorps  %xmm1,%xmm1
cvtsi2ss %rbp,%xmm1
addss  %xmm1,%xmm1
unpcklps %xmm1,%xmm0
movlps %xmm0,0x8(%rbx,%rdi,4)
movdqu 0x20(%r14,%rdi,8),%xmm1
movq   %xmm1,%rbp
test   %rbp,%rbp
js     13c0 <convertLong2Float+0x2a0>
xorps  %xmm0,%xmm0
cvtsi2ss %rbp,%xmm0
jmp    13d8 <convertLong2Float+0x2b8>
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdx
shr    %rdx
and    $0x1,%ebp
or     %rdx,%rbp
xorps  %xmm0,%xmm0
cvtsi2ss %rbp,%xmm0
addss  %xmm0,%xmm0
pshufd $0xee,%xmm1,%xmm1
movq   %xmm1,%rbp
test   %rbp,%rbp
js     1400 <convertLong2Float+0x2e0>
xorps  %xmm1,%xmm1
cvtsi2ss %rbp,%xmm1
jmp    1418 <convertLong2Float+0x2f8>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdx
shr    %rdx
and    $0x1,%ebp
or     %rdx,%rbp
xorps  %xmm1,%xmm1
cvtsi2ss %rbp,%xmm1
addss  %xmm1,%xmm1
unpcklps %xmm1,%xmm0
movlps %xmm0,0x10(%rbx,%rdi,4)
movdqu 0x30(%r14,%rdi,8),%xmm1
movq   %xmm1,%rbp
test   %rbp,%rbp
js     1440 <convertLong2Float+0x320>
xorps  %xmm0,%xmm0
cvtsi2ss %rbp,%xmm0
jmp    1458 <convertLong2Float+0x338>
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdx
shr    %rdx
and    $0x1,%ebp
or     %rdx,%rbp
xorps  %xmm0,%xmm0
cvtsi2ss %rbp,%xmm0
addss  %xmm0,%xmm0
pshufd $0xee,%xmm1,%xmm1
movq   %xmm1,%rbp
test   %rbp,%rbp
jns    1280 <convertLong2Float+0x160>
mov    %rbp,%rdx
shr    %rdx
and    $0x1,%ebp
or     %rdx,%rbp
xorps  %xmm1,%xmm1
cvtsi2ss %rbp,%xmm1
addss  %xmm1,%xmm1
jmp    1288 <convertLong2Float+0x168>

LLVM IR (-O0):
define float* @convertLong2Float(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i32
%6 = alloca float*
store i64* %0, i64** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = call i64 @calloc(i32 %7, i32 4)
%9 = inttoptr i64 %8 to float*
store float* %9, float** %6
%10 = icmp eq float* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @memoryCheck()
br label %13
13: ; preds = %11, %2
store i32 0, i32* %5
br label %14
14: ; preds = %29, %13
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %32
18: ; preds = %14
%19 = load i64*, i64** %3
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i64, i64* %19, i64 %21
%23 = load i64, i64* %22
%24 = uitofp i64 %23 to float
%25 = load float*, float** %6
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds float, float* %25, i64 %27
store float %24, float* %28
br label %29
29: ; preds = %18
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %14
32: ; preds = %14
%33 = load float*, float** %6
ret float* %33
}

LLVM IR (-O2):
define float* @convertLong2Float(i64* nocapture %0, i32 %1) {
%3 = tail call i64 @calloc(i32 %1, i32 4)
%4 = inttoptr i64 %3 to float*
%5 = icmp eq i64 %3, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @memoryCheck()
br label %8
8: ; preds = %6, %2
%9 = icmp sgt i32 %1, 0
br i1 %9, label %10, label %82
10: ; preds = %8
%11 = zext i32 %1 to i64
%12 = icmp eq i32 %1, 1
br i1 %12, label %72, label %13
13: ; preds = %10
%14 = and i64 %11, 4294967294
%15 = add nsw i64 %14, -2
%16 = lshr exact i64 %15, 1
%17 = add nuw i64 %16, 1
%18 = and i64 %17, 3
%19 = icmp ult i64 %15, 6
br i1 %19, label %55, label %20
20: ; preds = %13
%21 = and i64 %17, -4
br label %22
22: ; preds = %22, %20
%23 = phi i64 [ 0, %20 ], [ %52, %22 ]
%24 = phi i64 [ 0, %20 ], [ %53, %22 ]
%25 = getelementptr inbounds i64, i64* %0, i64 %23
%26 = bitcast i64* %25 to <2 x i64>*
%27 = load <2 x i64>, <2 x i64>* %26
%28 = uitofp <2 x i64> %27 to <2 x float>
%29 = getelementptr inbounds float, float* %4, i64 %23
%30 = bitcast float* %29 to <2 x float>*
store <2 x float> %28, <2 x float>* %30
%31 = or i64 %23, 2
%32 = getelementptr inbounds i64, i64* %0, i64 %31
%33 = bitcast i64* %32 to <2 x i64>*
%34 = load <2 x i64>, <2 x i64>* %33
%35 = uitofp <2 x i64> %34 to <2 x float>
%36 = getelementptr inbounds float, float* %4, i64 %31
%37 = bitcast float* %36 to <2 x float>*
store <2 x float> %35, <2 x float>* %37
%38 = or i64 %23, 4
%39 = getelementptr inbounds i64, i64* %0, i64 %38
%40 = bitcast i64* %39 to <2 x i64>*
%41 = load <2 x i64>, <2 x i64>* %40
%42 = uitofp <2 x i64> %41 to <2 x float>
%43 = getelementptr inbounds float, float* %4, i64 %38
%44 = bitcast float* %43 to <2 x float>*
store <2 x float> %42, <2 x float>* %44
%45 = or i64 %23, 6
%46 = getelementptr inbounds i64, i64* %0, i64 %45
%47 = bitcast i64* %46 to <2 x i64>*
%48 = load <2 x i64>, <2 x i64>* %47
%49 = uitofp <2 x i64> %48 to <2 x float>
%50 = getelementptr inbounds float, float* %4, i64 %45
%51 = bitcast float* %50 to <2 x float>*
store <2 x float> %49, <2 x float>* %51
%52 = add nuw i64 %23, 8
%53 = add i64 %24, 4
%54 = icmp eq i64 %53, %21
br i1 %54, label %55, label %22
55: ; preds = %22, %13
%56 = phi i64 [ 0, %13 ], [ %52, %22 ]
%57 = icmp eq i64 %18, 0
br i1 %57, label %70, label %58
58: ; preds = %55, %58
%59 = phi i64 [ %67, %58 ], [ %56, %55 ]
%60 = phi i64 [ %68, %58 ], [ 0, %55 ]
%61 = getelementptr inbounds i64, i64* %0, i64 %59
%62 = bitcast i64* %61 to <2 x i64>*
%63 = load <2 x i64>, <2 x i64>* %62
%64 = uitofp <2 x i64> %63 to <2 x float>
%65 = getelementptr inbounds float, float* %4, i64 %59
%66 = bitcast float* %65 to <2 x float>*
store <2 x float> %64, <2 x float>* %66
%67 = add nuw i64 %59, 2
%68 = add i64 %60, 1
%69 = icmp eq i64 %68, %18
br i1 %69, label %70, label %58
70: ; preds = %58, %55
%71 = icmp eq i64 %14, %11
br i1 %71, label %82, label %72
72: ; preds = %10, %70
%73 = phi i64 [ 0, %10 ], [ %14, %70 ]
br label %74
74: ; preds = %72, %74
%75 = phi i64 [ %80, %74 ], [ %73, %72 ]
%76 = getelementptr inbounds i64, i64* %0, i64 %75
%77 = load i64, i64* %76
%78 = uitofp i64 %77 to float
%79 = getelementptr inbounds float, float* %4, i64 %75
store float %78, float* %79
%80 = add nuw nsw i64 %75, 1
%81 = icmp eq i64 %80, %11
br i1 %81, label %82, label %74
82: ; preds = %74, %70, %8
ret float* %4
}