// File: JameyWoo[P]csmile/symtab.cpp
// Function: st_insert(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int, int)
void st_insert(string name, int lineno, int loc, int rank) {
    if (count(fun_names.begin(), fun_names.end(), name) != 0) return;
    if (rank == 2 || rank == 3) {
        // symtabOut << "insert: " << name << endl;
        if (loc == -1) {  // 当这个变量存在在符号表中时
            symtabs[name].line.push_back(lineno);
        } else if (lineno != -1) {  // 不在符号表
            SymtabOne s(lineno, loc, rank);
            s.addr = ++address;
            symtabs[name] = s;
        } else if (lineno != -1) {  // 不在符号表, 只建立key, 不在vector中插入
            SymtabOne s(loc);
            s.addr = ++address;
            symtabs[name] = s;
        }
    } else if (rank == 1) {
        // symtabOut << "insert: " << name << endl;
        if (loc == -1) {  // 当这个变量存在在符号表中时
            symtabs[name].line.push_back(lineno);
        } else {  // 不在符号表
            SymtabOne s(lineno, loc, rank);
            s.addr = ++address;
            symtabs[name] = s;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0xb8(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
leaq 0x1e082(%rip), %rdi     # 0x2e9e8
callq 0x5ef0
movq %rax, -0x20(%rbp)
leaq 0x1e072(%rip), %rdi     # 0x2e9e8
callq 0x5f20
movq -0xb8(%rbp), %rdx
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x5ea0
cmpq $0x0, %rax
je 0x1099e
jmp 0x10b9c
cmpl $0x2, -0x14(%rbp)
je 0x109ae
cmpl $0x3, -0x14(%rbp)
jne 0x10ae2
cmpl $-0x1, -0x10(%rbp)
jne 0x109d8
movq -0xb8(%rbp), %rsi
leaq 0x1e096(%rip), %rdi     # 0x2ea58
callq 0x11210
movq %rax, %rdi
leaq -0xc(%rbp), %rsi
callq 0x112f0
jmp 0x10add
cmpl $-0x1, -0xc(%rbp)
je 0x10a57
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
leaq -0x50(%rbp), %rdi
callq 0x11360
movq -0xb8(%rbp), %rsi
movl 0x1e08b(%rip), %eax     # 0x2ea88
incl %eax
movl %eax, 0x1e083(%rip)     # 0x2ea88
movl %eax, -0x30(%rbp)
leaq 0x1e049(%rip), %rdi     # 0x2ea58
callq 0x11210
movq %rax, -0xc0(%rbp)
jmp 0x10a1d
movq -0xc0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x113d0
jmp 0x10a2f
leaq -0x50(%rbp), %rdi
callq 0x11410
jmp 0x10adb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x11410
jmp 0x10ba5
cmpl $-0x1, -0xc(%rbp)
je 0x10ad9
movl -0x10(%rbp), %esi
leaq -0x88(%rbp), %rdi
callq 0x11430
movq -0xb8(%rbp), %rsi
movl 0x1e00f(%rip), %eax     # 0x2ea88
incl %eax
movl %eax, 0x1e007(%rip)     # 0x2ea88
movl %eax, -0x68(%rbp)
leaq 0x1dfcd(%rip), %rdi     # 0x2ea58
callq 0x11210
movq %rax, -0xc8(%rbp)
jmp 0x10a99
movq -0xc8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x113d0
jmp 0x10aae
leaq -0x88(%rbp), %rdi
callq 0x11410
jmp 0x10ad9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x11410
jmp 0x10ba5
jmp 0x10adb
jmp 0x10add
jmp 0x10b9c
cmpl $0x1, -0x14(%rbp)
jne 0x10b9a
cmpl $-0x1, -0x10(%rbp)
jne 0x10b16
movq -0xb8(%rbp), %rsi
leaq 0x1df58(%rip), %rdi     # 0x2ea58
callq 0x11210
movq %rax, %rdi
leaq -0xc(%rbp), %rsi
callq 0x112f0
jmp 0x10b98
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
leaq -0xb0(%rbp), %rdi
callq 0x11360
movq -0xb8(%rbp), %rsi
movl 0x1df50(%rip), %eax     # 0x2ea88
incl %eax
movl %eax, 0x1df48(%rip)     # 0x2ea88
movl %eax, -0x90(%rbp)
leaq 0x1df0b(%rip), %rdi     # 0x2ea58
callq 0x11210
movq %rax, -0xd0(%rbp)
jmp 0x10b5b
movq -0xd0(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x113d0
jmp 0x10b70
leaq -0xb0(%rbp), %rdi
callq 0x11410
jmp 0x10b98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x11410
jmp 0x10ba5
jmp 0x10b9a
jmp 0x10b9c
addq $0xd0, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x3470
nop