// File: /workspace/github_c_makefile_star2_O0/georgeweigt[P]eigenmath/eigenmath.c
// Function: minormatrix
void
minormatrix(int row, int col)
{
	int i, j, k, m, n;
	struct atom *p1, *p2;

	p2 = symbol(NIL); // silence compiler

	p1 = pop();

	n = p1->u.tensor->dim[0];
	m = p1->u.tensor->dim[1];

	if (n == 2 && m == 2) {
		if (row == 1) {
			if (col == 1)
				push(p1->u.tensor->elem[3]);
			else
				push(p1->u.tensor->elem[2]);
		} else {
			if (col == 1)
				push(p1->u.tensor->elem[1]);
			else
				push(p1->u.tensor->elem[0]);
		}
		return;
	}

	if (n == 2)
		p2 = alloc_vector(m - 1);

	if (m == 2)
		p2 = alloc_vector(n - 1);

	if (n > 2 && m > 2)
		p2 = alloc_matrix(n - 1, m - 1);

	row--;
	col--;

	k = 0;

	for (i = 0; i < n; i++) {

		if (i == row)
			continue;

		for (j = 0; j < m; j++) {

			if (j == col)
				continue;

			p2->u.tensor->elem[k++] = p1->u.tensor->elem[m * i + j];
		}
	}

	push(p2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq 0x4b45b(%rip), %rax     # 0x5ea00
movq %rax, -0x30(%rbp)
callq 0x91d0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl 0x4(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x18(%rbp)
cmpl $0x2, -0x1c(%rbp)
jne 0x1363a
cmpl $0x2, -0x18(%rbp)
jne 0x1363a
cmpl $0x1, -0x4(%rbp)
jne 0x1360b
cmpl $0x1, -0x8(%rbp)
jne 0x135f9
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x80(%rax), %rdi
callq 0x9110
jmp 0x13609
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x78(%rax), %rdi
callq 0x9110
jmp 0x13635
cmpl $0x1, -0x8(%rbp)
jne 0x13623
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x70(%rax), %rdi
callq 0x9110
jmp 0x13633
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x68(%rax), %rdi
callq 0x9110
jmp 0x13635
jmp 0x13724
cmpl $0x2, -0x1c(%rbp)
jne 0x1364f
movl -0x18(%rbp), %edi
subl $0x1, %edi
callq 0x7970
movq %rax, -0x30(%rbp)
cmpl $0x2, -0x18(%rbp)
jne 0x13664
movl -0x1c(%rbp), %edi
subl $0x1, %edi
callq 0x7970
movq %rax, -0x30(%rbp)
cmpl $0x2, -0x1c(%rbp)
jle 0x13685
cmpl $0x2, -0x18(%rbp)
jle 0x13685
movl -0x1c(%rbp), %edi
subl $0x1, %edi
movl -0x18(%rbp), %esi
subl $0x1, %esi
callq 0x7a40
movq %rax, -0x30(%rbp)
movl -0x4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4(%rbp)
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x1371b
movl -0xc(%rbp), %eax
cmpl -0x4(%rbp), %eax
jne 0x136b7
jmp 0x13710
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x1370e
movl -0x10(%rbp), %eax
cmpl -0x8(%rbp), %eax
jne 0x136d0
jmp 0x13703
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl -0x18(%rbp), %ecx
imull -0xc(%rbp), %ecx
addl -0x10(%rbp), %ecx
movslq %ecx, %rcx
movq 0x68(%rax,%rcx,8), %rdx
movq -0x30(%rbp), %rax
movq (%rax), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x14(%rbp)
movslq %ecx, %rcx
movq %rdx, 0x68(%rax,%rcx,8)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x136be
jmp 0x13710
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x136a5
movq -0x30(%rbp), %rdi
callq 0x9110
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)