// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/fullgen.c
// Function: sparse6code
int
sparse6code( PLANMAP map, FLAECHENTYP *code)
/* Make sparse6 code, including final '\n'. */
{
    FLAECHENTYP *p;
    int nb,i,j,lastj,x,k,r,rr,topbit;
    int nv;
    KANTE *merke, *lauf;

    nv = map[0][0].name;

    p = code;
    *p++ = ':';

    if (nv <= 62)
        *p++ = 63 + nv;
    else
    {
        *p++ = 63 + 63;
        *p++ = 63 + 0;
        *p++ = 63 + (nv >> 6);
        *p++ = 63 + (nv & 0x3F);
    }

    for (i = nv-1, nb = 0; i != 0 ; i >>= 1, ++nb) {}
    topbit = 1 << (nb-1);
    k = 6;
    x = 0;

    lastj = 0;
    for (j = 0; j < nv; ++j)
    {
        merke = lauf = map[j+1];
        do
        {
            i = lauf->name - 1;
            if (i <= j)
            {
                if (j == lastj)
                {
                    x <<= 1;
                    if (--k == 0)
                    {
                        *p++ = 63 + x;
                        k = 6;
                        x = 0;
                    }
                }
                else
                {
                    x = (x << 1) | 1;
                    if (--k == 0)
                    {
                        *p++ = 63 + x;
                        k = 6;
                        x = 0;
                    }
                    if (j > lastj+1)
                    {
                        for (r = 0, rr = j; r < nb; ++r, rr <<= 1)
                        {
                            if (rr & topbit) x = (x << 1) | 1;
                            else             x <<= 1;
                            if (--k == 0)
                            {
                                *p++ = 63 + x;
                                k = 6;
                                x = 0;
                            }
                        }
                        x <<= 1;
                        if (--k == 0)
                        {
                            *p++ = 63 + x;
                            k = 6;
                            x = 0;
                        }
                    }
                    lastj = j;
                }
                for (r = 0, rr = i; r < nb; ++r, rr <<= 1)
                {
                    if (rr & topbit) x = (x << 1) | 1;
                    else             x <<= 1;
                    if (--k == 0)
                    {
                        *p++ = 63 + x;
                        k = 6;
                        x = 0;
                    }
                }
            }
            lauf = lauf->next;
        } while (lauf != merke);
    }

    if (k != 6) *p++ = 63 + ((x << k) | ((1 << k) - 1));

    *p++ = '\n';
    return p - code;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x2(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x3a, (%rax)
cmpl $0x3e, -0x40(%rbp)
jg 0x1dc2
movl -0x40(%rbp), %eax
addl $0x3f, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %cl, (%rax)
jmp 0x1e1e
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x7e, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x3f, (%rax)
movl -0x40(%rbp), %eax
sarl $0x6, %eax
addl $0x3f, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %cl, (%rax)
movl -0x40(%rbp), %eax
andl $0x3f, %eax
addl $0x3f, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %cl, (%rax)
movl -0x40(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x1e49
jmp 0x1e36
movl -0x20(%rbp), %eax
sarl %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1e2e
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x3c(%rbp)
movl $0x6, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0x20c4
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rax
movzwl 0x2(%rax), %eax
subl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0x209a
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jne 0x1f04
movl -0x2c(%rbp), %eax
shll %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, %eax
jne 0x1eff
movl -0x2c(%rbp), %eax
addl $0x3f, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %cl, (%rax)
movl $0x6, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
jmp 0x2019
movl -0x2c(%rbp), %eax
shll %eax
orl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, %eax
jne 0x1f44
movl -0x2c(%rbp), %eax
addl $0x3f, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %cl, (%rax)
movl $0x6, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jle 0x2013
movl $0x0, -0x34(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x1fd4
movl -0x38(%rbp), %eax
andl -0x3c(%rbp), %eax
cmpl $0x0, %eax
je 0x1f82
movl -0x2c(%rbp), %eax
shll %eax
orl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1f8a
movl -0x2c(%rbp), %eax
shll %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, %eax
jne 0x1fbf
movl -0x2c(%rbp), %eax
addl $0x3f, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %cl, (%rax)
movl $0x6, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
jmp 0x1fc1
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x38(%rbp), %eax
shll %eax
movl %eax, -0x38(%rbp)
jmp 0x1f62
movl -0x2c(%rbp), %eax
shll %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, %eax
jne 0x2011
movl -0x2c(%rbp), %eax
addl $0x3f, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %cl, (%rax)
movl $0x6, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
jmp 0x2013
movl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x2098
movl -0x38(%rbp), %eax
andl -0x3c(%rbp), %eax
cmpl $0x0, %eax
je 0x2046
movl -0x2c(%rbp), %eax
shll %eax
orl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x204e
movl -0x2c(%rbp), %eax
shll %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, %eax
jne 0x2083
movl -0x2c(%rbp), %eax
addl $0x3f, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %cl, (%rax)
movl $0x6, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
jmp 0x2085
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x38(%rbp), %eax
shll %eax
movl %eax, -0x38(%rbp)
jmp 0x2026
jmp 0x209a
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jne 0x1ea0
jmp 0x20b6
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1e75
cmpl $0x6, -0x30(%rbp)
je 0x20f9
movl -0x2c(%rbp), %eax
movl -0x30(%rbp), %ecx
shll %cl, %eax
movl -0x30(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
orl %ecx, %eax
addl $0x3f, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %cl, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0xa, (%rax)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
popq %rbp
retq
nopl (%rax,%rax)