// File: Luthaf[P]zeopp/networkstorage.cc
// Function: read_cgd(_IO_FILE*, ATOM_NETWORK*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
bool read_cgd(FILE *cgd, ATOM_NETWORK *cell, string *net) {
  bool verbose = false; //write parsing progress to terminal
  if(verbose) printf(" --- called read_cgd() --- \n");
  char *line = new char[maxline];
  vector<string> token;
  int line_num = 0;
  bool read_ok = false;
  int atom_index = 0;
  bool uses_atom = false;
  bool uses_node = false; //two different kinds of file format use these different flags, and order/format the data differently ...
  //flags for when line breaks separate the data to be read
  bool anticipating_name = false, anticipating_cell = false, anticipating_group = false, anticipating_atom = false, anticipating_node = false, anticipating_edge = false;
  //reading loop begins here
  while(fgets(line, maxline, cgd)!=NULL && !read_ok) {
    if(verbose) printf("read line \"%s\"\n", line);
    line_num++;
    token = split(string(line)," ()\r\t\n");
    int num_tokens = token.size();
    if(num_tokens==0) {
      //do nothing on this empty line, just skip to next line
    }
    else if(token.at(0)=="name" || token.at(0)=="NAME" || token.at(0)=="id" || token.at(0)=="ID") {
      if(num_tokens>1) { //read from this line if there are fields, else read from next line...
        (*net) = token.at(1); //returning
      } else anticipating_name = true;
      if(verbose) printf("parsed topology name %s\n", net->c_str());
    }
    else if(anticipating_name) {
      (*net) = token.at(0); //returning
      anticipating_name = false;
    }
    else if(token.at(0)=="cell" || token.at(0)=="CELL") {
      if(num_tokens>6) { //read from this line if there are fields, else read from next line...
        parse_cell(&token, 1, cell);
      } else anticipating_cell = true;
    }
    else if(anticipating_cell && num_tokens>5) { //right now potential line breaks between cell definition and data fields are only handled when all the data fields are on the same line
      parse_cell(&token, 0, cell);
      anticipating_cell = false;
    }
    else if(token.at(0)=="group" || token.at(0)=="GROUP") {
      if(num_tokens>1) { //read from this line if there are fields, else read from next line...
        parse_group(&token, 1, cell);
      } else anticipating_group = true;
    }
    else if(anticipating_group) {
      parse_group(&token, 0, cell);
      anticipating_group = false;
    }
    else if(token.at(0)=="atom" || token.at(0)=="ATOM") {
      uses_atom = true;
      if(num_tokens>5) { //read from this line if there are fields, else read from next line...
        parse_atom(&token, 1, cell, &atom_index, &line_num, line, cgd);
      } else anticipating_atom = true;
    }
    else if(anticipating_atom && num_tokens>4) { //right now potential line breaks between atom definition and data fields are only handled when all the data fields are on the same line
      parse_atom(&token, 0, cell, &atom_index, &line_num, line, cgd);
      anticipating_atom = false;
    }
    else if(token.at(0)=="node" || token.at(0)=="NODE") { //a different kind of atom, does not list nodes directly
      uses_node = true;
      if(num_tokens>5) { //read from this line if there are fields, else read from next line...
        parse_node(&token, 1, cell, &atom_index);
      } else anticipating_node = true;
    }
    else if(anticipating_node && num_tokens>4) { //right now potential line breaks between node definition and data fields are only handled when all the data fields are on the same line
      parse_node(&token, 0, cell, &atom_index);
      anticipating_node = false;
    }
    else if(token.at(0)=="edge" || token.at(0)=="EDGE") { //should only occur when the different kind of atom (node) is used - handled differently to edges above
      if(num_tokens>6) { //read from this line if there are fields, else read from next line...
        parse_edge(&token, 1, cell, atom_index, uses_node);
      } else anticipating_edge = true;
    }
    else if(anticipating_edge && num_tokens>5) {
      parse_edge(&token, 0, cell, atom_index, uses_node);
      anticipating_edge = false;
    }
    else if(token.at(0)=="#") { //comment - ignore
      //do nothing
    }
    else if(token.at(0)=="end" || token.at(0)=="END") {
      if(verbose) printf(" --- successfully finished parsing net file --- \n");
      read_ok = true;
    }
    if(uses_node && uses_atom) {
      printf("NET ERROR: detected that both atom and node flags are used in the input net file - this is currently assumed to indicate an invalid input file\n");
      exit(EXIT_FAILURE);
    }
  }
  if(!read_ok) {
    printf("NET WARNING: net file parsing ended before \"end\" line was read\n");
  } else printf("net file parsed correctly\n");
  int num_v = cell->vertices.size();
  bool edges_provided_exhaustively = true;
  for(int i=0; i<num_v && edges_provided_exhaustively; i++) {
    if(cell->vertices.at(i).expected_edges!=cell->vertices.at(i).edges.size()) edges_provided_exhaustively = false;
  }
  delete[] line;
  return edges_provided_exhaustively;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
je 0xa6c7f
leaq 0x15297b(%rip), %rdi    # 0x1f95f3
movb $0x0, %al
callq 0x5070
movl $0x1f4, %edi            # imm = 0x1F4
callq 0x5030
movq %rax, -0x28(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x59240
movl $0x0, -0x44(%rbp)
movb $0x0, -0x45(%rbp)
movl $0x0, -0x4c(%rbp)
movb $0x0, -0x4d(%rbp)
movb $0x0, -0x4e(%rbp)
movb $0x0, -0x4f(%rbp)
movb $0x0, -0x50(%rbp)
movb $0x0, -0x51(%rbp)
movb $0x0, -0x52(%rbp)
movb $0x0, -0x53(%rbp)
movb $0x0, -0x54(%rbp)
movq -0x28(%rbp), %rdi
movq -0x8(%rbp), %rdx
movl $0x1f4, %esi            # imm = 0x1F4
callq 0x57e0
movq %rax, -0xe8(%rbp)
jmp 0xa6ce3
movq -0xe8(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0xe9(%rbp)
je 0xa6d03
movb -0x45(%rbp), %al
xorb $-0x1, %al
movb %al, -0xe9(%rbp)
movb -0xe9(%rbp), %al
testb $0x1, %al
jne 0xa6d12
jmp 0xa757a
testb $0x1, -0x19(%rbp)
je 0xa6d3f
movq -0x28(%rbp), %rsi
leaq 0x1528ed(%rip), %rdi    # 0x1f9610
xorl %eax, %eax
callq 0x5070
jmp 0xa6d2c
jmp 0xa6d3f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xa76cd
movl -0x44(%rbp), %eax
incl %eax
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x100(%rbp)
leaq -0xa1(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x5900
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0x47530
jmp 0xa6d81
leaq -0xc9(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x5900
movq -0x108(%rbp), %rdx
leaq 0x15287e(%rip), %rsi    # 0x1f9620
leaq -0xc8(%rbp), %rdi
callq 0x47530
jmp 0xa6db0
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0xc8(%rbp), %rdx
callq 0x8a620
jmp 0xa6dc9
leaq -0x40(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x59260
leaq -0x80(%rbp), %rdi
callq 0x59290
leaq -0xc8(%rbp), %rdi
callq 0x5300
leaq -0xc9(%rbp), %rdi
callq 0x55d0
leaq -0xa0(%rbp), %rdi
callq 0x5300
leaq -0xa1(%rbp), %rdi
callq 0x55d0
leaq -0x40(%rbp), %rdi
callq 0x592f0
movl %eax, -0xd0(%rbp)
cmpl $0x0, -0xd0(%rbp)
jne 0xa6e89
jmp 0xa754f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xa6e78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xa6e60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x5300
leaq -0xc9(%rbp), %rdi
callq 0x55d0
leaq -0xa0(%rbp), %rdi
callq 0x5300
leaq -0xa1(%rbp), %rdi
callq 0x55d0
jmp 0xa76cd
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x110(%rbp)
jmp 0xa6e9f
movq -0x110(%rbp), %rdi
leaq 0x1501e9(%rip), %rsi    # 0x1f7096
callq 0x845d0
movb %al, -0x111(%rbp)
jmp 0xa6eba
movb -0x111(%rbp), %al
testb $0x1, %al
jne 0xa6f81
jmp 0xa6eca
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x120(%rbp)
jmp 0xa6ee0
movq -0x120(%rbp), %rdi
leaq 0x152739(%rip), %rsi    # 0x1f9627
callq 0x845d0
movb %al, -0x121(%rbp)
jmp 0xa6efb
movb -0x121(%rbp), %al
testb $0x1, %al
jne 0xa6f81
jmp 0xa6f07
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x130(%rbp)
jmp 0xa6f1d
movq -0x130(%rbp), %rdi
leaq 0x14beb1(%rip), %rsi    # 0x1f2ddc
callq 0x845d0
movb %al, -0x131(%rbp)
jmp 0xa6f38
movb -0x131(%rbp), %al
testb $0x1, %al
jne 0xa6f81
jmp 0xa6f44
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x140(%rbp)
jmp 0xa6f5a
movq -0x140(%rbp), %rdi
leaq 0x1526c4(%rip), %rsi    # 0x1f962c
callq 0x845d0
movb %al, -0x141(%rbp)
jmp 0xa6f75
movb -0x141(%rbp), %al
testb $0x1, %al
jne 0xa6f81
jmp 0xa6fe2
cmpl $0x1, -0xd0(%rbp)
jle 0xa6fb5
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
callq 0xaf450
movq %rax, -0x150(%rbp)
jmp 0xa6fa1
movq -0x150(%rbp), %rsi
movq -0x18(%rbp), %rdi
callq 0x5060
jmp 0xa6fb3
jmp 0xa6fb9
movb $0x1, -0x4f(%rbp)
testb $0x1, -0x19(%rbp)
je 0xa6fdd
movq -0x18(%rbp), %rdi
callq 0x5200
movq %rax, %rsi
leaq 0x15265d(%rip), %rdi    # 0x1f962f
xorl %eax, %eax
callq 0x5070
jmp 0xa6fdb
jmp 0xa6fdd
jmp 0xa754d
testb $0x1, -0x4f(%rbp)
je 0xa7019
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x158(%rbp)
jmp 0xa6ffe
movq -0x158(%rbp), %rsi
movq -0x18(%rbp), %rdi
callq 0x5060
jmp 0xa7010
movb $0x0, -0x4f(%rbp)
jmp 0xa754b
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x160(%rbp)
jmp 0xa702f
movq -0x160(%rbp), %rdi
leaq 0x1503c9(%rip), %rsi    # 0x1f7406
callq 0x845d0
movb %al, -0x161(%rbp)
jmp 0xa704a
movb -0x161(%rbp), %al
testb $0x1, %al
jne 0xa7093
jmp 0xa7056
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x170(%rbp)
jmp 0xa706c
movq -0x170(%rbp), %rdi
leaq 0x1525ce(%rip), %rsi    # 0x1f9648
callq 0x845d0
movb %al, -0x171(%rbp)
jmp 0xa7087
movb -0x171(%rbp), %al
testb $0x1, %al
jne 0xa7093
jmp 0xa70bb
cmpl $0x6, -0xd0(%rbp)
jle 0xa70b2
movq -0x10(%rbp), %rdx
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
callq 0xa76e0
jmp 0xa70b0
jmp 0xa70b6
movb $0x1, -0x50(%rbp)
jmp 0xa7549
testb $0x1, -0x50(%rbp)
je 0xa70e4
cmpl $0x5, -0xd0(%rbp)
jle 0xa70e4
movq -0x10(%rbp), %rdx
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0xa76e0
jmp 0xa70db
movb $0x0, -0x50(%rbp)
jmp 0xa7547
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x180(%rbp)
jmp 0xa70fa
movq -0x180(%rbp), %rdi
leaq 0x152545(%rip), %rsi    # 0x1f964d
callq 0x845d0
movb %al, -0x181(%rbp)
jmp 0xa7115
movb -0x181(%rbp), %al
testb $0x1, %al
jne 0xa715e
jmp 0xa7121
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x190(%rbp)
jmp 0xa7137
movq -0x190(%rbp), %rdi
leaq 0x15250e(%rip), %rsi    # 0x1f9653
callq 0x845d0
movb %al, -0x191(%rbp)
jmp 0xa7152
movb -0x191(%rbp), %al
testb $0x1, %al
jne 0xa715e
jmp 0xa7186
cmpl $0x1, -0xd0(%rbp)
jle 0xa717d
movq -0x10(%rbp), %rdx
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
callq 0xa7830
jmp 0xa717b
jmp 0xa7181
movb $0x1, -0x51(%rbp)
jmp 0xa7545
testb $0x1, -0x51(%rbp)
je 0xa71a6
movq -0x10(%rbp), %rdx
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0xa7830
jmp 0xa719d
movb $0x0, -0x51(%rbp)
jmp 0xa7543
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x1a0(%rbp)
jmp 0xa71bc
movq -0x1a0(%rbp), %rdi
leaq 0x1580b9(%rip), %rsi    # 0x1ff283
callq 0x845d0
movb %al, -0x1a1(%rbp)
jmp 0xa71d7
movb -0x1a1(%rbp), %al
testb $0x1, %al
jne 0xa7220
jmp 0xa71e3
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x1b0(%rbp)
jmp 0xa71f9
movq -0x1b0(%rbp), %rdi
leaq 0x152452(%rip), %rsi    # 0x1f9659
callq 0x845d0
movb %al, -0x1b1(%rbp)
jmp 0xa7214
movb -0x1b1(%rbp), %al
testb $0x1, %al
jne 0xa7220
jmp 0xa7262
movb $0x1, -0x4d(%rbp)
cmpl $0x5, -0xd0(%rbp)
jle 0xa7259
movq -0x10(%rbp), %rdx
movq -0x28(%rbp), %r9
movq -0x8(%rbp), %rcx
movq %rsp, %rax
movq %rcx, (%rax)
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
leaq -0x4c(%rbp), %rcx
leaq -0x44(%rbp), %r8
callq 0xa7950
jmp 0xa7257
jmp 0xa725d
movb $0x1, -0x52(%rbp)
jmp 0xa7541
testb $0x1, -0x52(%rbp)
je 0xa72a1
cmpl $0x4, -0xd0(%rbp)
jle 0xa72a1
movq -0x10(%rbp), %rdx
movq -0x28(%rbp), %r9
movq -0x8(%rbp), %rcx
movq %rsp, %rax
movq %rcx, (%rax)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
leaq -0x4c(%rbp), %rcx
leaq -0x44(%rbp), %r8
callq 0xa7950
jmp 0xa7298
movb $0x0, -0x52(%rbp)
jmp 0xa753f
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x1c0(%rbp)
jmp 0xa72b7
movq -0x1c0(%rbp), %rdi
leaq 0x155fac(%rip), %rsi    # 0x1fd271
callq 0x845d0
movb %al, -0x1c1(%rbp)
jmp 0xa72d2
movb -0x1c1(%rbp), %al
testb $0x1, %al
jne 0xa731b
jmp 0xa72de
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x1d0(%rbp)
jmp 0xa72f4
movq -0x1d0(%rbp), %rdi
leaq 0x155bdf(%rip), %rsi    # 0x1fcee1
callq 0x845d0
movb %al, -0x1d1(%rbp)
jmp 0xa730f
movb -0x1d1(%rbp), %al
testb $0x1, %al
jne 0xa731b
jmp 0xa734b
movb $0x1, -0x4e(%rbp)
cmpl $0x5, -0xd0(%rbp)
jle 0xa7342
movq -0x10(%rbp), %rdx
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
leaq -0x4c(%rbp), %rcx
callq 0xa82f0
jmp 0xa7340
jmp 0xa7346
movb $0x1, -0x53(%rbp)
jmp 0xa753d
testb $0x1, -0x53(%rbp)
je 0xa7378
cmpl $0x4, -0xd0(%rbp)
jle 0xa7378
movq -0x10(%rbp), %rdx
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
leaq -0x4c(%rbp), %rcx
callq 0xa82f0
jmp 0xa736f
movb $0x0, -0x53(%rbp)
jmp 0xa753b
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x1e0(%rbp)
jmp 0xa738e
movq -0x1e0(%rbp), %rdi
leaq 0x1630ac(%rip), %rsi    # 0x20a448
callq 0x845d0
movb %al, -0x1e1(%rbp)
jmp 0xa73a9
movb -0x1e1(%rbp), %al
testb $0x1, %al
jne 0xa73f2
jmp 0xa73b5
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x1f0(%rbp)
jmp 0xa73cb
movq -0x1f0(%rbp), %rdi
leaq 0x1524fe(%rip), %rsi    # 0x1f98d7
callq 0x845d0
movb %al, -0x1f1(%rbp)
jmp 0xa73e6
movb -0x1f1(%rbp), %al
testb $0x1, %al
jne 0xa73f2
jmp 0xa7426
cmpl $0x6, -0xd0(%rbp)
jle 0xa741d
movq -0x10(%rbp), %rdx
movl -0x4c(%rbp), %ecx
movzbl -0x4e(%rbp), %r8d
andl $0x1, %r8d
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
callq 0xa84d0
jmp 0xa741b
jmp 0xa7421
movb $0x1, -0x54(%rbp)
jmp 0xa7539
testb $0x1, -0x54(%rbp)
je 0xa745b
cmpl $0x5, -0xd0(%rbp)
jle 0xa745b
movq -0x10(%rbp), %rdx
movl -0x4c(%rbp), %ecx
movzbl -0x4e(%rbp), %r8d
andl $0x1, %r8d
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0xa84d0
jmp 0xa7452
movb $0x0, -0x54(%rbp)
jmp 0xa7537
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x200(%rbp)
jmp 0xa7471
movq -0x200(%rbp), %rdi
leaq 0x14f027(%rip), %rsi    # 0x1f64a6
callq 0x845d0
movb %al, -0x201(%rbp)
jmp 0xa748c
movb -0x201(%rbp), %al
testb $0x1, %al
jne 0xa7498
jmp 0xa749d
jmp 0xa7535
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x210(%rbp)
jmp 0xa74b3
movq -0x210(%rbp), %rdi
leaq 0x155c34(%rip), %rsi    # 0x1fd0f5
callq 0x845d0
movb %al, -0x211(%rbp)
jmp 0xa74ce
movb -0x211(%rbp), %al
testb $0x1, %al
jne 0xa7517
jmp 0xa74da
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0xaf450
movq %rax, -0x220(%rbp)
jmp 0xa74f0
movq -0x220(%rbp), %rdi
leaq 0x14bf7e(%rip), %rsi    # 0x1f347c
callq 0x845d0
movb %al, -0x221(%rbp)
jmp 0xa750b
movb -0x221(%rbp), %al
testb $0x1, %al
jne 0xa7517
jmp 0xa7533
testb $0x1, -0x19(%rbp)
je 0xa752f
leaq 0x15213a(%rip), %rdi    # 0x1f965e
xorl %eax, %eax
callq 0x5070
jmp 0xa752d
jmp 0xa752f
movb $0x1, -0x45(%rbp)
jmp 0xa7535
jmp 0xa7537
jmp 0xa7539
jmp 0xa753b
jmp 0xa753d
jmp 0xa753f
jmp 0xa7541
jmp 0xa7543
jmp 0xa7545
jmp 0xa7547
jmp 0xa7549
jmp 0xa754b
jmp 0xa754d
jmp 0xa754f
testb $0x1, -0x4e(%rbp)
je 0xa7575
testb $0x1, -0x4d(%rbp)
je 0xa7575
leaq 0x15212e(%rip), %rdi    # 0x1f9690
xorl %eax, %eax
callq 0x5070
jmp 0xa756b
movl $0x1, %edi
callq 0x67c0
jmp 0xa6cc8
testb $0x1, -0x45(%rbp)
jne 0xa7592
leaq 0x152199(%rip), %rdi    # 0x1f9720
xorl %eax, %eax
callq 0x5070
jmp 0xa7590
jmp 0xa75a4
leaq 0x1521c7(%rip), %rdi    # 0x1f9760
xorl %eax, %eax
callq 0x5070
jmp 0xa75a2
jmp 0xa75a4
movq -0x10(%rbp), %rdi
addq $0x3c0, %rdi            # imm = 0x3C0
callq 0xae470
movl %eax, -0xd4(%rbp)
movb $0x1, -0xd5(%rbp)
movl $0x0, -0xdc(%rbp)
movl -0xdc(%rbp), %ecx
xorl %eax, %eax
cmpl -0xd4(%rbp), %ecx
movb %al, -0x222(%rbp)
jge 0xa75ed
movb -0xd5(%rbp), %al
movb %al, -0x222(%rbp)
movb -0x222(%rbp), %al
testb $0x1, %al
jne 0xa75fc
jmp 0xa768a
movq -0x10(%rbp), %rdi
addq $0x3c0, %rdi            # imm = 0x3C0
movslq -0xdc(%rbp), %rsi
callq 0xae4a0
movq %rax, -0x230(%rbp)
jmp 0xa761c
movq -0x230(%rbp), %rax
movslq 0x18(%rax), %rax
movq %rax, -0x240(%rbp)
movq -0x10(%rbp), %rdi
addq $0x3c0, %rdi            # imm = 0x3C0
movslq -0xdc(%rbp), %rsi
callq 0xae4a0
movq %rax, -0x238(%rbp)
jmp 0xa764e
movq -0x238(%rbp), %rdi
addq $0x20, %rdi
callq 0xae590
movq %rax, %rcx
movq -0x240(%rbp), %rax
cmpq %rcx, %rax
je 0xa7674
movb $0x0, -0xd5(%rbp)
jmp 0xa7676
movl -0xdc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xdc(%rbp)
jmp 0xa75cb
movq -0x28(%rbp), %rax
movq %rax, -0x248(%rbp)
cmpq $0x0, %rax
je 0xa76a7
movq -0x248(%rbp), %rdi
callq 0x56c0
movb -0xd5(%rbp), %al
movb %al, -0x249(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x59290
movb -0x249(%rbp), %al
andb $0x1, %al
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x59290
movq -0x60(%rbp), %rdi
callq 0x58f0
nop