// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
subq $0x48, %rsp
testq %rsi, %rsi
je 0x533b
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x78(%rsi), %rdi
callq 0x2060
testb %al, %al
je 0x532b
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%r14,%rax)
jne 0x532b
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq -0x38(%rbp), %rsi
movq %r14, %rdi
callq 0x2210
movq -0x30(%rbp), %rax
testq %rax, %rax
je 0x5377
movq -0x38(%rbp), %r14
movsbl (%r14), %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x528d
leaq -0x58(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movl $0x1, %ecx
xorl %edx, %edx
callq 0x21b0
movq -0x58(%rbp), %rdi
movzbl (%rdi), %r14d
subl $0x2d, %r14d
jne 0x5264
movzbl 0x1(%rdi), %r14d
negl %r14d
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x527c
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21a0
testl %r14d, %r14d
jne 0x5389
movq -0x38(%rbp), %r14
movq -0x30(%rbp), %rax
cmpq $0x2, %rax
jb 0x52ad
movl $0x1, %ecx
movsbl (%r14,%rcx), %edx
addl $-0x30, %edx
cmpl $0xa, %edx
jae 0x52e1
incq %rcx
cmpq %rcx, %rax
jne 0x5298
movq %r14, %rdi
callq 0x2260
movl %eax, 0x20(%rbx)
cmpb $0x0, 0x25(%rbx)
jne 0x52c2
movb $0x1, 0x25(%rbx)
cmpq %r15, %r14
je 0x52d6
movq -0x28(%rbp), %rsi
incq %rsi
movq %r14, %rdi
callq 0x21a0
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x6cf0(%rip), %rdi      # 0xbfd8
leaq 0x31c6(%rip), %rsi      # 0x84b5
movl $0x1c, %edx
callq 0x21d0
movq 0x6cd8(%rip), %rdi      # 0xbfd8
callq 0x20c0
movq 0x6ccc(%rip), %rdi      # 0xbfd8
leaq 0x2e83(%rip), %rsi      # 0x8196
movl $0x10, %edx
callq 0x21d0
movq 0x6cb4(%rip), %rdi      # 0xbfd8
callq 0x20c0
jmp 0x5370
movq 0x6ca6(%rip), %rbx      # 0xbfd8
leaq 0x3199(%rip), %rsi      # 0x84d2
jmp 0x5349
movq 0x6c96(%rip), %rbx      # 0xbfd8
leaq 0x31c4(%rip), %rsi      # 0x850d
movq %rbx, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
leaq 0x2dba(%rip), %rsi      # 0x811a
movq %rbx, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
xorl %edi, %edi
callq 0x21f0
leaq 0x2f11(%rip), %rdi      # 0x828f
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2230
movq 0x6c48(%rip), %rdi      # 0xbfd8
leaq 0x311e(%rip), %rsi      # 0x84b5
movl $0x1c, %edx
callq 0x21d0
movq 0x6c30(%rip), %rdi      # 0xbfd8
callq 0x20c0
movq 0x6c24(%rip), %rdi      # 0xbfd8
leaq 0x2d5f(%rip), %rsi      # 0x811a
movl $0x10, %edx
callq 0x21d0
movq 0x6c0c(%rip), %rdi      # 0xbfd8
callq 0x20c0
jmp 0x5370
jmp 0x53d7
jmp 0x53d7
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x53ef
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x22a0
nop