// File: /workspace/github_cpp_makefile_star2_O1/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, %ebp
movl %ecx, %r14d
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x5270
cmpl $0x1, %r12d
leaq 0x26208(%rip), %rax     # 0x34268
leaq 0x26219(%rip), %rsi     # 0x34280
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0xe3da
movl %ebp, 0x2c(%rsp)
movq %rbx, %rdi
callq 0xd638
leaq 0x40(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0xb6a4
movq 0x38(%rsp), %r12
leaq 0x18(%rsp), %rbp
cmpq $0xc, %r12
ja 0xe193
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x19cda(%rip), %rdx     # 0x27d99
movq %rdx, %rsi
callq 0xb734
leaq 0xb8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x52a0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xe0f0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x51f0
cmpl $0x9, %r12d
jg 0xe13e
movl $0xd, %eax
subl %r12d, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
cmpl $0x3, %ecx
movl $0x2, %r15d
cmovgel %ecx, %r15d
decl %r15d
leaq 0xb0(%rsp), %r12
leaq 0x8(%rsp), %r13
movb $0x20, 0x8(%rsp)
movl $0x1, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x5240
decl %r15d
jne 0xe124
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0xb0(%rsp), %rdi
callq 0x5240
leaq 0x8(%rsp), %rdi
leaq 0xb8(%rsp), %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 0xe193
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0xa0(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xb6a4
leaq 0x90(%rsp), %r15
movq %rbx, %rdi
movl $0x4e, %esi
movq %r15, %rdx
callq 0xd669
movq (%r15), %rdi
cmpq %r12, %rdi
je 0xe1ea
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x19ba0(%rip), %rdx     # 0x27d99
movq %rdx, %rsi
callq 0xb734
leaq 0xb8(%rsp), %r15
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x52a0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xe22d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0xb0(%rsp), %rdi
movl %r14d, %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 0xd71d
movq (%r14), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0xe27f
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x19b0b(%rip), %rdx     # 0x27d99
movq %rdx, %rsi
callq 0xb734
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x52a0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xe2ba
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0xb0(%rsp), %rdi
movl 0x2c(%rsp), %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 0xd669
movq (%r14), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0xe307
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x30(%rsp), %rdi
cmpq %r13, %rdi
je 0xe31e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x25c93(%rip), %rsi     # 0x33fb8
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 0xe38a
jmp 0xe38a
jmp 0xe360
jmp 0xe38a
jmp 0xe360
jmp 0xe38a
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xe38d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x51f0
jmp 0xe38d
jmp 0xe38a
movq %rax, %r14
jmp 0xe3a9
movq %rax, %r14
jmp 0xe3b1
jmp 0xe38a
movq %rax, %r14
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xe3a9
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x51f0
movq %rbx, %rdi
callq 0xc96c
movq 0x25c00(%rip), %rsi     # 0x33fb8
leaq 0xb0(%rsp), %rdi
callq 0x5120
leaq 0x120(%rsp), %rdi
callq 0x50b0
movq %r14, %rdi
callq 0x5320