// File: mlugo2[P]SunshineGPU/src/gpu.cpp
// Function: gpu::debug(unsigned long long)
void gpu::debug(u64 instr)
{
// DEBUG
	u64 w = instr;

	u8 b = get_opcode(w);
	cout << (u16)b << endl;

	b = get_dest_type(w);
	cout << (u16)b << endl;

	b = get_dest_index(w);
	cout << (u16)b << endl;

	b = get_dest_w(w);
	cout << (u16)b << endl;

	b = get_dest_z(w);
	cout << (u16)b << endl;

	b = get_dest_y(w);
	cout << (u16)b << endl;

	b = get_dest_x(w);
	cout << (u16)b << endl;

	b = get_srcN_neg(w, 0);
	cout <<"source0 neg: "<< (u16)b << endl;

	b = get_srcN_type(w, 0);
	cout <<"source0 type: "<< (u16)b << endl;

	b = get_srcN_index(w, 0);
	cout <<"source0 index: "<< (u16)b << endl;

	b = get_srcN_w(w, 0);
	cout <<"source0 w: "<< (u16)b << endl;

	b = get_srcN_z(w, 0);
	cout <<"source0 z: "<< (u16)b << endl;

	b = get_srcN_y(w, 0);
	cout <<"source0 y: "<< (u16)b << endl;

	b = get_srcN_x(w, 0);
	cout <<"source0 x: "<< (u16)b << endl;

	cout << "-------------------" << endl;

	b = get_srcN_neg(w, 1);
	cout <<"source1 neg: "<< (u16)b << endl;

	b = get_srcN_type(w, 1);
	cout <<"source1 type: "<< (u16)b << endl;

	b = get_srcN_index(w, 1);
	cout <<"source1 index: "<< (u16)b << endl;

	b = get_srcN_w(w, 1);
	cout <<"source1 w: "<< (u16)b << endl;

	b = get_srcN_z(w, 1);
	cout <<"source1 z: "<< (u16)b << endl;

	b = get_srcN_y(w, 1);
	cout <<"source1 y: "<< (u16)b << endl;

	b = get_srcN_x(w, 1);
	cout <<"source1 x: "<< (u16)b << endl;

	cout << "-------------------" << endl;

	b = get_srcN_neg(w, 2);
	cout <<"source2 neg: "<< (u16)b << endl;

	b = get_srcN_type(w, 2);
	cout <<"source2 type: "<< (u16)b << endl;

	b = get_srcN_index(w, 2);
	cout <<"source2 index: "<< (u16)b << endl;

	b = get_srcN_w(w, 2);
	cout <<"source2 w: "<< (u16)b << endl;

	b = get_srcN_z(w, 2);
	cout <<"source2 z: "<< (u16)b << endl;

	b = get_srcN_y(w, 2);
	cout <<"source2 y: "<< (u16)b << endl;

	b = get_srcN_x(w, 2);
	cout <<"source2 x: "<< (u16)b << endl;


	// DEBUG
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, (%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rsi
callq 0xd560
movb %al, 0xf(%rsp)
movzbl 0xf(%rsp), %eax
movq 0x7f15(%rip), %rdi      # 0x1bfc0
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7eeb(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x13c50
movb %al, 0xf(%rsp)
movzbl 0xf(%rsp), %eax
movq 0x7ee0(%rip), %rdi      # 0x1bfc0
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7eb6(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x13c90
movb %al, 0xf(%rsp)
movzbl 0xf(%rsp), %eax
movq 0x7eab(%rip), %rdi      # 0x1bfc0
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7e81(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x13cd0
movb %al, 0xf(%rsp)
movzbl 0xf(%rsp), %eax
movq 0x7e76(%rip), %rdi      # 0x1bfc0
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7e4c(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x13d10
movb %al, 0xf(%rsp)
movzbl 0xf(%rsp), %eax
movq 0x7e41(%rip), %rdi      # 0x1bfc0
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7e17(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x13d50
movb %al, 0xf(%rsp)
movzbl 0xf(%rsp), %eax
movq 0x7e0c(%rip), %rdi      # 0x1bfc0
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7de2(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x13d90
movb %al, 0xf(%rsp)
movzbl 0xf(%rsp), %eax
movq 0x7dd7(%rip), %rdi      # 0x1bfc0
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7dad(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x13dd0
movb %al, 0xf(%rsp)
movq 0x7da5(%rip), %rdi      # 0x1bfc0
leaq 0x113e(%rip), %rsi      # 0x15360
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7d67(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x13e30
movb %al, 0xf(%rsp)
movq 0x7d5f(%rip), %rdi      # 0x1bfc0
leaq 0x1106(%rip), %rsi      # 0x1536e
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7d21(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x13e90
movb %al, 0xf(%rsp)
movq 0x7d19(%rip), %rdi      # 0x1bfc0
leaq 0x10cf(%rip), %rsi      # 0x1537d
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7cdb(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x13ef0
movb %al, 0xf(%rsp)
movq 0x7cd3(%rip), %rdi      # 0x1bfc0
leaq 0x1099(%rip), %rsi      # 0x1538d
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7c95(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x13f50
movb %al, 0xf(%rsp)
movq 0x7c8d(%rip), %rdi      # 0x1bfc0
leaq 0x105f(%rip), %rsi      # 0x15399
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7c4f(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x13fb0
movb %al, 0xf(%rsp)
movq 0x7c47(%rip), %rdi      # 0x1bfc0
leaq 0x1025(%rip), %rsi      # 0x153a5
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7c09(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x14010
movb %al, 0xf(%rsp)
movq 0x7c01(%rip), %rdi      # 0x1bfc0
leaq 0xfeb(%rip), %rsi       # 0x153b1
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7bc3(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq 0x7bcf(%rip), %rdi      # 0x1bfc0
leaq 0xfc5(%rip), %rsi       # 0x153bd
callq 0x3300
movq %rax, %rdi
movq 0x7ba1(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x13dd0
movb %al, 0xf(%rsp)
movq 0x7b96(%rip), %rdi      # 0x1bfc0
leaq 0xfa0(%rip), %rsi       # 0x153d1
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7b58(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x13e30
movb %al, 0xf(%rsp)
movq 0x7b4d(%rip), %rdi      # 0x1bfc0
leaq 0xf65(%rip), %rsi       # 0x153df
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7b0f(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x13e90
movb %al, 0xf(%rsp)
movq 0x7b04(%rip), %rdi      # 0x1bfc0
leaq 0xf2b(%rip), %rsi       # 0x153ee
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7ac6(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x13ef0
movb %al, 0xf(%rsp)
movq 0x7abb(%rip), %rdi      # 0x1bfc0
leaq 0xef2(%rip), %rsi       # 0x153fe
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7a7d(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x13f50
movb %al, 0xf(%rsp)
movq 0x7a72(%rip), %rdi      # 0x1bfc0
leaq 0xeb5(%rip), %rsi       # 0x1540a
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7a34(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x13fb0
movb %al, 0xf(%rsp)
movq 0x7a29(%rip), %rdi      # 0x1bfc0
leaq 0xe78(%rip), %rsi       # 0x15416
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x79eb(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x14010
movb %al, 0xf(%rsp)
movq 0x79e0(%rip), %rdi      # 0x1bfc0
leaq 0xe3b(%rip), %rsi       # 0x15422
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x79a2(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq 0x79ae(%rip), %rdi      # 0x1bfc0
leaq 0xda4(%rip), %rsi       # 0x153bd
callq 0x3300
movq %rax, %rdi
movq 0x7980(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x2, %edx
callq 0x13dd0
movb %al, 0xf(%rsp)
movq 0x7975(%rip), %rdi      # 0x1bfc0
leaq 0xddc(%rip), %rsi       # 0x1542e
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7937(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x2, %edx
callq 0x13e30
movb %al, 0xf(%rsp)
movq 0x792c(%rip), %rdi      # 0x1bfc0
leaq 0xda1(%rip), %rsi       # 0x1543c
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x78ee(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x2, %edx
callq 0x13e90
movb %al, 0xf(%rsp)
movq 0x78e3(%rip), %rdi      # 0x1bfc0
leaq 0xd67(%rip), %rsi       # 0x1544b
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x78a5(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x2, %edx
callq 0x13ef0
movb %al, 0xf(%rsp)
movq 0x789a(%rip), %rdi      # 0x1bfc0
leaq 0xd2e(%rip), %rsi       # 0x1545b
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x785c(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x2, %edx
callq 0x13f50
movb %al, 0xf(%rsp)
movq 0x7851(%rip), %rdi      # 0x1bfc0
leaq 0xcf1(%rip), %rsi       # 0x15467
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7813(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x2, %edx
callq 0x13fb0
movb %al, 0xf(%rsp)
movq 0x7808(%rip), %rdi      # 0x1bfc0
leaq 0xcb4(%rip), %rsi       # 0x15473
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x77ca(%rip), %rsi      # 0x1bfa8
callq 0x3340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x2, %edx
callq 0x14010
movb %al, 0xf(%rsp)
movq 0x77bf(%rip), %rdi      # 0x1bfc0
leaq 0xc77(%rip), %rsi       # 0x1547f
callq 0x3300
movq %rax, %rdi
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x3440
movq %rax, %rdi
movq 0x7781(%rip), %rsi      # 0x1bfa8
callq 0x3340
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)