// File: /workspace/github_cpp_makefile_star2_O1/isimplyexcel[P]text-based-game/map.cpp
// Function: displayMap(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void displayMap(std::string carName){
	char map[7][66]; // row col

    std::cout << "\t\t\t Map" << std::endl;
    for(int i = 0; i < 7; i++){
        for(int j = 0; j < 66; j++){
            //  top row
            if(i == 0){
                map[i][j] = '-';
                std::cout << map[i][j];
            }
            //  bottom row
            if(i == 6){
                map[i][j] = '-';
                std::cout << map[i][j];
            }
            // column |
            if(j < 100 && (j % 10 == 0) && (i > 0 && i < 6)){
                map[i][j] = '|';
                std::cout << map[i][j];
            }

            if(j > 0 && j < 60 && i > 0 && i < 6){
                map[i][j] = ' ';

                //  engine car
                map[3][52] = 'e';
                map[3][53] = 'n';
                map[3][54] = 'g';
                map[3][55] = 'i';
                map[3][56] = 'n';
                map[3][57] = 'e';

                //  dining car
                map[3][42] = 'd';
                map[3][43] = 'i';
                map[3][44] = 'n';
                map[3][45] = 'i';
                map[3][46] = 'n';
                map[3][47] = 'g';

                //  baggage car
                map[3][32] = 'b';
                map[3][33] = 'a';
                map[3][34] = 'g';
                map[3][35] = 'g';
                map[3][36] = 'a';
                map[3][37] = 'g';
                map[3][38] = 'e';

                //  shopping car
                map[3][21] = 's';
                map[3][22] = 'h';
                map[3][23] = 'o';
                map[3][24] = 'p';
                map[3][25] = 'p';
                map[3][26] = 'i';
                map[3][27] = 'n';
                map[3][28] = 'g';

                //  bar car
                map[3][14] = 'b';
                map[3][15] = 'a';
                map[3][16] = 'r';

                //  caboose
                map[3][2] = 'c';
                map[3][3] = 'a';
                map[3][4] = 'b';
                map[3][5] = 'o';
                map[3][6] = 'o';
                map[3][7] = 's';
                map[3][8] = 'e';

                if(carName == "Caboose car"){
                	map[5][5] = '*';
                }
                else if(carName == "Bar car"){
                	map[5][14] = '*';
                }
                else if(carName == "Shopping car"){
                	map[5][25] = '*';
                }
                else if(carName == "Baggage car"){
                	map[5][34] = '*';
                }
                else if(carName == "Dining car"){
                	map[5][44] = '*';
                }
                else if(carName == "Engine car"){
                	map[5][55] = '*';
                }

                std::cout << map[i][j];
            }
        }
        std::cout << std::endl;
    }

    std::cout << "Key: * Current Location" << std::endl;
    //  empty line
    std::cout << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rdi, %r15
