// File: /workspace/github_c_makefile_star2_O0/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_unary_expr
static fin_ast_expr_t* fin_ast_parse_unary_expr(fin_ctx_t* ctx, fin_lex_t* lex) {
    fin_ast_unary_type_t op;
    if (fin_lex_match(lex, fin_lex_type_plus))
        op = fin_ast_unary_type_pos;
    else if (fin_lex_match(lex, fin_lex_type_minus))
        op = fin_ast_unary_type_neg;
    else if (fin_lex_match(lex, fin_lex_type_bang))
        op = fin_ast_unary_type_not;
    else if (fin_lex_match(lex, fin_lex_type_tilde))
        op = fin_ast_unary_type_bnot;
    else if (fin_lex_match(lex, fin_lex_type_plus_plus))
        op = fin_ast_unary_type_inc;
    else if (fin_lex_match(lex, fin_lex_type_minus_minus))
        op = fin_ast_unary_type_dec;
    else if (fin_lex_get_type(lex) == fin_lex_type_l_paren)
        return fin_ast_parse_const_expr(ctx, lex);
    else if (fin_lex_get_type(lex) == fin_lex_type_int)
        return fin_ast_parse_const_expr(ctx, lex);
    else if (fin_lex_get_type(lex) == fin_lex_type_float)
        return fin_ast_parse_const_expr(ctx, lex);
    else if (fin_lex_get_type(lex) == fin_lex_type_bool)
        return fin_ast_parse_const_expr(ctx, lex);
    else if (fin_lex_get_type(lex) == fin_lex_type_string)
        return fin_ast_parse_const_expr(ctx, lex);
    else if (fin_lex_get_type(lex) == fin_lex_type_quot)
        return fin_ast_parse_str_interp_expr(ctx, lex);
    else {
        fin_ast_expr_t* tmp_expr = fin_ast_parse_assign_expr(ctx, lex, NULL);
        if (tmp_expr->type == fin_ast_expr_type_id)
            return fin_lex_get_type(lex) == fin_lex_type_l_paren ? fin_ast_parse_invoke_expr(ctx, lex, tmp_expr) : tmp_expr;
        return tmp_expr;
    }

    fin_ast_expr_t* expr = fin_ast_parse_unary_expr(ctx, lex);
    fin_ast_unary_expr_t* un_expr = (fin_ast_unary_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_unary_expr_t));
    un_expr->base.type = fin_ast_expr_type_unary;
    un_expr->op = op;
    un_expr->expr = expr;
    return &un_expr->base;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x12, %esi
callq 0x6cd0
testb $0x1, %al
jne 0x4b74
jmp 0x4b80
movl $0x0, -0x1c(%rbp)
jmp 0x4d61
movq -0x18(%rbp), %rdi
movl $0x13, %esi
callq 0x6cd0
testb $0x1, %al
jne 0x4b94
jmp 0x4ba0
movl $0x1, -0x1c(%rbp)
jmp 0x4d5f
movq -0x18(%rbp), %rdi
movl $0x11, %esi
callq 0x6cd0
testb $0x1, %al
jne 0x4bb4
jmp 0x4bc0
movl $0x2, -0x1c(%rbp)
jmp 0x4d5d
movq -0x18(%rbp), %rdi
movl $0xe, %esi
callq 0x6cd0
testb $0x1, %al
jne 0x4bd4
jmp 0x4be0
movl $0x3, -0x1c(%rbp)
jmp 0x4d5b
movq -0x18(%rbp), %rdi
movl $0x18, %esi
callq 0x6cd0
testb $0x1, %al
jne 0x4bf4
jmp 0x4c00
movl $0x4, -0x1c(%rbp)
jmp 0x4d59
movq -0x18(%rbp), %rdi
movl $0x19, %esi
callq 0x6cd0
testb $0x1, %al
jne 0x4c14
jmp 0x4c20
movl $0x5, -0x1c(%rbp)
jmp 0x4d57
movq -0x18(%rbp), %rdi
callq 0x6d10
cmpl $0x2e, %eax
jne 0x4c44
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4dc0
movq %rax, -0x8(%rbp)
jmp 0x4dad
movq -0x18(%rbp), %rdi
callq 0x6d10
cmpl $0x1, %eax
jne 0x4c68
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4dc0
movq %rax, -0x8(%rbp)
jmp 0x4dad
movq -0x18(%rbp), %rdi
callq 0x6d10
cmpl $0x2, %eax
jne 0x4c8c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4dc0
movq %rax, -0x8(%rbp)
jmp 0x4dad
movq -0x18(%rbp), %rdi
callq 0x6d10
cmpl $0x0, %eax
jne 0x4cb0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4dc0
movq %rax, -0x8(%rbp)
jmp 0x4dad
movq -0x18(%rbp), %rdi
callq 0x6d10
cmpl $0x3, %eax
jne 0x4cd4
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4dc0
movq %rax, -0x8(%rbp)
jmp 0x4dad
movq -0x18(%rbp), %rdi
callq 0x6d10
cmpl $0x5, %eax
jne 0x4cf8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4f50
movq %rax, -0x8(%rbp)
jmp 0x4dad
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x4200
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x4d4d
movq -0x18(%rbp), %rdi
callq 0x6d10
cmpl $0x2e, %eax
jne 0x4d3b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x4130
movq %rax, -0x40(%rbp)
jmp 0x4d43
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4dad
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4dad
jmp 0x4d59
jmp 0x4d5b
jmp 0x4d5d
jmp 0x4d5f
jmp 0x4d61
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4b50
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edi
movl $0x10, %esi
callq *(%rax)
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl $0x6, (%rax)
movl -0x1c(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)