// File: /workspace/github_cpp_makefile_star2_O2/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 0x4b05
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x78(%rsi), %rdi
callq 0x2050
testb %al, %al
je 0x4af5
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%r14,%rax)
jne 0x4af5
leaq -0x28(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x38(%rbp), %rsi
movq %r14, %rdi
callq 0x21f0
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
callq 0x22d0
movsbl (%rax), %eax
addl $-0x30, %eax
cmpl $0x9, %eax
jbe 0x4a6c
leaq -0x58(%rbp), %rdi
leaq -0x38(%rbp), %rsi
pushq $0x1
popq %rcx
xorl %edx, %edx
callq 0x21a0
movq -0x58(%rbp), %rax
movzbl (%rax), %r14d
subl $0x2d, %r14d
jne 0x4a57
movzbl 0x1(%rax), %r14d
negl %r14d
leaq -0x58(%rbp), %rdi
callq 0x20c0
testl %r14d, %r14d
jne 0x4b41
pushq $0x1
popq %r14
leaq -0x38(%rbp), %r15
cmpq %r14, -0x30(%rbp)
jbe 0x4acb
movq %r15, %rdi
movq %r14, %rsi
callq 0x22d0
movsbl (%rax), %eax
addl $-0x30, %eax
incq %r14
cmpl $0xa, %eax
jb 0x4a74
movq 0x653e(%rip), %rdi      # 0xafd8
leaq 0x29f5(%rip), %rsi      # 0x7496
callq 0x2170
movq %rax, %rdi
callq 0x20d0
movq 0x6523(%rip), %rdi      # 0xafd8
leaq 0x2706(%rip), %rsi      # 0x71c2
callq 0x2170
movq %rax, %rdi
callq 0x20d0
jmp 0x4b3a
movq -0x38(%rbp), %rdi
callq 0x2250
movl %eax, 0x20(%rbx)
cmpb $0x0, 0x25(%rbx)
jne 0x4ae1
movb $0x1, 0x25(%rbx)
leaq -0x38(%rbp), %rdi
callq 0x20c0
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x64dc(%rip), %rbx      # 0xafd8
leaq 0x29b0(%rip), %rsi      # 0x74b3
jmp 0x4b13
movq 0x64cc(%rip), %rbx      # 0xafd8
leaq 0x29db(%rip), %rsi      # 0x74ee
movq %rbx, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x261c(%rip), %rsi      # 0x7146
movq %rbx, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
xorl %edi, %edi
callq 0x21d0
movq 0x6490(%rip), %rdi      # 0xafd8
leaq 0x2947(%rip), %rsi      # 0x7496
callq 0x2170
movq %rax, %rdi
callq 0x20d0
movq 0x6475(%rip), %rdi      # 0xafd8
leaq 0x25dc(%rip), %rsi      # 0x7146
callq 0x2170
movq %rax, %rdi
callq 0x20d0
jmp 0x4b3a
jmp 0x4b7f
jmp 0x4b7f
jmp 0x4b7f
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x2290
nop