// File: sighingnow[P]compile-pascal/pl0_parser.cpp
// Function: pl0_expression_fn(input_t*)
pair<int, pl0_ast_expression *> pl0_expression_fn(input_t *text) {
    auto res1 = ((~pl0_addop) + pl0_term)(text);
    pair<int, pl0_ast_expression *> ans;
    if (std::get<0>(res1) == -1) {
        auto vec = std::vector<std::pair<struct pl0_ast_addop *, struct pl0_ast_term *>>();
        ans = make_pair(-1, new pl0_ast_expression(text->locate(), vec));
    }
    else {
        std::pair<struct pl0_ast_addop *, struct pl0_ast_term *> head;
        int headlen = std::get<0>(res1);
        if (std::get<1>(res1).first == nullptr) {
            head = make_pair(new pl0_ast_addop(text->locate(), '+'), std::get<1>(res1).second); // default: '+'
        }
        else {
            head = std::get<1>(res1);
        }
        auto res2 = (++(pl0_addop + pl0_term))(text->drop(headlen));
        auto vec = std::get<1>(res2);
        vec.emplace(vec.begin(), head);
        ans = make_pair(headlen + std::get<0>(res2), new pl0_ast_expression(text->locate(), vec));
    }
    if (verbose) {
        cout << "parsing: Expression" << endl;
    }
    return ans;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x400, %rsp            # imm = 0x400
movq %rdi, -0x18(%rbp)
leaq 0x14e5ba(%rip), %rsi    # 0x1602e0
leaq -0x128(%rbp), %rdi
movq %rdi, -0x378(%rbp)
callq 0x24530
movq -0x378(%rbp), %rsi
leaq 0x14e431(%rip), %rdx    # 0x160178
leaq -0xe0(%rbp), %rdi
callq 0x244f0
jmp 0x11d55
movq -0x18(%rbp), %rdx
leaq -0x50(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x24560
jmp 0x11d6b
leaq -0xe0(%rbp), %rdi
callq 0x249b0
leaq -0x128(%rbp), %rdi
callq 0x249e0
leaq -0x10(%rbp), %rdi
callq 0x24a00
jmp 0x11d8e
leaq -0x50(%rbp), %rdi
callq 0x24a20
cmpl $-0x1, (%rax)
jne 0x11f27
xorps %xmm0, %xmm0
movaps %xmm0, -0x150(%rbp)
movq $0x0, -0x140(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x24a40
movl $0xffffffff, -0x164(%rbp) # imm = 0xFFFFFFFF
movl $0x20, %edi
callq 0x5340
movq %rax, -0x380(%rbp)
jmp 0x11dde
movq -0x18(%rbp), %rdi
callq 0x1a350
movq %rax, -0x388(%rbp)
jmp 0x11df0
movq -0x380(%rbp), %rdi
movq -0x388(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rsi
leaq -0x150(%rbp), %rdx
callq 0x24a90
jmp 0x11e1a
movq -0x380(%rbp), %rax
movq %rax, -0x170(%rbp)
leaq -0x164(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x24a60
movq %rdx, -0x398(%rbp)
movl %eax, -0x38c(%rbp)
jmp 0x11e4a
movq -0x398(%rbp), %rax
movl -0x38c(%rbp), %ecx
movl %ecx, -0x160(%rbp)
movq %rax, -0x158(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x24ad0
leaq -0x150(%rbp), %rdi
callq 0x24b00
jmp 0x122f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x130(%rbp)
movl %eax, -0x134(%rbp)
jmp 0x11eb7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x130(%rbp)
movl %eax, -0x134(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x249b0
leaq -0x128(%rbp), %rdi
callq 0x249e0
jmp 0x1234e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x130(%rbp)
movl %eax, -0x134(%rbp)
jmp 0x12345
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x130(%rbp)
movl %eax, -0x134(%rbp)
jmp 0x11f16
movq -0x380(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x130(%rbp)
movl %eax, -0x134(%rbp)
movl $0x20, %esi
callq 0x5350
leaq -0x150(%rbp), %rdi
callq 0x24b00
jmp 0x12345
leaq -0x188(%rbp), %rdi
callq 0x24b60
jmp 0x11f35
leaq -0x50(%rbp), %rdi
callq 0x24a20
movl (%rax), %eax
movl %eax, -0x18c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x24b80
cmpq $0x0, (%rax)
jne 0x12042
movl $0x10, %edi
callq 0x5340
movq %rax, -0x3a0(%rbp)
jmp 0x11f6c
movq -0x18(%rbp), %rdi
callq 0x1a350
movq %rax, -0x3a8(%rbp)
jmp 0x11f7e
movq -0x3a0(%rbp), %rdi
movq -0x3a8(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movb $0x2b, -0x1b1(%rbp)
movq -0x1b0(%rbp), %rsi
leaq -0x1b1(%rbp), %rdx
callq 0x1e7d0
jmp 0x11faf
movq -0x3a0(%rbp), %rax
movq %rax, -0x1a8(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x24b80
movq %rax, %rsi
addq $0x8, %rsi
leaq -0x1a8(%rbp), %rdi
callq 0x24ba0
movq %rdx, -0x3b8(%rbp)
movq %rax, -0x3b0(%rbp)
jmp 0x11fe9
movq -0x3b8(%rbp), %rax
movq -0x3b0(%rbp), %rcx
movq %rcx, -0x1a0(%rbp)
movq %rax, -0x198(%rbp)
leaq -0x188(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x24bd0
jmp 0x1205e
movq -0x3a0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x130(%rbp)
movl %eax, -0x134(%rbp)
movl $0x10, %esi
callq 0x5350
jmp 0x12345
leaq -0x50(%rbp), %rdi
callq 0x24b80
movq %rax, %rsi
leaq -0x188(%rbp), %rdi
callq 0x24c00
jmp 0x1205c
jmp 0x1205e
leaq 0x14e27b(%rip), %rsi    # 0x1602e0
leaq 0x14e10c(%rip), %rdx    # 0x160178
leaq -0x318(%rbp), %rdi
callq 0x24c60
jmp 0x1207a
leaq -0x288(%rbp), %rdi
leaq -0x318(%rbp), %rsi
callq 0x24c30
jmp 0x1208f
movq -0x18(%rbp), %rdi
leaq -0x18c(%rbp), %rsi
callq 0x1cb50
movq %rax, -0x3c0(%rbp)
jmp 0x120a8
movq -0x3c0(%rbp), %rdx
leaq -0x1f8(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x24ca0
jmp 0x120c4
leaq -0x288(%rbp), %rdi
callq 0x24d60
leaq -0x318(%rbp), %rdi
callq 0x24d80
leaq -0x1f8(%rbp), %rdi
callq 0x24db0
movq %rax, %rsi
leaq -0x330(%rbp), %rdi
callq 0x24dd0
jmp 0x120f9
leaq -0x330(%rbp), %rdi
movq %rdi, -0x3d0(%rbp)
callq 0x24f00
movq %rax, -0x340(%rbp)
leaq -0x338(%rbp), %rdi
leaq -0x340(%rbp), %rsi
callq 0x24f30
movq -0x3d0(%rbp), %rdi
movq -0x338(%rbp), %rsi
leaq -0x188(%rbp), %rdx
callq 0x24ec0
movq %rax, -0x3c8(%rbp)
jmp 0x12149
movq -0x3c8(%rbp), %rax
movq %rax, -0x348(%rbp)
movl -0x18c(%rbp), %eax
movl %eax, -0x3dc(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0x24f70
movq %rax, %rcx
movl -0x3dc(%rbp), %eax
movl (%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x35c(%rbp)
movl $0x20, %edi
callq 0x5340
movq %rax, -0x3d8(%rbp)
jmp 0x12195
movq -0x18(%rbp), %rdi
callq 0x1a350
movq %rax, -0x3e8(%rbp)
jmp 0x121a7
movq -0x3d8(%rbp), %rdi
movq -0x3e8(%rbp), %rax
movq %rax, -0x370(%rbp)
movq -0x370(%rbp), %rsi
leaq -0x330(%rbp), %rdx
callq 0x24a90
jmp 0x121d1
movq -0x3d8(%rbp), %rax
movq %rax, -0x368(%rbp)
leaq -0x35c(%rbp), %rdi
leaq -0x368(%rbp), %rsi
callq 0x24a60
movq %rdx, -0x3f8(%rbp)
movl %eax, -0x3ec(%rbp)
jmp 0x12201
movq -0x3f8(%rbp), %rax
movl -0x3ec(%rbp), %ecx
movl %ecx, -0x358(%rbp)
movq %rax, -0x350(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x358(%rbp), %rsi
callq 0x24ad0
leaq -0x330(%rbp), %rdi
callq 0x24b00
leaq -0x1f8(%rbp), %rdi
callq 0x24f90
jmp 0x122f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x130(%rbp)
movl %eax, -0x134(%rbp)
jmp 0x1227a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x130(%rbp)
movl %eax, -0x134(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x24d60
leaq -0x318(%rbp), %rdi
callq 0x24d80
jmp 0x12345
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x130(%rbp)
movl %eax, -0x134(%rbp)
jmp 0x122e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x130(%rbp)
movl %eax, -0x134(%rbp)
jmp 0x122d6
movq -0x3d8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x130(%rbp)
movl %eax, -0x134(%rbp)
movl $0x20, %esi
callq 0x5350
leaq -0x330(%rbp), %rdi
callq 0x24b00
leaq -0x1f8(%rbp), %rdi
callq 0x24f90
jmp 0x12345
testb $0x1, 0x14d541(%rip)    # 0x15f838
je 0x1232c
movq 0x14ccd8(%rip), %rdi    # 0x15efd8
leaq 0xdd144(%rip), %rsi     # 0xef44b
callq 0x5330
movq %rax, -0x400(%rbp)
jmp 0x12315
movq -0x400(%rbp), %rdi
movq 0x14cc9d(%rip), %rsi    # 0x15efc0
callq 0x53a0
jmp 0x1232a
jmp 0x1232c
leaq -0x50(%rbp), %rdi
callq 0x24fb0
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rdx
addq $0x400, %rsp            # imm = 0x400
popq %rbp
retq
leaq -0x50(%rbp), %rdi
callq 0x24fb0
movq -0x130(%rbp), %rdi
callq 0x55b0
nopw (%rax,%rax)