// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: output_hand
void
output_hand(int boardno, dl_num *dnp)
/*
 * Convert goedel number to various internal forms as necessary
 * Output all desired formats
 */
{
	dl_int	dinternal;
	dl_byh	dbyhand;
	dl_byc	dbycard;
	of_p	ofp;
	hr_t	handrep;

	/*
	 * First create all necessary internal forms
	 * Bits in formatset have been inited in output_createfiles
	 */
	if (formatset&bit(BF_INTERNAL))
		code_to_hand(dnp, &dinternal);
	if (formatset&bit(BF_BYHAND))
		cnv_int_byh(&dinternal, &dbyhand);
	if (formatset&bit(BF_BYCARD))
		cnv_byh_byc(&dbyhand, &dbycard);

	/*
	 * Now call output routines
	 */
	for(ofp = output_formats; ofp->of_name; ofp++) {
		if (ofp->of_file == NULL)
			continue;
		handrep.hr_baseform = ofp->of_baseform;
		switch (ofp->of_baseform) {
		case BF_GOEDEL:
			handrep.hr_value.hv_dnp = dnp;
			break;
		case BF_INTERNAL:
			handrep.hr_value.hv_dip = &dinternal;
			break;
		case BF_BYHAND:
			handrep.hr_value.hv_dbhp = &dbyhand;
			break;
		case BF_BYCARD:
			handrep.hr_value.hv_dbcp = &dbycard;
			break;
		}
		(*ofp->of_printit)(ofp->of_file, boardno, &handrep);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rsi, (%rsp)
movl %edi, %ebp
testb $0x2, 0x7230(%rip)      # 0xbc88
je 0x4a68
leaq 0x4c(%rsp), %rsi
movq (%rsp), %rdi
callq 0x39d8
movl 0x721a(%rip), %eax      # 0xbc88
testb $0x4, %al
je 0x4b18
xorl %ecx, %ecx
leaq 0x1(%rcx), %rdx
movl %edx, 0x80(%rsp,%rcx,4)
movq %rdx, %rcx
cmpq $0x34, %rdx
jne 0x4a78
movl $0x0, 0x150(%rsp)
xorl %ecx, %ecx
movl 0x80(%rsp), %esi
leaq (%rcx,%rcx,2), %rdx
leaq (%rcx,%rdx,4), %rdi
leaq (%rsp,%rdi), %rdx
addq $0x4c, %rdx
addq %rsp, %rdi
addq $0x18, %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
testq %r8, %r8
je 0x4ad2
movzbl (%r8,%rdx), %r10d
movzbl -0x1(%r8,%rdx), %r11d
subl %r11d, %r10d
jmp 0x4ad6
movzbl (%rdx), %r10d
testl %r10d, %r10d
jle 0x4aed
movl %esi, %r9d
movslq %esi, %rsi
movl 0x80(%rsp,%rsi,4), %esi
decl %r10d
jne 0x4adb
movb %sil, (%r8,%rdi)
movslq %esi, %rsi
movl 0x80(%rsp,%rsi,4), %esi
movslq %r9d, %r10
movl %esi, 0x80(%rsp,%r10,4)
incq %r8
cmpq $0xd, %r8
jne 0x4abd
incq %rcx
cmpq $0x4, %rcx
jne 0x4a99
testb $0x8, %al
je 0x4b4b
leaq 0x18(%rsp), %rax
xorl %ecx, %ecx
leaq 0x80(%rsp), %rdx
xorl %esi, %esi
movzbl (%rax,%rsi), %edi
movb %cl, -0x1(%rdi,%rdx)
incq %rsi
cmpq $0xd, %rsi
jne 0x4b2d
incq %rcx
addq $0xd, %rax
cmpq $0x4, %rcx
jne 0x4b2b
cmpq $0x0, 0x475d(%rip)      # 0x92b0
je 0x4bc6
leaq 0x479c(%rip), %r15      # 0x92f8
leaq 0x8(%rsp), %r14
leaq 0x1878(%rip), %r12      # 0x63e0
leaq 0x18(%rsp), %rbx
leaq 0x80(%rsp), %r13
movq -0x38(%r15), %rdi
testq %rdi, %rdi
je 0x4bbc
movl -0x28(%r15), %eax
movl %eax, 0x8(%rsp)
cmpq $0x3, %rax
ja 0x4bb3
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movq (%rsp), %rax
jmp 0x4bae
movq %rbx, 0x10(%rsp)
jmp 0x4bb3
movq %r13, 0x10(%rsp)
jmp 0x4bb3
leaq 0x4c(%rsp), %rax
movq %rax, 0x10(%rsp)
movl %ebp, %esi
movq %r14, %rdx
callq *-0x10(%r15)
cmpq $0x0, (%r15)
leaq 0x48(%r15), %r15
jne 0x4b75
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq