// File: /workspace/github_c_makefile_star2_O3/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, %r12
movzbl (%rsi), %r13d
cmpl $0x3e, %r13d
ja 0xb707
leal 0x3f(%r13), %eax
movl $0x1, %ebp
jmp 0xb72a
movb $0x3f, 0x11(%rsp)
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, %ebp
movb $0x7e, %al
movb %al, 0x10(%rsp)
movl %ebp, %eax
leaq (%rsp,%rax), %r15
addq $0x10, %r15
leal -0x1(%r13), %ebx
imull %r13d, %ebx
movl %ebx, %eax
shrl $0x1f, %eax
addl %ebx, %eax
shrl %eax
addl $0x5, %eax
cwtl
imull $0x2aab, %eax, %eax     # imm = 0x2AAB
movl %eax, %edx
shrl $0x1f, %edx
shrl $0x10, %eax
addl %edx, %eax
movswl %ax, %r11d
cmpl $0x2, %ebx
jl 0xb781
leal -0x1(%r11), %edx
incq %rdx
movq %r15, %rdi
xorl %esi, %esi
movq %r11, 0x8(%rsp)
callq 0x1030
movq 0x8(%rsp), %r11
movslq %r11d, %rax
movb $0xa, (%r15,%rax)
testl %r13d, %r13d
je 0xb7f3
incq %r14
xorl %eax, %eax
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
leaq 0x14934(%rip), %rdx     # 0x200d4
movb (%r14), %sil
incq %r14
testb %sil, %sil
je 0xb7e9
movzbl %sil, %esi
cmpl %esi, %eax
jb 0xb7a0
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 0xb7a0
addl %eax, %r9d
incl %eax
cmpl %r13d, %eax
jne 0xb7a0
cmpl $0x2, %ebx
jl 0xb80a
movl %r11d, %eax
xorl %edx, %edx
addb $0x3f, (%r15,%rdx)
incq %rdx
cmpq %rdx, %rax
jne 0xb7fd
leal (%r11,%rbp), %eax
incl %eax
movslq %eax, %r14
leaq 0x10(%rsp), %rdi
movl $0x1, %esi
movq %r14, %rdx
movq %r12, %rcx
callq 0x10e0
cmpq %r14, %rax
jne 0xb83f
addq $0x528, %rsp            # imm = 0x528
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x274e