// File: /workspace/github_c_makefile_star2_O1/ejunjsh[P]mycc/stmt.c
// Function: single_statement
static struct ASTnode *single_statement(void) {
  struct ASTnode *stmt;
  struct symtable *ctype;
  int linenum= Line;

  switch (Token.token) {
    case T_SEMI:
      // 空语句
      semi();
      break;
    case T_LBRACE:
      // 有 '{', 所以这个是个组合语句
      lbrace();
      stmt = compound_statement(0);
      stmt->linenum= linenum;
      rbrace();
      return (stmt);
    case T_IDENT:
      // 如果标识符不是个typedef,当它为表达式处理
      // 如果是,那就由下面的情况来处理
      if (findtypedef(Text) == NULL) {
        stmt = binexpr(0);
        stmt->linenum= linenum;
        semi();
        return (stmt);
      }
    case T_CHAR:
    case T_INT:
    case T_LONG:
    case T_STRUCT:
    case T_UNION:
    case T_ENUM:
    case T_TYPEDEF:
      // 变量声明
      declaration_list(&ctype, C_LOCAL, T_SEMI, T_EOF, &stmt);
      semi();
      return (stmt);		// 变量声明也可能有赋值
    case T_IF:
      stmt= if_statement(); stmt->linenum= linenum; return(stmt);
    case T_WHILE:
      stmt= while_statement(); stmt->linenum= linenum; return(stmt);
    case T_FOR:
      stmt= for_statement(); stmt->linenum= linenum; return(stmt);
    case T_RETURN:
      stmt= return_statement(); stmt->linenum= linenum; return(stmt);
    case T_BREAK:
      stmt= break_statement(); stmt->linenum= linenum; return(stmt);
    case T_CONTINUE:
      stmt= continue_statement(); stmt->linenum= linenum; return(stmt);
    case T_SWITCH:
      stmt= switch_statement(); stmt->linenum= linenum; return(stmt);
    default:
      // 到这里,剩下的应该就是赋值的语句了
      stmt = binexpr(0);
      stmt->linenum= linenum;
      semi();
      return (stmt);
  }
  return (NULL);		
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x7ce4(%rip), %rax      # 0xf368
movl (%rax), %r13d
leaq 0x7d12(%rip), %r15      # 0xf3a0
movl (%r15), %eax
addl $-0x1f, %eax
cmpl $0x18, %eax
ja 0x78dd
leaq 0x42a8(%rip), %rcx      # 0xb94c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x60(%rbp), %rdi
leaq -0x30(%rbp), %rbx
movl $0x2, %esi
movl $0x35, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x42bb
callq 0x67f5
movq (%rbx), %r14
jmp 0x7c25
leaq 0x7ef7(%rip), %rax      # 0xf5d4
cmpl $0x0, (%rax)
jne 0x76ee
leaq 0x4329(%rip), %rdi      # 0xba12
callq 0x688f
leaq 0x7cab(%rip), %rdi      # 0xf3a0
callq 0x6a78
callq 0x67f5
movl $0x30, %edi
jmp 0x773c
leaq 0x7ec7(%rip), %rax      # 0xf5d4
leaq 0x7ec4(%rip), %rcx      # 0xf5d8
movl (%rcx), %ecx
orl (%rax), %ecx
jne 0x7726
leaq 0x42cd(%rip), %rdi      # 0xb9ee
callq 0x688f
leaq 0x7c73(%rip), %rdi      # 0xf3a0
callq 0x6a78
callq 0x67f5
movl $0x2f, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x883b
jmp 0x7c1a
leaq 0x4085(%rip), %rsi      # 0xb7db
movl $0x25, %edi
callq 0x6770
callq 0x6837
movl $0x35, %edi
callq 0x4c3c
movq %rax, %rbx
callq 0x67f5
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x4cc5
movq %rax, %r14
movl 0x4(%rax), %eax
addl $-0x13, %eax
cmpl $-0x7, %eax
movl %r13d, -0x34(%rbp)
ja 0x77b1
movl 0x8(%r14), %esi
movq 0x10(%r14), %rdx
movl $0x2e, %edi
movq %r14, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x885b
movq %rax, %r14
callq 0x67f5
movl $0x3a, %edi
callq 0x4c3c
movq %rax, %r15
callq 0x684d
leaq 0x7e05(%rip), %r13      # 0xf5d4
incl (%r13)
callq 0x766c
decl (%r13)
movl $0x1d, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %rax, %rcx
xorl %r8d, %r8d
movq %r15, %r9
pushq %r12
pushq %r12
callq 0x87b0
addq $0x10, %rsp
movl $0x1f, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %r14, %rcx
xorl %r8d, %r8d
movq %rax, %r9
pushq %r12
pushq %r12
callq 0x87b0
addq $0x10, %rsp
movl $0x1d, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
movq %rax, %r9
pushq %r12
pushq %r12
callq 0x87b0
addq $0x10, %rsp
movq %rax, %r14
movq %rax, -0x30(%rbp)
jmp 0x7bc7
leaq 0x3f89(%rip), %rsi      # 0xb7d5
movl $0x24, %edi
callq 0x6770
callq 0x6837
xorl %edi, %edi
callq 0x4cc5
movq %rax, %rbx
movl 0x4(%rax), %eax
addl $-0x13, %eax
cmpl $-0x7, %eax
ja 0x788d
movl 0x8(%rbx), %esi
movq 0x10(%rbx), %rdx
movl $0x2e, %edi
movq %rbx, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x885b
movq %rax, %rbx
callq 0x684d
leaq 0x7d3b(%rip), %r14      # 0xf5d4
incl (%r14)
callq 0x766c
decl (%r14)
movl $0x1f, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
movq %rax, %r9
jmp 0x7c0d
callq 0x67f5
xorl %r14d, %r14d
jmp 0x7c25
leaq 0x7b01(%rip), %rdi      # 0xf3d0
callq 0x83ac
testq %rax, %rax
jne 0x76ad
xorl %edi, %edi
callq 0x4cc5
movq %rax, -0x30(%rbp)
movl %r13d, 0x40(%rax)
callq 0x67f5
jmp 0x7984
leaq 0x40ea(%rip), %rsi      # 0xb9e7
movl $0x26, %edi
callq 0x6770
cmpl $0x39, (%r15)
jne 0x7bd0
leaq 0x7a60(%rip), %rbx      # 0xf378
movq (%rbx), %rax
cmpl $0x10, 0x10(%rax)
jne 0x792d
leaq 0x4088(%rip), %rdi      # 0xb9b0
callq 0x688f
callq 0x6837
xorl %edi, %edi
callq 0x4cc5
movq (%rbx), %rcx
movl 0x10(%rcx), %esi
movq 0x18(%rcx), %rdx
movq %rax, %rdi
xorl %ecx, %ecx
callq 0x8e42
movq %rax, %rbx
testq %rax, %rax
jne 0x7961
leaq 0x4076(%rip), %rdi      # 0xb9d2
callq 0x688f
callq 0x684d
jmp 0x7bd2
callq 0x680b
xorl %edi, %edi
callq 0x75f0
movq %rax, -0x30(%rbp)
movl %r13d, 0x40(%rax)
callq 0x6821
movq -0x30(%rbp), %r14
jmp 0x7c25
leaq 0x3e39(%rip), %rsi      # 0xb7cd
movl $0x22, %edi
callq 0x6770
callq 0x6837
xorl %edi, %edi
callq 0x4cc5
movq %rax, %rbx
movl 0x4(%rax), %eax
addl $-0x13, %eax
cmpl $-0x7, %eax
ja 0x79d5
movl 0x8(%rbx), %esi
movq 0x10(%rbx), %rdx
movl $0x2e, %edi
movq %rbx, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x885b
movq %rax, %rbx
callq 0x684d
callq 0x766c
movq %rax, %r14
cmpl $0x23, (%r15)
jne 0x7bfb
leaq 0x79ad(%rip), %rdi      # 0xf3a0
callq 0x6a78
callq 0x766c
movq %rax, %r9
jmp 0x7bfe
movl %r13d, -0x34(%rbp)
leaq 0x7990(%rip), %r15      # 0xf3a0
movq %r15, %rdi
callq 0x6a78
callq 0x6837
movq $0x0, -0x48(%rbp)
xorl %edi, %edi
callq 0x4cc5
movq %rax, %rbx
callq 0x684d
callq 0x680b
movl 0x8(%rbx), %edi
callq 0x8db0
testl %eax, %eax
jne 0x7a51
leaq 0x3fdd(%rip), %rdi      # 0xba29
callq 0x688f
movl $0x31, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x885b
movq %rax, -0x58(%rbp)
leaq 0x7b65(%rip), %rax      # 0xf5d8
incl (%rax)
xorl %r14d, %r14d
movq $0x0, -0x40(%rbp)
movl (%r15), %eax
leal -0x2f(%rax), %ecx
cmpl $0x2, %ecx
jae 0x7adb
cmpl $0x0, -0x48(%rbp)
je 0x7a9d
leaq 0x3fcd(%rip), %rdi      # 0xba65
callq 0x688f
movl (%r15), %ebx
movq %r15, %r12
movq %r15, %rdi
callq 0x6a78
cmpl $0x30, %ebx
jne 0x7b00
movl $0x33, %r15d
movl $0x1, %eax
movq %rax, -0x48(%rbp)
movl $0x40, %edi
leaq 0x2aba(%rip), %rsi      # 0xa585
callq 0x6770
cmpl $0x2f, (%r12)
jne 0x7b45
xorl %ecx, %ecx
jmp 0x7b52
cmpl $0x38, %eax
jne 0x7b7c
movb $0x1, %bl
testl %r14d, %r14d
jne 0x7b9b
leaq 0x3f5c(%rip), %rdi      # 0xba52
callq 0x688f
jmp 0x7b9b
xorl %edi, %edi
callq 0x4cc5
movq %rax, %r15
cmpl $0x1a, 0x4(%rax)
je 0x7b1c
leaq 0x3f75(%rip), %rdi      # 0xba8c
callq 0x688f
movl (%r15), %r13d
movl $0x32, %r15d
movq -0x40(%rbp), %rbx
testq %rbx, %rbx
je 0x7abf
cmpl (%rbx), %r13d
jne 0x7b3f
leaq 0x3f7b(%rip), %rdi      # 0xbab5
callq 0x688f
movq 0x30(%rbx), %rbx
jmp 0x7b29
movl $0x1, %edi
callq 0x75f0
movq %rax, %rcx
incl %r14d
xorl %ebx, %ebx
movl %r15d, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %r8d, %r8d
movl %r13d, %r9d
callq 0x885b
cmpq $0x0, -0x40(%rbp)
je 0x7b90
movq -0x50(%rbp), %rcx
movq %rax, 0x30(%rcx)
xorl %ebx, %ebx
jmp 0x7b94
movq 0x8(%r15), %rsi
leaq 0x3f43(%rip), %rdi      # 0xbaca
callq 0x6797
xorl %ebx, %ebx
jmp 0x7b9b
movq %rax, -0x40(%rbp)
movq %rax, -0x50(%rbp)
movq %r12, %r15
testb %bl, %bl
je 0x7a80
leaq 0x7a2e(%rip), %rax      # 0xf5d8
decl (%rax)
movq -0x58(%rbp), %rax
movl %r14d, (%rax)
movq %rax, %r14
movq -0x40(%rbp), %rax
movq %rax, 0x30(%r14)
callq 0x6821
movq %r14, -0x30(%rbp)
movl -0x34(%rbp), %eax
movl %eax, 0x40(%r14)
jmp 0x7c25
xorl %ebx, %ebx
movl $0x22, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x885b
movq %rax, %r14
callq 0x67f5
movq %r14, -0x30(%rbp)
movl %r13d, 0x40(%r14)
jmp 0x7c25
xorl %r9d, %r9d
movl $0x1e, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
movq %r14, %r8
pushq $0x0
pushq $0x0
callq 0x87b0
addq $0x10, %rsp
movq %rax, %r14
movq %rax, -0x30(%rbp)
movl %r13d, 0x40(%rax)
movq %r14, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop