// File: /workspace/github_cpp_makefile_star2_O2/JameyWoo[P]csmile/parse.cpp
// Function: expression()
TreeNode* expression() {
    // cout << "expression token: " << ptoken.type << endl;
    if (ptoken.type == "input") {  // 如果是输入
        TreeNode* input = new TreeNode("Input");
        match("input");
        match("LeftBracket");
        match("RightBracket");
        return input;
    } else if (ptoken.type == "output") {
        TreeNode* output = new TreeNode("Output");
        match("output");
        match("LeftBracket");
        if (output != NULL) {
            output->child[0] = expression();
        }
        match("RightBracket");
        return output;
    }
    TreeNode* t = var();
    if (t == NULL) {
        t = simple_expression(t);  // ! 开头不是Id的情况
    } else {                       // Id 开头
        TreeNode* p = NULL;
        if (ptoken.type == "Assign") {
            p = new TreeNode("Assign");
            match("Assign");
            p->child[0] = t;
            p->child[1] = expression();  // 赋值的另一边可能是一个表达式
            return p;
        } else {
            t = simple_expression(t);
        }
    }

    return t;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x348, %rsp            # imm = 0x348
leaq 0x11894(%rip), %rdi     # 0x164c0
leaq 0xa55f(%rip), %rsi      # 0xf192
callq 0x368e
testb %al, %al
je 0x4d5b
movl $0xe0, %edi
callq 0x21c0
movq %rax, %rbx
leaq 0xa621(%rip), %rsi      # 0xf275
leaq 0x130(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2efc
leaq 0x130(%rsp), %rsi
movq %rbx, %rdi
callq 0x703e
leaq 0x130(%rsp), %rdi
callq 0x2358
leaq 0xa508(%rip), %rsi      # 0xf192
leaq 0x110(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2efc
leaq 0x300(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x3e94
leaq 0x300(%rsp), %rdi
callq 0x2ee6
leaq 0x110(%rsp), %rdi
callq 0x2358
leaq 0xa45a(%rip), %rsi      # 0xf12c
leaq 0xf0(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2efc
leaq 0x2b8(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x3e94
leaq 0x2b8(%rsp), %rdi
callq 0x2ee6
leaq 0xf0(%rsp), %rdi
callq 0x2358
leaq 0xa41e(%rip), %rsi      # 0xf138
leaq 0xd0(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2efc
leaq 0x270(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x3e94
leaq 0x270(%rsp), %rdi
callq 0x2ee6
leaq 0xd0(%rsp), %rdi
jmp 0x4e82
leaq 0x1175e(%rip), %rdi     # 0x164c0
leaq 0xa42f(%rip), %rsi      # 0xf198
callq 0x368e
testb %al, %al
je 0x4e95
movl $0xe0, %edi
callq 0x21c0
movq %rax, %rbx
leaq 0xa4f1(%rip), %rsi      # 0xf27b
leaq 0xb0(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2efc
leaq 0xb0(%rsp), %rsi
movq %rbx, %rdi
callq 0x703e
leaq 0xb0(%rsp), %rdi
callq 0x2358
leaq 0xa3d8(%rip), %rsi      # 0xf198
leaq 0x90(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2efc
leaq 0x228(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x3e94
leaq 0x228(%rsp), %rdi
callq 0x2ee6
leaq 0x90(%rsp), %rdi
callq 0x2358
leaq 0xa324(%rip), %rsi      # 0xf12c
leaq 0x70(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2efc
leaq 0x1e0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x3e94
leaq 0x1e0(%rsp), %rdi
callq 0x2ee6
leaq 0x70(%rsp), %rdi
callq 0x2358
callq 0x4c1b
movq %rax, (%rbx)
leaq 0xa2e9(%rip), %rsi      # 0xf138
leaq 0x50(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2efc
leaq 0x198(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x3e94
leaq 0x198(%rsp), %rdi
callq 0x2ee6
leaq 0x50(%rsp), %rdi
callq 0x2358
movq %rbx, %rax
addq $0x348, %rsp            # imm = 0x348
popq %rbx
popq %r14
retq
callq 0x5316
testq %rax, %rax
je 0x4f4b
movq %rax, %r14
leaq 0x11613(%rip), %rdi     # 0x164c0
leaq 0xa3f6(%rip), %rsi      # 0xf2aa
callq 0x368e
testb %al, %al
je 0x4f4f
movl $0xe0, %edi
callq 0x21c0
movq %rax, %rbx
leaq 0xa3d5(%rip), %rsi      # 0xf2aa
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2efc
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x703e
leaq 0x30(%rsp), %rdi
callq 0x2358
leaq 0xa3a8(%rip), %rsi      # 0xf2aa
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2efc
leaq 0x150(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x3e94
leaq 0x150(%rsp), %rdi
callq 0x2ee6
leaq 0x10(%rsp), %rdi
callq 0x2358
movq %r14, (%rbx)
callq 0x4c1b
movq %rax, 0x8(%rbx)
jmp 0x4e87
xorl %edi, %edi
jmp 0x4f52
movq %r14, %rdi
addq $0x348, %rsp            # imm = 0x348
popq %rbx
popq %r14
jmp 0x5bbb
movq %rax, %r14
leaq 0x10(%rsp), %rdi
jmp 0x4fd8
jmp 0x4fdf
movq %rax, %r14
leaq 0x30(%rsp), %rdi
jmp 0x4fef
jmp 0x4ff6
movq %rax, %r14
leaq 0x50(%rsp), %rdi
jmp 0x4fd8
jmp 0x4fdf
movq %rax, %r14
leaq 0x70(%rsp), %rdi
jmp 0x4fd8
jmp 0x4fdf
movq %rax, %r14
leaq 0x90(%rsp), %rdi
jmp 0x4fd8
jmp 0x4fdf
movq %rax, %r14
leaq 0xb0(%rsp), %rdi
jmp 0x4fef
jmp 0x4ff6
movq %rax, %r14
leaq 0xd0(%rsp), %rdi
jmp 0x4fd8
jmp 0x4fdf
movq %rax, %r14
leaq 0xf0(%rsp), %rdi
jmp 0x4fd8
jmp 0x4fdf
movq %rax, %r14
leaq 0x110(%rsp), %rdi
callq 0x2358
jmp 0x5006
movq %rax, %r14
jmp 0x5006
movq %rax, %r14
leaq 0x130(%rsp), %rdi
callq 0x2358
jmp 0x4ff9
movq %rax, %r14
movl $0xe0, %esi
movq %rbx, %rdi
callq 0x21d0
movq %r14, %rdi
callq 0x2300