// File: /workspace/github_cpp_makefile_star2_O1/smallsimple[P]CoreInterpreter-CSE5341/Id.cpp
// Function: Id::ReadId(std::basic_ifstream<char, std::char_traits<char>>*)
void Id::ReadId(ifstream* inputfile){
  if(inputfile != NULL){
    if(inputfile->is_open() && !inputfile->eof()){
      int integer;
      string num;
      *inputfile >> num;
      if (!isdigit(num.at(0))) {
	if (strcmp("-", num.substr(0,1).c_str()) != 0){
	  cout << "Error: input is not a number" << endl;
	  cout << "program stopped." << endl;
	  exit(0);
	}
      }
      for (int i=1; i< num.size(); i++){
	if (!isdigit (num.at(i))){
	  cout << "Error: input is not a number" << endl;
	  cout << "program stopped!" << endl;
	  exit(0);
	}
      }
      integer = atoi(num.c_str());
      this->SetIdVal(integer);
    }
    else {
      cout << "input file is not open or has reached the end of the file." << endl;
      cout << "program stopped." << endl;
      exit(0);
    }
  }
  else{
    cout << "Error: no input file is assigned." << endl;
    cout << "program stopped." << endl;
    exit(0);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
testq %rsi, %rsi
je 0x5409
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x78(%rsi), %rdi
callq 0x2060
testb %al, %al
je 0x53f9
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%r14,%rax)
jne 0x53f9
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x2210
movq -0x40(%rbp), %rdx
testq %rdx, %rdx
je 0x5445
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
addl $-0x30, %eax
cmpl $0xa, %eax
jb 0x534c
leaq -0x68(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movl $0x1, %ecx
xorl %edx, %edx
callq 0x21b0
leaq -0x58(%rbp), %r13
movq -0x10(%r13), %r14
leaq 0x3191(%rip), %rdi      # 0x84b5
movq %r14, %rsi
callq 0x2220
movl %eax, %r15d
cmpq %r13, %r14
je 0x5343
movq -0x58(%rbp), %rsi
incq %rsi
movq %r14, %rdi
callq 0x21a0
testl %r15d, %r15d
jne 0x5455
movq -0x40(%rbp), %rax
cmpq $0x2, %rax
jb 0x5373
movl $0x1, %ecx
movq -0x48(%rbp), %rdx
movsbl (%rdx,%rcx), %esi
addl $-0x30, %esi
cmpl $0xa, %esi
jae 0x53af
incq %rcx
cmpq %rcx, %rax
jne 0x535f
movq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x2270
movl %eax, 0x20(%rbx)
cmpb $0x0, 0x25(%rbx)
jne 0x538c
movb $0x1, 0x25(%rbx)
cmpq %r12, %r14
je 0x53a0
movq -0x38(%rbp), %rsi
incq %rsi
movq %r14, %rdi
callq 0x21a0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x6c22(%rip), %rdi      # 0xbfd8
leaq 0x30fa(%rip), %rsi      # 0x84b7
movl $0x1c, %edx
callq 0x21d0
movq 0x6c0a(%rip), %rdi      # 0xbfd8
callq 0x20c0
movq 0x6bfe(%rip), %rdi      # 0xbfd8
leaq 0x2db5(%rip), %rsi      # 0x8196
movl $0x10, %edx
callq 0x21d0
movq 0x6be6(%rip), %rdi      # 0xbfd8
callq 0x20c0
jmp 0x543e
movq 0x6bd8(%rip), %rbx      # 0xbfd8
leaq 0x30cd(%rip), %rsi      # 0x84d4
jmp 0x5417
movq 0x6bc8(%rip), %rbx      # 0xbfd8
leaq 0x30f8(%rip), %rsi      # 0x850f
movq %rbx, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
leaq 0x2cec(%rip), %rsi      # 0x811a
movq %rbx, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
xorl %edi, %edi
callq 0x21f0
leaq 0x2e43(%rip), %rdi      # 0x828f
xorl %esi, %esi
xorl %eax, %eax
callq 0x2240
movq 0x6b7c(%rip), %rdi      # 0xbfd8
leaq 0x3054(%rip), %rsi      # 0x84b7
movl $0x1c, %edx
callq 0x21d0
movq 0x6b64(%rip), %rdi      # 0xbfd8
callq 0x20c0
movq 0x6b58(%rip), %rdi      # 0xbfd8
leaq 0x2c93(%rip), %rsi      # 0x811a
movl $0x10, %edx
callq 0x21d0
movq 0x6b40(%rip), %rdi      # 0xbfd8
callq 0x20c0
jmp 0x543e
jmp 0x54a3
jmp 0x54a3
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x54bb
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x22b0
nop