// File: /workspace/github_c_makefile_star2_O2/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
movq %rsi, %rbx
movslq %edi, %r13
pushq $0x1
popq %r12
leaq 0x71cc(%rip), %r14      # 0x1ff50
leaq 0x71c9(%rip), %r15      # 0x1ff54
cmpq %r13, %r12
jge 0x18e54
movq (%rbx,%r12,8), %rbp
cmpb $0x2d, (%rbp)
jne 0x18dd0
cmpb $0x4e, 0x1(%rbp)
jne 0x18db4
addq $0x2, %rbp
movq %rbp, 0x19691(%rip)     # 0x32440
jmp 0x18e4c
cmpb $0x47, 0x1(%rbp)
jne 0x18dc4
cmpb $0x0, 0x2(%rbp)
je 0x18e45
cmpb $0x4f, 0x1(%rbp)
jne 0x18dd0
cmpb $0x0, 0x2(%rbp)
je 0x18e18
movq %rbp, %rdi
movq %r14, %rsi
callq 0x3110
testl %eax, %eax
je 0x18e24
movq %rbp, %rdi
movq %r15, %rsi
callq 0x3110
testl %eax, %eax
je 0x18e2d
movq %rbp, %rdi
leaq 0x7160(%rip), %rsi      # 0x1ff58
callq 0x3110
testl %eax, %eax
je 0x18e39
movq %rbp, %rdi
leaq 0x7151(%rip), %rsi      # 0x1ff5c
callq 0x3110
testl %eax, %eax
jne 0x18f34
movl $0x3, 0x109a6(%rip)     # 0x297c8
jmp 0x18e4c
andl $0x0, 0x1099d(%rip)     # 0x297c8
jmp 0x18e4c
movl $0x1, 0x10991(%rip)     # 0x297c8
jmp 0x18e4c
movl $0x2, 0x10985(%rip)     # 0x297c8
jmp 0x18e4c
movb $0x1, 0x195fc(%rip)     # 0x32448
incq %r12
jmp 0x18d8b
cmpb $0x1, 0x195ed(%rip)     # 0x32448
jne 0x18e72
andl $0x0, 0x10964(%rip)     # 0x297c8
leaq 0x79b8(%rip), %rdi      # 0x20823
callq 0x3060
jmp 0x18e80
movq 0x10947(%rip), %rdi     # 0x297c0
xorl %eax, %eax
callq 0x106a9
leaq 0x195c9(%rip), %r15     # 0x32450
leaq 0x70e5(%rip), %rbx      # 0x1ff73
xorl %r14d, %r14d
cmpq $0x8, %r14
je 0x18eb0
movq %rbx, %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x10a97
movq %rax, (%r15)
incq %r14
addq $0x8, %r15
jmp 0x18e91
xorl %r12d, %r12d
pushq $0x51
popq %rbx
pushq $0x5
popq %rbp
leaq 0x195d0(%rip), %r15     # 0x32490
pushq $0x1
popq %r14
leaq 0x196c5(%rip), %r13     # 0x32590
cmpq $0x100, %r12            # imm = 0x100
je 0x18ef5
movl %ebx, %edi
movl %ebp, %esi
callq 0x162b4
movq %rax, (%r12,%r15)
movl %ebx, %edi
movl %r14d, %esi
callq 0x162b4
movq %rax, (%r12,%r13)
addq $0x8, %r12
jmp 0x18ecb
leaq 0x707d(%rip), %rbx      # 0x1ff79
xorl %r14d, %r14d
cmpq $0x20, %r14
je 0x18f25
movq %rbx, %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x10a97
movq (%r15), %rcx
movq %rax, (%rcx)
movb $0x5a, 0x8(%rcx)
incq %r14
addq $0x8, %r15
jmp 0x18eff
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xf0b5(%rip), %rax      # 0x27ff0
movq (%rax), %rdi
leaq 0x701b(%rip), %rsi      # 0x1ff60
movq %rbp, %rdx
xorl %eax, %eax
callq 0x3120
pushq $0x1
popq %rdi
callq 0x31a0