// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/parse.c
// Function: parse_expr
ast_node* parse_expr(parse_state* state, scope* sc) {
    token* tok = (void*)0;

    // invalid pointer type
    ast_node* node = parse_term(state, sc);

    if (state->current_token->type == _LBRACKET) {
        tok = state->current_token;
        parse_eat(state, _LBRACKET);
        ast_node_vecptr* vecptrnode = init_ast_node_vecptr((void*)0, node, parse_expr(state, sc));
        parse_eat(state, _RBRACKET);
        return (ast_node*) vecptrnode;
    }

    while(
            state->current_token->type == _OP_PLUS ||
            state->current_token->type == _OP_SUBTRACT ||
            state->current_token->type == _NOT_EQUALS ||
            state->current_token->type == _LESS_THAN ||
            state->current_token->type == _LARGER_THAN ||
            state->current_token->type == _LESS_OR_EQUALS ||
            state->current_token->type == _LARGER_OR_EQUALS ||
            state->current_token->type == _EQUALS_EQUALS ||
            state->current_token->type == _DOT
         ) {
        tok = state->current_token;

        if (tok->type == _OP_PLUS) {
            parse_eat(state, _OP_PLUS);
        } else if (tok->type == _OP_SUBTRACT) {
            parse_eat(state, _OP_SUBTRACT);
        } else if (tok->type == _NOT_EQUALS) {
            parse_eat(state, _NOT_EQUALS);
        } else if (tok->type == _LESS_THAN) {
            parse_eat(state, _LESS_THAN);
        } else if (tok->type == _LARGER_THAN) {
            parse_eat(state, _LARGER_THAN);
        } else if (tok->type == _LESS_OR_EQUALS) {
            parse_eat(state, _LESS_OR_EQUALS);
        } else if (tok->type == _LARGER_OR_EQUALS) {
            parse_eat(state, _LARGER_OR_EQUALS);
        } else if (tok->type == _EQUALS_EQUALS) {
            parse_eat(state, _EQUALS_EQUALS);
        } else if (tok->type == _DOT) {
            parse_eat(state, _DOT);
        }

        // invalid pointer type
        node = (ast_node*) init_ast_node_binop(tok, node, parse_term(state, sc));
        ast_node_set_scope((ast_node*) node, (struct scope*) sc);
    };

    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5370
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x22, (%rax)
jne 0x4704
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movl $0x22, %esi
callq 0x4520
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4670
movq -0x38(%rbp), %rsi
movq %rax, %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x19f0
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movl $0x23, %esi
callq 0x4520
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4909
jmp 0x4706
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movb $0x1, %al
cmpl $0x5, (%rcx)
movb %al, -0x39(%rbp)
je 0x47ab
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movb $0x1, %al
cmpl $0x6, (%rcx)
movb %al, -0x39(%rbp)
je 0x47ab
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movb $0x1, %al
cmpl $0x1a, (%rcx)
movb %al, -0x39(%rbp)
je 0x47ab
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movb $0x1, %al
cmpl $0x16, (%rcx)
movb %al, -0x39(%rbp)
je 0x47ab
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movb $0x1, %al
cmpl $0x17, (%rcx)
movb %al, -0x39(%rbp)
je 0x47ab
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movb $0x1, %al
cmpl $0x18, (%rcx)
movb %al, -0x39(%rbp)
je 0x47ab
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movb $0x1, %al
cmpl $0x19, (%rcx)
movb %al, -0x39(%rbp)
je 0x47ab
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movb $0x1, %al
cmpl $0x24, (%rcx)
movb %al, -0x39(%rbp)
je 0x47ab
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x15, (%rax)
sete %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0x47b7
jmp 0x4901
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x5, (%rax)
jne 0x47df
movq -0x10(%rbp), %rdi
movl $0x5, %esi
callq 0x4520
jmp 0x48be
movq -0x20(%rbp), %rax
cmpl $0x6, (%rax)
jne 0x47fb
movq -0x10(%rbp), %rdi
movl $0x6, %esi
callq 0x4520
jmp 0x48bc
movq -0x20(%rbp), %rax
cmpl $0x1a, (%rax)
jne 0x4817
movq -0x10(%rbp), %rdi
movl $0x1a, %esi
callq 0x4520
jmp 0x48ba
movq -0x20(%rbp), %rax
cmpl $0x16, (%rax)
jne 0x4833
movq -0x10(%rbp), %rdi
movl $0x16, %esi
callq 0x4520
jmp 0x48b8
movq -0x20(%rbp), %rax
cmpl $0x17, (%rax)
jne 0x484c
movq -0x10(%rbp), %rdi
movl $0x17, %esi
callq 0x4520
jmp 0x48b6
movq -0x20(%rbp), %rax
cmpl $0x18, (%rax)
jne 0x4865
movq -0x10(%rbp), %rdi
movl $0x18, %esi
callq 0x4520
jmp 0x48b4
movq -0x20(%rbp), %rax
cmpl $0x19, (%rax)
jne 0x487e
movq -0x10(%rbp), %rdi
movl $0x19, %esi
callq 0x4520
jmp 0x48b2
movq -0x20(%rbp), %rax
cmpl $0x24, (%rax)
jne 0x4897
movq -0x10(%rbp), %rdi
movl $0x24, %esi
callq 0x4520
jmp 0x48b0
movq -0x20(%rbp), %rax
cmpl $0x15, (%rax)
jne 0x48ae
movq -0x10(%rbp), %rdi
movl $0x15, %esi
callq 0x4520
jmp 0x48b0
jmp 0x48b2
jmp 0x48b4
jmp 0x48b6
jmp 0x48b8
jmp 0x48ba
jmp 0x48bc
jmp 0x48be
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5370
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq %rax, %rdx
callq 0x1370
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x12f0
jmp 0x4706
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)