#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 M_PI;
int /*<<< orphan*/ ld_by_order(int, double *, double *, double *, double *);
void LabedevQ(int npoint, double *x, double *y, double *z, double *w) {
  int i;
  ld_by_order(npoint, x, y, z, w);
  for (i = 0; i < npoint; i++)
    w[i] = w[i] * 4.0 * M_PI;
}


x86 assembly (clang, -O0):
<LabedevQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <ld_by_order@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1191 <LabedevQ+0x81>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  0xe9a(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    0x2e76(%rip),%rax
mulsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    114a <LabedevQ+0x3a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LabedevQ>:
push   %rbp
push   %rbx
push   %rax
mov    %r8,%rbx
mov    %edi,%ebp
call   1030 <ld_by_order@plt>
test   %ebp,%ebp
jle    12ad <LabedevQ+0x19d>
mov    %ebp,%eax
cmp    $0x4,%ebp
jb     1151 <LabedevQ+0x41>
mov    0x2eb5(%rip),%rdx
lea    0x8(%rdx),%rcx
cmp    %rcx,%rbx
jae    11d4 <LabedevQ+0xc4>
lea    (%rbx,%rax,8),%rcx
cmp    0x2e9d(%rip),%rcx
jbe    11d4 <LabedevQ+0xc4>
xor    %ecx,%ecx
mov    %rcx,%rdx
not    %rdx
test   $0x1,%al
je     117e <LabedevQ+0x6e>
movsd  (%rbx,%rcx,8),%xmm0
mulsd  0xea6(%rip),%xmm0
mov    0x2e77(%rip),%rsi
mulsd  (%rsi),%xmm0
movsd  %xmm0,(%rbx,%rcx,8)
or     $0x1,%rcx
add    %rax,%rdx
je     12ad <LabedevQ+0x19d>
movsd  0xe81(%rip),%xmm0
mov    0x2e52(%rip),%rdx
cs nopw 0x0(%rax,%rax,1)
movsd  (%rbx,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
mulsd  (%rdx),%xmm1
movsd  %xmm1,(%rbx,%rcx,8)
movsd  0x8(%rbx,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
mulsd  (%rdx),%xmm1
movsd  %xmm1,0x8(%rbx,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rax
jne    11a0 <LabedevQ+0x90>
jmp    12ad <LabedevQ+0x19d>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rsi
mov    %rsi,%rbp
shr    $0x2,%rbp
add    $0x1,%rbp
test   %rsi,%rsi
je     12b4 <LabedevQ+0x1a4>
mov    %rbp,%rdi
and    $0xfffffffffffffffe,%rdi
movsd  (%rdx),%xmm0
unpcklpd %xmm0,%xmm0
xor    %esi,%esi
movapd 0xdf6(%rip),%xmm1
nopw   0x0(%rax,%rax,1)
movupd (%rbx,%rsi,8),%xmm2
movupd 0x10(%rbx,%rsi,8),%xmm3
movupd 0x20(%rbx,%rsi,8),%xmm4
movupd 0x30(%rbx,%rsi,8),%xmm5
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
mulpd  %xmm0,%xmm2
mulpd  %xmm0,%xmm3
movupd %xmm2,(%rbx,%rsi,8)
movupd %xmm3,0x10(%rbx,%rsi,8)
mulpd  %xmm1,%xmm4
mulpd  %xmm1,%xmm5
mulpd  %xmm0,%xmm4
mulpd  %xmm0,%xmm5
movupd %xmm4,0x20(%rbx,%rsi,8)
movupd %xmm5,0x30(%rbx,%rsi,8)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1210 <LabedevQ+0x100>
test   $0x1,%bpl
je     12a4 <LabedevQ+0x194>
movupd (%rbx,%rsi,8),%xmm0
movupd 0x10(%rbx,%rsi,8),%xmm1
movapd 0xd7f(%rip),%xmm2
mulpd  %xmm2,%xmm0
mulpd  %xmm2,%xmm1
movsd  (%rdx),%xmm2
unpcklpd %xmm2,%xmm2
mulpd  %xmm2,%xmm0
mulpd  %xmm1,%xmm2
movupd %xmm0,(%rbx,%rsi,8)
movupd %xmm2,0x10(%rbx,%rsi,8)
cmp    %rax,%rcx
jne    1153 <LabedevQ+0x43>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %esi,%esi
test   $0x1,%bpl
jne    126e <LabedevQ+0x15e>
jmp    12a4 <LabedevQ+0x194>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define void @LabedevQ(i32 %0, double* %1, double* %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
store i32 %0, i32* %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%12 = load i32, i32* %6
%13 = load double*, double** %7
%14 = load double*, double** %8
%15 = load double*, double** %9
%16 = load double*, double** %10
%17 = call i32 @ld_by_order(i32 %12, double* %13, double* %14, double* %15, double* %16)
store i32 0, i32* %11
br label %18
18: ; preds = %35, %5
%19 = load i32, i32* %11
%20 = load i32, i32* %6
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %38
22: ; preds = %18
%23 = load double*, double** %10
%24 = load i32, i32* %11
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
%27 = load double, double* %26
%28 = fmul double %27, 4.000000e+00
%29 = load double, double* @M_PI
%30 = fmul double %28, %29
%31 = load double*, double** %10
%32 = load i32, i32* %11
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %31, i64 %33
store double %30, double* %34
br label %35
35: ; preds = %22
%36 = load i32, i32* %11
%37 = add nsw i32 %36, 1
store i32 %37, i32* %11
br label %18
38: ; preds = %18
ret void
}

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