// File: /workspace/github_c_makefile_star2_O1/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, 0x17a4d(%rip)     # 0x32448
jne 0x1aa1f
movq (%rbx), %rsi
leaq 0x757a(%rip), %rdi      # 0x21f81
xorl %eax, %eax
callq 0x30c0
movq (%rbx), %rsi
leaq 0x757f(%rip), %rdi      # 0x21f97
xorl %eax, %eax
callq 0x30c0
xorl %ecx, %ecx
movl %ecx, 0x17c69(%rip)     # 0x32690
movl %ecx, 0x17c67(%rip)     # 0x32694
movl %ecx, 0x17c65(%rip)     # 0x32698
movq (%rbx), %rax
leaq 0xee43(%rip), %r12      # 0x29880
movq %rax, (%r12)
leaq 0x17b48(%rip), %rdx     # 0x32590
leaq 0x76fc(%rip), %rax      # 0x2214b
movq (%rcx,%rdx), %rsi
movq %rax, (%rsi)
addq $0x8, %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x1aa4f
movl $0x8, %ecx
leaq 0x17a21(%rip), %rdx     # 0x32490
movq (%rdx,%rcx,8), %rsi
movq %rax, (%rsi)
incq %rcx
cmpq $0x20, %rcx
jne 0x1aa6f
cmpq $0x0, (%r15)
je 0x1ab51
leaq 0x7515(%rip), %rbp      # 0x21fa5
leaq 0x7518(%rip), %r12      # 0x21faf
xorl %r13d, %r13d
cmpq $0x0, (%r14,%r13,8)
je 0x1ab5c
cmpb $0x0, 0x1799c(%rip)     # 0x32448
movq %r12, %rdi
cmovneq %rbp, %rdi
movl 0x17bdb(%rip), %esi     # 0x32694
xorl %eax, %eax
callq 0x11c7f
movq (%r15,%r13,8), %rcx
movq %rax, (%rcx)
movq (%r15,%r13,8), %rax
movb $0x41, 0x8(%rax)
movq 0x20(%rax), %rax
movl 0x8(%rax), %eax
addl %eax, 0x17bb8(%rip)     # 0x32694
cmpl $0x2, 0xece5(%rip)      # 0x297c8
jl 0x1ab06
movq (%r14,%r13,8), %rax
cmpb $0x4e, 0x1a(%rax)
jne 0x1ab06
movslq 0x17b9a(%rip), %rcx     # 0x32690
cmpq $0x8, %rcx
je 0x1ab06
movq 0x20(%rax), %rdx
cmpl $0x5, 0x8(%rdx)
jne 0x1ab34
movq (%r15,%r13,8), %rax
movb 0x8(%rax), %cl
movq (%r14,%r13,8), %rdx
movb %cl, 0x8(%rdx)
movq (%rax), %rax
movq %rax, (%rdx)
movq (%r14,%r13,8), %rax
movb $0x43, 0x1a(%rax)
cmpq $0x0, 0x8(%r15,%r13,8)
leaq 0x1(%r13), %r13
jne 0x1aa9a
jmp 0x1ab56
leaq 0x17915(%rip), %rdx     # 0x32450
movq (%rdx,%rcx,8), %rdx
movq %rdx, (%rax)
movb $0x52, 0x8(%rax)
leal 0x1(%rcx), %eax
movl %eax, 0x17b41(%rip)     # 0x32690
jmp 0x1ab22
movb $0x1, %bpl
jmp 0x1ab6a
movl $0x1, %r13d
testl %r13d, %r13d
sete %bpl
leaq 0xed16(%rip), %r12      # 0x29880
xorl %eax, %eax
movl %eax, 0x17b26(%rip)     # 0x32698
movl %eax, 0x17b24(%rip)     # 0x3269c
movl $0x6, 0x17b12(%rip)     # 0x32694
movq %r15, %rdi
movq %r14, %rsi
callq 0x36b0
cmpl $0x6, 0x17b04(%rip)     # 0x32698
sete %al
andb %bpl, %al
movzbl %al, %eax
movl %eax, 0x17afd(%rip)     # 0x326a0
cmpb $0x0, 0x1789e(%rip)     # 0x32448
jne 0x1ac4d
movq (%r12), %rsi
leaq 0x7311(%rip), %rdi      # 0x21ecc
xorl %eax, %eax
callq 0x1187e
cmpl $0x2, 0xebff(%rip)      # 0x297c8
setge %al
cmpl $0x0, 0x17acd(%rip)     # 0x326a0
setne %cl
andb %al, %cl
movl 0x17ab2(%rip), %esi     # 0x32690
testl %esi, %esi
sete %al
testb %al, %cl
jne 0x1abfb
movl 0x17aab(%rip), %edx     # 0x32698
leaq 0x73c3(%rip), %rdi      # 0x21fb7
xorl %eax, %eax
callq 0x1187e
movq 0x20(%rbx), %rdi
callq 0x197d4
movl (%rax), %ebp
movq 0x20(%rbx), %rdi
callq 0x197d4
cmpl $0xf, %ebp
jb 0x1ac18
movq 0x10(%rax), %rax
cmpl $0x9, (%rax)
je 0x1ac3f
movq 0x20(%rbx), %rdi
callq 0x197d4
movl (%rax), %ebp
movq 0x20(%rbx), %rdi
callq 0x197d4
cmpl $0xf, %ebp
jb 0x1ac3a
movq 0x10(%rax), %rax
cmpl $0xa, (%rax)
jne 0x1ac4d
leaq 0x7380(%rip), %rdi      # 0x21fc6
xorl %eax, %eax
callq 0x1187e
callq 0x34ef
cmpb $0x1, 0x177ef(%rip)     # 0x32448
jne 0x1ac75
leaq 0x5301(%rip), %rdi      # 0x1ff63
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