// File: BohangZhang[P]Sorcery-C-Project/ascii_graphics.cc
// Function: display_player_card(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int)
card_template_t display_player_card(int player_num,std::string name,int life,int mana) {
  std::ostringstream oss;
  card_template_t out = player_num == 1 ? PLAYER_1_TEMPLATE : PLAYER_2_TEMPLATE;
  prepare_for_replace(out);
  std::string centred_name = name;
  if (centred_name.size() < 13) {
    int extend = 13 - static_cast<int>(centred_name.size());
    oss.str("");
    for (int i=0;i<extend/2-1;i++) oss << ' ';
    oss << centred_name;
    centred_name = oss.str();
  }
  replace_text_left(out,'N',centred_name);
  oss.str("");
  oss << life;
  replace_text_right(out,'H',oss.str());
  oss.str("");
  oss << mana;
  replace_text_left(out,'M',oss.str());
  return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x310, %rsp            # imm = 0x310
movq %rdx, -0x2e8(%rbp)
movq %rdi, -0x2e0(%rbp)
movq %rdi, %rax
movq %rax, -0x2d8(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x63c0
movb $0x0, -0x199(%rbp)
cmpl $0x1, -0xc(%rbp)
jne 0x1846e
leaq 0x3beb3(%rip), %rax     # 0x54318
movq %rax, -0x2f0(%rbp)
jmp 0x1847e
leaq 0x3bebb(%rip), %rax     # 0x54330
movq %rax, -0x2f0(%rbp)
jmp 0x1847e
movq -0x2e0(%rbp), %rdi
movq -0x2f0(%rbp), %rsi
callq 0x18960
jmp 0x18493
movq -0x2e0(%rbp), %rdi
callq 0x175e0
jmp 0x184a1
movq -0x2e8(%rbp), %rsi
leaq -0x1d0(%rbp), %rdi
callq 0x6100
jmp 0x184b6
leaq -0x1d0(%rbp), %rdi
callq 0x61d0
cmpq $0xd, %rax
jae 0x18671
leaq -0x1d0(%rbp), %rdi
callq 0x61d0
movl %eax, %ecx
movl $0xd, %eax
subl %ecx, %eax
movl %eax, -0x1d4(%rbp)
leaq -0x1f9(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
callq 0x6470
movq -0x2f8(%rbp), %rdx
leaq 0x287f3(%rip), %rsi     # 0x40cfb
leaq -0x1f8(%rbp), %rdi
callq 0x12870
jmp 0x18516
leaq -0x198(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x6130
jmp 0x1852b
leaq -0x1f8(%rbp), %rdi
callq 0x64c8
leaq -0x1f9(%rbp), %rdi
callq 0x62f0
movl $0x0, -0x200(%rbp)
movl -0x200(%rbp), %eax
movl %eax, -0x2fc(%rbp)
movl -0x1d4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x2fc(%rbp), %eax
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x18628
leaq -0x198(%rbp), %rdi
movl $0x20, %esi
callq 0x6350
jmp 0x1858d
jmp 0x1858f
movl -0x200(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x200(%rbp)
jmp 0x1854d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
jmp 0x18944
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
jmp 0x18938
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
jmp 0x18600
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0x64c8
leaq -0x1f9(%rbp), %rdi
callq 0x62f0
jmp 0x18902
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
jmp 0x18902
leaq -0x198(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x6250
jmp 0x1863d
leaq -0x220(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x62b0
jmp 0x18652
leaq -0x1d0(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x6370
leaq -0x220(%rbp), %rdi
callq 0x64c8
leaq -0x240(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x6100
jmp 0x18686
movq -0x2e0(%rbp), %rdi
movl $0x4e, %esi
leaq -0x240(%rbp), %rdx
callq 0x176a0
jmp 0x186a0
leaq -0x240(%rbp), %rdi
callq 0x64c8
leaq -0x261(%rbp), %rdi
movq %rdi, -0x308(%rbp)
callq 0x6470
movq -0x308(%rbp), %rdx
leaq 0x2862e(%rip), %rsi     # 0x40cfb
leaq -0x260(%rbp), %rdi
callq 0x12870
jmp 0x186db
leaq -0x198(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x6130
jmp 0x186f0
leaq -0x260(%rbp), %rdi
callq 0x64c8
leaq -0x261(%rbp), %rdi
callq 0x62f0
movl -0x1c(%rbp), %esi
leaq -0x198(%rbp), %rdi
callq 0x6440
jmp 0x18719
leaq -0x288(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x62b0
jmp 0x1872e
movq -0x2e0(%rbp), %rdi
movl $0x48, %esi
leaq -0x288(%rbp), %rdx
callq 0x17860
jmp 0x18748
leaq -0x288(%rbp), %rdi
callq 0x64c8
leaq -0x2a9(%rbp), %rdi
movq %rdi, -0x310(%rbp)
callq 0x6470
movq -0x310(%rbp), %rdx
leaq 0x28586(%rip), %rsi     # 0x40cfb
leaq -0x2a8(%rbp), %rdi
callq 0x12870
jmp 0x18783
leaq -0x198(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x6130
jmp 0x18798
leaq -0x2a8(%rbp), %rdi
callq 0x64c8
leaq -0x2a9(%rbp), %rdi
callq 0x62f0
movl -0x20(%rbp), %esi
leaq -0x198(%rbp), %rdi
callq 0x6440
jmp 0x187c1
leaq -0x2d0(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x62b0
jmp 0x187d6
movq -0x2e0(%rbp), %rdi
movl $0x4d, %esi
leaq -0x2d0(%rbp), %rdx
callq 0x176a0
jmp 0x187f0
leaq -0x2d0(%rbp), %rdi
callq 0x64c8
movb $0x1, -0x199(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x64c8
testb $0x1, -0x199(%rbp)
jne 0x1891c
jmp 0x18910
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x64c8
jmp 0x18902
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
jmp 0x18876
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x64c8
leaq -0x261(%rbp), %rdi
callq 0x62f0
jmp 0x18902
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x64c8
jmp 0x18902
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
jmp 0x188d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
leaq -0x2a8(%rbp), %rdi
callq 0x64c8
leaq -0x2a9(%rbp), %rdi
callq 0x62f0
jmp 0x18902
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0x64c8
leaq -0x1d0(%rbp), %rdi
callq 0x64c8
jmp 0x18938
movq -0x2e0(%rbp), %rdi
callq 0x15d90
leaq -0x198(%rbp), %rdi
callq 0x6090
movq -0x2d8(%rbp), %rax
addq $0x310, %rsp            # imm = 0x310
popq %rbp
retq
movq -0x2e0(%rbp), %rdi
callq 0x15d90
leaq -0x198(%rbp), %rdi
callq 0x6090
movq -0x1a8(%rbp), %rdi
callq 0x6460
nopl (%rax)