// File: /workspace/github_c_makefile_star2_O2/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, %rbx
movl %edi, %ebp
movl 0x7401(%rip), %eax      # 0xbc88
testb $0x2, %al
je 0x489e
leaq 0x4c(%rsp), %rsi
movq %rbx, %rdi
callq 0x38c0
movl 0x73ea(%rip), %eax      # 0xbc88
testb $0x4, %al
jne 0x4929
testb $0x8, %al
jne 0x4941
leaq 0x4a33(%rip), %r15      # 0x92e8
leaq 0x8(%rsp), %r14
leaq 0x1b1f(%rip), %r12      # 0x63e0
leaq 0x80(%rsp), %r13
cmpq $0x0, -0x38(%r15)
je 0x4917
movq -0x28(%r15), %rdi
testq %rdi, %rdi
je 0x4911
movl -0x18(%r15), %eax
movl %eax, 0x8(%rsp)
cmpq $0x3, %rax
ja 0x4909
movslq (%r12,%rax,4), %rcx
addq %r12, %rcx
movq %rbx, %rax
jmpq *%rcx
leaq 0x4c(%rsp), %rax
jmp 0x4904
leaq 0x18(%rsp), %rax
jmp 0x4904
movq %r13, %rax
movq %rax, 0x10(%rsp)
movl %ebp, %esi
movq %r14, %rdx
callq *(%r15)
addq $0x48, %r15
jmp 0x48c9
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ecx, %ecx
cmpq $0x34, %rcx
je 0x497e
leaq 0x1(%rcx), %rdx
movl %edx, 0x80(%rsp,%rcx,4)
movq %rdx, %rcx
jmp 0x492b
leaq 0x18(%rsp), %rax
xorl %ecx, %ecx
pushq $-0xd
popq %rdx
leaq 0x80(%rsp), %rsi
cmpq $0x4, %rcx
je 0x48ae
movq %rdx, %rdi
testq %rdi, %rdi
je 0x4975
movzbl 0xd(%rax,%rdi), %r8d
movb %cl, -0x1(%r8,%rsi)
incq %rdi
jmp 0x4960
incq %rcx
addq $0xd, %rax
jmp 0x4953
andl $0x0, 0x150(%rsp)
xorl %ecx, %ecx
xorl %edx, %edx
cmpq $0x4, %rdx
je 0x48a6
movl 0x80(%rsp), %r10d
imulq $0xd, %rdx, %r8
leaq (%rsp,%r8), %rsi
addq $0x4c, %rsi
xorl %edi, %edi
addq %rsp, %r8
addq $0x18, %r8
xorl %r9d, %r9d
testq %rdi, %rdi
je 0x49cf
cmpq $0xd, %rdi
je 0x4a0f
movzbl (%rdi,%rsi), %r11d
movzbl -0x1(%rdi,%rsi), %r14d
subl %r14d, %r11d
jmp 0x49d3
movzbl (%rsi), %r11d
testl %r11d, %r11d
cmovlel %ecx, %r11d
movl %r10d, %r14d
movslq %r10d, %r10
subl $0x1, %r11d
jb 0x49f3
movl 0x80(%rsp,%r10,4), %r10d
movl %r14d, %r9d
jmp 0x49da
movb %r10b, (%rdi,%r8)
movl 0x80(%rsp,%r10,4), %r10d
movslq %r9d, %r11
movl %r10d, 0x80(%rsp,%r11,4)
incq %rdi
jmp 0x49b4
incq %rdx
jmp 0x498a