// File: /workspace/github_c_makefile_star2_O1/sisshiki1969[P]monocc/src/debug.c
// Function: print_type
void print_type(FILE *stream, Type *type) {
  MemberInfo *param;
  bool first;
  switch (type->ty) {
    case CHAR:
      fprintf(stream, "char ");
      break;
    case SHORT:
      fprintf(stream, "short ");
      break;
    case USHORT:
      fprintf(stream, "unsigned short ");
      break;
    case INT:
      fprintf(stream, "int ");
      break;
    case UINT:
      fprintf(stream, "unsigned int ");
      break;
    case LONG:
      fprintf(stream, "long ");
      break;
    case ULONG:
      fprintf(stream, "unsigned long ");
      break;
    case BOOL:
      fprintf(stream, "bool ");
      break;
    case VOID:
      fprintf(stream, "void ");
      break;
    case PTR:
      fprintf(stream, "* ");
      print_type(stream, type->ptr_to);
      break;
    case ARRAY:
      fprintf(stream, "[%d] ", type->array_size);
      print_type(stream, type->ptr_to);
      break;
    case FUNC:
      fprintf(stream, "func ");
      if (type->variadic) fprintf(stream, "VARIADIC ");
      param = type->params;
      fprintf(stream, "( ");
      first = true;
      while (param) {
        if (!first) fprintf(stream, ", ");
        first = false;
        if (param->type)
          print_type(stream, param->type);
        else
          fprintf(stream, "NULL_TYPE");
        if (param->ident)
          fprintf(stream, " %.*s ", param->ident->len, param->ident->str);
        else
          fprintf(stream, "- ");
        param = param->next;
      }
      fprintf(stream, ") ");
      print_type(stream, type->ptr_to);
      break;
    case STRUCT:
      fprintf(stream, "struct ");
      if (type->tag_name) {
        fprintf(stream, "<%.*s> ", type->tag_name->len, type->tag_name->str);
      } else {
        fprintf(stream, "<> { ");
        print_struct_member(stream, type->member);
        fprintf(stream, "}");
      }
      break;
      // Type *member = type->member;
    case ENUM:
      fprintf(stream, "enum ");
      if (type->tag_name) {
        fprintf(stream, "<%.*s> ", type->tag_name->len, type->tag_name->str);
      }
      break;
    case ENUM_EL:
      fprintf(stream, "enum_el ");
      if (type->tag_name) {
        fprintf(stream, "<%.*s:%d> ", type->tag_name->len, type->tag_name->str,
                type->offset);
      }
      break;
    default:
      error("print_type(): Unknown Type.");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8501(%rip), %r12      # 0xcc98
leaq 0x8730(%rip), %r13      # 0xcece
leaq 0x87ae(%rip), %rbp      # 0xcf53
leaq 0x8715(%rip), %r15      # 0xcec1
movl (%r14), %eax
cmpq $0xe, %rax
ja 0x4a96
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movl $0x2, %esi
movl $0x1, %edx
leaq 0x86d2(%rip), %rdi      # 0xcea5
movq %rbx, %rcx
callq 0x1190
movq 0x8(%r14), %r14
jmp 0x47ac
movl 0x10(%r14), %edx
movq %rbx, %rdi
leaq 0x86b9(%rip), %rsi      # 0xcea8
xorl %eax, %eax
callq 0x10f0
movq 0x8(%r14), %r14
jmp 0x47ac
movl $0x5, %esi
movl $0x1, %edx
leaq 0x86a1(%rip), %rdi      # 0xceae
movq %rbx, %rcx
callq 0x1190
cmpb $0x1, 0x38(%r14)
jne 0x4835
movl $0x9, %esi
movl $0x1, %edx
leaq 0x8687(%rip), %rdi      # 0xceb4
movq %rbx, %rcx
callq 0x1190
movq 0x18(%r14), %r12
movl $0x2, %esi
movl $0x1, %edx
leaq 0x8674(%rip), %rdi      # 0xcebe
movq %rbx, %rcx
callq 0x1190
testq %r12, %r12
je 0x48e7
movb $0x1, %al
testb $0x1, %al
jne 0x4876
movl $0x2, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x1190
movq 0x10(%r12), %rsi
testq %rsi, %rsi
je 0x488a
movq %rbx, %rdi
callq 0x477f
jmp 0x48a3
movl $0x9, %esi
movl $0x1, %edx
leaq 0x8629(%rip), %rdi      # 0xcec4
movq %rbx, %rcx
callq 0x1190
movq 0x8(%r12), %rax
testq %rax, %rax
je 0x48c3
movl 0x28(%rax), %edx
movq 0x20(%rax), %rcx
movq %rbx, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x10f0
jmp 0x48d8
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x1190
movq (%r12), %r12
xorl %eax, %eax
testq %r12, %r12
jne 0x485d
movl $0x2, %esi
movl $0x1, %edx
leaq 0x85d9(%rip), %rdi      # 0xced1
movq %rbx, %rcx
callq 0x1190
movq 0x8(%r14), %r14
leaq 0x838d(%rip), %r12      # 0xcc98
jmp 0x47ac
leaq 0x85bd(%rip), %rdi      # 0xced4
movl $0x7, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1190
movq 0x30(%r14), %rax
testq %rax, %rax
jne 0x4a70
leaq 0x85a7(%rip), %rdi      # 0xcee4
movl $0x5, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1190
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x4b40
movl $0x7d, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10c0
leaq 0x84ef(%rip), %rdi      # 0xce6c
movl $0xf, %esi
jmp 0x49c7
leaq 0x850e(%rip), %rdi      # 0xce99
jmp 0x49c2
leaq 0x84e1(%rip), %rdi      # 0xce75
movl $0x6, %esi
jmp 0x49c7
leaq 0x84f1(%rip), %rdi      # 0xce93
jmp 0x49c2
leaq 0x84bb(%rip), %rdi      # 0xce66
jmp 0x49c2
leaq 0x84c8(%rip), %rdi      # 0xce7c
movl $0xd, %esi
jmp 0x49c7
leaq 0x84dd(%rip), %rdi      # 0xce9f
movl $0x5, %esi
movl $0x1, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1190
leaq 0x84a1(%rip), %rdi      # 0xce8a
movl $0xe, %esi
jmp 0x49c7
leaq 0x848e(%rip), %rdi      # 0xce85
movl $0x4, %esi
jmp 0x49c7
leaq 0x84eb(%rip), %rdi      # 0xcef0
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1190
movq 0x30(%r14), %rax
testq %rax, %rax
je 0x4ab2
movl 0x28(%rax), %edx
movq 0x20(%rax), %rcx
movl 0x28(%r14), %r8d
leaq 0x84c3(%rip), %rsi      # 0xcef9
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10f0
leaq 0x8495(%rip), %rdi      # 0xceea
movl $0x5, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1190
movq 0x30(%r14), %rax
testq %rax, %rax
je 0x4ab2
movl 0x28(%rax), %edx
movq 0x20(%rax), %rcx
leaq 0x845e(%rip), %rsi      # 0xcedc
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10f0
leaq 0x8467(%rip), %rdi      # 0xcf04
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x50b0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq