// File: ticky[P]ps2iconsys/src/ps2_ps2icon.cpp
// Function: PS2Icon::GetVertexData(float*, int) const
void PS2Icon::GetVertexData(float* data, int shape) const {
	if(shape >= static_cast<int>(header.animation_shapes)) {
		throw( Ghulbus::gbException( Ghulbus::gbException::GB_ILLEGALPARAMETER ) ); 
	}
	if(shape >= 0) {	//copy specified shape
		for(unsigned int i=0; i<header.n_vertices; i++) {
			data[i*3]     = fvertices[(i*header.animation_shapes + shape) * 3];
			data[i*3 + 1] = fvertices[(i*header.animation_shapes + shape) * 3 + 1];
			data[i*3 + 2] = fvertices[(i*header.animation_shapes + shape) * 3 + 2];
		}
	} else {			//copy *all* shapes one after the other
		for(unsigned int j=0; j<header.animation_shapes; j++) {
			for(unsigned int i=0; i<header.n_vertices; i++) {
				data[j*header.n_vertices*3 + i*3]     = fvertices[(i*header.animation_shapes + j) * 3];
				data[j*header.n_vertices*3 + i*3 + 1] = fvertices[(i*header.animation_shapes + j) * 3 + 1];
				data[j*header.n_vertices*3 + i*3 + 2] = fvertices[(i*header.animation_shapes + j) * 3 + 2];
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x28(%rbp)
movl -0x14(%rbp), %eax
cmpl 0x4(%rcx), %eax
jl 0xb495
movl $0x18, %edi
callq 0x20f0
movq %rax, %rdi
movq %rdi, -0x30(%rbp)
movl $0x3, %esi
callq 0xf060
movq -0x30(%rbp), %rdi
leaq 0xc907(%rip), %rsi      # 0x17d90
leaq 0x3cc0(%rip), %rdx      # 0xf150
callq 0x2340
cmpl $0x0, -0x14(%rbp)
jl 0xb54e
movl $0x0, -0x18(%rbp)
movq -0x28(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0x10(%rcx), %eax
jae 0xb549
movq -0x28(%rbp), %rdx
movq 0x30(%rdx), %rax
movl -0x18(%rbp), %ecx
imull 0x4(%rdx), %ecx
addl -0x14(%rbp), %ecx
imull $0x3, %ecx, %ecx
movl %ecx, %ecx
movss (%rax,%rcx,4), %xmm0
movq -0x10(%rbp), %rax
imull $0x3, -0x18(%rbp), %ecx
movl %ecx, %ecx
movss %xmm0, (%rax,%rcx,4)
movq 0x30(%rdx), %rax
movl -0x18(%rbp), %ecx
imull 0x4(%rdx), %ecx
addl -0x14(%rbp), %ecx
imull $0x3, %ecx, %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movss (%rax,%rcx,4), %xmm0
movq -0x10(%rbp), %rax
imull $0x3, -0x18(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movss %xmm0, (%rax,%rcx,4)
movq 0x30(%rdx), %rax
movl -0x18(%rbp), %ecx
imull 0x4(%rdx), %ecx
addl -0x14(%rbp), %ecx
imull $0x3, %ecx, %ecx
addl $0x2, %ecx
movl %ecx, %ecx
movss (%rax,%rcx,4), %xmm0
movq -0x10(%rbp), %rax
imull $0x3, -0x18(%rbp), %ecx
addl $0x2, %ecx
movl %ecx, %ecx
movss %xmm0, (%rax,%rcx,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xb4a6
jmp 0xb645
movl $0x0, -0x1c(%rbp)
movq -0x28(%rbp), %rcx
movl -0x1c(%rbp), %eax
cmpl 0x4(%rcx), %eax
jae 0xb643
movl $0x0, -0x20(%rbp)
movq -0x28(%rbp), %rcx
movl -0x20(%rbp), %eax
cmpl 0x10(%rcx), %eax
jae 0xb633
movq -0x28(%rbp), %rdx
movq 0x30(%rdx), %rax
movl -0x20(%rbp), %ecx
imull 0x4(%rdx), %ecx
addl -0x1c(%rbp), %ecx
imull $0x3, %ecx, %ecx
movl %ecx, %ecx
movss (%rax,%rcx,4), %xmm0
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull 0x10(%rdx), %ecx
imull $0x3, %ecx, %ecx
imull $0x3, -0x20(%rbp), %esi
addl %esi, %ecx
movl %ecx, %ecx
movss %xmm0, (%rax,%rcx,4)
movq 0x30(%rdx), %rax
movl -0x20(%rbp), %ecx
imull 0x4(%rdx), %ecx
addl -0x1c(%rbp), %ecx
imull $0x3, %ecx, %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movss (%rax,%rcx,4), %xmm0
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull 0x10(%rdx), %ecx
imull $0x3, %ecx, %ecx
imull $0x3, -0x20(%rbp), %esi
addl %esi, %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movss %xmm0, (%rax,%rcx,4)
movq 0x30(%rdx), %rax
movl -0x20(%rbp), %ecx
imull 0x4(%rdx), %ecx
addl -0x1c(%rbp), %ecx
imull $0x3, %ecx, %ecx
addl $0x2, %ecx
movl %ecx, %ecx
movss (%rax,%rcx,4), %xmm0
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull 0x10(%rdx), %ecx
imull $0x3, %ecx, %ecx
imull $0x3, -0x20(%rbp), %edx
addl %edx, %ecx
addl $0x2, %ecx
movl %ecx, %ecx
movss %xmm0, (%rax,%rcx,4)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xb56c
jmp 0xb635
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xb555
jmp 0xb645
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)