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

/* Write in edge_code format.  Always write in next direction,
   and if doflip != 0 also write in prev direction. */
{
    int length, headerlength;
    unsigned char code[MAXN+MAXE+4]; 
    unsigned char mirrorcode[MAXN+MAXE+4];


      if ((ne/2)>UCHAR_MAX) 
	{ fprintf(stderr,
             ">E %s: Output routine write_edgecode not prepared for ",cmdname);
	  fprintf(stderr,"that many edges\n");
	  exit(1);
	}

    compute_edgecode(code,&length,&headerlength);

    if (fwrite(code,sizeof(unsigned char),length,f) != length)
    {
        fprintf(stderr,">E %s: fwrite() failed\n",cmdname);
        perror(">E ");
        exit(1);
    }
    if (doflip)
      { mirror_of_edgecode(mirrorcode, code, (code_edge!=NULL), length, headerlength);
        if (fwrite(mirrorcode,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 $0x378, %rsp            # imm = 0x378
movl 0x239b7b(%rip), %edx    # 0x244614
cmpl $0x200, %edx            # imm = 0x200
jge 0xacaf
movl %esi, %ebp
movq %rdi, %rbx
movl 0x1b5e4(%rip), %eax     # 0x26094
leal 0x2(%rax), %ecx
movl %ecx, 0x1b5db(%rip)     # 0x26094
cmpl $0x752f, %eax           # imm = 0x752F
jl 0xaae9
movl $0x2, 0x1b5ca(%rip)     # 0x26094
movl $0x30, %eax
leaq 0x239b4a(%rip), %rcx    # 0x244620
movl $0x0, (%rax,%rcx)
addq $0x40, %rax
cmpq $0x46630, %rax          # imm = 0x46630
jne 0xaad6
movl 0x1b5a1(%rip), %ecx     # 0x26090
movl 0x239b1b(%rip), %edi    # 0x244610
notl %ecx
leal (%rdi,%rdx), %eax
addl %edi, %edx
decl %edx
cmpl $0x100, %eax            # imm = 0x100
jg 0xab15
leaq 0x1(%rsp), %rsi
movb %dl, -0x1(%rsi)
movl $0x1, %r14d
jmp 0xab30
leaq 0x4(%rsp), %rsi
movw $0x2100, -0x4(%rsi)     # imm = 0x2100
movb %dh, 0x2(%rsp)
movb %dl, -0x1(%rsi)
addl $0x3, %eax
movl $0x4, %r14d
shrl $0x1f, %ecx
movq 0x239ade(%rip), %r9     # 0x244618
testq %r9, %r9
jne 0xab46
movq 0x1ceaa(%rip), %r9      # 0x279f0
addl %ecx, %edi
movslq (%r9), %r8
movl 0x1b542(%rip), %r11d    # 0x26094
movq 0x20(%r9), %rcx
movl %r11d, 0x30(%rcx)
movb $0x0, (%rsi)
movl $0x0, 0x34(%rcx)
leaq 0x1d085(%rip), %rcx     # 0x27bf0
leaq 0x1(%rsi), %r10
movl $0x1, %edx
cmpl $0x2, (%rcx,%r8,4)
jl 0xabbc
movl $0x1, %esi
movq 0x18(%r9), %r9
cmpl %r11d, 0x30(%r9)
jge 0xaba6
movq 0x20(%r9), %r15
movl %r11d, 0x30(%r15)
movb %dl, (%r10)
movzbl %dl, %r15d
movq 0x20(%r9), %r12
movl %r15d, 0x34(%r12)
incl %edx
jmp 0xabad
movb 0x34(%r9), %r15b
movb %r15b, (%r10)
incl %esi
incq %r10
cmpl (%rcx,%r8,4), %esi
jl 0xab80
leaq -0x1(%r10), %rsi
movb $-0x1, (%r10)
testl %edi, %edi
jle 0xac40
movl %r8d, %r8d
addq $0x2, %rsi
movl %edi, %edi
xorl %r9d, %r9d
leaq 0x1ce19(%rip), %r10     # 0x279f0
cmpq %r8, %r9
je 0xac38
movl 0x1b4ad(%rip), %r11d    # 0x26090
cmpq %r11, %r9
je 0xac38
cmpl $0x0, (%rcx,%r9,4)
jle 0xac32
leaq (%r10,%r9,8), %r15
xorl %r11d, %r11d
movq (%r15), %r15
movl 0x1b494(%rip), %r12d    # 0x26094
cmpl %r12d, 0x30(%r15)
jge 0xac1a
movq 0x20(%r15), %r13
movl %r12d, 0x30(%r13)
movl %edx, 0x34(%r13)
movb %dl, (%rsi,%r11)
incl %edx
jmp 0xac22
movb 0x34(%r15), %r12b
movb %r12b, (%rsi,%r11)
addq $0x18, %r15
incq %r11
cmpl (%rcx,%r9,4), %r11d
jl 0xabf6
addq %r11, %rsi
movb $-0x1, (%rsi)
incq %rsi
incq %r9
cmpq %rdi, %r9
jne 0xabd7
movslq %eax, %r15
movq %rsp, %rdi
movl $0x1, %esi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x10f0
cmpq %r15, %rax
jne 0xacb4
testl %ebp, %ebp
je 0xac9d
xorl %edx, %edx
cmpq $0x0, 0x2399af(%rip)    # 0x244618
setne %dl
leaq 0x1c0(%rsp), %r12
movq %rsp, %rsi
movq %r12, %rdi
movl %r15d, %ecx
movl %r14d, %r8d
callq 0xb98c
movl $0x1, %esi
movq %r12, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x10f0
cmpq %r15, %rax
jne 0xacb9
addq $0x378, %rsp            # imm = 0x378
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2618
callq 0x25b0
callq 0x25e4