// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/plantri.c
// Function: open_output_file
static void
open_output_file(void)

/* Open the output file, and write a header if one is called for.
   All the needed information is in global vars.  Also check if
   maxn is too large for this format, and set the global procedure
   variables write_graph() and write_dual_graph().
*/
{
    int nvf;

    if (aswitch + gswitch + sswitch + uswitch + Eswitch >= 2)
    {
        fprintf(stderr,">E %s: -a, -g, -s, -u, -E are incompatible\n",cmdname);
        exit(1);
    }

    if (!uswitch)   /*UPDATE for -E and reconconsider */
    {
        nvf = dswitch ? 2*(maxnv-(polygonsize>=0))-4 : maxnv-(polygonsize>=0);
        if ((aswitch && nvf > 99) ||
            (gswitch && nvf > 255) ||
            (sswitch && nvf > 255) ||
           (!aswitch && !gswitch && !sswitch && nvf > 255))
        {
            fprintf(stderr,">E %s: n is too large for that output format\n",
                cmdname);
            exit(1);
        }
    }

    msgfile = stderr;
    if (outfilename == NULL)
    {
        outfilename = "stdout";
        outfile = stdout;
    }
    else if ((outfile = fopen(outfilename,
        zeroswitch || aswitch || gswitch || sswitch ? "w" : "wb")) == NULL)
    {
        fprintf(stderr,
          ">E %s: can't open %s for writing\n",cmdname,outfilename);
        perror(">E ");
        exit(1);
    }

    if (zeroswitch)  /* implied by oneswitch */
        write_graph = write_dual_graph = write_digits;
    else if (aswitch)
    {
        write_graph = write_alpha;
        write_dual_graph = write_dual_alpha;
    }
    else if (gswitch)
    {
        write_graph = write_graph6;
        write_dual_graph = write_dual_graph6;
    }
    else if (sswitch)
    {
        write_graph = write_sparse6;
        write_dual_graph = write_dual_sparse6;
    }
    else if (Eswitch)
    {
        write_graph = write_edgecode;
        write_dual_graph = write_dual_edgecode;
    }
    else
    {
        write_graph = write_planar_code;
        write_dual_graph = write_dual_planar_code;
    }

    if (!uswitch && !aswitch)
    {
        if ((!zeroswitch && !hswitch && !gswitch && !sswitch && !Eswitch &&
	     fwrite(PCODE,(size_t)1,PCODELEN,outfile) != PCODELEN)
          || (!hswitch && Eswitch &&
	      fwrite(ECODE,(size_t)1,ECODELEN,outfile) != ECODELEN)
          || (hswitch && gswitch &&
	      fwrite(G6CODE,(size_t)1,G6CODELEN,outfile) != G6CODELEN)
          || (hswitch && sswitch &&
	      fwrite(S6CODE,(size_t)1,S6CODELEN,outfile) != S6CODELEN))
        {
            fprintf(stderr,">E %s: error writing header\n",cmdname);
            perror(">E ");
            exit(1);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl 0x35746(%rip), %eax     # 0x3c244
addl 0x35744(%rip), %eax     # 0x3c248
addl 0x35742(%rip), %eax     # 0x3c24c
addl 0x35724(%rip), %eax     # 0x3c234
addl 0x3573a(%rip), %eax     # 0x3c250
cmpl $0x2, %eax
jl 0x6b44
movq 0x354d6(%rip), %rax     # 0x3bff8
movq (%rax), %rdi
movq 0x35594(%rip), %rdx     # 0x3c0c0
leaq 0x317eb(%rip), %rsi     # 0x3831e
movb $0x0, %al
callq 0x1060
movl $0x1, %edi
callq 0x10c0
cmpl $0x0, 0x356e9(%rip)     # 0x3c234
jne 0x6c1f
cmpl $0x0, 0x35704(%rip)     # 0x3c25c
je 0x6b7c
movl 0x35720(%rip), %eax     # 0x3c280
cmpl $0x0, 0x35649(%rip)     # 0x3c1b0
setge %cl
andb $0x1, %cl
movzbl %cl, %ecx
subl %ecx, %eax
shll %eax
subl $0x4, %eax
movl %eax, -0x8(%rbp)
jmp 0x6b97
movl 0x356fe(%rip), %eax     # 0x3c280
cmpl $0x0, 0x35627(%rip)     # 0x3c1b0
setge %cl
andb $0x1, %cl
movzbl %cl, %ecx
subl %ecx, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
cmpl $0x0, 0x356a0(%rip)     # 0x3c244
je 0x6bac
cmpl $0x63, -0x4(%rbp)
jg 0x6bf4
cmpl $0x0, 0x35695(%rip)     # 0x3c248
je 0x6bbe
cmpl $0xff, -0x4(%rbp)
jg 0x6bf4
cmpl $0x0, 0x35687(%rip)     # 0x3c24c
je 0x6bd0
cmpl $0xff, -0x4(%rbp)
jg 0x6bf4
cmpl $0x0, 0x3566d(%rip)     # 0x3c244
jne 0x6c1d
cmpl $0x0, 0x35668(%rip)     # 0x3c248
jne 0x6c1d
cmpl $0x0, 0x35663(%rip)     # 0x3c24c
jne 0x6c1d
cmpl $0xff, -0x4(%rbp)
jle 0x6c1d
movq 0x353fd(%rip), %rax     # 0x3bff8
movq (%rax), %rdi
movq 0x354bb(%rip), %rdx     # 0x3c0c0
leaq 0x3173e(%rip), %rsi     # 0x3834a
movb $0x0, %al
callq 0x1060
movl $0x1, %edi
callq 0x10c0
jmp 0x6c1f
movq 0x353d2(%rip), %rax     # 0x3bff8
movq (%rax), %rax
movq %rax, 0x355c0(%rip)     # 0x3c1f0
cmpq $0x0, 0x35600(%rip)     # 0x3c238
jne 0x6c5e
leaq 0x31737(%rip), %rax     # 0x38378
movq %rax, 0x355f0(%rip)     # 0x3c238
movq 0x35389(%rip), %rax     # 0x3bfd8
movq (%rax), %rax
movq %rax, 0x2539a7(%rip)    # 0x25a600
jmp 0x6d0c
movq 0x355d3(%rip), %rax     # 0x3c238
movq %rax, -0x18(%rbp)
movb $0x1, %al
cmpl $0x0, 0x355ee(%rip)     # 0x3c260
movb %al, -0x9(%rbp)
jne 0x6ca0
movb $0x1, %al
cmpl $0x0, 0x355c4(%rip)     # 0x3c244
movb %al, -0x9(%rbp)
jne 0x6ca0
movb $0x1, %al
cmpl $0x0, 0x355ba(%rip)     # 0x3c248
movb %al, -0x9(%rbp)
jne 0x6ca0
cmpl $0x0, 0x355b2(%rip)     # 0x3c24c
setne %al
movb %al, -0x9(%rbp)
movq -0x18(%rbp), %rdi
movb -0x9(%rbp), %cl
leaq 0x316d1(%rip), %rsi     # 0x3837f
leaq 0x3185e(%rip), %rax     # 0x38513
testb $0x1, %cl
cmovneq %rax, %rsi
callq 0x1090
movq %rax, 0x253938(%rip)    # 0x25a600
cmpq $0x0, %rax
jne 0x6d0a
movq 0x35323(%rip), %rax     # 0x3bff8
movq (%rax), %rdi
movq 0x353e1(%rip), %rdx     # 0x3c0c0
movq 0x35552(%rip), %rcx     # 0x3c238
leaq 0x31695(%rip), %rsi     # 0x38382
movb $0x0, %al
callq 0x1060
leaq 0x316a9(%rip), %rdi     # 0x383a4
callq 0x10a0
movl $0x1, %edi
callq 0x10c0
jmp 0x6d0c
cmpl $0x0, 0x3554d(%rip)     # 0x3c260
je 0x6d36
leaq 0x2c34(%rip), %rax      # 0x9950
movq %rax, 0x2538e5(%rip)    # 0x25a608
leaq 0x2c26(%rip), %rax      # 0x9950
movq %rax, 0x2538df(%rip)    # 0x25a610
jmp 0x6df9
cmpl $0x0, 0x35507(%rip)     # 0x3c244
je 0x6d60
leaq 0x317a(%rip), %rax      # 0x9ec0
movq %rax, 0x2538c3(%rip)    # 0x25a610
leaq 0x33fc(%rip), %rax      # 0xa150
movq %rax, 0x2538ad(%rip)    # 0x25a608
jmp 0x6df7
cmpl $0x0, 0x354e1(%rip)     # 0x3c248
je 0x6d87
leaq 0x36a0(%rip), %rax      # 0xa410
movq %rax, 0x253899(%rip)    # 0x25a610
leaq 0x36d2(%rip), %rax      # 0xa450
movq %rax, 0x253883(%rip)    # 0x25a608
jmp 0x6df5
cmpl $0x0, 0x354be(%rip)     # 0x3c24c
je 0x6dae
leaq 0x36f9(%rip), %rax      # 0xa490
movq %rax, 0x253872(%rip)    # 0x25a610
leaq 0x372b(%rip), %rax      # 0xa4d0
movq %rax, 0x25385c(%rip)    # 0x25a608
jmp 0x6df3
cmpl $0x0, 0x3549b(%rip)     # 0x3c250
je 0x6dd5
leaq 0x3752(%rip), %rax      # 0xa510
movq %rax, 0x25384b(%rip)    # 0x25a610
leaq 0x38b4(%rip), %rax      # 0xa680
movq %rax, 0x253835(%rip)    # 0x25a608
jmp 0x6df1
leaq 0x3a04(%rip), %rax      # 0xa7e0
movq %rax, 0x25382d(%rip)    # 0x25a610
leaq 0x3af6(%rip), %rax      # 0xa8e0
movq %rax, 0x253817(%rip)    # 0x25a608
jmp 0x6df3
jmp 0x6df5
jmp 0x6df7
jmp 0x6df9
cmpl $0x0, 0x35434(%rip)     # 0x3c234
jne 0x6f3d
cmpl $0x0, 0x35437(%rip)     # 0x3c244
jne 0x6f3d
cmpl $0x0, 0x35446(%rip)     # 0x3c260
jne 0x6e67
cmpl $0x0, 0x35435(%rip)     # 0x3c258
jne 0x6e67
cmpl $0x0, 0x3541c(%rip)     # 0x3c248
jne 0x6e67
cmpl $0x0, 0x35417(%rip)     # 0x3c24c
jne 0x6e67
cmpl $0x0, 0x35412(%rip)     # 0x3c250
jne 0x6e67
movq 0x2537b9(%rip), %rcx    # 0x25a600
leaq 0x3155a(%rip), %rdi     # 0x383a8
movl $0x1, %esi
movl $0xf, %edx
callq 0x10d0
cmpq $0xf, %rax
jne 0x6f06
cmpl $0x0, 0x353ea(%rip)     # 0x3c258
jne 0x6e9c
cmpl $0x0, 0x353d9(%rip)     # 0x3c250
je 0x6e9c
movq 0x253780(%rip), %rcx    # 0x25a600
leaq 0x31531(%rip), %rdi     # 0x383b8
movl $0x1, %esi
movl $0xd, %edx
callq 0x10d0
cmpq $0xd, %rax
jne 0x6f06
cmpl $0x0, 0x353b5(%rip)     # 0x3c258
je 0x6ed1
cmpl $0x0, 0x3539c(%rip)     # 0x3c248
je 0x6ed1
movq 0x25374b(%rip), %rcx    # 0x25a600
leaq 0x3150a(%rip), %rdi     # 0x383c6
movl $0x1, %esi
movl $0xa, %edx
callq 0x10d0
cmpq $0xa, %rax
jne 0x6f06
cmpl $0x0, 0x35380(%rip)     # 0x3c258
je 0x6f3b
cmpl $0x0, 0x3536b(%rip)     # 0x3c24c
je 0x6f3b
movq 0x253716(%rip), %rcx    # 0x25a600
leaq 0x314e0(%rip), %rdi     # 0x383d1
movl $0x1, %esi
movl $0xb, %edx
callq 0x10d0
cmpq $0xb, %rax
je 0x6f3b
movq 0x350eb(%rip), %rax     # 0x3bff8
movq (%rax), %rdi
movq 0x351a9(%rip), %rdx     # 0x3c0c0
leaq 0x314bf(%rip), %rsi     # 0x383dd
movb $0x0, %al
callq 0x1060
leaq 0x31478(%rip), %rdi     # 0x383a4
callq 0x10a0
movl $0x1, %edi
callq 0x10c0
jmp 0x6f3d
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)