// File: /workspace/github_cpp_makefile_star2_O3/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 0x14406(%rip), %rdi     # 0x1b4c0
leaq 0xe06b(%rip), %rsi      # 0x1512c
callq 0x2090
testq %rbx, %rbx
je 0x7102
testl %eax, %eax
jne 0x7468
leaq 0x30(%rbx), %rdi
leaq 0xe17d(%rip), %rsi      # 0x1525b
callq 0x2090
testl %eax, %eax
je 0x7468
movq %rbx, %rdi
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6df4
testl %eax, %eax
je 0x71c7
leaq 0x143af(%rip), %rdi     # 0x1b4c0
leaq 0xe108(%rip), %rsi      # 0x15220
callq 0x2090
testl %eax, %eax
je 0x72ea
leaq 0x14394(%rip), %rdi     # 0x1b4c0
leaq 0xdfd6(%rip), %rsi      # 0x15109
callq 0x2090
testl %eax, %eax
je 0x7319
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
callq 0x3382
leaq 0x14369(%rip), %rdi     # 0x1b4c0
movq %rbx, %rsi
callq 0x2240
leaq 0xa0(%rsp), %rbx
leaq 0x14372(%rip), %rdi     # 0x1b4e0
movq %rbx, %rsi
callq 0x2240
movl 0x20(%rbx), %eax
movl %eax, 0x14381(%rip)     # 0x1b500
movq (%rbx), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x719f
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x71c0
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x21c0
xorl %ebx, %ebx
jmp 0x7468
leaq 0x70(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xdf55(%rip), %rsi      # 0x1512c
leaq 0xdf59(%rip), %rdx      # 0x15137
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x312c
leaq 0x158(%rsp), %rdi
movq %rbx, %rsi
callq 0x4630
leaq 0x188(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x721c
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0x168(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x723d
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x7254
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21c0
callq 0x5eb0
movq %rax, %rbx
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xdecc(%rip), %rsi      # 0x15138
leaq 0xded1(%rip), %rdx      # 0x15144
leaq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x312c
leaq 0x110(%rsp), %rdi
movq %r14, %rsi
callq 0x4630
leaq 0x140(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x72b1
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0x120(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x72d2
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x7468
movq 0x50(%rsp), %rsi
jmp 0x7460
callq 0x6aa2
movq %rax, %rbx
leaq 0x141c7(%rip), %rdi     # 0x1b4c0
leaq 0xde2c(%rip), %rsi      # 0x1512c
callq 0x2090
testl %eax, %eax
jne 0x7468
movq %rbx, %rdi
addq $0x30, %rdi
jmp 0x70d7
movl $0xe0, %edi
callq 0x21b0
movq %rax, %rbx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xdf2f(%rip), %rsi      # 0x15265
leaq 0xdf2d(%rip), %rdx      # 0x1526a
movq %rsp, %rdi
callq 0x312c
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x98d0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x7366
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0x14153(%rip), %rdi     # 0x1b4c0
leaq 0xdd95(%rip), %rsi      # 0x15109
callq 0x2090
testl %eax, %eax
jne 0x73db
movq 0x1415c(%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 0x747b
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x7487
movl (%r15), %ecx
cmpl $0x22, %ecx
je 0x7487
testl %ecx, %ecx
jne 0x73d5
movl %ebp, (%r15)
movl %eax, 0xb8(%rbx)
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xdd1e(%rip), %rsi      # 0x15109
leaq 0xdd1a(%rip), %rdx      # 0x1510c
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x312c
leaq 0xc8(%rsp), %rdi
movq %r14, %rsi
callq 0x4630
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7430
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7451
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x7468
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 0xdf21(%rip), %rdi      # 0x153a3
callq 0x2110
leaq 0xdf15(%rip), %rdi      # 0x153a3
callq 0x2280
movq %rax, %r14
cmpl $0x0, (%r15)
jne 0x750b
movl %ebp, (%r15)
jmp 0x750b
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x750b
movq 0x30(%rsp), %rsi
jmp 0x7503
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x74d3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21c0
jmp 0x74d3
movq %rax, %r14
movl $0xe0, %esi
movq %rbx, %rdi
jmp 0x7506
movq %rax, %r14
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x750b
movq 0x50(%rsp), %rsi
jmp 0x7503
movq %rax, %r14
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x750b
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21c0
movq %r14, %rdi
callq 0x2310