// File: /workspace/github_cpp_makefile_star2_O2/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, 0xc(%rsp)
movl %ecx, %r14d
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x5280
cmpl $0x1, %r12d
leaq 0x203ff(%rip), %rax     # 0x2b270
leaq 0x20410(%rip), %rsi     # 0x2b288
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0xb0c4
movq %rbx, %rdi
callq 0xa7ab
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0x5290
movq 0x38(%rsp), %r12
cmpq $0xc, %r12
ja 0xaf42
leaq 0x12e4c(%rip), %rsi     # 0x1dcfb
leaq 0x10(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x8d88
leaq 0xb8(%rsp), %r15
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x52b0
pushq $0xd
popq %rbp
subl %r12d, %ebp
leaq 0x10(%rsp), %rdi
callq 0x5378
shrl %ebp
cmpl $0x1, %ebp
adcl $-0x1, %ebp
leaq 0xb0(%rsp), %r12
pushq $0x20
popq %r13
subl $0x1, %ebp
jb 0xaf09
movq %r12, %rdi
movl %r13d, %esi
callq 0x5240
jmp 0xaef7
leaq 0xb0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x51b0
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x52d0
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x5250
movq %r15, %rdi
callq 0x5378
leaq 0x90(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x5290
pushq $0x4e
popq %rsi
leaq 0x90(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rdx
callq 0xa7dd
movq %r15, %rdi
callq 0x5378
leaq 0x12d82(%rip), %rsi     # 0x1dcfb
leaq 0x10(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x8d88
leaq 0xb8(%rsp), %r15
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x52b0
leaq 0x10(%rsp), %rdi
callq 0x5378
leaq 0xb0(%rsp), %rdi
movl %r14d, %esi
callq 0x5320
leaq 0x70(%rsp), %rdi
movq %r15, %rsi
callq 0x52d0
pushq $0x48
popq %rsi
leaq 0x70(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0xa863
movq %r14, %rdi
callq 0x5378
leaq 0x12d15(%rip), %rsi     # 0x1dcfb
leaq 0x10(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x8d88
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x52b0
leaq 0x10(%rsp), %rdi
callq 0x5378
leaq 0xb0(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x5320
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x52d0
pushq $0x4d
popq %rsi
leaq 0x50(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0xa7dd
movq %r14, %rdi
callq 0x5378
leaq 0x30(%rsp), %rdi
callq 0x5378
leaq 0xb0(%rsp), %rdi
callq 0x5070
movq %rbx, %rax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb09a
jmp 0xb09a
jmp 0xb07d
jmp 0xb09a
jmp 0xb07d
jmp 0xb09a
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x5378
jmp 0xb09d
jmp 0xb09a
movq %rax, %r14
jmp 0xb0a7
movq %rax, %r14
jmp 0xb0af
jmp 0xb09a
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x5378
movq %rbx, %rdi
callq 0x9dd8
leaq 0xb0(%rsp), %rdi
callq 0x5070
movq %r14, %rdi
callq 0x5330