#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 * sizeof(float)));
  int i;
  for (i = dftsize; 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)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
je     1187 <get_x_randreal_32bit+0x67>
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    1150 <get_x_randreal_32bit+0x30>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_x_randreal_32bit>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%r14d
call   1040 <get_x_randreal_64bit@plt>
mov    %rax,%r15
lea    0x0(,%r14,4),%edi
call   1030 <malloc@plt>
test   %r14d,%r14d
je     125c <get_x_randreal_32bit+0x13c>
movslq %r14d,%rcx
add    $0xffffffff,%r14d
cmp    $0x3,%r14d
jb     1240 <get_x_randreal_32bit+0x120>
add    $0x1,%r14
mov    %r14,%r8
and    $0xfffffffffffffffc,%r8
lea    -0x4(%r8),%rdx
mov    %rdx,%r9
shr    $0x2,%r9
add    $0x1,%r9
test   %rdx,%rdx
je     1262 <get_x_randreal_32bit+0x142>
mov    %r9,%rdi
and    $0xfffffffffffffffe,%rdi
lea    (%rax,%rcx,4),%rdx
add    $0xfffffffffffffff8,%rdx
lea    (%r15,%rcx,8),%rbx
add    $0xfffffffffffffff0,%rbx
mov    $0xfffffffffffffffe,%rsi
nopl   0x0(%rax,%rax,1)
movupd (%rbx,%rsi,8),%xmm0
movupd 0x10(%rbx,%rsi,8),%xmm1
shufpd $0x1,%xmm1,%xmm1
shufpd $0x1,%xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
cvtpd2ps %xmm0,%xmm0
shufps $0x11,%xmm1,%xmm0
movups %xmm0,(%rdx,%rsi,4)
movupd -0x20(%rbx,%rsi,8),%xmm0
movupd -0x10(%rbx,%rsi,8),%xmm1
shufpd $0x1,%xmm1,%xmm1
shufpd $0x1,%xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
cvtpd2ps %xmm0,%xmm0
shufps $0x11,%xmm1,%xmm0
movups %xmm0,-0x10(%rdx,%rsi,4)
add    $0xfffffffffffffff8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    11a0 <get_x_randreal_32bit+0x80>
add    $0x1,%rsi
test   $0x1,%r9b
je     122c <get_x_randreal_32bit+0x10c>
add    %rcx,%rsi
movupd -0x18(%r15,%rsi,8),%xmm0
movupd -0x8(%r15,%rsi,8),%xmm1
shufpd $0x1,%xmm1,%xmm1
shufpd $0x1,%xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
cvtpd2ps %xmm0,%xmm0
shufps $0x11,%xmm1,%xmm0
movups %xmm0,-0xc(%rax,%rsi,4)
cmp    %r8,%r14
je     125c <get_x_randreal_32bit+0x13c>
sub    %r8,%rcx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  -0x8(%r15,%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>
pop    %rbx
pop    %r14
pop    %r15
ret
mov    $0xffffffffffffffff,%rsi
test   $0x1,%r9b
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 = sext i32 %8 to i64
%10 = mul i64 %9, 4
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to float*
store float* %13, float** %4
%14 = load i32, i32* %2
store i32 %14, i32* %5
br label %15
15: ; preds = %19, %1
%16 = load i32, i32* %5
%17 = add nsw i32 %16, -1
store i32 %17, i32* %5
%18 = icmp ne i32 %16, 0
br i1 %18, label %19, label %30
19: ; preds = %15
%20 = load double*, double** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double, double* %20, i64 %22
%24 = load double, double* %23
%25 = fptrunc double %24 to float
%26 = load float*, float** %4
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds float, float* %26, i64 %28
store float %25, float* %29
br label %15
30: ; preds = %15
%31 = load float*, float** %4
ret float* %31
}

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