// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/tests/matrix.c
// Function: main
int main(void)
{
	int r;
	struct tt_mtx m, b, b2;
	double vm[6][6] = {
		{ 10, 15, 11, 6, 1, 1 },
		{ 106, 15, 114, 63, 12, 11 },
		{ 1, -82, 83, -4, 5, -86 },
		{ -16, 15, -14, 13, -12, 11 },
		{ 11, 61, 21, 401, 355, 511 },
		{ 50, 30, 40, 20, 60, 10 },
	};
	double vb[6] = { 100, 99, 101, 98, -200, -321 };
	double vm2[6][6];
	memcpy(vm2, vm, sizeof(vm));

	m.cols = m.rows = 6;
	m.v = (double *)vm;

	b.cols = 1;
	b.rows = 6;
	b.v = vb;

	r = tt_mtx_gaussj(&m, &b);
	printf("%f, %f, %f, %f, %f, %f\n",
			vb[0], vb[1], vb[2], vb[3], vb[4], vb[5]);
	printf("%d\n", r);

	int i, j;
	for (i = 0; i < 6; i++) {
		for (j = 0; j < 6; j++)
			printf("%f, ", m.v[i*6+j]);
		printf("\n");
	}

	m.v = (double *)vm2;
	b2.cols = 1;
	b2.rows = 6;
	double vb2[6];
	b2.v = vb2;
	tt_mtx_mul(&b2, &m, &b);
	for (i = 0; i < 6; i++)
		printf("%f, ", b2.v[i]);
	printf("\n");

	return r;
}

// Assembly:
subq $0x2e8, %rsp            # imm = 0x2E8
movl $0x0, 0x2e4(%rsp)
leaq 0x190(%rsp), %rdi
leaq 0x6dbf(%rip), %rsi      # 0x8040
movl $0x120, %edx            # imm = 0x120
callq 0x1100
leaq 0x160(%rsp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x10b0
movsd 0x6d89(%rip), %xmm0     # 0x8030
movsd %xmm0, 0x160(%rsp)
movsd 0x6d70(%rip), %xmm0     # 0x8028
movsd %xmm0, 0x168(%rsp)
movsd 0x6d57(%rip), %xmm0     # 0x8020
movsd %xmm0, 0x170(%rsp)
movsd 0x6d3e(%rip), %xmm0     # 0x8018
movsd %xmm0, 0x178(%rsp)
movsd 0x6d25(%rip), %xmm0     # 0x8010
movsd %xmm0, 0x180(%rsp)
movsd 0x6d0c(%rip), %xmm0     # 0x8008
movsd %xmm0, 0x188(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x190(%rsp), %rsi
movl $0x120, %edx            # imm = 0x120
callq 0x1100
movl $0x6, 0x2d0(%rsp)
movl $0x6, 0x2d4(%rsp)
leaq 0x190(%rsp), %rax
movq %rax, 0x2d8(%rsp)
movl $0x1, 0x2c4(%rsp)
movl $0x6, 0x2c0(%rsp)
leaq 0x160(%rsp), %rax
movq %rax, 0x2c8(%rsp)
leaq 0x2d0(%rsp), %rdi
leaq 0x2c0(%rsp), %rsi
callq 0x1880
movl %eax, 0x2e0(%rsp)
movsd 0x160(%rsp), %xmm0
movsd 0x168(%rsp), %xmm1
movsd 0x170(%rsp), %xmm2
movsd 0x178(%rsp), %xmm3
movsd 0x180(%rsp), %xmm4
movsd 0x188(%rsp), %xmm5
leaq 0x6d9f(%rip), %rdi      # 0x8160
movb $0x6, %al
callq 0x1090
movl 0x2e0(%rsp), %esi
leaq 0x6da2(%rip), %rdi      # 0x8178
movb $0x0, %al
callq 0x1090
movl $0x0, 0x3c(%rsp)
cmpl $0x6, 0x3c(%rsp)
jge 0x144a
movl $0x0, 0x38(%rsp)
cmpl $0x6, 0x38(%rsp)
jge 0x142f
movq 0x2d8(%rsp), %rax
imull $0x6, 0x3c(%rsp), %ecx
addl 0x38(%rsp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x6d61(%rip), %rdi      # 0x817c
movb $0x1, %al
callq 0x1090
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38(%rsp)
jmp 0x13f4
leaq 0x7013(%rip), %rdi      # 0x8449
movb $0x0, %al
callq 0x1090
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x13e5
leaq 0x40(%rsp), %rax
movq %rax, 0x2d8(%rsp)
movl $0x1, 0x2b4(%rsp)
movl $0x6, 0x2b0(%rsp)
movq %rsp, %rax
movq %rax, 0x2b8(%rsp)
leaq 0x2b0(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
leaq 0x2c0(%rsp), %rdx
callq 0x14f0
movl $0x0, 0x3c(%rsp)
cmpl $0x6, 0x3c(%rsp)
jge 0x14d1
movq 0x2b8(%rsp), %rax
movslq 0x3c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x6cbf(%rip), %rdi      # 0x817c
movb $0x1, %al
callq 0x1090
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x149d
leaq 0x6f71(%rip), %rdi      # 0x8449
movb $0x0, %al
callq 0x1090
movl 0x2e0(%rsp), %eax
addq $0x2e8, %rsp            # imm = 0x2E8
retq
nop