// File: joncampbell123[P]haxcc/haxpp.cpp
// Function: parse_expr_ltr(expression&, __gnu_cxx::__normal_iterator<token*, std::vector<token, std::allocator<token>>>&, __gnu_cxx::__normal_iterator<token*, std::vector<token, std::allocator<token>>> const&, unsigned int, tokenlist_entry const*, unsigned long)
expression::node::node_t parse_expr_ltr(expression &expr,token_string::iterator &ti,const token_string::iterator &tie,unsigned int min_prec,const tokenlist_entry *match_token,expression::node::node_t headnode) {
    token::token_t repl;
    unsigned int prec;

    while (ti != tie && match_token_list(repl,*ti,match_token) && (prec=token::precedence(*ti,false)) <= min_prec) {
        const expression::node::node_t opnode = expr.newnode(*(ti++),repl);

        if (ti != tie) {
            expr.getnode(opnode).children.resize(2);
            expr.getnode(opnode).children[0] = headnode;
            expr.getnode(opnode).children[1] = parse_expr(expr,ti,tie,prec-1u);
            headnode = opnode;
        }
        else {
            throw invalid_argument("missing rvalue");
        }
    }

    return headnode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x16580
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x55(%rbp)
jne 0x1150d
jmp 0x11553
movq -0x10(%rbp), %rdi
callq 0x16600
movq %rax, %rsi
movq -0x28(%rbp), %rdx
leaq -0x34(%rbp), %rdi
callq 0x10ad0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x55(%rbp)
jne 0x11534
jmp 0x11553
movq -0x10(%rbp), %rdi
callq 0x16600
movq %rax, %rdi
xorl %esi, %esi
callq 0x3a50
movl %eax, -0x38(%rbp)
cmpl -0x1c(%rbp), %eax
setbe %al
movb %al, -0x55(%rbp)
movb -0x55(%rbp), %al
testb $0x1, %al
jne 0x1155f
jmp 0x11691
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x165c0
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x16600
movq -0x60(%rbp), %rdi
movq %rax, %rsi
movl -0x34(%rbp), %edx
callq 0x10a50
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x16580
testb $0x1, %al
jne 0x115a8
jmp 0x1163c
movq -0x8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x16810
movq %rax, %rdi
addq $0x70, %rdi
movl $0x2, %esi
callq 0x168c0
movq -0x30(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x16810
movq %rax, %rdi
addq $0x70, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x16950
movq -0x70(%rbp), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x38(%rbp), %ecx
subl $0x1, %ecx
callq 0x10cd0
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x16810
movq %rax, %rdi
addq $0x70, %rdi
movl $0x1, %esi
callq 0x16950
movq -0x68(%rbp), %rcx
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x1168c
movl $0x10, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x78(%rbp)
leaq 0x13e8d(%rip), %rsi     # 0x254e4
callq 0x3530
jmp 0x1165e
movq -0x78(%rbp), %rdi
movq 0x2196f(%rip), %rsi     # 0x32fd8
movq 0x21950(%rip), %rdx     # 0x32fc0
callq 0x34b0
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
callq 0x31f0
jmp 0x1169e
jmp 0x114f2
movq -0x30(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x34e0
nopw (%rax,%rax)