// File: /workspace/github_c_makefile_star2_O1/mishun[P]plantri/plantri.c
// Function: write_alpha
static void
write_alpha(FILE *f, int doflip)

/* Write in alphabetic format.  Always write in next direction,
   and if doflip != 0 also write in prev direction. */
{
    int i, j, start;
    unsigned char code[MAXN+MAXE+4];
    unsigned char precode[MAXN+MAXE+1];
    size_t length;

    length=nv+ne;
    compute_code(precode);

    if (nv >= 10) 
    {
        code[0] = '0' + nv/10;
        code[1] = '0' + nv%10;
        code[2] = ' ';
        length += 3;
	start=3;
    }
    else
    {
        code[0] = '0' + nv;
        code[1] = ' ';
        length += 2;
	start=2;
    }

    for (i = 1, j=start; j < length; ++i, ++j)
	if (precode[i]==0) code[j]=',';
        else code[j]=precode[i]-1+'a';

    code[j-1]='\n';
    if (fwrite(code,sizeof(unsigned char),length,f) != length)
    {
        fprintf(stderr,">E %s: fwrite() failed\n",cmdname);
        perror(">E ");
        exit(1);
    }
    if (doflip)
      { compute_code_mirror(precode);
        for (i = 1, j=start; j < length; ++i, ++j)
	    if (precode[i]==0) code[j]=',';
            else code[j]=precode[i]-1+'a';
        code[j-1]='\n';
        if (fwrite(code,sizeof(unsigned char),length,f) != length)
	  {
	    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 $0x388, %rsp            # imm = 0x388
movl %esi, %ebp
movq %rdi, 0x8(%rsp)
movl 0x239f36(%rip), %r14d   # 0x244610
movl 0x239f34(%rip), %eax    # 0x244614
addl %r14d, %eax
movslq %eax, %rbx
leaq 0x1d0(%rsp), %rdi
callq 0xb02d
cmpl $0xa, %r14d
jl 0xa734
movl %r14d, %eax
movl $0xcccccccd, %ecx       # imm = 0xCCCCCCCD
imulq %rax, %rcx
shrq $0x23, %rcx
leal 0x30(%rcx), %eax
movb %al, 0x10(%rsp)
addl %ecx, %ecx
leal (%rcx,%rcx,4), %eax
subl %eax, %r14d
orb $0x30, %r14b
movb %r14b, 0x11(%rsp)
movb $0x20, 0x12(%rsp)
movl $0x3, %r13d
movl $0x3, %r14d
jmp 0xa74e
addb $0x30, %r14b
movb %r14b, 0x10(%rsp)
movb $0x20, 0x11(%rsp)
movl $0x2, %r13d
movl $0x2, %r14d
addq %rbx, %r14
movl %r13d, %ebx
movq %r14, %r12
movl %r13d, %eax
subq %rbx, %r12
jbe 0xa792
leaq (%rsp,%rbx), %rax
addq $0x10, %rax
xorl %ecx, %ecx
movl $0x2c, %edx
movb 0x1d1(%rsp,%rcx), %sil
leal 0x60(%rsi), %edi
testb %sil, %sil
movzbl %dil, %esi
cmovel %edx, %esi
movb %sil, (%rax,%rcx)
incq %rcx
cmpq %rcx, %r12
jne 0xa76e
movl %r14d, %eax
cltq
leaq 0x10(%rsp), %r15
movb $0xa, -0x1(%rax,%r15)
movl $0x1, %esi
movq %r15, %rdi
movq %r14, %rdx
movq 0x8(%rsp), %rcx
callq 0x10f0
cmpq %r14, %rax
jne 0xa837
testl %ebp, %ebp
je 0xa825
leaq 0x1d0(%rsp), %rdi
callq 0xb172
cmpq %rbx, %r14
jbe 0xa802
leaq (%rsp,%rbx), %rax
addq $0x10, %rax
xorl %ecx, %ecx
movl $0x2c, %edx
movb 0x1d1(%rsp,%rcx), %sil
leal 0x60(%rsi), %edi
testb %sil, %sil
movzbl %dil, %esi
cmovel %edx, %esi
movb %sil, (%rax,%rcx)
incq %rcx
cmpq %rcx, %r12
jne 0xa7de
movl %r14d, %r13d
movslq %r13d, %rax
movb $0xa, -0x1(%rax,%r15)
movl $0x1, %esi
movq %r15, %rdi
movq %r14, %rdx
movq 0x8(%rsp), %rcx
callq 0x10f0
cmpq %r14, %rax
jne 0xa83c
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x24e0
callq 0x2514