// File: /workspace/github_c_makefile_star2_O3/Oric4ever[P]lcc65/6502/build/../src/gen.c
// Function: progbeg
void progbeg(int argc,char *argv[]) {
    int i;
    for(i=1;i<argc;i++) {
        if (strncmp(argv[i],"-N",2)==0) {
            NamePrefix=argv[i]+2;
        } else if (strcmp(argv[i],"-G")==0) {
            graph_output=true;
        } else if (strcmp(argv[i],"-O")==0) {
            optimizelevel=3;
        } else if (strcmp(argv[i],"-O0")==0) {
            optimizelevel=0;    /* no optimization */
        } else if (strcmp(argv[i],"-O1")==0) {
            optimizelevel=1;    /* remove ADDR and CNST leaves */
        } else if (strcmp(argv[i],"-O2")==0) {
            optimizelevel=2;    /* allocate register variables */
                                /* and do some easy opt. (INC...) */
        } else if (strcmp(argv[i],"-O3")==0) {
            optimizelevel=3;    /* optimizes INDIR, ASGN ... */
        } else {
            fprintf(stderr,"Unknown option %s\n",argv[i]);
            exit(1);
        }
    }
    if (graph_output) optimizelevel=0;
    if (graph_output) printf("digraph Frontend_output {\n");
    else print(version);

    /* 8 virtual registers */
    for (i=0;i<8;i++) regname[i]=stringf("reg%d",i);

    /* No spilling for simplicity purpose:
     * 32 temporaries for integer/pointer expressions, 32 for float expresssions.
     * => it should be nearly impossible to have such a complex expression
     * that we run out of temporaries (a compilation error will be raised in such
     * a pathological case).
     * All 32 integer/pointer temporaries in page zero,
     * and all 32 floating-point temporaries on stack frame.
     * => the runtime has to declare enough temporaries in zero page,
     * previous versions only used tmp0-tmp7...
     */
    for (i=0;i<32;i++) {
        temp[i]     = newtemp(STATIC,I);
        flt_temp[i] = newtemp(STATIC,F);
    }
    for (i=0;i<32;i++) {
        temp[i]->x.name=stringf("tmp%d",i);
        temp[i]->x.adrmode='Z';
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x2, %edi
jl 0x1a35d
movq %rsi, %rbx
movl %edi, %r13d
movl $0x1, %r12d
leaq 0x7cc1(%rip), %r14      # 0x21f50
leaq 0x7cbe(%rip), %r15      # 0x21f54
movq (%rbx,%r12,8), %rbp
cmpb $0x2d, (%rbp)
jne 0x1a2d2
cmpb $0x4e, 0x1(%rbp)
jne 0x1a2b6
addq $0x2, %rbp
movq %rbp, 0x1918f(%rip)     # 0x33440
jmp 0x1a351
cmpb $0x47, 0x1(%rbp)
jne 0x1a2c6
cmpb $0x0, 0x2(%rbp)
je 0x1a34a
cmpb $0x4f, 0x1(%rbp)
jne 0x1a2d2
cmpb $0x0, 0x2(%rbp)
je 0x1a31a
movq %rbp, %rdi
movq %r14, %rsi
callq 0x3110
testl %eax, %eax
je 0x1a326
movq %rbp, %rdi
movq %r15, %rsi
callq 0x3110
testl %eax, %eax
je 0x1a332
movq %rbp, %rdi
leaq 0x7c5e(%rip), %rsi      # 0x21f58
callq 0x3110
testl %eax, %eax
je 0x1a33e
movq %rbp, %rdi
leaq 0x7c4f(%rip), %rsi      # 0x21f5c
callq 0x3110
testl %eax, %eax
jne 0x1a43a
movl $0x3, 0x104a4(%rip)     # 0x2a7c8
jmp 0x1a351
movl $0x0, 0x10498(%rip)     # 0x2a7c8
jmp 0x1a351
movl $0x1, 0x1048c(%rip)     # 0x2a7c8
jmp 0x1a351
movl $0x2, 0x10480(%rip)     # 0x2a7c8
jmp 0x1a351
movb $0x1, 0x190f7(%rip)     # 0x33448
incq %r12
cmpq %r12, %r13
jne 0x1a296
cmpb $0x1, 0x190e4(%rip)     # 0x33448
jne 0x1a37e
movl $0x0, 0x10458(%rip)     # 0x2a7c8
leaq 0x84ac(%rip), %rdi      # 0x22823
callq 0x3060
jmp 0x1a38c
movq 0x1043b(%rip), %rdi     # 0x2a7c0
xorl %eax, %eax
callq 0x11732
leaq 0x190bd(%rip), %r15     # 0x33450
leaq 0x7bd9(%rip), %rbx      # 0x21f73
xorl %r14d, %r14d
movq %rbx, %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x11b33
movq %rax, (%r15)
incq %r14
addq $0x8, %r15
cmpq $0x8, %r14
jne 0x1a39d
xorl %ebx, %ebx
leaq 0x190cd(%rip), %r15     # 0x33490
leaq 0x191c6(%rip), %r14     # 0x33590
movl $0x51, %edi
movl $0x5, %esi
callq 0x17667
movq %rax, (%rbx,%r15)
movl $0x51, %edi
movl $0x1, %esi
callq 0x17667
movq %rax, (%rbx,%r14)
addq $0x8, %rbx
cmpq $0x100, %rbx            # imm = 0x100
jne 0x1a3ca
leaq 0x7b75(%rip), %rbx      # 0x21f79
xorl %r14d, %r14d
movq %rbx, %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x11b33
movq (%r15), %rcx
movq %rax, (%rcx)
movb $0x5a, 0x8(%rcx)
incq %r14
addq $0x8, %r15
cmpq $0x20, %r14
jne 0x1a407
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbp, %rdi
callq 0x3314