#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 */
int qu2om(double *, double *, int);
int qu2omLoopf(float *qu, float *om, unsigned long long n, int p) {
  int trash;
  unsigned long long j, i, iIn, iOut, qustep = 4, omstep = 9;
  double quFlt[4], omFlt[9];
#pragma omp parallel for default(shared) private(j, i, iIn, iOut, trash,       \
                                                 quFlt, omFlt)                 \
    firstprivate(qustep, omstep) schedule(static)
  for (i = 0; i < n; i++) {
    iIn = i * qustep;
    iOut = i * omstep;
    for (j = 0; j < qustep; j++) {
      quFlt[j] = (double)qu[iIn + j];
    }
    trash = qu2om(quFlt, omFlt, p);
    for (j = 0; j < omstep; j++) {
      om[iOut + j] = (float)omFlt[j];
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<qu2omLoopf>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movq   $0x4,-0x48(%rbp)
movq   $0x9,-0x50(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1225 <qu2omLoopf+0x115>
mov    -0x30(%rbp),%rax
imul   -0x48(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
imul   -0x50(%rbp),%rax
mov    %rax,-0x40(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x48(%rbp),%rax
jae    11b0 <qu2omLoopf+0xa0>
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
add    -0x28(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,-0x70(%rbp,%rax,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1172 <qu2omLoopf+0x62>
lea    -0x70(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <qu2om@plt>
mov    %eax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x50(%rbp),%rax
jae    120f <qu2omLoopf+0xff>
mov    -0x28(%rbp),%rax
movsd  -0xc0(%rbp,%rax,8),%xmm0
ff ff
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%rcx
add    -0x28(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11ce <qu2omLoopf+0xbe>
jmp    1214 <qu2omLoopf+0x104>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1142 <qu2omLoopf+0x32>
mov    $0x1,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qu2omLoopf>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
test   %rdx,%rdx
je     11b5 <qu2omLoopf+0xa5>
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
add    $0x8,%rbx
add    $0x20,%rbp
mov    %rsp,%r12
lea    0x20(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cvtps2pd -0x8(%rbx),%xmm0
movaps %xmm0,(%rsp)
cvtps2pd (%rbx),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r14d,%edx
call   1030 <qu2om@plt>
cvtpd2ps 0x30(%rsp),%xmm0
cvtpd2ps 0x20(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
movupd %xmm1,-0x20(%rbp)
cvtpd2ps 0x50(%rsp),%xmm0
cvtpd2ps 0x40(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
movupd %xmm1,-0x10(%rbp)
movsd  0x60(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x0(%rbp)
add    $0x10,%rbx
add    $0x24,%rbp
add    $0xffffffffffffffff,%r15
jne    1150 <qu2omLoopf+0x40>
mov    $0x1,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @qu2omLoopf(float* %0, float* %1, i64 %2, i32 %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca [4 x double]
%17 = alloca [9 x double]
store float* %0, float** %5
store float* %1, float** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
store i64 4, i64* %14
store i64 9, i64* %15
store i64 0, i64* %11
br label %18
18: ; preds = %69, %4
%19 = load i64, i64* %11
%20 = load i64, i64* %7
%21 = icmp ult i64 %19, %20
br i1 %21, label %22, label %72
22: ; preds = %18
%23 = load i64, i64* %11
%24 = load i64, i64* %14
%25 = mul i64 %23, %24
store i64 %25, i64* %12
%26 = load i64, i64* %11
%27 = load i64, i64* %15
%28 = mul i64 %26, %27
store i64 %28, i64* %13
store i64 0, i64* %10
br label %29
29: ; preds = %43, %22
%30 = load i64, i64* %10
%31 = load i64, i64* %14
%32 = icmp ult i64 %30, %31
br i1 %32, label %33, label %46
33: ; preds = %29
%34 = load float*, float** %5
%35 = load i64, i64* %12
%36 = load i64, i64* %10
%37 = add i64 %35, %36
%38 = getelementptr inbounds float, float* %34, i64 %37
%39 = load float, float* %38
%40 = fpext float %39 to double
%41 = load i64, i64* %10
%42 = getelementptr inbounds [4 x double], [4 x double]* %16, i64 0, i64 %41
store double %40, double* %42
br label %43
43: ; preds = %33
%44 = load i64, i64* %10
%45 = add i64 %44, 1
store i64 %45, i64* %10
br label %29
46: ; preds = %29
%47 = getelementptr inbounds [4 x double], [4 x double]* %16, i64 0, i64 0
%48 = getelementptr inbounds [9 x double], [9 x double]* %17, i64 0, i64 0
%49 = load i32, i32* %8
%50 = call i32 @qu2om(double* %47, double* %48, i32 %49)
store i32 %50, i32* %9
store i64 0, i64* %10
br label %51
51: ; preds = %65, %46
%52 = load i64, i64* %10
%53 = load i64, i64* %15
%54 = icmp ult i64 %52, %53
br i1 %54, label %55, label %68
55: ; preds = %51
%56 = load i64, i64* %10
%57 = getelementptr inbounds [9 x double], [9 x double]* %17, i64 0, i64 %56
%58 = load double, double* %57
%59 = fptrunc double %58 to float
%60 = load float*, float** %6
%61 = load i64, i64* %13
%62 = load i64, i64* %10
%63 = add i64 %61, %62
%64 = getelementptr inbounds float, float* %60, i64 %63
store float %59, float* %64
br label %65
65: ; preds = %55
%66 = load i64, i64* %10
%67 = add i64 %66, 1
store i64 %67, i64* %10
br label %51
68: ; preds = %51
br label %69
69: ; preds = %68
%70 = load i64, i64* %11
%71 = add i64 %70, 1
store i64 %71, i64* %11
br label %18
72: ; preds = %18
ret i32 1
}

LLVM IR (-O2):
define i32 @qu2omLoopf(float* nocapture %0, float* nocapture writeonly %1, i64 %2, i32 %3) {
%5 = alloca [4 x double]
%6 = alloca [9 x double]
%7 = bitcast [4 x double]* %5 to i8*
%8 = bitcast [9 x double]* %6 to i8*
%9 = icmp eq i64 %2, 0
br i1 %9, label %49, label %10
10: ; preds = %4
%11 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%12 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 0
%13 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 2
%14 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 4
%15 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 8
%16 = bitcast [4 x double]* %5 to <2 x double>*
%17 = bitcast double* %13 to <2 x double>*
%18 = bitcast [9 x double]* %6 to <4 x double>*
%19 = bitcast double* %14 to <4 x double>*
br label %20
20: ; preds = %10, %20
%21 = phi i64 [ 0, %10 ], [ %47, %20 ]
%22 = shl i64 %21, 2
%23 = getelementptr inbounds float, float* %0, i64 %22
%24 = bitcast float* %23 to <2 x float>*
%25 = load <2 x float>, <2 x float>* %24
%26 = fpext <2 x float> %25 to <2 x double>
store <2 x double> %26, <2 x double>* %16
%27 = or i64 %22, 2
%28 = getelementptr inbounds float, float* %0, i64 %27
%29 = bitcast float* %28 to <2 x float>*
%30 = load <2 x float>, <2 x float>* %29
%31 = fpext <2 x float> %30 to <2 x double>
store <2 x double> %31, <2 x double>* %17
%32 = mul i64 %21, 9
%33 = call i32 @qu2om(double* %11, double* %12, i32 %3)
%34 = getelementptr inbounds float, float* %1, i64 %32
%35 = load <4 x double>, <4 x double>* %18
%36 = fptrunc <4 x double> %35 to <4 x float>
%37 = bitcast float* %34 to <4 x float>*
store <4 x float> %36, <4 x float>* %37
%38 = add i64 %32, 4
%39 = getelementptr inbounds float, float* %1, i64 %38
%40 = load <4 x double>, <4 x double>* %19
%41 = fptrunc <4 x double> %40 to <4 x float>
%42 = bitcast float* %39 to <4 x float>*
store <4 x float> %41, <4 x float>* %42
%43 = load double, double* %15
%44 = fptrunc double %43 to float
%45 = add i64 %32, 8
%46 = getelementptr inbounds float, float* %1, i64 %45
store float %44, float* %46
%47 = add nuw i64 %21, 1
%48 = icmp eq i64 %47, %2
br i1 %48, label %49, label %20
49: ; preds = %20, %4
ret i32 1
}