// File: ticky[P]ps2iconsys/src/ps2_ps2icon.cpp
// Function: PS2Icon::AllocateVertexMemory()
void PS2Icon::AllocateVertexMemory() 
{
	//helper function that reallocates all per-vertex storage fields based 
	//on the information stored in the header struct
	if(vertices)     { delete[] vertices;          vertices = NULL; }
	if(fvertices)    { delete[] fvertices;        fvertices = NULL; }
	if(normals)      { delete[] normals;            normals = NULL; }
	if(fnormals)     { delete[] fnormals;          fnormals = NULL; }
	if(vert_texture) { delete[] vert_texture;  vert_texture = NULL; }
	vertices     = new Vertex_Coord[header.n_vertices * header.animation_shapes];
	fvertices    = new        float[header.n_vertices * header.animation_shapes * 3];
	normals      = new Vertex_Coord[header.n_vertices];
	fnormals     = new        float[header.n_vertices * 3];
	vert_texture = new Texture_Data[header.n_vertices];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, 0x18(%rax)
je 0xa872
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0xa866
movq -0x18(%rbp), %rdi
callq 0x2270
movq -0x10(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0xa8a4
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0xa898
movq -0x20(%rbp), %rdi
callq 0x2270
movq -0x10(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0xa8d6
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0xa8ca
movq -0x28(%rbp), %rdi
callq 0x2270
movq -0x10(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0xa908
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0xa8fc
movq -0x30(%rbp), %rdi
callq 0x2270
movq -0x10(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0xa93a
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0xa92e
movq -0x38(%rbp), %rdi
callq 0x2270
movq -0x10(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x10(%rbp), %rcx
movl 0x10(%rcx), %eax
imull 0x4(%rcx), %eax
movl %eax, %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2040
movq -0x10(%rbp), %rcx
movq %rax, 0x18(%rcx)
movl 0x10(%rcx), %eax
imull 0x4(%rcx), %eax
imull $0x3, %eax, %eax
movl %eax, %eax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2040
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movl 0x10(%rax), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2040
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
imull $0x3, 0x10(%rax), %eax
movl %eax, %eax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2040
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movl 0x10(%rax), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2040
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
addq $0x40, %rsp
popq %rbp
retq
nop