// File: 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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x5, -0xc(%rbp)
movl $0x410, %edi            # imm = 0x410
callq 0x3030
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x48(%rax)
movl $0x230, %edi            # imm = 0x230
callq 0x3030
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x50(%rax)
movq 0x50(%rax), %rcx
movaps 0xa9e0(%rip), %xmm0     # 0x13510
movaps %xmm0, 0x60(%rcx)
movaps 0xa9c5(%rip), %xmm0     # 0x13500
movaps %xmm0, 0x50(%rcx)
movaps 0xa9aa(%rip), %xmm0     # 0x134f0
movaps %xmm0, 0x40(%rcx)
movaps 0xa98f(%rip), %xmm0     # 0x134e0
movaps %xmm0, 0x30(%rcx)
movaps 0xa974(%rip), %xmm0     # 0x134d0
movaps %xmm0, 0x20(%rcx)
movaps 0xa959(%rip), %xmm0     # 0x134c0
movaps %xmm0, 0x10(%rcx)
movaps 0xa93e(%rip), %xmm0     # 0x134b0
movaps %xmm0, (%rcx)
movq 0x48(%rax), %rdi
leaq 0xa860(%rip), %rsi      # 0x133e0
movq %rsi, -0x28(%rbp)
movl $0xd0, %edx
movq %rdx, -0x20(%rbp)
callq 0x3300
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rcx
movaps 0xa967(%rip), %xmm0     # 0x13510
movaps %xmm0, 0xd0(%rcx)
movaps 0xa949(%rip), %xmm0     # 0x13500
movaps %xmm0, 0xc0(%rcx)
movaps 0xa92b(%rip), %xmm0     # 0x134f0
movaps %xmm0, 0xb0(%rcx)
movaps 0xa90d(%rip), %xmm0     # 0x134e0
movaps %xmm0, 0xa0(%rcx)
movaps 0xa8ef(%rip), %xmm0     # 0x134d0
movaps %xmm0, 0x90(%rcx)
movaps 0xa8d1(%rip), %xmm0     # 0x134c0
movaps %xmm0, 0x80(%rcx)
movaps 0xa8b3(%rip), %xmm0     # 0x134b0
movaps %xmm0, 0x70(%rcx)
movq 0x50(%rax), %rcx
movaps 0xa904(%rip), %xmm0     # 0x13510
movaps %xmm0, 0x140(%rcx)
movaps 0xa8e6(%rip), %xmm0     # 0x13500
movaps %xmm0, 0x130(%rcx)
movaps 0xa8c8(%rip), %xmm0     # 0x134f0
movaps %xmm0, 0x120(%rcx)
movaps 0xa8aa(%rip), %xmm0     # 0x134e0
movaps %xmm0, 0x110(%rcx)
movaps 0xa88c(%rip), %xmm0     # 0x134d0
movaps %xmm0, 0x100(%rcx)
movaps 0xa86e(%rip), %xmm0     # 0x134c0
movaps %xmm0, 0xf0(%rcx)
movaps 0xa850(%rip), %xmm0     # 0x134b0
movaps %xmm0, 0xe0(%rcx)
movq 0x50(%rax), %rcx
movaps 0xa89e(%rip), %xmm0     # 0x13510
movaps %xmm0, 0x1b0(%rcx)
movaps 0xa880(%rip), %xmm0     # 0x13500
movaps %xmm0, 0x1a0(%rcx)
movaps 0xa862(%rip), %xmm0     # 0x134f0
movaps %xmm0, 0x190(%rcx)
movaps 0xa844(%rip), %xmm0     # 0x134e0
movaps %xmm0, 0x180(%rcx)
movaps 0xa826(%rip), %xmm0     # 0x134d0
movaps %xmm0, 0x170(%rcx)
movaps 0xa808(%rip), %xmm0     # 0x134c0
movaps %xmm0, 0x160(%rcx)
movaps 0xa7ea(%rip), %xmm0     # 0x134b0
movaps %xmm0, 0x150(%rcx)
movq 0x50(%rax), %rcx
movaps 0xa838(%rip), %xmm0     # 0x13510
movaps %xmm0, 0x220(%rcx)
movaps 0xa81a(%rip), %xmm0     # 0x13500
movaps %xmm0, 0x210(%rcx)
movaps 0xa7fc(%rip), %xmm0     # 0x134f0
movaps %xmm0, 0x200(%rcx)
movaps 0xa7de(%rip), %xmm0     # 0x134e0
movaps %xmm0, 0x1f0(%rcx)
movaps 0xa7c0(%rip), %xmm0     # 0x134d0
movaps %xmm0, 0x1e0(%rcx)
movaps 0xa7a2(%rip), %xmm0     # 0x134c0
movaps %xmm0, 0x1d0(%rcx)
movaps 0xa784(%rip), %xmm0     # 0x134b0
movaps %xmm0, 0x1c0(%rcx)
movq 0x48(%rax), %rdi
addq $0xd0, %rdi
callq 0x3300
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rcx
fldl 0x56af(%rip)            # 0xe400
fstpt 0x120(%rcx)
movq 0x48(%rax), %rcx
fldl 0x56a7(%rip)            # 0xe408
fstpt 0x130(%rcx)
movq 0x48(%rax), %rcx
fldl 0x569f(%rip)            # 0xe410
fstpt 0x140(%rcx)
movq 0x48(%rax), %rcx
fldt 0x120(%rcx)
fchs
fstpt 0x150(%rcx)
movq 0x48(%rax), %rcx
fldt 0x130(%rcx)
fchs
fstpt 0x160(%rcx)
movq 0x48(%rax), %rcx
fldt 0x140(%rcx)
fstpt 0x170(%rcx)
movq 0x48(%rax), %rcx
movl $0x1, 0x188(%rcx)
movq 0x48(%rax), %rcx
movb $0x1, 0xd0(%rcx)
movq 0x48(%rax), %rcx
movabsq $0x3fefae147ae147ae, %rdx # imm = 0x3FEFAE147AE147AE
movq %rdx, 0x180(%rcx)
movq 0x50(%rax), %rcx
movabsq $0x4014000000000000, %rdx # imm = 0x4014000000000000
movq %rdx, 0x88(%rcx)
movq 0x48(%rax), %rdx
movq %rdx, %rsi
addq $0xe0, %rsi
addq $0xf0, %rdx
xorl %edi, %edi
callq 0xb100
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x1a0, %rdi            # imm = 0x1A0
callq 0x3300
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rcx
fldl 0x55dc(%rip)            # 0xe418
fstpt 0x1f0(%rcx)
movq 0x48(%rax), %rcx
fldl 0x55d4(%rip)            # 0xe420
fstpt 0x200(%rcx)
movq 0x48(%rax), %rcx
fldl 0x55cc(%rip)            # 0xe428
fstpt 0x210(%rcx)
movq 0x48(%rax), %rcx
movl $0x0, 0x258(%rcx)
movq 0x48(%rax), %rcx
fldl 0x55b6(%rip)            # 0xe430
fstpt 0x220(%rcx)
movq 0x48(%rax), %rcx
fldz
fstpt 0x230(%rcx)
movq 0x48(%rax), %rcx
fldl 0x55a2(%rip)            # 0xe438
fstpt 0x240(%rcx)
movq 0x48(%rax), %rcx
movabsq $0x4008000000000000, %rdi # imm = 0x4008000000000000
movq %rdi, 0x250(%rcx)
movq 0x50(%rax), %rcx
movabsq $0x4051800000000000, %rdi # imm = 0x4051800000000000
movq %rdi, 0x128(%rcx)
movq 0x50(%rax), %rcx
movabsq $0x4072c00000000000, %rdi # imm = 0x4072C00000000000
movq %rdi, 0x120(%rcx)
movq 0x50(%rax), %rcx
movsd 0xf8(%rcx), %xmm0
movsd 0x5551(%rip), %xmm1     # 0xe440
divsd %xmm1, %xmm0
movsd %xmm0, 0xf8(%rcx)
movq 0x50(%rax), %rcx
movabsq $0x407a400000000000, %rdi # imm = 0x407A400000000000
movq %rdi, 0xf0(%rcx)
movq 0x48(%rax), %rdi
addq $0x270, %rdi            # imm = 0x270
callq 0x3300
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rcx
movabsq $0x4054000000000000, %rdi # imm = 0x4054000000000000
movq %rdi, 0x198(%rcx)
movq 0x50(%rax), %rcx
movabsq $0x4077c00000000000, %rdi # imm = 0x4077C00000000000
movq %rdi, 0x190(%rcx)
movq 0x50(%rax), %rcx
movabsq $0x401921fb54442d18, %rdi # imm = 0x401921FB54442D18
movq %rdi, 0x168(%rcx)
movq 0x50(%rax), %rcx
movabsq $0x408f400000000000, %rdi # imm = 0x408F400000000000
movq %rdi, 0x160(%rcx)
movq 0x48(%rax), %rdi
addq $0x340, %rdi            # imm = 0x340
callq 0x3300
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rcx
fldl 0x54aa(%rip)            # 0xe448
fstpt 0x390(%rcx)
movq 0x48(%rax), %rcx
fldl 0x54a2(%rip)            # 0xe450
fstpt 0x3a0(%rcx)
movq 0x48(%rax), %rcx
fldl 0x549a(%rip)            # 0xe458
fstpt 0x3b0(%rcx)
movq 0x48(%rax), %rcx
movl $0x1, 0x3f8(%rcx)
movq 0x48(%rax), %rcx
fldl 0x5484(%rip)            # 0xe460
fstpt 0x3c0(%rcx)
movq 0x48(%rax), %rcx
fldl 0x547c(%rip)            # 0xe468
fstpt 0x3d0(%rcx)
movq 0x48(%rax), %rcx
fldl 0x5474(%rip)            # 0xe470
fstpt 0x3e0(%rcx)
movq 0x48(%rax), %rcx
movsd 0x53ea(%rip), %xmm0     # 0xe3f8
movsd %xmm0, 0x3f0(%rcx)
movq 0x50(%rax), %rcx
movsd 0x53ce(%rip), %xmm0     # 0xe3f0
movsd %xmm0, 0x208(%rcx)
movq 0x50(%rax), %rcx
movsd 0x53b2(%rip), %xmm0     # 0xe3e8
movsd %xmm0, 0x200(%rcx)
movq 0x50(%rax), %rcx
movsd 0x5396(%rip), %xmm0     # 0xe3e0
movsd %xmm0, 0x1d8(%rcx)
movq 0x50(%rax), %rax
movsd 0x537a(%rip), %xmm0     # 0xe3d8
movsd %xmm0, 0x1d0(%rax)
movl $0x0, -0x10(%rbp)
cmpl $0x5, -0x10(%rbp)
jge 0x9095
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movslq -0x10(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movb $0x1, 0x60(%rax)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x906d
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)