// File: /workspace/github_c_makefile_star2_O2/sisshiki1969[P]monocc/src/parse.c
// Function: parse_stmt
Node *parse_stmt() {
  if (consume_if(TK_SEMI)) return NULL;
  Node *node;
  Node *then_;
  Token *op_token = token;
  switch (token->kind) {
    case TK_RETURN:
      expect(TK_RETURN);
      if (consume_if(TK_SEMI))
        return new_node_binary(ND_RETURN, NULL, NULL, op_token);
      else {
        node = parse_expr();
        expect(TK_SEMI);
        return new_node_binary(ND_RETURN, node, NULL, op_token);
      }
    case TK_IF:
      expect(TK_IF);
      expect(TK_OP_PAREN);
      node = parse_expr();
      expect(TK_CL_PAREN);
      then_ = parse_stmt();
      if (consume_if(TK_ELSE))
        return new_node_if_then(node, then_, parse_stmt());
      else
        return new_node_if_then(node, then_, NULL);
    case TK_SWITCH:
      switch_level++;
      expect(TK_SWITCH);
      expect(TK_OP_PAREN);
      node = parse_eq_expr();  // this should be a conditional-expr.
      expect(TK_CL_PAREN);
      then_ = parse_stmt();
      switch_level--;
      return new_node_switch(node, then_, op_token);
    case TK_WHILE:
      expect(TK_WHILE);
      expect(TK_OP_PAREN);
      node = parse_expr();
      expect(TK_CL_PAREN);
      return new_node_while(node, parse_stmt());
    case TK_FOR:
      return parse_for();
    case TK_OP_BRACE:
      return parse_block();
    case TK_BREAK:
      expect(TK_BREAK);
      expect(TK_SEMI);
      return new_node(ND_BREAK, op_token);
    case TK_CONTINUE:
      expect(TK_CONTINUE);
      expect(TK_SEMI);
      return new_node(ND_CONTINUE, op_token);
    case TK_CASE:
      if (switch_level == 0)
        error_at_token(op_token,
                       "a case label may only be used within a switch.");
      expect(TK_CASE);
      node = parse_expr();
      expect(TK_COLON);
      then_ = new_node_block(vec_new());
      while (!peek(TK_CASE) && !peek(TK_DEFAULT) && !peek(TK_CL_BRACE))
        add_stmt_to_block(then_, parse_stmt());
      return new_node_case(node, then_, op_token);
    case TK_DEFAULT:
      if (switch_level == 0)
        error_at_token(op_token,
                       "a default label may only be used within a switch.");
      expect(TK_DEFAULT);
      expect(TK_COLON);
      node = parse_stmt();
      return new_node_default(node, op_token);
  }
  node = parse_expr();
  expect(TK_SEMI);
  return node;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0xa5b4(%rip), %r12      # 0x11228
movq (%r12), %rbx
movl (%rbx), %eax
addl $-0x1c, %eax
cmpl $0x16, %eax
ja 0x6ebd
leaq 0x458f(%rip), %rcx      # 0xb21c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%rbx), %rax
movq %rax, (%r12)
xorl %eax, %eax
jmp 0x6ed0
pushq $0x32
popq %rdi
callq 0x5a46
movq (%r12), %rax
cmpl $0x1c, (%rax)
jne 0x6eda
movq 0x8(%rax), %rax
movq %rax, (%r12)
pushq $0x23
popq %rdi
xorl %esi, %esi
jmp 0x6ef0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x6b85
incl 0xa598(%rip)            # 0x11278
pushq $0x2d
popq %rdi
callq 0x5a46
pushq $0x1d
popq %rdi
callq 0x5a46
callq 0x68b1
movq %rax, %r14
pushq $0x1e
popq %rdi
callq 0x5a46
callq 0x6c64
decl 0xa56d(%rip)            # 0x11278
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x56f9
pushq $0x2b
popq %rdi
callq 0x5a46
pushq $0x1d
popq %rdi
callq 0x5a46
callq 0x6ac5
movq %rax, %rbx
pushq $0x1e
popq %rdi
callq 0x5a46
callq 0x6c64
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x585a
pushq $0x29
popq %rdi
callq 0x5a46
pushq $0x1d
popq %rdi
callq 0x5a46
callq 0x6ac5
movq %rax, %rbx
pushq $0x1e
popq %rdi
callq 0x5a46
callq 0x6c64
movq %rax, %r14
movq (%r12), %rax
cmpl $0x2a, (%rax)
jne 0x6f03
movq 0x8(%rax), %rax
movq %rax, (%r12)
callq 0x6c64
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
jmp 0x6f0b
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x711b
cmpl $0x0, 0xa4b8(%rip)      # 0x11278
jne 0x6dd3
leaq 0x47b7(%rip), %rsi      # 0xb580
movq %rbx, %rdi
xorl %eax, %eax
callq 0x48b3
pushq $0x2e
popq %rdi
callq 0x5a46
callq 0x6ac5
movq %rax, %r14
pushq $0x24
popq %rdi
callq 0x5a46
xorl %eax, %eax
callq 0x34c8
movq %rax, %rdi
callq 0x58fc
movq %rax, %r15
movabsq $0xc00100000000, %r13   # imm = 0xC00100000000
movq (%r12), %rax
movl (%rax), %eax
cmpq $0x2f, %rax
ja 0x6e19
btq %rax, %r13
jb 0x6e2b
callq 0x6c64
movq %r15, %rdi
movq %rax, %rsi
callq 0x5925
jmp 0x6e07
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x57fe
cmpl $0x0, 0xa42f(%rip)      # 0x11278
jne 0x6e5c
leaq 0x475d(%rip), %rsi      # 0xb5af
movq %rbx, %rdi
xorl %eax, %eax
callq 0x48b3
pushq $0x2f
popq %rdi
callq 0x5a46
pushq $0x24
popq %rdi
callq 0x5a46
callq 0x6c64
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x582f
pushq $0x31
popq %rdi
callq 0x5a46
pushq $0x1c
popq %rdi
callq 0x5a46
pushq $0x25
jmp 0x6eab
pushq $0x30
popq %rdi
callq 0x5a46
pushq $0x1c
popq %rdi
callq 0x5a46
pushq $0x24
popq %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x563c
callq 0x6ac5
movq %rax, %rbx
pushq $0x1c
popq %rdi
callq 0x5a46
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x6ac5
movq %rax, %r14
pushq $0x1c
popq %rdi
callq 0x5a46
pushq $0x23
popq %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rbx, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x5422
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x56ba