// File: /workspace/github_c_makefile_star2_O3/Oric4ever[P]lcc65/6502/build/../src/gen.c
// Function: function
void function(Symbol f, Symbol caller[], Symbol callee[], int ncalls) {
    int i;

    if (graph_output) {
        printf("subgraph cluster%s {\n", f->x.name);
        printf("\tlabel=\"%s\";\n",f->x.name);
    }
    localsize=offset=tmpsize=nbregs=0; fname=f->x.name;

    for (i=0;i<32;i++) flt_temp[i]->x.name="******";
    for (i=8;i<32;i++) temp[i]->x.name="******";

    for (i = 0; caller[i] && callee[i]; i++) {
        caller[i]->x.name=stringf(graph_output?"param(%d)":"(ap),%d",offset);
        caller[i]->x.adrmode='A';
        offset+=caller[i]->type->size;
        if (optimizelevel>1 && callee[i]->sclass==REGISTER && allocreg(callee[i]))
            ; /* allocreg ok */
        else {
            callee[i]->x.adrmode=caller[i]->x.adrmode;
            callee[i]->x.name=caller[i]->x.name;
            callee[i]->sclass=AUTO;
        }
    }
    busy=localsize=0; offset=6;
    gencode(caller,callee);

    omit_frame=(i==0 && localsize==6);
    if (!graph_output) {
        print("%s\n",fname);
        if (optimizelevel>1 && omit_frame && nbregs==0)
            ;
        else print("\tENTER(%d,%d)\n",nbregs,localsize);
        if (isstruct(freturn(f->type)))
            print("\tMOVW_DY(op1,(fp),6)\n");
    }
    emitcode();

    if (graph_output) printf("}\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
cmpb $0x1, 0x18c8f(%rip)     # 0x33448
jne 0x1a7dd
movq (%rbx), %rsi
leaq 0x7833(%rip), %rdi      # 0x21ff8
xorl %eax, %eax
callq 0x30c0
movq (%rbx), %rsi
leaq 0x7838(%rip), %rdi      # 0x2200e
xorl %eax, %eax
callq 0x30c0
xorl %ecx, %ecx
movl %ecx, 0x18eab(%rip)     # 0x33690
movl %ecx, 0x18ea9(%rip)     # 0x33694
movl %ecx, 0x18ea7(%rip)     # 0x33698
movq (%rbx), %rax
leaq 0x10085(%rip), %r12     # 0x2a880
movq %rax, (%r12)
leaq 0x18d8a(%rip), %rdx     # 0x33590
leaq 0x79b5(%rip), %rax      # 0x221c2
movq (%rcx,%rdx), %rsi
movq %rax, (%rsi)
addq $0x8, %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x1a80d
movl $0x8, %ecx
leaq 0x18c63(%rip), %rdx     # 0x33490
movq (%rdx,%rcx,8), %rsi
movq %rax, (%rsi)
incq %rcx
cmpq $0x20, %rcx
jne 0x1a82d
cmpq $0x0, (%r15)
je 0x1a908
leaq 0x77ce(%rip), %r13      # 0x2201c
leaq 0x77d1(%rip), %rbp      # 0x22026
xorl %r12d, %r12d
xorl %esi, %esi
cmpq $0x0, (%r14,%r12)
je 0x1a90d
cmpb $0x0, 0x18bdc(%rip)     # 0x33448
movq %rbp, %rdi
cmovneq %r13, %rdi
xorl %eax, %eax
callq 0x11b33
movq (%r15,%r12), %rcx
movq %rax, (%rcx)
movq (%r15,%r12), %rax
movb $0x41, 0x8(%rax)
movq 0x20(%rax), %rcx
movl 0x18e01(%rip), %esi     # 0x33694
addl 0x8(%rcx), %esi
movl %esi, 0x18df8(%rip)     # 0x33694
cmpl $0x2, 0xff25(%rip)      # 0x2a7c8
movq (%r14,%r12), %rcx
jl 0x1a8c6
cmpb $0x4e, 0x1a(%rcx)
jne 0x1a8c6
movslq 0x18dda(%rip), %rdx     # 0x33690
cmpq $0x8, %rdx
je 0x1a8c6
movq 0x20(%rcx), %rdi
cmpl $0x5, 0x8(%rdi)
jne 0x1a8eb
movb $0x41, 0x8(%rcx)
movq (%rax), %rax
movq %rax, (%rcx)
movq (%r14,%r12), %rax
movb $0x43, 0x1a(%rax)
cmpq $0x0, 0x8(%r15,%r12)
leaq 0x8(%r12), %r12
jne 0x1a85a
jmp 0x1a916
leaq 0x18b5e(%rip), %rax     # 0x33450
movq (%rax,%rdx,8), %rax
movq %rax, (%rcx)
movb $0x52, 0x8(%rcx)
leal 0x1(%rdx), %eax
movl %eax, 0x18d8a(%rip)     # 0x33690
jmp 0x1a8d8
movb $0x1, %bpl
jmp 0x1a91f
testq %r12, %r12
sete %bpl
jmp 0x1a918
xorl %ebp, %ebp
leaq 0xff61(%rip), %r12      # 0x2a880
xorl %eax, %eax
movl %eax, 0x18d71(%rip)     # 0x33698
movl %eax, 0x18d6f(%rip)     # 0x3369c
movl $0x6, 0x18d5d(%rip)     # 0x33694
movq %r15, %rdi
movq %r14, %rsi
callq 0x36b0
cmpl $0x6, 0x18d4f(%rip)     # 0x33698
sete %al
andb %bpl, %al
movzbl %al, %eax
movl %eax, 0x18d48(%rip)     # 0x336a0
cmpb $0x0, 0x18ae9(%rip)     # 0x33448
jne 0x1aa02
movq (%r12), %rsi
leaq 0x75dc(%rip), %rdi      # 0x21f4c
xorl %eax, %eax
callq 0x11732
cmpl $0x2, 0xfe4a(%rip)      # 0x2a7c8
setge %al
cmpl $0x0, 0x18d18(%rip)     # 0x336a0
setne %cl
andb %al, %cl
movl 0x18cfd(%rip), %esi     # 0x33690
testl %esi, %esi
sete %al
testb %al, %cl
jne 0x1a9b0
movl 0x18cf6(%rip), %edx     # 0x33698
leaq 0x7685(%rip), %rdi      # 0x2202e
xorl %eax, %eax
callq 0x11732
movq 0x20(%rbx), %rdi
callq 0x195c1
movl (%rax), %ebp
movq 0x20(%rbx), %rdi
callq 0x195c1
cmpl $0xf, %ebp
jb 0x1a9cd
movq 0x10(%rax), %rax
cmpl $0x9, (%rax)
je 0x1a9f4
movq 0x20(%rbx), %rdi
callq 0x195c1
movl (%rax), %ebp
movq 0x20(%rbx), %rdi
callq 0x195c1
cmpl $0xf, %ebp
jb 0x1a9ef
movq 0x10(%rax), %rax
cmpl $0xa, (%rax)
jne 0x1aa02
leaq 0x7642(%rip), %rdi      # 0x2203d
xorl %eax, %eax
callq 0x11732
callq 0x34ef
cmpb $0x1, 0x18a3a(%rip)     # 0x33448
jne 0x1aa2a
leaq 0x55d2(%rip), %rdi      # 0x1ffe9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3060
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq