// File: /workspace/github_c_makefile_star2_O2/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 0x6eef(%rip), %r15      # 0xac98
pushq $0x2
popq %r12
pushq $0x1
popq %r13
leaq 0x719b(%rip), %rbp      # 0xaf53
movl (%r14), %eax
cmpq $0xe, %rax
ja 0x4058
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
leaq 0x70d0(%rip), %rdi      # 0xaea5
movq %r12, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x1190
jmp 0x3eee
movl 0x10(%r14), %edx
movq %rbx, %rdi
leaq 0x70b2(%rip), %rsi      # 0xaea8
xorl %eax, %eax
callq 0x10f0
jmp 0x3eee
leaq 0x70a5(%rip), %rdi      # 0xaeae
pushq $0x5
popq %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x1190
cmpb $0x1, 0x38(%r14)
jne 0x3e33
leaq 0x708f(%rip), %rdi      # 0xaeb4
pushq $0x9
popq %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x1190
movq 0x18(%r14), %r15
leaq 0x7080(%rip), %rdi      # 0xaebe
movq %r12, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x1190
movb $0x1, %al
testq %r15, %r15
je 0x3ed2
testb $0x1, %al
jne 0x3e6c
leaq 0x7063(%rip), %rdi      # 0xaec1
movq %r12, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x1190
movq 0x10(%r15), %rsi
testq %rsi, %rsi
je 0x3e7f
movq %rbx, %rdi
callq 0x3d91
jmp 0x3e94
leaq 0x703e(%rip), %rdi      # 0xaec4
pushq $0x9
popq %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x1190
movq 0x8(%r15), %rax
testq %rax, %rax
je 0x3eb3
movl 0x28(%rax), %edx
movq 0x20(%rax), %rcx
movq %rbx, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x10f0
jmp 0x3ec8
leaq 0x7014(%rip), %rdi      # 0xaece
movq %r12, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x1190
movq (%r15), %r15
xorl %eax, %eax
jmp 0x3e4e
leaq 0x6ff8(%rip), %rdi      # 0xaed1
movq %r12, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x1190
leaq 0x6daa(%rip), %r15      # 0xac98
movq 0x8(%r14), %r14
jmp 0x3db8
leaq 0x6fd6(%rip), %rdi      # 0xaed4
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x1190
movq 0x30(%r14), %rax
testq %rax, %rax
jne 0x4032
leaq 0x6fc4(%rip), %rdi      # 0xaee4
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x1190
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x4107
pushq $0x7d
popq %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10c0
leaq 0x6f12(%rip), %rdi      # 0xae6c
pushq $0xf
jmp 0x3f98
leaq 0x6f34(%rip), %rdi      # 0xae99
jmp 0x3f96
leaq 0x6f07(%rip), %rdi      # 0xae75
pushq $0x6
jmp 0x3f98
leaq 0x6f1a(%rip), %rdi      # 0xae93
jmp 0x3f96
leaq 0x6ee4(%rip), %rdi      # 0xae66
jmp 0x3f96
leaq 0x6ef1(%rip), %rdi      # 0xae7c
pushq $0xd
jmp 0x3f98
leaq 0x6f09(%rip), %rdi      # 0xae9f
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1190
leaq 0x6ed1(%rip), %rdi      # 0xae8a
pushq $0xe
jmp 0x3f98
leaq 0x6ec1(%rip), %rdi      # 0xae85
pushq $0x4
jmp 0x3f98
leaq 0x6f21(%rip), %rdi      # 0xaef0
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x1190
movq 0x30(%r14), %rax
testq %rax, %rax
je 0x4074
movl 0x28(%rax), %edx
movq 0x20(%rax), %rcx
movl 0x28(%r14), %r8d
leaq 0x6efd(%rip), %rsi      # 0xaef9
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10f0
leaq 0x6ecf(%rip), %rdi      # 0xaeea
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x1190
movq 0x30(%r14), %rax
testq %rax, %rax
je 0x4074
movl 0x28(%rax), %edx
movq 0x20(%rax), %rcx
leaq 0x6e9c(%rip), %rsi      # 0xaedc
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10f0
leaq 0x6ea5(%rip), %rdi      # 0xaf04
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x462f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq