// File: adamnovak[P]rlcsa/misc/utils.cpp
// Function: CSA::readPizzaChili(std::basic_ifstream<char, std::char_traits<char>>&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
void
readPizzaChili(std::ifstream& file, std::vector<std::string>& patterns)
{
  std::string header;
  std::getline(file, header);

  std::size_t start = header.find("number=");
  if(start == std::string::npos) { return; }
  int temp = std::atoi(header.substr(start + 7).c_str());
  if(temp <= 0) { return; }
  usint n = temp;

  start = header.find("length=");
  if(start == std::string::npos) { return; }
  temp = std::atoi(header.substr(start + 7).c_str());
  if(temp <= 0) { return; }
  usint l = temp;

  char buffer[l];
  for(usint i = 0; i < n; i++)
  {
    file.read(buffer, l);
    patterns.push_back(std::string(buffer, l));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x3420
movq -0xe8(%rbp), %rsi
movq -0x8(%rbp), %rdi
callq 0x30b0
jmp 0x23865
leaq -0x30(%rbp), %rdi
leaq 0x6140(%rip), %rsi      # 0x299b0
xorl %eax, %eax
movl %eax, %edx
callq 0x35c0
movq %rax, -0x48(%rbp)
cmpq $-0x1, -0x48(%rbp)
jne 0x238a1
movl $0x1, -0x4c(%rbp)
jmp 0x23ac3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x23ad1
movq -0x48(%rbp), %rdx
addq $0x7, %rdx
leaq -0x70(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movq $-0x1, %rcx
callq 0x32e0
jmp 0x238bf
leaq -0x70(%rbp), %rdi
callq 0x3130
movq %rax, %rdi
callq 0x34b0
movl %eax, -0xec(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x35d8
movl -0xec(%rbp), %eax
movl %eax, -0x50(%rbp)
cmpl $0x0, -0x50(%rbp)
jg 0x238fa
movl $0x1, -0x4c(%rbp)
jmp 0x23ac3
movl -0x50(%rbp), %eax
movl %eax, -0x74(%rbp)
leaq -0x30(%rbp), %rdi
leaq 0x60ad(%rip), %rsi      # 0x299b8
xorl %eax, %eax
movl %eax, %edx
callq 0x35c0
movq %rax, -0x48(%rbp)
cmpq $-0x1, -0x48(%rbp)
jne 0x2392b
movl $0x1, -0x4c(%rbp)
jmp 0x23ac3
movq -0x48(%rbp), %rdx
addq $0x7, %rdx
leaq -0x98(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movq $-0x1, %rcx
callq 0x32e0
jmp 0x2394c
leaq -0x98(%rbp), %rdi
callq 0x3130
movq %rax, %rdi
callq 0x34b0
movl %eax, -0x50(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x35d8
cmpl $0x0, -0x50(%rbp)
jg 0x23981
movl $0x1, -0x4c(%rbp)
jmp 0x23ac3
movl -0x50(%rbp), %eax
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0xa8(%rbp)
movq %rax, %rdx
addq $0xf, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0xf8(%rbp)
movq %rcx, %rsp
movq %rax, -0xb0(%rbp)
movl $0x0, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
cmpl -0x74(%rbp), %eax
jae 0x23ab2
movq -0xf8(%rbp), %rsi
movq -0x8(%rbp), %rdi
movl -0x9c(%rbp), %eax
movl %eax, %edx
callq 0x33c0
jmp 0x239ef
movq -0x10(%rbp), %rax
movq %rax, -0x110(%rbp)
movl -0x9c(%rbp), %eax
movq %rax, -0x108(%rbp)
leaq -0xd9(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x3540
movq -0xf8(%rbp), %rsi
movq -0x108(%rbp), %rdx
movq -0x100(%rbp), %rcx
leaq -0xd8(%rbp), %rdi
callq 0x3370
jmp 0x23a3d
movq -0x110(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x24c70
jmp 0x23a52
leaq -0xd8(%rbp), %rdi
callq 0x35d8
leaq -0xd9(%rbp), %rdi
callq 0x3320
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0x239c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x23aa4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x35d8
leaq -0xd9(%rbp), %rdi
callq 0x3320
jmp 0x23ad1
movq -0xa8(%rbp), %rax
movq %rax, %rsp
movl $0x0, -0x4c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x35d8
movq %rbp, %rsp
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x35d8
movq -0x38(%rbp), %rdi
callq 0x3530
nopw %cs:(%rax,%rax)