// File: /workspace/github_c_makefile_star2_O2/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, 0x19186(%rip)     # 0x32448
jne 0x192e6
movq (%rbx), %rsi
leaq 0x6d2a(%rip), %rdi      # 0x1fff8
xorl %eax, %eax
callq 0x30c0
movq (%rbx), %rsi
leaq 0x6d2f(%rip), %rdi      # 0x2000e
xorl %eax, %eax
callq 0x30c0
andl $0x0, 0x193a3(%rip)     # 0x32690
andl $0x0, 0x193a0(%rip)     # 0x32694
andl $0x0, 0x1939d(%rip)     # 0x32698
movq (%rbx), %rax
leaq 0x1057b(%rip), %rcx     # 0x29880
movq %rax, (%rcx)
xorl %ecx, %ecx
leaq 0x1927f(%rip), %rdx     # 0x32590
leaq 0x6eaa(%rip), %rax      # 0x201c2
cmpq $0x100, %rcx            # imm = 0x100
je 0x1932e
movq (%rcx,%rdx), %rsi
movq %rax, (%rsi)
addq $0x8, %rcx
jmp 0x19318
pushq $0x8
popq %rcx
leaq 0x19158(%rip), %rdx     # 0x32490
cmpq $0x20, %rcx
je 0x1934a
movq (%rdx,%rcx,8), %rsi
movq %rax, (%rsi)
incq %rcx
jmp 0x19338
movq %rbx, (%rsp)
leaq 0x6cc7(%rip), %r12      # 0x2001c
leaq 0x6cca(%rip), %rbx      # 0x20026
xorl %r13d, %r13d
xorl %ebp, %ebp
cmpq $0x0, (%r15,%r13)
je 0x193ef
cmpq $0x0, (%r14,%r13)
je 0x193ef
cmpb $0x0, 0x190ce(%rip)     # 0x32448
movq %rbx, %rdi
cmovneq %r12, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x10a97
movq (%r15,%r13), %rcx
movq %rax, (%rcx)
movq (%r15,%r13), %rax
movb $0x41, 0x8(%rax)
movq 0x20(%rax), %rcx
movl 0x192f1(%rip), %ebp     # 0x32694
addl 0x8(%rcx), %ebp
movl %ebp, 0x192e8(%rip)     # 0x32694
cmpl $0x2, 0x10415(%rip)     # 0x297c8
movq (%r14,%r13), %rdi
movb $0x41, %cl
jl 0x193d5
cmpb $0x4e, 0x1a(%rdi)
jne 0x193d5
callq 0x1926f
testl %eax, %eax
jne 0x193e6
movq (%r15,%r13), %rax
movb 0x8(%rax), %cl
movq (%r14,%r13), %rdi
movb %cl, 0x8(%rdi)
movq (%rax), %rax
movq %rax, (%rdi)
movq (%r14,%r13), %rax
movb $0x43, 0x1a(%rax)
addq $0x8, %r13
jmp 0x19361
andl $0x0, 0x192a2(%rip)     # 0x32698
andl $0x0, 0x1929f(%rip)     # 0x3269c
movl $0x6, 0x1928d(%rip)     # 0x32694
movq %r15, %rdi
movq %r14, %rsi
callq 0x34fc
testq %r13, %r13
sete %al
cmpl $0x6, 0x19279(%rip)     # 0x32698
sete %cl
andb %al, %cl
movzbl %cl, %eax
movl %eax, 0x19273(%rip)     # 0x326a0
cmpb $0x0, 0x19014(%rip)     # 0x32448
movq (%rsp), %r14
jne 0x194e1
leaq 0x1043b(%rip), %rax     # 0x29880
movq (%rax), %rsi
leaq 0x6afd(%rip), %rdi      # 0x1ff4c
xorl %eax, %eax
callq 0x106a9
cmpl $0x2, 0x1036b(%rip)     # 0x297c8
setge %al
cmpl $0x0, 0x19239(%rip)     # 0x326a0
setne %cl
andb %al, %cl
movl 0x1921e(%rip), %esi     # 0x32690
testl %esi, %esi
sete %al
testb %al, %cl
jne 0x1948f
movl 0x19217(%rip), %edx     # 0x32698
leaq 0x6ba6(%rip), %rdi      # 0x2002e
xorl %eax, %eax
callq 0x106a9
movq 0x20(%r14), %rdi
callq 0x18021
movl (%rax), %ebx
movq 0x20(%r14), %rdi
callq 0x18021
cmpl $0xf, %ebx
jb 0x194ac
movq 0x10(%rax), %rax
cmpl $0x9, (%rax)
je 0x194d3
movq 0x20(%r14), %rdi
callq 0x18021
movl (%rax), %ebx
movq 0x20(%r14), %rdi
callq 0x18021
cmpl $0xf, %ebx
jb 0x194ce
movq 0x10(%rax), %rax
cmpl $0xa, (%rax)
jne 0x194e1
leaq 0x6b63(%rip), %rdi      # 0x2003d
xorl %eax, %eax
callq 0x106a9
callq 0x3358
cmpb $0x1, 0x18f5b(%rip)     # 0x32448
jne 0x19509
leaq 0x4af3(%rip), %rdi      # 0x1dfe9
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