// File: /workspace/github_cpp_makefile_star2_O1/JameyWoo[P]csmile/parse.cpp
// Function: factor(TreeNode*)
TreeNode* factor(TreeNode* k) {
    TreeNode* t = NULL;
    if (k != NULL) {
        if (ptoken.type == "LeftBracket" && k->nodekind != "ArrayElem") {  // TODO: 数组元素
            t = call(k);
        } else {
            t = k;
        }
    } else {
        if (ptoken.type == "LeftBracket") {
            match("LeftBracket");
            t = expression();
            match("RightBracket");
        } else if (ptoken.type == "Id") {
            k = var();
            if (ptoken.type == "LeftBracket" && k->nodekind != "ArrayElem") {
                t = call(k);
            } else {
                t = k;
            }
        } else if (ptoken.type == "Num") {
            t = new TreeNode("Const");
            if ((t != NULL) && (ptoken.type == "Num")) {
                t->val = stoi(ptoken.value);
            }
            match("Num");
        } else {
            ptoken = getToken();
        }
    }
    return t;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, %rbx
leaq 0x14387(%rip), %rdi     # 0x1b4c0
leaq 0xdfec(%rip), %rsi      # 0x1512c
callq 0x2090
testq %rbx, %rbx
je 0x7181
testl %eax, %eax
jne 0x74e7
leaq 0x30(%rbx), %rdi
leaq 0xe0fe(%rip), %rsi      # 0x1525b
callq 0x2090
testl %eax, %eax
je 0x74e7
movq %rbx, %rdi
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6e73
testl %eax, %eax
je 0x7246
leaq 0x14330(%rip), %rdi     # 0x1b4c0
leaq 0xe089(%rip), %rsi      # 0x15220
callq 0x2090
testl %eax, %eax
je 0x7369
leaq 0x14315(%rip), %rdi     # 0x1b4c0
leaq 0xdf57(%rip), %rsi      # 0x15109
callq 0x2090
testl %eax, %eax
je 0x7398
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
callq 0x338a
leaq 0x142ea(%rip), %rdi     # 0x1b4c0
movq %rbx, %rsi
callq 0x2240
leaq 0xa0(%rsp), %rbx
leaq 0x142f3(%rip), %rdi     # 0x1b4e0
movq %rbx, %rsi
callq 0x2240
movl 0x20(%rbx), %eax
movl %eax, 0x14302(%rip)     # 0x1b500
movq (%rbx), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x721e
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x723f
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x21c0
xorl %ebx, %ebx
jmp 0x74e7
leaq 0x70(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xded6(%rip), %rsi      # 0x1512c
leaq 0xdeda(%rip), %rdx      # 0x15137
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x312c
leaq 0x158(%rsp), %rdi
movq %rbx, %rsi
callq 0x46a4
leaq 0x188(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x729b
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0x168(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x72bc
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x72d3
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21c0
callq 0x5f2f
movq %rax, %rbx
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xde4d(%rip), %rsi      # 0x15138
leaq 0xde52(%rip), %rdx      # 0x15144
leaq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x312c
leaq 0x110(%rsp), %rdi
movq %r14, %rsi
callq 0x46a4
leaq 0x140(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7330
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0x120(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7351
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x74e7
movq 0x50(%rsp), %rsi
jmp 0x74df
callq 0x6b21
movq %rax, %rbx
leaq 0x14148(%rip), %rdi     # 0x1b4c0
leaq 0xddad(%rip), %rsi      # 0x1512c
callq 0x2090
testl %eax, %eax
jne 0x74e7
movq %rbx, %rdi
addq $0x30, %rdi
jmp 0x7156
movl $0xe0, %edi
callq 0x21b0
movq %rax, %rbx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xdeb0(%rip), %rsi      # 0x15265
leaq 0xdeae(%rip), %rdx      # 0x1526a
movq %rsp, %rdi
callq 0x312c
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x995c
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x73e5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0x140d4(%rip), %rdi     # 0x1b4c0
leaq 0xdd16(%rip), %rsi      # 0x15109
callq 0x2090
testl %eax, %eax
jne 0x745a
movq 0x140dd(%rip), %r14     # 0x1b4e0
callq 0x2050
movq %rax, %r15
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0x80(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x2260
cmpq %r14, (%r12)
je 0x74fa
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x7506
movl (%r15), %ecx
cmpl $0x22, %ecx
je 0x7506
testl %ecx, %ecx
jne 0x7454
movl %ebp, (%r15)
movl %eax, 0xb8(%rbx)
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xdc9f(%rip), %rsi      # 0x15109
leaq 0xdc9b(%rip), %rdx      # 0x1510c
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x312c
leaq 0xc8(%rsp), %rdi
movq %r14, %rsi
callq 0x46a4
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x74af
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x74d0
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x74e7
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21c0
movq %rbx, %rax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xdea2(%rip), %rdi      # 0x153a3
callq 0x2110
leaq 0xde96(%rip), %rdi      # 0x153a3
callq 0x2280
movq %rax, %r14
cmpl $0x0, (%r15)
jne 0x758a
movl %ebp, (%r15)
jmp 0x758a
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x758a
movq 0x30(%rsp), %rsi
jmp 0x7582
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x7552
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21c0
jmp 0x7552
movq %rax, %r14
movl $0xe0, %esi
movq %rbx, %rdi
jmp 0x7585
movq %rax, %r14
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x758a
movq 0x50(%rsp), %rsi
jmp 0x7582
movq %rax, %r14
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x758a
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21c0
movq %r14, %rdi
callq 0x2310