// File: /workspace/github_cpp_makefile_star2_O3/intheswim[P]FractalTubes/m3d.cpp
// Function: M3DDrawer::InitRotationArray()
void M3DDrawer::InitRotationArray (void)
{
	const int in_rotation = PRESET_COUNT ;

	rotationArray = new struct DrawParams [in_rotation];
	spArray = new struct ShapeParams [in_rotation];
    
	memcpy (&spArray[0], &defShapeParams, sizeof (struct ShapeParams));
	memcpy (&rotationArray[0], &defParams, sizeof (struct DrawParams));
    
	memcpy (&spArray[1], &defShapeParams, sizeof (struct ShapeParams));
	memcpy (&spArray[2], &defShapeParams, sizeof (struct ShapeParams));
	memcpy (&spArray[3], &defShapeParams, sizeof (struct ShapeParams));
	memcpy (&spArray[4], &defShapeParams, sizeof (struct ShapeParams));
    
	//leave as is
	//********************************************************************
	memcpy (&rotationArray[1], &defParams, sizeof (struct DrawParams));
    
	// this one is julia set (picture #2)
	rotationArray[1].xCenter = -0.171035469619938; //0.0300786343590521;
	rotationArray[1].yCenter = -0.318802963959513; //0.520811231249443;
	rotationArray[1].xRadius = 0.000583506991765284; //7.3510528665225e-008;
    
	rotationArray[1].xCenter2 = -rotationArray[1].xCenter;
	rotationArray[1].yCenter2 = -rotationArray[1].yCenter;
	rotationArray[1].xRadius2 = rotationArray[1].xRadius;
    
    //	rotationArray[1].base = 0.94;
	rotationArray[1].method = dmTwoPoints;
    rotationArray[1].juliaSet = true;
	rotationArray[1].max_radius = 0.99;
	spArray[1].alpha_range = 5;
    
	GetJuliaSetParams (0, rotationArray[1].juliaRe, rotationArray[1].juliaIm);
    
	//********************************************************************
	memcpy (&rotationArray[2], &defParams, sizeof (struct DrawParams));
	rotationArray[2].xCenter = -1.0013121704951;
	rotationArray[2].yCenter = -0.304196021963963;
	rotationArray[2].xRadius = 1.0e-008;
    //	rotationArray[2].base = 0.91;
	rotationArray[2].method = dmOnePoint;
	rotationArray[2].xCenter2 = -0.11; //-0.104869104079861;
	rotationArray[2].yCenter2 = 0.0; //-0.92806604397287;
	rotationArray[2].xRadius2 = 0.41; //6e-011;
	rotationArray[2].max_radius = 3; //2.0386550422325;
    
	spArray[2].l = 70; //cx * 7 / 128; //70
	spArray[2].r = 300; //cx * 15 / 64; //300;
	spArray[2].alpha_range /= 1.95;
	spArray[2].y_range = 420; //cy * 21/51;
    
	//spArray[2].delta_y /=1.95;
	//rotationArray[2].stretchRatio /= 1.95;
    
	//********************************************************************
	memcpy (&rotationArray[3], &defParams, sizeof (struct DrawParams));
	spArray[3].l = 80; //cx/16; //80;
	spArray[3].r = 380; //cx * 19/64; //380;
	spArray[3].alpha_range = 2 * M_PI;
	spArray[3].y_range = 1000; //cy/1.024;
	//********************************************************************
	
	memcpy (&rotationArray[4], &defParams, sizeof (struct DrawParams));
    
	rotationArray[4].xCenter = -0.76295980213721;
	rotationArray[4].yCenter = -0.094826839433747;
	rotationArray[4].xRadius = 8.1706250576269e-009;
	rotationArray[4].method = dmTwoPoints;
	rotationArray[4].xCenter2 = -0.76518309844711;
	rotationArray[4].yCenter2 = -0.098669746089906;
	rotationArray[4].xRadius2 = 2.8644189916084e-008;
	rotationArray[4].max_radius = 0.0045964089747317;
    
	spArray[4].l = 70;
	spArray[4].r = 300;
	spArray[4].alpha_range = 1.2 * M_PI;
	spArray[4].y_range = 400;
    
	for (int i = 0; i < in_rotation; i++)
    {
		spArray[i].visible = true;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movl $0x410, %edi            # imm = 0x410
callq 0x3030
movq %rax, %r14
movq %rax, 0x48(%r15)
movl $0x230, %edi            # imm = 0x230
callq 0x3030
movq %rax, %rbx
movq %rax, 0x50(%r15)
leaq 0x6293(%rip), %r12      # 0xc430
movl $0xe, %ecx
movq %rax, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x61ae(%rip), %r15      # 0xc360
movl $0xd0, %r13d
movl $0xd0, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3270
leaq 0x70(%rbx), %rdi
movl $0xe, %ecx
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xe0(%rbx), %rdi
movl $0xe, %ecx
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x150(%rbx), %rdi
movl $0xe, %ecx
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x1c0(%rbx), %rdi
movl $0xe, %ecx
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xd0(%r14), %rdi
movl $0xd0, %edx
movq %r15, %rsi
callq 0x3270
fldl 0x31f1(%rip)            # 0x9418
fstpt 0x120(%r14)
fldl 0x31ec(%rip)            # 0x9420
fstpt 0x130(%r14)
fldl 0x31e7(%rip)            # 0x9428
fld %st(0)
fstpt 0x140(%r14)
fldl 0x31e0(%rip)            # 0x9430
fstpt 0x150(%r14)
fldl 0x31db(%rip)            # 0x9438
fstpt 0x160(%r14)
fstpt 0x170(%r14)
movl $0x1, %ebp
movl %ebp, 0x188(%r14)
movb $0x1, 0xd0(%r14)
movabsq $0x3fefae147ae147ae, %rax # imm = 0x3FEFAE147AE147AE
movq %rax, 0x180(%r14)
movabsq $0x4014000000000000, %rax # imm = 0x4014000000000000
movq %rax, 0x88(%rbx)
fldl 0x3199(%rip)            # 0x9440
fstpt 0xe0(%r14)
fldl 0x3194(%rip)            # 0x9448
fstpt 0xf0(%r14)
leaq 0x1a0(%r14), %rdi
movl $0xd0, %edx
movq %r15, %rsi
callq 0x3270
fldl 0x317b(%rip)            # 0x9450
fstpt 0x1f0(%r14)
fldl 0x3176(%rip)            # 0x9458
fstpt 0x200(%r14)
fldl 0x3171(%rip)            # 0x9460
fstpt 0x210(%r14)
movl $0x0, 0x258(%r14)
fldl 0x3161(%rip)            # 0x9468
fstpt 0x220(%r14)
fldz
fstpt 0x230(%r14)
fldl 0x3153(%rip)            # 0x9470
fstpt 0x240(%r14)
movabsq $0x4008000000000000, %rax # imm = 0x4008000000000000
movq %rax, 0x250(%r14)
movaps 0x31b4(%rip), %xmm0     # 0x94f0
movaps %xmm0, 0x120(%rbx)
movsd 0xf8(%rbx), %xmm0
divsd 0x3125(%rip), %xmm0     # 0x9478
movsd %xmm0, 0xf8(%rbx)
movabsq $0x407a400000000000, %rax # imm = 0x407A400000000000
movq %rax, 0xf0(%rbx)
leaq 0x270(%r14), %rdi
movl $0xd0, %edx
movq %r15, %rsi
callq 0x3270
movaps 0x3179(%rip), %xmm0     # 0x9500
movaps %xmm0, 0x190(%rbx)
movaps 0x317b(%rip), %xmm0     # 0x9510
movaps %xmm0, 0x160(%rbx)
leaq 0x340(%r14), %rdi
movl $0xd0, %edx
movq %r15, %rsi
callq 0x3270
fldl 0x30ca(%rip)            # 0x9480
fstpt 0x390(%r14)
fldl 0x30c5(%rip)            # 0x9488
fstpt 0x3a0(%r14)
fldl 0x30c0(%rip)            # 0x9490
fstpt 0x3b0(%r14)
movl %ebp, 0x3f8(%r14)
fldl 0x30b4(%rip)            # 0x9498
fstpt 0x3c0(%r14)
fldl 0x30af(%rip)            # 0x94a0
fstpt 0x3d0(%r14)
fldl 0x30aa(%rip)            # 0x94a8
fstpt 0x3e0(%r14)
movabsq $0x3f72d3af239bb416, %rax # imm = 0x3F72D3AF239BB416
movq %rax, 0x3f0(%r14)
movaps 0x30d3(%rip), %xmm0     # 0x94f0
movaps %xmm0, 0x200(%rbx)
movaps 0x30f5(%rip), %xmm0     # 0x9520
movaps %xmm0, 0x1d0(%rbx)
movdqa 0x30f6(%rip), %xmm0     # 0x9530
movdqa 0x2efe(%rip), %xmm1     # 0x9340
movdqa 0x30f6(%rip), %xmm2     # 0x9540
pshufd $0xf5, %xmm2, %xmm3     # xmm3 = xmm2[1,1,3,3]
movdqa 0x30f9(%rip), %xmm4     # 0x9550
movdqa %xmm0, %xmm5
pxor %xmm1, %xmm5
movdqa %xmm2, %xmm6
pcmpgtd %xmm5, %xmm6
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pcmpeqd %xmm3, %xmm5
pand %xmm6, %xmm5
movd %xmm5, %eax
testb $0x1, %al
je 0x6482
movb $0x1, -0x70(%rbx,%r13)
pextrw $0x4, %xmm5, %eax
testb $0x1, %al
je 0x6490
movb $0x1, (%rbx,%r13)
paddq %xmm4, %xmm0
addq $0xe0, %r13
cmpq $0x370, %r13            # imm = 0x370
jne 0x6457
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop