// File: /workspace/github_cpp_makefile_star2_O2/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 0x74ad(%rip), %r12      # 0xd440
pushq $0xe
popq %r13
movq %r13, %rcx
movq %rax, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x73c6(%rip), %r15      # 0xd370
movl $0xd0, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3290
leaq 0x70(%rbx), %rdi
movq %r13, %rcx
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xe0(%rbx), %rdi
movq %r13, %rcx
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x150(%rbx), %rdi
movq %r13, %rcx
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x1c0(%rbx), %rdi
movq %r13, %rcx
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xd0(%r14), %rdi
movl $0xd0, %edx
movq %r15, %rsi
callq 0x3290
fldl 0x3407(%rip)            # 0x9418
fstpt 0x120(%r14)
fldl 0x3402(%rip)            # 0x9420
fstpt 0x130(%r14)
fldl 0x33fd(%rip)            # 0x9428
fld %st(0)
fstpt 0x140(%r14)
fldl 0x33f6(%rip)            # 0x9430
fstpt 0x150(%r14)
fldl 0x33f1(%rip)            # 0x9438
fstpt 0x160(%r14)
fstpt 0x170(%r14)
pushq $0x1
popq %rbp
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 0x33b1(%rip)            # 0x9440
fstpt 0xe0(%r14)
fldl 0x33ac(%rip)            # 0x9448
fstpt 0xf0(%r14)
leaq 0x1a0(%r14), %rdi
movl $0xd0, %edx
movq %r15, %rsi
callq 0x3290
fldl 0x3393(%rip)            # 0x9450
fstpt 0x1f0(%r14)
fldl 0x338e(%rip)            # 0x9458
fstpt 0x200(%r14)
fldl 0x3389(%rip)            # 0x9460
fstpt 0x210(%r14)
andl $0x0, 0x258(%r14)
fldl 0x337c(%rip)            # 0x9468
fstpt 0x220(%r14)
fldz
fstpt 0x230(%r14)
fldl 0x336e(%rip)            # 0x9470
fstpt 0x240(%r14)
movabsq $0x4008000000000000, %rax # imm = 0x4008000000000000
movq %rax, 0x250(%r14)
movaps 0x33cf(%rip), %xmm0     # 0x94f0
movaps %xmm0, 0x120(%rbx)
movsd 0xf8(%rbx), %xmm0
divsd 0x3340(%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 0x3290
movaps 0x3394(%rip), %xmm0     # 0x9500
movaps %xmm0, 0x190(%rbx)
movaps 0x3396(%rip), %xmm0     # 0x9510
movaps %xmm0, 0x160(%rbx)
leaq 0x340(%r14), %rdi
movl $0xd0, %edx
movq %r15, %rsi
callq 0x3290
fldl 0x32e5(%rip)            # 0x9480
fstpt 0x390(%r14)
fldl 0x32e0(%rip)            # 0x9488
fstpt 0x3a0(%r14)
fldl 0x32db(%rip)            # 0x9490
fstpt 0x3b0(%r14)
movl %ebp, 0x3f8(%r14)
fldl 0x32cf(%rip)            # 0x9498
fstpt 0x3c0(%r14)
fldl 0x32ca(%rip)            # 0x94a0
fstpt 0x3d0(%r14)
fldl 0x32c5(%rip)            # 0x94a8
fstpt 0x3e0(%r14)
movabsq $0x3f72d3af239bb416, %rax # imm = 0x3F72D3AF239BB416
movq %rax, 0x3f0(%r14)
movaps 0x32ee(%rip), %xmm0     # 0x94f0
movaps %xmm0, 0x200(%rbx)
movaps 0x3310(%rip), %xmm0     # 0x9520
movaps %xmm0, 0x1d0(%rbx)
pushq $0x60
popq %rax
cmpq $0x290, %rax            # imm = 0x290
je 0x622c
movb $0x1, (%rbx,%rax)
addq $0x70, %rax
jmp 0x621a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop