// File: /workspace/github_c_makefile_star2_O2/ejunjsh[P]mycc/decl.c
// Function: declaration_list
int declaration_list(struct symtable **ctype, int class, int et1, int et2,
		     struct ASTnode **gluetree) {
  int inittype, type;
  struct symtable *sym;
  struct ASTnode *tree;
  *gluetree = NULL; // TODO：有问题？

  // 获取初始的类型， 如果是-1，代表是个复合类型声明，直接返回
  if ((inittype = parse_type(ctype, &class)) == -1)
    return (inittype);

  // 现在解析一列表符号
  while (1) {
    // 看看这个符号是否是个指针
    type = parse_stars(inittype);

    // 解析符号
    sym = symbol_declaration(type, *ctype, class, &tree);

    // 解析到函数，直接返回
    if (sym->stype == S_FUNCTION) {
      if (class != C_GLOBAL && class != C_STATIC)
	      fatal("Function definition not at global level");
      return (type);
    }

    // 把tree粘起来（Glue）
    // 这只在本地变量声明并有赋值操作的时候，
    // 这样就能把一系列赋值操作连起来
    if (*gluetree == NULL)
      *gluetree = tree;
    else
      *gluetree =
	      mkastnode(A_GLUE, P_NONE, NULL, *gluetree, NULL, tree, NULL, 0);

    // 遇到结束token，返回
    if (Token.token == et1 || Token.token == et2)
      return (type);

    // 否则，匹配逗号，继续
    comma();
  }

  return(0);	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r8, %rbx
movl %ecx, -0x68(%rbp)
movl %edx, -0x6c(%rbp)
leaq -0x5c(%rbp), %rax
movl %esi, (%rax)
andq $0x0, (%r8)
movq %rdi, -0x78(%rbp)
movq %rax, %rsi
callq 0x39b8
movl %eax, -0x70(%rbp)
cmpl $-0x1, %eax
je 0x480e
leaq 0xa31a(%rip), %r12      # 0xe3a0
movq %rbx, -0x58(%rbp)
movl -0x70(%rbp), %edi
callq 0x3f2c
movl %eax, -0x2c(%rbp)
movq -0x78(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movl -0x5c(%rbp), %r13d
leaq 0xa325(%rip), %rdi      # 0xe3d0
callq 0x2190
movq %rax, %r15
callq 0x64e9
movl (%r12), %eax
cmpl $0x39, %eax
movq %r13, -0x38(%rbp)
jne 0x40f0
leaq 0xa29c(%rip), %rax      # 0xe368
movl (%rax), %eax
movl %eax, -0x64(%rbp)
movq %r15, %rdi
callq 0x7c48
testq %rax, %rax
je 0x4123
cmpl $0x1, 0x20(%rax)
jne 0x4123
movq %rax, -0x40(%rbp)
xorl %r14d, %r14d
xorl %r15d, %r15d
jmp 0x4153
leal -0x1(%r13), %r14d
cmpl $0x5, %r14d
jae 0x4210
movq %r15, %rdi
callq 0x7bfc
testq %rax, %rax
je 0x4216
leaq 0x5a44(%rip), %rdi      # 0x9b5a
movq %r15, %rsi
callq 0x641f
jmp 0x4216
callq 0x53c0
movl %eax, -0x60(%rbp)
movl %eax, (%rsp)
movq %r15, %rdi
movl -0x2c(%rbp), %esi
xorl %edx, %edx
pushq $0x1
popq %rcx
movq -0x38(%rbp), %r8
xorl %r9d, %r9d
callq 0x7961
movq %rax, %r15
movb $0x1, %r14b
movq $0x0, -0x40(%rbp)
callq 0x64bd
movq %r14, -0x38(%rbp)
testb %r14b, %r14b
je 0x4166
xorl %r14d, %r14d
jmp 0x416e
movq -0x40(%rbp), %rax
movq 0x40(%rax), %r14
xorl %r13d, %r13d
movl (%r12), %eax
cmpl $0x1e, %eax
je 0x4184
cmpl $0x3a, %eax
jne 0x419c
jmp 0x4374
leaq 0xa22d(%rip), %rbx      # 0xe3b8
movq %rbx, %rdi
callq 0x66f4
cmpl $0x3a, (%rbx)
je 0x4369
leaq -0x88(%rbp), %rdi
pushq $0x3
popq %rsi
pushq $0x3d
popq %rdx
pushq $0x3a
popq %rcx
leaq -0x80(%rbp), %r8
callq 0x4043
movl %eax, %r12d
cmpl $-0x1, %eax
jne 0x41c9
leaq 0x5a3c(%rip), %rdi      # 0x9c00
callq 0x6515
testq %r14, %r14
je 0x41ea
cmpl 0x10(%r14), %r12d
je 0x41e4
leal 0x1(%r13), %esi
leaq 0x5a3c(%rip), %rdi      # 0x9c1b
callq 0x656d
movq 0x38(%r14), %r14
jmp 0x41ed
xorl %r14d, %r14d
leaq 0xa1ac(%rip), %r12      # 0xe3a0
cmpl $0x3a, (%r12)
je 0x4208
callq 0x64ff
incl %r13d
jmp 0x4171
incl %r13d
jmp 0x4374
cmpl $0x8, %r13d
jne 0x4236
movq %r15, %rdi
callq 0x7cad
testq %rax, %rax
je 0x4232
leaq 0x5955(%rip), %rdi      # 0x9b7f
movq %r15, %rsi
callq 0x641f
movl (%r12), %eax
cmpl $0x3b, %eax
jne 0x4300
movq %r12, %rdi
callq 0x66f4
cmpl $0x3c, (%r12)
pushq $-0x1
popq %r13
je 0x4270
pushq $0x30
popq %rdi
callq 0x3f9e
movl %eax, %r13d
testl %eax, %eax
jg 0x4270
leaq 0x5a04(%rip), %rdi      # 0x9c6c
movl %r13d, %esi
callq 0x656d
pushq $0x3c
popq %rdi
leaq 0x696e(%rip), %rsi      # 0xabe8
callq 0x63f8
movq -0x38(%rbp), %rcx
leal -0x4(%rcx), %eax
cmpl $0x2, %eax
movl %r13d, -0x50(%rbp)
jb 0x42a1
cmpl $0x2, %ecx
je 0x44d8
cmpl $0x1, %ecx
jne 0x44f6
movq %r15, %rdi
movq %rcx, %rbx
callq 0x7b9d
movq %rax, %r14
movl -0x2c(%rbp), %r13d
movl %r13d, %edi
callq 0x8752
movq %r14, %rdi
movl %ebx, %esi
movl %eax, %edx
movl %r13d, %ebx
movq -0x48(%rbp), %r13
movq %r13, %rcx
callq 0x48a9
testl %eax, %eax
je 0x44cb
movl %ebx, %edi
callq 0x8752
andl $0x0, (%rsp)
movq %r15, %rdi
movl %eax, %esi
movq %r13, %rdx
pushq $0x2
popq %rcx
movq -0x38(%rbp), %r8
xorl %r9d, %r9d
callq 0x7961
jmp 0x44ce
xorl %r8d, %r8d
cmpl $0x7, %r14d
ja 0x46ae
leaq 0x55e0(%rip), %rcx      # 0x98f4
movslq (%rcx,%r14,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r15, %rdi
callq 0x7b9d
movq %rax, %rbx
movq %rax, %rdi
movq -0x38(%rbp), %r13
movl %r13d, %esi
movl -0x2c(%rbp), %edx
movq -0x48(%rbp), %r14
movq %r14, %rcx
callq 0x48a9
testl %eax, %eax
je 0x4667
andl $0x0, (%rsp)
movq %r15, %rdi
movl -0x2c(%rbp), %esi
movq %r14, %rdx
xorl %ecx, %ecx
movl %r13d, %r8d
pushq $0x1
popq %r9
callq 0x7961
jmp 0x46ab
movq %r12, %rdi
callq 0x66f4
xorl %r13d, %r13d
cmpb $0x0, -0x38(%rbp)
movq -0x58(%rbp), %rbx
jne 0x439c
movq -0x40(%rbp), %rax
cmpl 0x2c(%rax), %r13d
je 0x439c
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x58af(%rip), %rdi      # 0x9c46
callq 0x641f
callq 0x64d3
testq %r15, %r15
leaq 0xa255(%rip), %rcx      # 0xe600
movq -0x40(%rbp), %r8
je 0x43bf
movl %r13d, 0x2c(%r15)
movq (%rcx), %rax
movq %rax, 0x40(%r15)
movq %r15, %r8
leaq 0xa242(%rip), %rax      # 0xe608
andq $0x0, (%rax)
andq $0x0, (%rcx)
cmpl $0x35, (%r12)
je 0x44c2
leaq 0xa1f4(%rip), %rax      # 0xe5d4
andl $0x0, (%rax)
leaq 0x9f8e(%rip), %rax      # 0xe378
movq %r8, %r14
movq %r8, (%rax)
leaq 0xa1e1(%rip), %rax      # 0xe5d8
andl $0x0, (%rax)
callq 0x6491
xorl %edi, %edi
callq 0x723c
movq %rax, %r15
callq 0x64a7
cmpl $0x10, -0x2c(%rbp)
je 0x444b
testq %r15, %r15
jne 0x4425
leaq 0x5789(%rip), %rdi      # 0x9ba9
callq 0x6515
movl 0x4(%r15), %eax
cmpl $0x1d, %eax
jne 0x443a
movq 0x30(%r15), %rax
testq %rax, %rax
je 0x443f
movl 0x4(%rax), %eax
cmpl $0x22, %eax
je 0x444b
leaq 0x5790(%rip), %rdi      # 0x9bd6
callq 0x6515
pushq $0x20
popq %rdi
movl -0x2c(%rbp), %esi
movq -0x48(%rbp), %rdx
movq %r15, %rcx
movq %r14, %r8
movl -0x60(%rbp), %r9d
callq 0x81aa
movl -0x64(%rbp), %ecx
movl %ecx, 0x40(%rax)
movq %rax, %rdi
callq 0x6624
movq %rax, %r15
leaq 0x9ed8(%rip), %rax      # 0xe354
cmpl $0x0, (%rax)
je 0x44a9
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x81c6
movq 0x9b3c(%rip), %rax      # 0xdfd0
movq (%rax), %rcx
leaq 0x4daa(%rip), %rdi      # 0x9248
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
callq 0x2180
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x53d5
callq 0x7ded
movq %r14, %r8
movq -0x50(%rbp), %r15
jmp 0x47c1
movq %r14, %rax
movl -0x50(%rbp), %r13d
movq -0x58(%rbp), %rbx
jmp 0x4502
movl -0x2c(%rbp), %edi
callq 0x8752
movq %r15, %rdi
movl %eax, %esi
movq -0x48(%rbp), %rdx
pushq $0x2
popq %rcx
xorl %r8d, %r8d
callq 0x79b6
jmp 0x4502
leaq 0x5785(%rip), %rdi      # 0x9c82
callq 0x6515
cmpl $0x1, (%r12)
movq %rax, -0x40(%rbp)
jne 0x45c4
movq -0x38(%rbp), %rax
andl $-0x5, %eax
cmpl $0x1, %eax
je 0x452c
leaq 0x5791(%rip), %rdi      # 0x9cb5
movq %r15, %rsi
callq 0x641f
movq %r12, %rdi
callq 0x66f4
pushq $0x37
popq %rdi
leaq 0x5797(%rip), %rsi      # 0x9cd5
callq 0x63f8
cmpl $-0x1, %r13d
pushq $0xa
popq %rax
cmovel %eax, %r13d
movslq %r13d, %rdi
shlq $0x2, %rdi
callq 0x2120
movq %rax, %r15
xorl %ebx, %ebx
movl %r13d, %r14d
cmpl $-0x1, -0x50(%rbp)
je 0x4579
cmpq %r14, %rbx
jne 0x4579
leaq 0x5763(%rip), %rdi      # 0x9cd7
callq 0x6515
movl -0x2c(%rbp), %edi
callq 0x3f9e
leaq 0x1(%rbx), %r12
movl %eax, (%r15,%rbx,4)
cmpl $-0x1, -0x50(%rbp)
jne 0x45ae
cmpq %r14, %r12
jne 0x45ae
movslq %r13d, %rax
addl $0xa, %r13d
leaq 0x28(,%rax,4), %rsi
movq %r15, %rdi
callq 0x2140
movq %rax, %r15
leaq 0x9deb(%rip), %rax      # 0xe3a0
cmpl $0x38, (%rax)
je 0x45ca
callq 0x64ff
movq %r12, %rbx
jmp 0x455f
movq -0x38(%rbp), %rdx
jmp 0x460a
leaq 0x9dcf(%rip), %r12      # 0xe3a0
movq %r12, %rdi
callq 0x66f4
leaq 0x1(%rbx), %rcx
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rdx
movl -0x50(%rbp), %r13d
cmpl %ecx, 0x2c(%rax)
jle 0x45f8
andl $0x0, (%r15,%rcx,4)
incq %rcx
jmp 0x45e9
leal 0x1(%rbx), %ecx
cmpl %ebx, %r13d
cmovlel %ecx, %r13d
movq %r15, 0x30(%rax)
movq -0x58(%rbp), %rbx
cmpl $0x4, %edx
movq -0x48(%rbp), %r14
je 0x462c
testl %r13d, %r13d
jg 0x462c
movq 0x8(%rax), %rsi
leaq 0x56db(%rip), %rdi      # 0x9cfe
callq 0x641f
movq -0x40(%rbp), %rax
movl %r13d, 0x2c(%rax)
movl -0x2c(%rbp), %edi
movq %r14, %rsi
callq 0x87a1
movq -0x40(%rbp), %r8
imull %r13d, %eax
movl %eax, 0x28(%r8)
movq -0x38(%rbp), %rax
andl $-0x5, %eax
cmpl $0x1, %eax
jne 0x465f
movq %r8, %rdi
callq 0x5d6b
movq -0x40(%rbp), %r8
xorl %r15d, %r15d
jmp 0x47c1
movq %rbx, %r8
jmp 0x46ae
movq %r15, %rdi
movl -0x2c(%rbp), %esi
movq -0x48(%rbp), %rdx
xorl %ecx, %ecx
pushq $0x1
popq %r8
callq 0x7a4a
jmp 0x46ab
movq %r15, %rdi
movl -0x2c(%rbp), %esi
movq -0x48(%rbp), %rdx
xorl %ecx, %ecx
pushq $0x1
popq %r8
callq 0x79b6
jmp 0x46ab
movq %r15, %rdi
movl -0x2c(%rbp), %esi
movq -0x48(%rbp), %rdx
xorl %ecx, %ecx
callq 0x7a10
movq %rax, %r8
cmpl $0x1, (%r12)
movq %r8, %r14
jne 0x47a1
movq -0x38(%rbp), %rcx
cmpl $0x5, %ecx
ja 0x46cd
pushq $0x26
popq %rax
btl %ecx, %eax
jb 0x46dc
leaq 0x55e1(%rip), %rdi      # 0x9cb5
movq %r15, %rsi
callq 0x641f
movq %r12, %rdi
callq 0x66f4
movq -0x38(%rbp), %rdx
movl %edx, %ebx
andl $-0x5, %ebx
cmpl $0x1, %ebx
jne 0x4710
pushq $0x4
popq %rdi
callq 0x2120
movq %rax, 0x30(%r14)
movl -0x2c(%rbp), %edi
callq 0x3f9e
movq -0x38(%rbp), %rdx
movq 0x30(%r14), %rcx
movl %eax, (%rcx)
cmpl $0x2, %edx
movq %r14, %r8
jne 0x47aa
movl 0x10(%r8), %esi
movq 0x18(%r8), %rdx
pushq $0x1c
popq %rdi
movq %r8, %rcx
xorl %r8d, %r8d
callq 0x818c
movq %rax, %r15
xorl %edi, %edi
callq 0x49b5
movl $0x1, 0x18(%rax)
movl 0x8(%r15), %esi
movq 0x10(%r15), %rdx
movq %rax, %rdi
xorl %ecx, %ecx
callq 0x87ba
movq %rax, %r12
testq %rax, %rax
movq -0x58(%rbp), %rbx
jne 0x476d
leaq 0x5602(%rip), %rdi      # 0x9d6a
callq 0x6515
movl 0x8(%r12), %esi
movq 0x10(%r12), %rdx
andl $0x0, 0x8(%rsp)
andq $0x0, (%rsp)
pushq $0x1
popq %rdi
movq %r12, %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x8108
movq %rax, %r15
leaq 0x9c04(%rip), %r12      # 0xe3a0
movq %r14, %r8
jmp 0x47c1
movq -0x38(%rbp), %rax
andl $-0x5, %eax
movl %eax, %ebx
cmpl $0x1, %ebx
jne 0x47ba
movq %r8, %rdi
callq 0x5d6b
movq %r14, %r8
xorl %r15d, %r15d
movq -0x58(%rbp), %rbx
cmpl $0x1, 0x20(%r8)
je 0x4816
movq (%rbx), %rcx
movq %r15, %rax
testq %rcx, %rcx
je 0x47ef
andl $0x0, 0x8(%rsp)
andq $0x0, (%rsp)
pushq $0x1d
popq %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x8108
movq %rax, (%rbx)
movl (%r12), %eax
cmpl -0x6c(%rbp), %eax
je 0x482d
cmpl -0x68(%rbp), %eax
je 0x482d
movq %r15, -0x50(%rbp)
callq 0x64ff
jmp 0x408a
pushq $-0x1
popq %rax
movl %eax, -0x2c(%rbp)
jmp 0x482d
movl -0x5c(%rbp), %eax
andl $-0x5, %eax
cmpl $0x1, %eax
je 0x482d
leaq 0x51ea(%rip), %rdi      # 0x9a12
callq 0x6515
movl -0x2c(%rbp), %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq