// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movl %r8d, %r14d
movl %ecx, %ebp
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x5270
cmpl $0x1, %r12d
leaq 0x25402(%rip), %rax     # 0x33268
leaq 0x25413(%rip), %rsi     # 0x33280
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0xe1d8
movl %ebp, 0x2c(%rsp)
movq %rbx, %rdi
callq 0xd464
leaq 0x40(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0xb4e8
movq 0x38(%rsp), %r12
leaq 0x18(%rsp), %rbp
cmpq $0xc, %r12
movl %r14d, 0x28(%rsp)
ja 0xdf8f
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x18ecf(%rip), %rdx     # 0x26d99
movq %rdx, %rsi
callq 0xb57e
leaq 0xb8(%rsp), %r15
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x52a0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xdefe
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x51f0
cmpq $0x9, %r12
ja 0xdf3a
movl $0xd, %r14d
subl %r12d, %r14d
shrl %r14d
decl %r14d
leaq 0xb0(%rsp), %r12
leaq 0x8(%rsp), %r13
movb $0x20, 0x8(%rsp)
movl $0x1, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x5240
decl %r14d
jne 0xdf20
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0xb0(%rsp), %rdi
callq 0x5240
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
leaq 0x40(%rsp), %r13
callq 0x52c0
leaq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x5250
movq (%r15), %rdi
cmpq %rbp, %rdi
je 0xdf8a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x38(%rsp), %r12
leaq 0xa0(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x30(%rsp), %rsi
addq %rsi, %r12
leaq 0x90(%rsp), %rdi
movq %r12, %rdx
callq 0xb4e8
leaq 0x90(%rsp), %r15
movq %rbx, %rdi
movl $0x4e, %esi
movq %r15, %rdx
callq 0xd4a5
movq (%r15), %rdi
cmpq %r14, %rdi
je 0xdfe3
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x18da7(%rip), %rdx     # 0x26d99
movq %rdx, %rsi
callq 0xb57e
leaq 0xb8(%rsp), %r15
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x52a0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xe026
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0xb0(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x5310
leaq 0x70(%rsp), %rdi
movq %r15, %rsi
callq 0x52c0
leaq 0x70(%rsp), %r14
movq %rbx, %rdi
movl $0x48, %esi
movq %r14, %rdx
callq 0xd545
movq (%r14), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0xe079
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x18d11(%rip), %rdx     # 0x26d99
movq %rdx, %rsi
callq 0xb57e
movl 0x28(%rsp), %r14d
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x52a0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xe0b9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0xb0(%rsp), %rdi
movl %r14d, %esi
callq 0x5310
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x52c0
leaq 0x50(%rsp), %r14
movq %rbx, %rdi
movl $0x4d, %esi
movq %r14, %rdx
callq 0xd4a5
movq (%r14), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0xe105
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x30(%rsp), %rdi
cmpq %r13, %rdi
je 0xe11c
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x24e95(%rip), %rsi     # 0x32fb8
leaq 0xb0(%rsp), %rdi
callq 0x5120
leaq 0x120(%rsp), %rdi
callq 0x50b0
movq %rbx, %rax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe188
jmp 0xe188
jmp 0xe15e
jmp 0xe188
jmp 0xe15e
jmp 0xe188
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xe18b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x51f0
jmp 0xe18b
jmp 0xe188
movq %rax, %r14
jmp 0xe1a7
movq %rax, %r14
jmp 0xe1af
jmp 0xe188
movq %rax, %r14
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xe1a7
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x51f0
movq %rbx, %rdi
callq 0xc796
movq 0x24e02(%rip), %rsi     # 0x32fb8
leaq 0xb0(%rsp), %rdi
callq 0x5120
leaq 0x120(%rsp), %rdi
callq 0x50b0
movq %r14, %rdi
callq 0x5320