// File: BohangZhang[P]Sorcery-C-Project/ascii_graphics.cc
// Function: replace_text_left(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>>>>&, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
static void replace_text_left(card_template_t &text,char flag,std::string new_text) {
  std::string::iterator sit = new_text.begin();
  bool start_replace = false;
  bool end_replace = false;
  for (card_template_t::iterator vit = text.begin(); vit != text.end(); ++vit) {
    for (std::string::iterator lit = vit->begin(); lit != vit->end(); ++lit) {
      if (*lit == DELIMITER && *(lit+1) == flag) {
        start_replace = true;
      } else if (*lit == DELIMITER) {
        end_replace = true;
      }
      if (start_replace && (*lit == flag || *lit == DELIMITER)) {
        if (sit != new_text.end()) {
          *lit = *sit;
          ++sit;
        } else {
          *lit = ' ';
        }
      }
      if (end_replace) {
        end_replace = false;
        start_replace = false;
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdx, -0x60(%rbp)
movq %rdi, %rcx
movq -0x60(%rbp), %rdi
movb %sil, %al
movq %rcx, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq %rdi, -0x18(%rbp)
callq 0x6230
movq %rax, -0x20(%rbp)
movb $0x0, -0x21(%rbp)
movb $0x0, -0x22(%rbp)
movq -0x8(%rbp), %rdi
callq 0x15cb0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0x15d20
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x15ce0
testb $0x1, %al
jne 0x17702
jmp 0x17856
leaq -0x30(%rbp), %rdi
callq 0x18c00
movq %rax, %rdi
callq 0x6230
movq %rax, -0x40(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x18c00
movq %rax, %rdi
callq 0x6180
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x18c20
testb $0x1, %al
jne 0x17742
jmp 0x17846
leaq -0x40(%rbp), %rdi
callq 0x18c60
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0xb, %ecx
movb %al, -0x61(%rbp)
jne 0x17782
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
callq 0x18c80
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x18c60
movsbl (%rax), %eax
movsbl -0x9(%rbp), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x1778b
jmp 0x17791
movb $0x1, -0x21(%rbp)
jmp 0x177a8
leaq -0x40(%rbp), %rdi
callq 0x18c60
movsbl (%rax), %eax
cmpl $0xb, %eax
jne 0x177a6
movb $0x1, -0x22(%rbp)
jmp 0x177a8
testb $0x1, -0x21(%rbp)
je 0x17828
leaq -0x40(%rbp), %rdi
callq 0x18c60
movsbl (%rax), %eax
movsbl -0x9(%rbp), %ecx
cmpl %ecx, %eax
je 0x177d3
leaq -0x40(%rbp), %rdi
callq 0x18c60
movsbl (%rax), %eax
cmpl $0xb, %eax
jne 0x17828
movq -0x60(%rbp), %rdi
callq 0x6180
movq %rax, -0x58(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x18c20
testb $0x1, %al
jne 0x177f3
jmp 0x1781a
leaq -0x20(%rbp), %rdi
callq 0x18c60
movb (%rax), %al
movb %al, -0x62(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x18c60
movb -0x62(%rbp), %cl
movb %cl, (%rax)
leaq -0x20(%rbp), %rdi
callq 0x18cc0
jmp 0x17826
leaq -0x40(%rbp), %rdi
callq 0x18c60
movb $0x20, (%rax)
jmp 0x17828
testb $0x1, -0x22(%rbp)
je 0x17836
movb $0x0, -0x22(%rbp)
movb $0x0, -0x21(%rbp)
jmp 0x17838
leaq -0x40(%rbp), %rdi
callq 0x18cc0
jmp 0x17717
jmp 0x17848
leaq -0x30(%rbp), %rdi
callq 0x15d70
jmp 0x176df
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)