movq 0x3e41(%rip), %rbx      # 0x9fd0
leaq 0x1805(%rip), %rsi      # 0x799b
movl $0x7, %edx
movq %rbx, %rdi
callq 0x2160
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
xorl %eax, %eax
movb $0x2d, %r12b
xorl %ebp, %ebp
movq %rax, 0x8(%rsp)
leaq (%rsp,%rax), %r14
addq $0x10, %r14
xorl %ebx, %ebx
movq %r15, %r13
cmpl $0x6, %ebp
je 0x61f3
testl %ebp, %ebp
jne 0x6219
movb %r12b, 0x10(%rsp,%rbx)
jmp 0x61fb
movb %r12b, 0x19c(%rsp,%rbx)
movb %r12b, 0x7(%rsp)
movl $0x1, %edx
movq 0x3dc4(%rip), %rdi      # 0x9fd0
leaq 0x7(%rsp), %rsi
callq 0x2160
movq %r15, %r13
movl %ebx, %eax
movl $0xcccccccd, %ecx       # imm = 0xCCCCCCCD
imulq %rcx, %rax
shrq $0x23, %rax
addl %eax, %eax
leal (%rax,%rax,4), %eax
negl %eax
addl %ebx, %eax
je 0x636d
leal -0x1(%rbx), %eax
cmpl $0x3a, %eax
ja 0x63f7
testl %ebp, %ebp
je 0x63f7
cmpl $0x6, %ebp
je 0x63f7
movb $0x20, (%r14,%rbx)
movl $0x69676e65, 0x10a(%rsp) # imm = 0x69676E65
movw $0x656e, 0x10e(%rsp)    # imm = 0x656E
movl $0x696e6964, 0x100(%rsp) # imm = 0x696E6964
movw $0x676e, 0x104(%rsp)    # imm = 0x676E
movl $0x67676162, 0xf6(%rsp) # imm = 0x67676162
movw $0x6761, 0xfa(%rsp)     # imm = 0x6761
movb $0x65, %al
movb %al, 0xfc(%rsp)
movabsq $0x676e6970706f6873, %rcx # imm = 0x676E6970706F6873
movq %rcx, 0xeb(%rsp)
movw $0x6162, 0xe4(%rsp)     # imm = 0x6162
movb $0x72, 0xe6(%rsp)
movl $0x6f626163, 0xd8(%rsp) # imm = 0x6F626163
movw $0x736f, 0xdc(%rsp)     # imm = 0x736F
movb %al, 0xde(%rsp)
movq %r13, %rdi
leaq 0x117d(%rip), %rsi      # 0x7468
callq 0x2050
testl %eax, %eax
je 0x63a6
movq %r13, %rdi
leaq 0x1186(%rip), %rsi      # 0x7488
callq 0x2050
testl %eax, %eax
je 0x63b0
movq %r13, %rdi
leaq 0x11aa(%rip), %rsi      # 0x74c3
callq 0x2050
testl %eax, %eax
je 0x63ba
movq %r13, %rdi
leaq 0x11c9(%rip), %rsi      # 0x74f9
callq 0x2050
testl %eax, %eax
je 0x63c4
movq %r13, %rdi
leaq 0x11e3(%rip), %rsi      # 0x752a
callq 0x2050
testl %eax, %eax
je 0x63ce
movq %r13, %rdi
leaq 0x11f7(%rip), %rsi      # 0x7551
callq 0x2050
testl %eax, %eax
jne 0x63d6
movb $0x2a, 0x191(%rsp)
jmp 0x63d6
testl %ebp, %ebp
je 0x6237
cmpl $0x6, %ebp
je 0x6237
movb $0x7c, %al
movb %al, (%r14,%rbx)
movb %al, 0x7(%rsp)
movl $0x1, %edx
movq 0x3c3c(%rip), %rdi      # 0x9fd0
leaq 0x7(%rsp), %rsi
callq 0x2160
movq %r15, %r13
jmp 0x6237
movb $0x2a, 0x15f(%rsp)
jmp 0x63d6
movb $0x2a, 0x168(%rsp)
jmp 0x63d6
movb $0x2a, 0x173(%rsp)
jmp 0x63d6
movb $0x2a, 0x17c(%rsp)
jmp 0x63d6
movb $0x2a, 0x186(%rsp)
movb (%r14,%rbx), %al
movb %al, 0x7(%rsp)
movl $0x1, %edx
movq 0x3be6(%rip), %rdi      # 0x9fd0
leaq 0x7(%rsp), %rsi
callq 0x2160
movq %r15, %r13
incq %rbx
cmpq $0x42, %rbx
jne 0x61e3
movq 0x3bc5(%rip), %rbx      # 0x9fd0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
incq %rbp
movq 0x8(%rsp), %rax
addq $0x42, %rax
cmpq $0x7, %rbp
jne 0x61d1
leaq 0x1554(%rip), %rsi      # 0x79a3
movl $0x17, %edx
movq 0x3b75(%rip), %rbx      # 0x9fd0
movq %rbx, %rdi
callq 0x2160
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop