#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 */
double *get_X_randreal_64bit(int const);
scalar_t__ malloc(int const);
const float *get_X_randreal_32bit(const int dftsize) {
  const double *d = get_X_randreal_64bit(dftsize);
  float *ret = (float *)(malloc(dftsize * 2 * sizeof(float)));
  int i;
  for (i = dftsize * 2; i--;)
    ret[i] = (float)(d[i]);
  return ret;
}


x86 assembly (clang, -O0):
<get_X_randreal_32bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <get_X_randreal_64bit@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
je     118e <get_X_randreal_32bit+0x6e>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
jmp    1157 <get_X_randreal_32bit+0x37>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_X_randreal_32bit>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <get_X_randreal_64bit@plt>
mov    %rax,%r14
lea    0x0(,%rbx,8),%edi
call   1030 <malloc@plt>
test   %ebx,%ebx
je     125c <get_X_randreal_32bit+0x13c>
lea    (%rbx,%rbx,1),%ecx
movslq %ecx,%rcx
lea    (%rbx,%rbx,1),%r9d
add    $0xfffffffe,%r9d
test   %r9d,%r9d
je     1240 <get_X_randreal_32bit+0x120>
add    $0x2,%r9
mov    %r9,%r8
and    $0xfffffffffffffffc,%r8
lea    -0x4(%r8),%rdx
mov    %rdx,%r10
shr    $0x2,%r10
add    $0x1,%r10
test   %rdx,%rdx
je     1264 <get_X_randreal_32bit+0x144>
mov    %r10,%rbx
and    $0xfffffffffffffffe,%rbx
lea    (%rax,%rcx,4),%rdx
add    $0xfffffffffffffff8,%rdx
lea    (%r14,%rcx,8),%rsi
add    $0xfffffffffffffff0,%rsi
mov    $0xfffffffffffffffe,%rdi
nopw   0x0(%rax,%rax,1)
movupd (%rsi,%rdi,8),%xmm0
movupd 0x10(%rsi,%rdi,8),%xmm1
shufpd $0x1,%xmm1,%xmm1
shufpd $0x1,%xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
cvtpd2ps %xmm0,%xmm0
shufps $0x11,%xmm1,%xmm0
movups %xmm0,(%rdx,%rdi,4)
movupd -0x20(%rsi,%rdi,8),%xmm0
movupd -0x10(%rsi,%rdi,8),%xmm1
shufpd $0x1,%xmm1,%xmm1
shufpd $0x1,%xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
cvtpd2ps %xmm0,%xmm0
shufps $0x11,%xmm1,%xmm0
movups %xmm0,-0x10(%rdx,%rdi,4)
add    $0xfffffffffffffff8,%rdi
add    $0xfffffffffffffffe,%rbx
jne    11a0 <get_X_randreal_32bit+0x80>
add    $0x1,%rdi
test   $0x1,%r10b
je     122c <get_X_randreal_32bit+0x10c>
add    %rcx,%rdi
movupd -0x18(%r14,%rdi,8),%xmm0
movupd -0x8(%r14,%rdi,8),%xmm1
shufpd $0x1,%xmm1,%xmm1
shufpd $0x1,%xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
cvtpd2ps %xmm0,%xmm0
shufps $0x11,%xmm1,%xmm0
movups %xmm0,-0xc(%rax,%rdi,4)
cmp    %r8,%r9
je     125c <get_X_randreal_32bit+0x13c>
sub    %r8,%rcx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  -0x8(%r14,%rcx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rax,%rcx,4)
lea    -0x1(%rcx),%rdx
mov    %rdx,%rcx
test   %edx,%edx
jne    1240 <get_X_randreal_32bit+0x120>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    $0xffffffffffffffff,%rdi
test   $0x1,%r10b
jne    1200 <get_X_randreal_32bit+0xe0>
jmp    122c <get_X_randreal_32bit+0x10c>

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

LLVM IR (-O2):
define float* @get_X_randreal_32bit(i32 %0) {
%2 = tail call double* @get_X_randreal_64bit(i32 %0)
%3 = shl i32 %0, 3
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to float*
%6 = icmp eq i32 %0, 0
br i1 %6, label %114, label %7
7: ; preds = %1
%8 = shl i32 %0, 1
%9 = sext i32 %8 to i64
%10 = add i32 %8, -2
%11 = zext i32 %10 to i64
%12 = add nuw nsw i64 %11, 2
%13 = icmp eq i32 %10, 0
br i1 %13, label %103, label %14
14: ; preds = %7
%15 = and i64 %12, 8589934588
%16 = sub nsw i64 %9, %15
%17 = add nsw i64 %15, -4
%18 = lshr exact i64 %17, 2
%19 = add nuw nsw i64 %18, 1
%20 = and i64 %19, 1
%21 = icmp eq i64 %17, 0
br i1 %21, label %76, label %22
22: ; preds = %14
%23 = and i64 %19, 9223372036854775806
br label %24
24: ; preds = %24, %22
%25 = phi i64 [ 0, %22 ], [ %71, %24 ]
%26 = phi i64 [ 0, %22 ], [ %72, %24 ]
%27 = xor i64 %25, -1
%28 = add i64 %27, %9
%29 = getelementptr inbounds double, double* %2, i64 %28
%30 = getelementptr inbounds double, double* %29, i64 -1
%31 = bitcast double* %30 to <2 x double>*
%32 = load <2 x double>, <2 x double>* %31
%33 = shufflevector <2 x double> %32, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%34 = getelementptr inbounds double, double* %29, i64 -2
%35 = getelementptr inbounds double, double* %34, i64 -1
%36 = bitcast double* %35 to <2 x double>*
%37 = load <2 x double>, <2 x double>* %36
%38 = shufflevector <2 x double> %37, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%39 = fptrunc <2 x double> %33 to <2 x float>
%40 = fptrunc <2 x double> %38 to <2 x float>
%41 = getelementptr inbounds float, float* %5, i64 %28
%42 = shufflevector <2 x float> %39, <2 x float> poison, <2 x i32> <i32 1, i32 0>
%43 = getelementptr inbounds float, float* %41, i64 -1
%44 = bitcast float* %43 to <2 x float>*
store <2 x float> %42, <2 x float>* %44
%45 = shufflevector <2 x float> %40, <2 x float> poison, <2 x i32> <i32 1, i32 0>
%46 = getelementptr inbounds float, float* %41, i64 -2
%47 = getelementptr inbounds float, float* %46, i64 -1
%48 = bitcast float* %47 to <2 x float>*
store <2 x float> %45, <2 x float>* %48
%49 = sub nuw nsw i64 -5, %25
%50 = add i64 %49, %9
%51 = getelementptr inbounds double, double* %2, i64 %50
%52 = getelementptr inbounds double, double* %51, i64 -1
%53 = bitcast double* %52 to <2 x double>*
%54 = load <2 x double>, <2 x double>* %53
%55 = shufflevector <2 x double> %54, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%56 = getelementptr inbounds double, double* %51, i64 -2
%57 = getelementptr inbounds double, double* %56, i64 -1
%58 = bitcast double* %57 to <2 x double>*
%59 = load <2 x double>, <2 x double>* %58
%60 = shufflevector <2 x double> %59, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%61 = fptrunc <2 x double> %55 to <2 x float>
%62 = fptrunc <2 x double> %60 to <2 x float>
%63 = getelementptr inbounds float, float* %5, i64 %50
%64 = shufflevector <2 x float> %61, <2 x float> poison, <2 x i32> <i32 1, i32 0>
%65 = getelementptr inbounds float, float* %63, i64 -1
%66 = bitcast float* %65 to <2 x float>*
store <2 x float> %64, <2 x float>* %66
%67 = shufflevector <2 x float> %62, <2 x float> poison, <2 x i32> <i32 1, i32 0>
%68 = getelementptr inbounds float, float* %63, i64 -2
%69 = getelementptr inbounds float, float* %68, i64 -1
%70 = bitcast float* %69 to <2 x float>*
store <2 x float> %67, <2 x float>* %70
%71 = add nuw i64 %25, 8
%72 = add i64 %26, 2
%73 = icmp eq i64 %72, %23
br i1 %73, label %74, label %24
74: ; preds = %24
%75 = sub i64 -9, %25
br label %76
76: ; preds = %74, %14
%77 = phi i64 [ -1, %14 ], [ %75, %74 ]
%78 = icmp eq i64 %20, 0
br i1 %78, label %101, label %79
79: ; preds = %76
%80 = add i64 %77, %9
%81 = getelementptr inbounds double, double* %2, i64 %80
%82 = getelementptr inbounds double, double* %81, i64 -1
%83 = bitcast double* %82 to <2 x double>*
%84 = load <2 x double>, <2 x double>* %83
%85 = shufflevector <2 x double> %84, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%86 = getelementptr inbounds double, double* %81, i64 -2
%87 = getelementptr inbounds double, double* %86, i64 -1
%88 = bitcast double* %87 to <2 x double>*
%89 = load <2 x double>, <2 x double>* %88
%90 = shufflevector <2 x double> %89, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%91 = fptrunc <2 x double> %85 to <2 x float>
%92 = fptrunc <2 x double> %90 to <2 x float>
%93 = getelementptr inbounds float, float* %5, i64 %80
%94 = shufflevector <2 x float> %91, <2 x float> poison, <2 x i32> <i32 1, i32 0>
%95 = getelementptr inbounds float, float* %93, i64 -1
%96 = bitcast float* %95 to <2 x float>*
store <2 x float> %94, <2 x float>* %96
%97 = shufflevector <2 x float> %92, <2 x float> poison, <2 x i32> <i32 1, i32 0>
%98 = getelementptr inbounds float, float* %93, i64 -2
%99 = getelementptr inbounds float, float* %98, i64 -1
%100 = bitcast float* %99 to <2 x float>*
store <2 x float> %97, <2 x float>* %100
br label %101
101: ; preds = %76, %79
%102 = icmp eq i64 %12, %15
br i1 %102, label %114, label %103
103: ; preds = %7, %101
%104 = phi i64 [ %9, %7 ], [ %16, %101 ]
br label %105
105: ; preds = %103, %105
%106 = phi i64 [ %107, %105 ], [ %104, %103 ]
%107 = add nsw i64 %106, -1
%108 = getelementptr inbounds double, double* %2, i64 %107
%109 = load double, double* %108
%110 = fptrunc double %109 to float
%111 = getelementptr inbounds float, float* %5, i64 %107
store float %110, float* %111
%112 = trunc i64 %107 to i32
%113 = icmp eq i32 %112, 0
br i1 %113, label %114, label %105
114: ; preds = %105, %101, %1
ret float* %5
}