// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_che_s_trans_builtin_fork
er_t xoico_che_s_trans_builtin_fork( xoico_che_s* o, x_source* source, bl_t source_without_brackets, const xoico_che_result* result_expr, const xoico_typespec_s* typespec_expr, xoico_che_result* result_out, xoico_typespec_s* typespec_out )
{
    // xoico_che_builtin.x:367:1
    BLM_INIT_LEVEL(0);
    if( result_expr ) // member call
    {
        if( source_without_brackets )
        {
            BLM_TRY(x_source_parse_fa(source," " ))
        }
        else
        {
            BLM_TRY(x_source_parse_fa(source," ( " ))
        }
        xoico_che_result_a_clear(result_out);
    }
    else // direct call
    {BLM_INIT_LEVEL(1);
        BLM_TRY(x_source_parse_fa(source,"fork ( " ))
        xoico_che_result_arr_s* result = ((xoico_che_result_arr_s*)BLM_LEVEL_T_PUSH(1,xoico_che_result_arr_s,xoico_che_result_arr_s_create()));
        xoico_typespec_s* typespec = ((xoico_typespec_s*)BLM_LEVEL_T_PUSH(0,xoico_typespec_s,xoico_typespec_s_create()));
        BLM_TRY(xoico_che_s_trans_expression(o,source,((xoico_che_result*)( result)), typespec ))
        typespec_expr = typespec;
        result_expr =((const xoico_che_result*)( result));
    BLM_DOWN();}
    
    xoico_typespec_s* typespec_fork = ((xoico_typespec_s*)BLM_LEVEL_T_PUSH(0,xoico_typespec_s,xoico_typespec_s_clone(typespec_expr)));
    typespec_fork->access_class = TYPEOF_discardable;
    
    BLM_TRY(xoico_che_result_a_push_sc(result_out,"((" ))
    
    if( source_without_brackets )
    {
        BLM_TRY(x_source_parse_fa(source," " ))
    }
    else
    {
        BLM_TRY(x_source_parse_fa(source," )" ))
    }
    
    if( typespec_fork->type        == 0 ) BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Operator 'fork': Expression not tractable." ))
    if( typespec_fork->indirection != 1 ) BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Operator 'fork': Expression's indirection != 1." ))
    
    BLM_TRY(xoico_che_s_push_typespec(o,typespec_fork, result_out ))
    BLM_TRY(xoico_che_result_a_push_sc(result_out,")bcore_fork(" ))
    xoico_che_result_a_push_result_c(result_out,result_expr );
    BLM_TRY(xoico_che_result_a_push_sc(result_out,"))" ))
    
    if( typespec_out ) xoico_typespec_s_copy(typespec_out,typespec_fork );
    
    BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r9, %rbx
movq %r8, %r15
movq %rcx, %r12
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
leaq 0xf3128(%rip), %rax     # 0x117dd0
movq (%rax), %rsi
leaq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0x717f5
andq $0x0, 0x10(%r13)
testq %r12, %r12
je 0x24cd7
testb %bpl, %bpl
je 0x24d79
leaq 0x9caab(%rip), %rsi     # 0xc177d
jmp 0x24d80
leaq 0x48(%rsp), %r15
movq %r15, 0x40(%rsp)
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x717f5
movq $0x1, 0x10(%r15)
leaq 0x89b53(%rip), %rsi     # 0xae850
movq %r14, %rdi
xorl %eax, %eax
callq 0xd600
testq %rax, %rax
jne 0x24d6c
callq 0x2637f
leaq 0x48(%rsp), %r15
pushq $0x1
popq %rsi
movabsq $-0x7850996cdf80346a, %rdx # imm = 0x87AF6693207FCB96
movq %r15, %rdi
movq %rax, %rcx
callq 0x71967
movq %rax, %r12
callq 0xe090
movabsq $-0x641110359430e9c5, %rdx # imm = 0x9BEEEFCA6BCF163B
movq %r15, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x71967
movq %rax, %r15
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rax, %rcx
callq 0x1fc8a
testq %rax, %rax
je 0x24e93
movq %rax, %r13
leaq 0x48(%rsp), %rdi
jmp 0x24ec4
leaq 0x8993f(%rip), %rsi     # 0xae6bf
movq %r14, %rdi
xorl %eax, %eax
callq 0xd600
testq %rax, %rax
jne 0x24ebc
movq %rbx, %rdi
callq 0x235f4
movq %r15, %rdi
callq 0xe0b1
leaq 0x10(%rsp), %rdi
movabsq $-0x641110359430e9c5, %rdx # imm = 0x9BEEEFCA6BCF163B
xorl %esi, %esi
movq %rax, %rcx
callq 0x71967
movq %rax, %r15
movabsq $-0x12e90733f18038df, %rax # imm = 0xED16F8CC0E7FC721
movq %rax, 0x10(%r15)
leaq 0x897ed(%rip), %rsi     # 0xae5c1
movq %rbx, %rdi
callq 0x1d59d
testq %rax, %rax
jne 0x24ebc
testb %bpl, %bpl
je 0x24df3
leaq 0x9c98c(%rip), %rsi     # 0xc177d
jmp 0x24dfa
leaq 0xa40ec(%rip), %rsi     # 0xc8ee6
movq %r14, %rdi
xorl %eax, %eax
callq 0xd600
testq %rax, %rax
movq 0x8(%rsp), %rdi
jne 0x24ebc
cmpq $0x0, 0x8(%r15)
je 0x24ea2
cmpq $0x1, 0x20(%r15)
jne 0x24eab
movq %r15, %rsi
movq %rbx, %rdx
callq 0x1d30a
testq %rax, %rax
jne 0x24ebc
leaq 0x89a70(%rip), %rsi     # 0xae8b3
movq %rbx, %rdi
callq 0x1d59d
testq %rax, %rax
jne 0x24ebc
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1e42a
leaq 0x88579(%rip), %rsi     # 0xad3db
movq %rbx, %rdi
callq 0x1d59d
testq %rax, %rax
jne 0x24ebc
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x24e84
movq %r15, %rsi
callq 0xe075
leaq 0x10(%rsp), %rdi
callq 0x71b64
xorl %r13d, %r13d
jmp 0x24ec9
leaq 0x40(%rsp), %rdi
callq 0x71b48
jmp 0x24d9b
leaq 0x899af(%rip), %rsi     # 0xae858
jmp 0x24eb2
leaq 0x899d1(%rip), %rsi     # 0xae883
movq %r14, %rdi
xorl %eax, %eax
callq 0xd7c4
movq %rax, %r13
leaq 0x10(%rsp), %rdi
callq 0x71b64
movq %r13, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq