// File: /workspace/github_cpp_makefile_star2_O2/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, %r13
movq 0x3605(%rip), %r14      # 0x7fd0
leaq 0xfc9(%rip), %rsi       # 0x599b
movq %r14, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
leaq 0x10(%rsp), %rbx
xorl %r15d, %r15d
movb $0xa, %r12b
movq %r13, 0x8(%rsp)
cmpq $0x7, %r15
je 0x4bfc
xorl %ebp, %ebp
movzbl %bpl, %eax
divb %r12b
cmpq $0x42, %rbp
je 0x4be8
movl %eax, %r13d
cmpl $0x6, %r15d
je 0x4a24
testl %r15d, %r15d
jne 0x4a3b
leaq 0x10(%rsp), %rax
jmp 0x4a2c
leaq 0x19c(%rsp), %rax
movb $0x2d, (%rax,%rbp)
movq %r14, %rdi
pushq $0x2d
popq %rsi
callq 0x2180
movzbl %r13b, %eax
imull $-0xa, %eax, %eax
movzbl %al, %eax
addb %bpl, %al
je 0x4b1e
leal -0x1(%rbp), %eax
cmpl $0x3a, %eax
ja 0x4be0
testl %r15d, %r15d
je 0x4be0
cmpl $0x6, %r15d
je 0x4be0
movb $0x20, (%rbx,%rbp)
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 0x8(%rsp), %r13
movq %r13, %rdi
leaq 0x960(%rip), %rsi       # 0x5468
callq 0x4c33
testb %al, %al
je 0x4b45
movb $0x2a, 0x15f(%rsp)
jmp 0x4bd4
testl %r15d, %r15d
je 0x4a4e
cmpl $0x6, %r15d
je 0x4a4e
movb $0x7c, (%rbx,%rbp)
movq %r14, %rdi
pushq $0x7c
popq %rsi
callq 0x2180
jmp 0x4a4e
movq %r13, %rdi
leaq 0x939(%rip), %rsi       # 0x5488
callq 0x4c33
testb %al, %al
je 0x4b62
movb $0x2a, 0x168(%rsp)
jmp 0x4bd4
movq %r13, %rdi
leaq 0x957(%rip), %rsi       # 0x54c3
callq 0x4c33
testb %al, %al
je 0x4b7f
movb $0x2a, 0x173(%rsp)
jmp 0x4bd4
movq %r13, %rdi
leaq 0x970(%rip), %rsi       # 0x54f9
callq 0x4c33
testb %al, %al
je 0x4b9c
movb $0x2a, 0x17c(%rsp)
jmp 0x4bd4
movq %r13, %rdi
leaq 0x984(%rip), %rsi       # 0x552a
callq 0x4c33
testb %al, %al
je 0x4bb9
movb $0x2a, 0x186(%rsp)
jmp 0x4bd4
movq %r13, %rdi
leaq 0x98e(%rip), %rsi       # 0x5551
callq 0x4c33
testb %al, %al
je 0x4bd4
movb $0x2a, 0x191(%rsp)
movsbl (%rbx,%rbp), %esi
movq %r14, %rdi
callq 0x2180
incq %rbp
jmp 0x49fe
movq %r14, %rdi
callq 0x20a0
incq %r15
addq $0x42, %rbx
jmp 0x49f2
movq 0x33cd(%rip), %rbx      # 0x7fd0
leaq 0xd99(%rip), %rsi       # 0x59a3
movq %rbx, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq %rbx, %rdi
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20a0