// File: 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 %rbp
movq %rsp, %rbp
subq $0x430, %rsp            # imm = 0x430
leaq 0x24a76(%rip), %rdi     # 0x2e588
leaq 0x175fd(%rip), %rsi     # 0x21116
callq 0x5e70
testb $0x1, %al
jne 0x9b27
jmp 0x9dcc
movl $0xe0, %edi
callq 0x3280
movq %rax, -0x3d0(%rbp)
movb $0x1, -0x45(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x3c8(%rbp)
callq 0x3480
movq -0x3c8(%rbp), %rdx
leaq 0x1769f(%rip), %rsi     # 0x211f9
leaq -0x30(%rbp), %rdi
callq 0x4ef0
jmp 0x9b65
movq -0x3d0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xdb50
jmp 0x9b77
movb $0x0, -0x45(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x34e8
leaq -0x31(%rbp), %rdi
callq 0x32d0
movq -0x3d0(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x3d8(%rbp)
callq 0x3480
movq -0x3d8(%rbp), %rdx
leaq 0x1755d(%rip), %rsi     # 0x21116
leaq -0xb0(%rbp), %rdi
callq 0x4ef0
jmp 0x9bc7
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x80b0
jmp 0x9bdc
leaq -0x90(%rbp), %rdi
callq 0x4ec0
leaq -0xb0(%rbp), %rdi
callq 0x34e8
leaq -0xb1(%rbp), %rdi
callq 0x32d0
leaq -0x121(%rbp), %rdi
movq %rdi, -0x3e0(%rbp)
callq 0x3480
movq -0x3e0(%rbp), %rdx
leaq 0x1748f(%rip), %rsi     # 0x210b0
leaq -0x120(%rbp), %rdi
callq 0x4ef0
jmp 0x9c2f
leaq -0x100(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x80b0
jmp 0x9c44
leaq -0x100(%rbp), %rdi
callq 0x4ec0
leaq -0x120(%rbp), %rdi
callq 0x34e8
leaq -0x121(%rbp), %rdi
callq 0x32d0
leaq -0x191(%rbp), %rdi
movq %rdi, -0x3e8(%rbp)
callq 0x3480
movq -0x3e8(%rbp), %rdx
leaq 0x17433(%rip), %rsi     # 0x210bc
leaq -0x190(%rbp), %rdi
callq 0x4ef0
jmp 0x9c97
leaq -0x170(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x80b0
jmp 0x9cac
leaq -0x170(%rbp), %rdi
callq 0x4ec0
leaq -0x190(%rbp), %rdi
callq 0x34e8
leaq -0x191(%rbp), %rdi
callq 0x32d0
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xa2f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x9d00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x34e8
leaq -0x31(%rbp), %rdi
callq 0x32d0
testb $0x1, -0x45(%rbp)
jne 0x9d11
jmp 0x9d22
movq -0x3d0(%rbp), %rdi
movl $0xe0, %esi
callq 0x3290
jmp 0xa303
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x9d4d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x34e8
leaq -0xb1(%rbp), %rdi
callq 0x32d0
jmp 0xa303
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x9d84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x34e8
leaq -0x121(%rbp), %rdi
callq 0x32d0
jmp 0xa303
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x9dbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x34e8
leaq -0x191(%rbp), %rdi
callq 0x32d0
jmp 0xa303
leaq 0x247b5(%rip), %rdi     # 0x2e588
leaq 0x17342(%rip), %rsi     # 0x2111c
callq 0x5e70
testb $0x1, %al
jne 0x9de8
jmp 0xa0d6
movl $0xe0, %edi
callq 0x3280
movq %rax, -0x3f8(%rbp)
movb $0x1, -0x1c2(%rbp)
leaq -0x1c1(%rbp), %rdi
movq %rdi, -0x3f0(%rbp)
callq 0x3480
movq -0x3f0(%rbp), %rdx
leaq 0x173de(%rip), %rsi     # 0x211ff
leaq -0x1c0(%rbp), %rdi
callq 0x4ef0
jmp 0x9e2f
movq -0x3f8(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0xdb50
jmp 0x9e44
movb $0x0, -0x1c2(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x34e8
leaq -0x1c1(%rbp), %rdi
callq 0x32d0
movq -0x3f8(%rbp), %rax
movq %rax, -0x1a0(%rbp)
leaq -0x231(%rbp), %rdi
movq %rdi, -0x400(%rbp)
callq 0x3480
movq -0x400(%rbp), %rdx
leaq 0x1728a(%rip), %rsi     # 0x2111c
leaq -0x230(%rbp), %rdi
callq 0x4ef0
jmp 0x9ea0
leaq -0x210(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x80b0
jmp 0x9eb5
leaq -0x210(%rbp), %rdi
callq 0x4ec0
leaq -0x230(%rbp), %rdi
callq 0x34e8
leaq -0x231(%rbp), %rdi
callq 0x32d0
leaq -0x2a1(%rbp), %rdi
movq %rdi, -0x408(%rbp)
callq 0x3480
movq -0x408(%rbp), %rdx
leaq 0x171b6(%rip), %rsi     # 0x210b0
leaq -0x2a0(%rbp), %rdi
callq 0x4ef0
jmp 0x9f08
leaq -0x280(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x80b0
jmp 0x9f1d
leaq -0x280(%rbp), %rdi
callq 0x4ec0
leaq -0x2a0(%rbp), %rdi
callq 0x34e8
leaq -0x2a1(%rbp), %rdi
callq 0x32d0
cmpq $0x0, -0x1a0(%rbp)
je 0xa027
callq 0x9b00
movq %rax, %rcx
movq -0x1a0(%rbp), %rax
movq %rcx, (%rax)
jmp 0xa027
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x9f8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x34e8
leaq -0x1c1(%rbp), %rdi
callq 0x32d0
testb $0x1, -0x1c2(%rbp)
jne 0x9fa3
jmp 0x9fb4
movq -0x3f8(%rbp), %rdi
movl $0xe0, %esi
callq 0x3290
jmp 0xa303
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x9fdf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x230(%rbp), %rdi
callq 0x34e8
leaq -0x231(%rbp), %rdi
callq 0x32d0
jmp 0xa303
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xa016
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x34e8
leaq -0x2a1(%rbp), %rdi
callq 0x32d0
jmp 0xa303
leaq -0x311(%rbp), %rdi
movq %rdi, -0x410(%rbp)
callq 0x3480
movq -0x410(%rbp), %rdx
leaq 0x17074(%rip), %rsi     # 0x210bc
leaq -0x310(%rbp), %rdi
callq 0x4ef0
jmp 0xa056
leaq -0x2f0(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x80b0
jmp 0xa06b
leaq -0x2f0(%rbp), %rdi
callq 0x4ec0
leaq -0x310(%rbp), %rdi
callq 0x34e8
leaq -0x311(%rbp), %rdi
callq 0x32d0
movq -0x1a0(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xa2f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xa0c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x310(%rbp), %rdi
callq 0x34e8
leaq -0x311(%rbp), %rdi
callq 0x32d0
jmp 0xa303
jmp 0xa0d8
callq 0xa890
movq %rax, -0x320(%rbp)
cmpq $0x0, -0x320(%rbp)
jne 0xa106
movq -0x320(%rbp), %rdi
callq 0xb7f0
movq %rax, -0x320(%rbp)
jmp 0xa2eb
movq $0x0, -0x328(%rbp)
leaq 0x24470(%rip), %rdi     # 0x2e588
leaq 0x1710f(%rip), %rsi     # 0x2122e
callq 0x5e70
testb $0x1, %al
jne 0xa12d
jmp 0xa2d6
movl $0xe0, %edi
callq 0x3280
movq %rax, -0x420(%rbp)
movb $0x1, -0x34a(%rbp)
leaq -0x349(%rbp), %rdi
movq %rdi, -0x418(%rbp)
callq 0x3480
movq -0x418(%rbp), %rdx
leaq 0x170c8(%rip), %rsi     # 0x2122e
leaq -0x348(%rbp), %rdi
callq 0x4ef0
jmp 0xa174
movq -0x420(%rbp), %rdi
leaq -0x348(%rbp), %rsi
callq 0xdb50
jmp 0xa189
movq -0x420(%rbp), %rax
movb $0x0, -0x34a(%rbp)
movq %rax, -0x328(%rbp)
leaq -0x348(%rbp), %rdi
callq 0x34e8
leaq -0x349(%rbp), %rdi
callq 0x32d0
leaq -0x3b9(%rbp), %rdi
movq %rdi, -0x428(%rbp)
callq 0x3480
movq -0x428(%rbp), %rdx
leaq 0x17057(%rip), %rsi     # 0x2122e
leaq -0x3b8(%rbp), %rdi
callq 0x4ef0
jmp 0xa1e5
leaq -0x398(%rbp), %rdi
leaq -0x3b8(%rbp), %rsi
callq 0x80b0
jmp 0xa1fa
leaq -0x398(%rbp), %rdi
callq 0x4ec0
leaq -0x3b8(%rbp), %rdi
callq 0x34e8
leaq -0x3b9(%rbp), %rdi
callq 0x32d0
movq -0x320(%rbp), %rcx
movq -0x328(%rbp), %rax
movq %rcx, (%rax)
callq 0x9b00
movq %rax, %rcx
movq -0x328(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x328(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xa2f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xa278
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x348(%rbp), %rdi
callq 0x34e8
leaq -0x349(%rbp), %rdi
callq 0x32d0
testb $0x1, -0x34a(%rbp)
jne 0xa28f
jmp 0xa2a0
movq -0x420(%rbp), %rdi
movl $0xe0, %esi
callq 0x3290
jmp 0xa303
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xa2c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x3b8(%rbp), %rdi
callq 0x34e8
leaq -0x3b9(%rbp), %rdi
callq 0x32d0
jmp 0xa303
movq -0x320(%rbp), %rdi
callq 0xb7f0
movq %rax, -0x320(%rbp)
jmp 0xa2eb
movq -0x320(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x430, %rsp            # imm = 0x430
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3470
nopl (%rax)