// File: /workspace/github_c_makefile_star2_O0/taeguk[P]Compiler-Proj-Cminus/src/analyze.c
// Function: registerIO
static void registerIO(void)
{
  SymbolInfo *symbolInfo = NULL;
  int registerSuccess = 0;
  TreeNode* type_specifier, // return type of a function
       *_var, // function name
       *params, // parameters of a function
       *compound_stmt, // body of a function, TODO: Do we need this?
       *func_decl;

  /* register int input(void) */
  // set func_decl
  type_specifier = newTokenTypeNode(INT);
  _var = newVariableNode("input");
  params = NULL;
  compound_stmt = newCompoundStatementNode(
                  /* local_declarations */NULL,
                  /* statement_list */ NULL);
  func_decl = newFunctionDeclarationNode(
              type_specifier,
              _var,
              params,
              compound_stmt);
  // Register Symbol
  MALLOC(symbolInfo, sizeof(*symbolInfo));
  symbolInfo = setSymbolInfo(func_decl);
  _var->lineno = -1;
  registerSymbol(func_decl, func_decl->attr.varDecl._var, symbolInfo);


  /* register void output(int) */
  type_specifier = newTokenTypeNode(VOID);
  _var = newVariableNode("output");
  params = newVariableParameterNode(
           /* type_spec */ newTokenTypeNode(INT),
           /* _id */ newVariableNode("")
           );
  compound_stmt = newCompoundStatementNode(
                  /* local_declarations */NULL,
                  /* statement_list */ NULL);
  func_decl = newFunctionDeclarationNode(
              type_specifier,
              _var,
              params,
              compound_stmt);
  // Register Symbol
  MALLOC(symbolInfo, sizeof(*symbolInfo));
  symbolInfo = setSymbolInfo(func_decl);
  _var->lineno = -1;
  registerSymbol(func_decl, func_decl->attr.varDecl._var, symbolInfo);

/*
  symbolInfo->nodeType = FuncT;
  symbolInfo->attr.funcInfo.retType = IntT;
  symbolInfo->attr.funcInfo.paramTypeList = NULL;
  symbolInfo->attr.funcInfo.paramLen = n_param;
*/


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq $0x0, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x107, %edi            # imm = 0x107
callq 0x7e60
movq %rax, -0x18(%rbp)
leaq 0x804f(%rip), %rdi      # 0x93bb
callq 0x7d10
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0x7980
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x7870
movq %rax, -0x38(%rbp)
movl $0x18, %edi
callq 0x1160
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x1405
leaq 0xce4e(%rip), %rax      # 0xe210
movq (%rax), %rdi
leaq 0x7ff5(%rip), %rsi      # 0x93c1
leaq 0x8013(%rip), %rdx      # 0x93e6
movl $0x18a, %ecx            # imm = 0x18A
leaq 0x8011(%rip), %r8       # 0x93f0
movb $0x0, %al
callq 0x1120
leaq 0x800e(%rip), %rdi      # 0x93fb
leaq 0x7ff2(%rip), %rsi      # 0x93e6
movl $0x18a, %edx            # imm = 0x18A
leaq 0x7ffd(%rip), %rcx      # 0x93fd
callq 0x10e0
jmp 0x1407
movq -0x38(%rbp), %rdi
callq 0x22d0
movq %rax, -0x8(%rbp)
movq -0x20(%rbp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq -0x38(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x8(%rbp), %rdx
callq 0x26e0
movl $0x109, %edi            # imm = 0x109
callq 0x7e60
movq %rax, -0x18(%rbp)
leaq 0x7fca(%rip), %rdi      # 0x9413
callq 0x7d10
movq %rax, -0x20(%rbp)
movl $0x107, %edi            # imm = 0x107
callq 0x7e60
movq %rax, -0x40(%rbp)
leaq 0x8def(%rip), %rdi      # 0xa256
callq 0x7d10
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x78e0
movq %rax, -0x28(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0x7980
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x7870
movq %rax, -0x38(%rbp)
movl $0x18, %edi
callq 0x1160
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x1504
leaq 0xcd4f(%rip), %rax      # 0xe210
movq (%rax), %rdi
leaq 0x7ef6(%rip), %rsi      # 0x93c1
leaq 0x7f14(%rip), %rdx      # 0x93e6
movl $0x1a0, %ecx            # imm = 0x1A0
leaq 0x7f12(%rip), %r8       # 0x93f0
movb $0x0, %al
callq 0x1120
leaq 0x7f0f(%rip), %rdi      # 0x93fb
leaq 0x7ef3(%rip), %rsi      # 0x93e6
movl $0x1a0, %edx            # imm = 0x1A0
leaq 0x7efe(%rip), %rcx      # 0x93fd
callq 0x10e0
jmp 0x1506
movq -0x38(%rbp), %rdi
callq 0x22d0
movq %rax, -0x8(%rbp)
movq -0x20(%rbp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq -0x38(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x8(%rbp), %rdx
callq 0x26e0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)