// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_wrap_s_finalize
er_t xoico_wrap_s_finalize( xoico_wrap_s* o, const xoico_host* host )
{
    // xoico_wrap.x:42:5
    BLM_INIT_LEVEL(0);
    xoico_compiler_s* compiler = xoico_host_a_compiler(host);
    const xoico_group_s* group = xoico_compiler_s_get_group(compiler,o->group_name );
    if( !group ) BLM_TRY(x_source_point_s_parse_error_fa(&(o->source_point),"Wrap: '#<sc_t>' is not a group.", xoico_compiler_s_nameof(compiler,o->group_name ) ))
    const xoico_func_s* func = xoico_group_s_get_func(group,o->func_name );
    if( !func ) BLM_TRY(x_source_point_s_parse_error_fa(&(o->source_point),"Wrap: '#<sc_t>' is not a function in group '#<sc_t>'.", xoico_compiler_s_nameof(compiler,o->func_name ), xoico_compiler_s_nameof(compiler,o->group_name ) ))
    
    xoico_signature_s_attach( &(o->signature ),  xoico_signature_s_clone(xoico_compiler_s_get_signature(compiler,func->signature->global_name )));
    BLM_TRY(xoico_signature_s_set_global_name(o->signature,host ))
    BLM_TRY(xoico_signature_s_convert_transient_types(o->signature,host, xoico_host_a_transient_map(host) ))
    BLM_TRY(xoico_compiler_s_register_item(compiler,((const xoico*)(o->signature ))))
    
    BCORE_PASS_CREATE(xoico_func_s,o->func);
    o->func->name = o->signature->name;
    o->func->signature_global_name = o->signature->global_name;
    
    st_s* st = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,st_s_create()));
    st_s_push_fa(st,"{" );
    if( xoico_signature_s_returns_a_value(o->signature) ) st_s_push_sc(st,"return " );
    
    st_s_push_fa(st,"#<sc_t>_#<sc_t>(", xoico_host_a_nameof(host,group->tp_name ), xoico_host_a_nameof(host,func->name ) );
    
    if( o->signature->arg_o )
    {
        BLM_TRY(xoico_arg_s_expand_name(o->signature->arg_o,host,((x_sink*)( st ))))
        BLM_TRY(xoico_args_s_expand_name(&(o->signature->args),host, false,((x_sink*)( st ))))
    }
    else
    {
        BLM_TRY(xoico_args_s_expand_name(&(o->signature->args),host, true,((x_sink*)( st ))))
    }
    
    st_s_push_fa(st,");};" );
    
    BCORE_PASS_CREATE(xoico_body_s,o->func->body);
    BLM_TRY(xoico_body_s_parse(o->func->body,host, ((x_source*)BLM_LEVEL_A_PUSH(0,x_source_create_from_sc(st->sc ))) ))
    
    BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq 0x19a466(%rip), %rax    # 0x1b2330
movq (%rax), %rax
movq %rax, -0x20(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xbfe80
movq -0x58(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x18(%rbp), %rdi
callq 0x5170
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x10480
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
jne 0x17f86
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x118(%rbp)
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x51d0
movq -0x118(%rbp), %rdi
movq %rax, %rdx
leaq 0x11cc46(%rip), %rsi    # 0x134b9a
movb $0x0, %al
callq 0x7d20
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
je 0x17f84
movq -0x70(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x58(%rbp), %rdi
callq 0xc0720
movq -0x78(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x18480
jmp 0x17f86
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x10700
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
jne 0x18037
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x128(%rbp)
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x51d0
movq %rax, -0x120(%rbp)
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x51d0
movq -0x128(%rbp), %rdi
movq -0x120(%rbp), %rdx
movq %rax, %rcx
leaq 0x11cbc4(%rip), %rsi    # 0x134bba
movb $0x0, %al
callq 0x7d20
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x18035
movq -0x88(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x58(%rbp), %rdi
callq 0xc0720
movq -0x90(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x18480
jmp 0x18037
movq -0x10(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x130(%rbp)
movq -0x60(%rbp), %rdi
movq -0x80(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x18(%rax), %rsi
callq 0x9b10
movq %rax, %rdi
callq 0x8c60
movq -0x130(%rbp), %rdi
movq %rax, %rsi
callq 0xc210
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x9150
movq %rax, -0x98(%rbp)
cmpq $0x0, -0x98(%rbp)
je 0x180bb
movq -0x98(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x58(%rbp), %rdi
callq 0xc0720
movq -0xa0(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x18480
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x140(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x18(%rbp), %rdi
callq 0xc290
movq -0x140(%rbp), %rdi
movq -0x138(%rbp), %rsi
movq %rax, %rdx
callq 0x8ca0
movq %rax, -0xa8(%rbp)
cmpq $0x0, -0xa8(%rbp)
je 0x1812c
movq -0xa8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x58(%rbp), %rdi
callq 0xc0720
movq -0xb0(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x18480
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0xc180
movq %rax, -0xb8(%rbp)
cmpq $0x0, -0xb8(%rbp)
je 0x18175
movq -0xb8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x58(%rbp), %rdi
callq 0xc0720
movq -0xc0(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x18480
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
leaq -0xcbe4(%rip), %rsi     # 0xb5a0
callq 0x6750
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rcx, 0x20(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x148(%rbp)
movb $0x0, %al
callq 0xff2e0
movq -0x148(%rbp), %rdi
movq %rax, %rcx
xorl %eax, %eax
movl %eax, %esi
movabsq $-0x503db0e6e1c2e704, %rdx # imm = 0xAFC24F191E3D18FC
callq 0xc01a0
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rdi
leaq 0x13560f(%rip), %rsi    # 0x14d80c
movb $0x0, %al
callq 0x100210
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xf0a0
testb $0x1, %al
jne 0x18217
jmp 0x1822a
movq -0xc8(%rbp), %rdi
leaq 0x11bb42(%rip), %rsi    # 0x133d67
callq 0x100040
movq -0xc8(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x18(%rbp), %rdi
movq -0x68(%rbp), %rax
movq 0xa8(%rax), %rsi
callq 0x5a60
movq %rax, -0x150(%rbp)
movq -0x18(%rbp), %rdi
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x5a60
movq -0x158(%rbp), %rdi
movq -0x150(%rbp), %rdx
movq %rax, %rcx
leaq 0x11c974(%rip), %rsi    # 0x134bf0
movb $0x0, %al
callq 0x100210
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
cmpq $0x0, 0x50(%rax)
je 0x18342
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x50(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0xc8(%rbp), %rdx
callq 0x7f40
movq %rax, -0xd0(%rbp)
cmpq $0x0, -0xd0(%rbp)
je 0x182ea
movq -0xd0(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x58(%rbp), %rdi
callq 0xc0720
movq -0xd8(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x18480
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
addq $0x58, %rdi
movq -0x18(%rbp), %rsi
movq -0xc8(%rbp), %rcx
xorl %edx, %edx
callq 0x8970
movq %rax, -0xe0(%rbp)
cmpq $0x0, -0xe0(%rbp)
je 0x18340
movq -0xe0(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x58(%rbp), %rdi
callq 0xc0720
movq -0xe8(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x18480
jmp 0x1839d
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
addq $0x58, %rdi
movq -0x18(%rbp), %rsi
movq -0xc8(%rbp), %rcx
movl $0x1, %edx
callq 0x8970
movq %rax, -0xf0(%rbp)
cmpq $0x0, -0xf0(%rbp)
je 0x1839b
movq -0xf0(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x58(%rbp), %rdi
callq 0xc0720
movq -0xf8(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x18480
jmp 0x1839d
movq -0xc8(%rbp), %rdi
leaq 0x11c856(%rip), %rsi    # 0x134c01
movb $0x0, %al
callq 0x100210
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
addq $0x38, %rdi
leaq -0xd985(%rip), %rsi     # 0xaa40
callq 0x6750
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x38(%rax), %rax
movq %rax, -0x168(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x4e20
movq -0x170(%rbp), %rdi
movq %rax, %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0xc0500
movq -0x168(%rbp), %rdi
movq -0x160(%rbp), %rsi
movq %rax, %rdx
callq 0xaf90
movq %rax, -0x100(%rbp)
cmpq $0x0, -0x100(%rbp)
je 0x18461
movq -0x100(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x58(%rbp), %rdi
callq 0xc0720
movq -0x108(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x18480
movq $0x0, -0x110(%rbp)
movq -0x58(%rbp), %rdi
callq 0xc0720
movq -0x110(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopl (%rax)