// File: /workspace/github_c_makefile_star2_O0/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_const_expr
static fin_ast_expr_t* fin_ast_parse_const_expr(fin_ctx_t* ctx, fin_lex_t* lex) {
    if (fin_lex_get_type(lex) == fin_lex_type_bool) {
        fin_ast_bool_expr_t* bool_expr = (fin_ast_bool_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_bool_expr_t));
        bool_expr->base.type = fin_ast_expr_type_bool;
        bool_expr->value = fin_lex_consume_bool(lex);
        return &bool_expr->base;
    }
    else if (fin_lex_get_type(lex) == fin_lex_type_int) {
        fin_ast_int_expr_t* int_expr = (fin_ast_int_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_int_expr_t));
        int_expr->base.type = fin_ast_expr_type_int;
        int_expr->value = fin_lex_consume_int(lex);
        return &int_expr->base;
    }
    else if (fin_lex_get_type(lex) == fin_lex_type_float) {
        fin_ast_float_expr_t* float_expr = (fin_ast_float_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_float_expr_t));
        float_expr->base.type = fin_ast_expr_type_float;
        float_expr->value = fin_lex_consume_float(lex);
        return &float_expr->base;
    }
    else if (fin_lex_get_type(lex) == fin_lex_type_string) {
        fin_ast_str_expr_t* str_expr = (fin_ast_str_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_str_expr_t));
        str_expr->base.type = fin_ast_expr_type_str;
        str_expr->value = fin_str_from_lex(ctx, fin_lex_consume_string(lex));
        return &str_expr->base;
    }
    else {
        assert(0);
        return NULL;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6d10
cmpl $0x0, %eax
jne 0x4e1d
movq -0x10(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edi
movl $0x8, %esi
callq *(%rax)
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl $0x1, (%rax)
movq -0x18(%rbp), %rdi
callq 0x6d30
movb %al, %cl
movq -0x20(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x4(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4f3a
movq -0x18(%rbp), %rdi
callq 0x6d10
cmpl $0x1, %eax
jne 0x4e69
movq -0x10(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edi
movl $0x10, %esi
callq *(%rax)
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl $0x2, (%rax)
movq -0x18(%rbp), %rdi
callq 0x6d70
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4f3a
movq -0x18(%rbp), %rdi
callq 0x6d10
cmpl $0x2, %eax
jne 0x4eb3
movq -0x10(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edi
movl $0x10, %esi
callq *(%rax)
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl $0x3, (%rax)
movq -0x18(%rbp), %rdi
callq 0x6db0
movq -0x30(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4f3a
movq -0x18(%rbp), %rdi
callq 0x6d10
cmpl $0x3, %eax
jne 0x4f1b
movq -0x10(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edi
movl $0x10, %esi
callq *(%rax)
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl $0x4, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6df0
movq -0x50(%rbp), %rdi
movq %rax, -0x48(%rbp)
movl %edx, -0x40(%rbp)
movq -0x48(%rbp), %rsi
movl -0x40(%rbp), %edx
callq 0x3b30
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4f3a
leaq 0x82f3(%rip), %rdi      # 0xd215
leaq 0x82ee(%rip), %rsi      # 0xd217
movl $0x88, %edx
leaq 0x8321(%rip), %rcx      # 0xd256
callq 0x3110
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)