// File: /workspace/github_cpp_makefile_star2_O2/hansfilipelo[P]floodfill/src/main.cpp
// Function: main
int main(int argc, char* argv[])
{
    vector< vector<int> > map;
    srand(0);
    int size = 100;

    cout << "Before: " << endl;
    // Generate random map between 1-10
    for (int i = 0; i < size; i++){
        map.push_back(vector<int>());
        for(int j = 0; j < size; j++){
            int tmp = i/10;
            map.at(i).push_back(tmp);
            cout << tmp << " ";
        }
        cout << endl;
    }
    
    int middle = map.size()/2;
    Utils::flood_fill(&map, map.size()/2, map.at(0).size()/2, map.at(middle).at(middle), -1);

    cout << endl << "After: " << endl;

    for (int i = 0; i < map.size(); i++){
        for (int j = 0; j < map.at(0).size(); j++ ){
            cout << map.at(i).at(j) << " ";
        }
        cout << endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
andq $0x0, -0x30(%rbp)
xorl %edi, %edi
callq 0x10a0
movq 0x2791(%rip), %rdi      # 0x3fd8
leaq 0x832(%rip), %rsi       # 0x2080
callq 0x10b0
movq %rax, %rdi
callq 0x1060
xorl %ebx, %ebx
leaq -0x60(%rbp), %r15
movq 0x2770(%rip), %r12      # 0x3fd8
cmpq $0x64, %rbx
je 0x18e8
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
andq $0x0, -0x50(%rbp)
leaq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0x1b28
movq %r15, %rdi
callq 0x1aea
movl %ebx, %eax
xorl %edx, %edx
pushq $0xa
popq %rcx
divl %ecx
movl %eax, %r14d
pushq $0x64
popq %r13
subl $0x1, %r13d
jb 0x18db
movl %r14d, -0x60(%rbp)
leaq -0x40(%rbp), %rdi
movq %rbx, %rsi
callq 0x14d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x1a2e
movl -0x60(%rbp), %esi
movq %r12, %rdi
callq 0x1110
movq %rax, %rdi
leaq 0x7b3(%rip), %rsi       # 0x2087
callq 0x10b0
jmp 0x189e
movq %r12, %rdi
callq 0x1060
incq %rbx
jmp 0x1868
leaq -0x40(%rbp), %rdi
movq 0x8(%rdi), %rax
subq (%rdi), %rax
pushq $0x18
popq %rcx
cqto
idivq %rcx
movq %rax, %rbx
xorl %esi, %esi
callq 0x14d0
shrq %rbx
movq 0x8(%rax), %r14
subq (%rax), %r14
movslq %ebx, %r15
leaq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0x14d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x1512
shrq $0x3, %r14
movl (%rax), %ecx
leaq -0x40(%rbp), %rdi
pushq $-0x1
popq %r8
movl %ebx, %esi
movl %r14d, %edx
callq 0x129c
movq 0x2690(%rip), %rdi      # 0x3fd8
callq 0x1060
leaq 0x735(%rip), %rsi       # 0x2089
movq %rax, %rdi
callq 0x10b0
movq %rax, %rdi
callq 0x1060
xorl %ebx, %ebx
leaq -0x40(%rbp), %r14
movq 0x2667(%rip), %r15      # 0x3fd8
leaq 0x70f(%rip), %r12       # 0x2087
movq -0x38(%rbp), %rax
subq -0x40(%rbp), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
cmpq %rbx, %rax
jbe 0x19e7
xorl %r13d, %r13d
movq %r14, %rdi
xorl %esi, %esi
callq 0x14d0
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x2, %rcx
cmpq %r13, %rcx
jbe 0x19da
movq %r14, %rdi
movq %rbx, %rsi
callq 0x14d0
movq %rax, %rdi
movq %r13, %rsi
callq 0x1512
movl (%rax), %esi
movq %r15, %rdi
callq 0x1110
movq %rax, %rdi
movq %r12, %rsi
callq 0x10b0
incq %r13
jmp 0x1990
movq %r15, %rdi
callq 0x1060
incq %rbx
jmp 0x1978
leaq -0x40(%rbp), %rdi
callq 0x1a54
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1a19
jmp 0x1a19
jmp 0x1a19
jmp 0x1a19
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x1aea
jmp 0x1a1c
jmp 0x1a19
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x1a54
movq %rbx, %rdi
callq 0x1120
nop