// File: /workspace/github_c_makefile_star2_O1/mishun[P]plantri/plantri.c
// Function: write_code_as_graph6
static void
write_code_as_graph6(FILE *f, unsigned char code[])

/* Write a graph represented in planar_code to a file in graph6 format.
   The imbedding is lost, loops are lost, and multiple edges are changed
   to one edge.  The vertex numbering is the same.  This does not use any
   global variables and works to 255 vertices. */

{
    unsigned char g6[20+MAXF*(MAXF-1)/12];
    register unsigned char *pin,*pout;
    int n,nlen,bodylen,i,j,org;
    static unsigned char g6bit[] = {32,16,8,4,2,1};

    pin = code;
    n = *pin++;

    if (n <= 62)
    {
        g6[0] = 63 + n;
        nlen = 1;
    }
    else
    {
        g6[0] = 63 + 63;
        g6[1] = 63 + 0;
        g6[2] = 63 + (n >> 6);
        g6[3] = 63 + (n & 0x3F);
        nlen = 4;
    }

    pout = g6 + nlen;
    bodylen = ((n * (n-1)) / 2 + 5) / 6;
    for (i = 0; i < bodylen; ++i) pout[i] = 0;
    pout[bodylen] = '\n';

    for (i = 0, org = -1; i < n; org += i, ++i)
    {
        while ((j = *pin++) != 0)
        {
            if (j <= i)
            {
                j += org;
                pout[j/6] |= g6bit[j%6];
            }
        }
    }

    for (i = 0; i < bodylen; ++i) pout[i] += 63;

    j = nlen + bodylen + 1;
    if (fwrite(g6,sizeof(unsigned char),(size_t)j,f) != j)
    {
        fprintf(stderr,">E %s: fwrite() failed\n",cmdname);
        perror(">E ");
        exit(1);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x528, %rsp            # imm = 0x528
movq %rsi, %r14
movq %rdi, %rcx
movzbl (%rsi), %r13d
cmpl $0x3e, %r13d
ja 0xb648
leal 0x3f(%r13), %eax
movb %al, 0x10(%rsp)
movl $0x1, %r12d
jmp 0xb66c
movw $0x3f7e, 0x10(%rsp)     # imm = 0x3F7E
movl %r13d, %eax
shrb $0x6, %al
addb $0x3f, %al
movb %al, 0x12(%rsp)
movl %r13d, %eax
andb $0x3f, %al
addb $0x3f, %al
movb %al, 0x13(%rsp)
movl $0x4, %r12d
movl %r12d, %eax
leaq (%rsp,%rax), %r15
addq $0x10, %r15
leal -0x1(%r13), %ebx
imull %r13d, %ebx
movl %ebx, %eax
shrl $0x1f, %eax
addl %ebx, %eax
sarl %eax
addl $0x5, %eax
cltq
imulq $0x2aaaaaab, %rax, %rbp # imm = 0x2AAAAAAB
movq %rbp, %rax
shrq $0x3f, %rax
shrq $0x20, %rbp
addl %eax, %ebp
cmpl $0x2, %ebx
jl 0xb6c5
cmpl $0x2, %ebp
movl $0x1, %edx
cmovgel %ebp, %edx
movq %r15, %rdi
xorl %esi, %esi
movq %rcx, 0x8(%rsp)
callq 0x1030
movq 0x8(%rsp), %rcx
movslq %ebp, %rax
movb $0xa, (%r15,%rax)
testl %r13d, %r13d
je 0xb737
incq %r14
xorl %eax, %eax
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
leaq 0x149f0(%rip), %rdx     # 0x200d4
movb (%r14), %sil
incq %r14
testb %sil, %sil
je 0xb72d
movzbl %sil, %esi
cmpl %esi, %eax
jb 0xb6e4
addl %r9d, %esi
movslq %esi, %rsi
imulq $0x2aaaaaab, %rsi, %rdi # imm = 0x2AAAAAAB
movq %rdi, %r8
shrq $0x3f, %r8
shrq $0x20, %rdi
addl %r8d, %edi
leal (%rdi,%rdi), %r8d
leal (%r8,%r8,2), %r8d
subl %r8d, %esi
movslq %esi, %rsi
movb (%rsi,%rdx), %sil
movslq %edi, %rdi
orb %sil, (%r15,%rdi)
jmp 0xb6e4
addl %eax, %r9d
incl %eax
cmpl %r13d, %eax
jne 0xb6e4
cmpl $0x2, %ebx
jl 0xb756
cmpl $0x2, %ebp
movl $0x1, %eax
cmovgel %ebp, %eax
xorl %edx, %edx
addb $0x3f, (%r15,%rdx)
incq %rdx
cmpq %rdx, %rax
jne 0xb749
leal (%r12,%rbp), %eax
incl %eax
movslq %eax, %r14
leaq 0x10(%rsp), %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x10f0
cmpq %r14, %rax
jne 0xb788
addq $0x528, %rsp            # imm = 0x528
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x27ca