// File: /workspace/github_cpp_makefile_star2_O3/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 $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, %r15
movq 0x3e45(%rip), %rbx      # 0x9fd0
leaq 0x1809(%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
movl $0xff, %r13d
movb $0x2d, %r12b
xorl %ebp, %ebp
movq %rax, 0x18(%rsp)
addq %rsp, %rax
addq $0x20, %rax
movq %rax, 0x10(%rsp)
xorl %ebx, %ebx
movq %r15, %r14
cmpl $0x6, %ebp
je 0x61f9
testl %ebp, %ebp
jne 0x621f
movb %r12b, 0x20(%rsp,%rbx)
jmp 0x6201
movb %r12b, 0x1ac(%rsp,%rbx)
movb %r12b, 0xf(%rsp)
movl $0x1, %edx
movq 0x3dbe(%rip), %rdi      # 0x9fd0
leaq 0xf(%rsp), %rsi
callq 0x2160
movq %r15, %r14
movl %ebx, %eax
andl %r13d, %eax
imull $0xcd, %eax, %eax
shrl $0xa, %eax
andl $-0x2, %eax
leal (%rax,%rax,4), %eax
negl %eax
andl %r13d, %eax
addb %bl, %al
je 0x637e
leal -0x1(%rbx), %eax
cmpl $0x3a, %eax
ja 0x6410
testl %ebp, %ebp
je 0x6410
cmpl $0x6, %ebp
je 0x6410
movq 0x10(%rsp), %rax
movb $0x20, (%rax,%rbx)
movl $0x69676e65, 0x11a(%rsp) # imm = 0x69676E65
movw $0x656e, 0x11e(%rsp)    # imm = 0x656E
movl $0x696e6964, 0x110(%rsp) # imm = 0x696E6964
movw $0x676e, 0x114(%rsp)    # imm = 0x676E
movl $0x67676162, 0x106(%rsp) # imm = 0x67676162
movw $0x6761, 0x10a(%rsp)    # imm = 0x6761
movb $0x65, %al
movb %al, 0x10c(%rsp)
movabsq $0x676e6970706f6873, %rcx # imm = 0x676E6970706F6873
movq %rcx, 0xfb(%rsp)
movw $0x6162, 0xf4(%rsp)     # imm = 0x6162
movb $0x72, 0xf6(%rsp)
movl $0x6f626163, 0xe8(%rsp) # imm = 0x6F626163
movw $0x736f, 0xec(%rsp)     # imm = 0x736F
movb %al, 0xee(%rsp)
movq %r14, %rdi
leaq 0x1170(%rip), %rsi      # 0x7468
callq 0x2050
testl %eax, %eax
je 0x63bb
movq %r14, %rdi
leaq 0x1179(%rip), %rsi      # 0x7488
callq 0x2050
testl %eax, %eax
je 0x63c5
movq %r14, %rdi
leaq 0x119d(%rip), %rsi      # 0x74c3
callq 0x2050
testl %eax, %eax
je 0x63cf
movq %r14, %rdi
leaq 0x11bc(%rip), %rsi      # 0x74f9
callq 0x2050
testl %eax, %eax
je 0x63d9
movq %r14, %rdi
leaq 0x11d6(%rip), %rsi      # 0x752a
callq 0x2050
testl %eax, %eax
je 0x63e3
movq %r14, %rdi
leaq 0x11e6(%rip), %rsi      # 0x7551
callq 0x2050
testl %eax, %eax
jne 0x63eb
movb $0x2a, 0x1a1(%rsp)
jmp 0x63eb
testl %ebp, %ebp
je 0x6240
cmpl $0x6, %ebp
je 0x6240
movb $0x7c, %al
movq 0x10(%rsp), %rcx
movb %al, (%rcx,%rbx)
movb %al, 0xf(%rsp)
movl $0x1, %edx
movq 0x3c27(%rip), %rdi      # 0x9fd0
leaq 0xf(%rsp), %rsi
callq 0x2160
movq %r15, %r14
jmp 0x6240
movb $0x2a, 0x16f(%rsp)
jmp 0x63eb
movb $0x2a, 0x178(%rsp)
jmp 0x63eb
movb $0x2a, 0x183(%rsp)
jmp 0x63eb
movb $0x2a, 0x18c(%rsp)
jmp 0x63eb
movb $0x2a, 0x196(%rsp)
movq 0x10(%rsp), %rax
movb (%rax,%rbx), %al
movb %al, 0xf(%rsp)
movl $0x1, %edx
movq 0x3bcd(%rip), %rdi      # 0x9fd0
leaq 0xf(%rsp), %rsi
callq 0x2160
movq %r15, %r14
incq %rbx
cmpq $0x42, %rbx
jne 0x61e9
movq 0x3bac(%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 0x18(%rsp), %rax
addq $0x42, %rax
cmpq $0x7, %rbp
jne 0x61d3
leaq 0x153b(%rip), %rsi      # 0x79a3
movl $0x17, %edx
movq 0x3b5c(%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 $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq