// File: i32ropie[P]n-queen-microservice/./extra_functions.hpp
// Function: exportar_soluciones[abi:cxx11](std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>> const&)
std::string exportar_soluciones(const std::vector<std::vector<int>> &soluciones){
    struct stat st = {0};
    tablero t;
    if(stat("soluciones", &st) == -1){
        mkdir("soluciones", 0700);
    }
    time_t epoch = std::time(0);
    std::string carpeta_salida = "soluciones/" + std::to_string(epoch);
    mkdir(carpeta_salida.c_str(), 0700);
    for(int k = 0 ; k < soluciones.size() ; ++k){
        std::string fichero_salida = carpeta_salida + "/" + std::to_string(k) + ".sol";
        std::ofstream f(fichero_salida.c_str());
        std::vector<int> sol = soluciones[k];
        for(int i = 0 ; i < sol.size() ; ++i){
            for(int j = 0 ; j < sol.size() ; ++j){
                if(j == sol[i]){
                    f << t.reina;
                }
                else if((i+j)%2==0){
                    f << t.blanco;
                }
                else{
                    f << t.negro;
                }
            }
            f << std::endl;
        }
        f.close();
    }
    return carpeta_salida;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x410, %rsp            # imm = 0x410
movq %rdi, -0x3f0(%rbp)
movq %rdi, %rax
movq %rax, -0x3e8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0xa0(%rbp), %rdi
xorl %esi, %esi
movl $0x90, %edx
callq 0x20c0
leaq -0x100(%rbp), %rdi
callq 0x2e70
leaq 0x3942(%rip), %rdi      # 0x602c
leaq -0xa0(%rbp), %rsi
callq 0x2140
cmpl $-0x1, %eax
jne 0x270c
leaq 0x392a(%rip), %rdi      # 0x602c
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x20a0
xorl %eax, %eax
movl %eax, %edi
callq 0x2150
movq %rax, -0x108(%rbp)
movb $0x0, -0x109(%rbp)
movq -0x108(%rbp), %rsi
leaq -0x130(%rbp), %rdi
callq 0x2fe0
jmp 0x2738
movq -0x3f0(%rbp), %rdi
leaq 0x38f1(%rip), %rsi      # 0x6037
leaq -0x130(%rbp), %rdx
callq 0x2f90
jmp 0x2754
leaq -0x130(%rbp), %rdi
callq 0x20e0
movq -0x3f0(%rbp), %rdi
callq 0x2080
movq %rax, %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x20a0
movl $0x0, -0x140(%rbp)
movslq -0x140(%rbp), %rax
movq %rax, -0x3f8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2cd0
movq %rax, %rcx
movq -0x3f8(%rbp), %rax
cmpq %rcx, %rax
jae 0x2b23
movq -0x3f0(%rbp), %rsi
leaq 0x3886(%rip), %rdx      # 0x6041
leaq -0x1a0(%rbp), %rdi
callq 0x3230
jmp 0x27c9
movl -0x140(%rbp), %esi
leaq -0x1c0(%rbp), %rdi
callq 0x32b0
jmp 0x27dd
leaq -0x180(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
leaq -0x1c0(%rbp), %rdx
callq 0x3160
jmp 0x27f9
leaq 0x3843(%rip), %rdx      # 0x6043
leaq -0x160(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x3110
jmp 0x2815
leaq -0x180(%rbp), %rdi
callq 0x20e0
leaq -0x1c0(%rbp), %rdi
callq 0x20e0
leaq -0x1a0(%rbp), %rdi
callq 0x20e0
leaq -0x160(%rbp), %rdi
callq 0x2080
movq %rax, %rsi
leaq -0x3c0(%rbp), %rdi
movl $0x10, %edx
callq 0x21b0
jmp 0x285b
movq -0x10(%rbp), %rdi
movslq -0x140(%rbp), %rsi
callq 0x2d00
movq %rax, %rsi
leaq -0x3d8(%rbp), %rdi
callq 0x2d20
jmp 0x287c
movl $0x0, -0x3dc(%rbp)
movslq -0x3dc(%rbp), %rax
movq %rax, -0x400(%rbp)
leaq -0x3d8(%rbp), %rdi
callq 0x2cb0
movq %rax, %rcx
movq -0x400(%rbp), %rax
cmpq %rcx, %rax
jae 0x2ac3
movl $0x0, -0x3e0(%rbp)
movslq -0x3e0(%rbp), %rax
movq %rax, -0x408(%rbp)
leaq -0x3d8(%rbp), %rdi
callq 0x2cb0
movq %rax, %rcx
movq -0x408(%rbp), %rax
cmpq %rcx, %rax
jae 0x2a98
movl -0x3e0(%rbp), %eax
movl %eax, -0x40c(%rbp)
movslq -0x3dc(%rbp), %rsi
leaq -0x3d8(%rbp), %rdi
callq 0x33d0
movq %rax, %rcx
movl -0x40c(%rbp), %eax
cmpl (%rcx), %eax
jne 0x2a39
leaq -0xc0(%rbp), %rsi
leaq -0x3c0(%rbp), %rdi
callq 0x2130
jmp 0x292f
jmp 0x2a82
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x138(%rbp)
movl %eax, -0x13c(%rbp)
jmp 0x2b67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x138(%rbp)
movl %eax, -0x13c(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x20e0
jmp 0x2b67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x138(%rbp)
movl %eax, -0x13c(%rbp)
jmp 0x2b5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x138(%rbp)
movl %eax, -0x13c(%rbp)
jmp 0x29d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x138(%rbp)
movl %eax, -0x13c(%rbp)
jmp 0x29cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x138(%rbp)
movl %eax, -0x13c(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x20e0
leaq -0x1c0(%rbp), %rdi
callq 0x20e0
leaq -0x1a0(%rbp), %rdi
callq 0x20e0
jmp 0x2b5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x138(%rbp)
movl %eax, -0x13c(%rbp)
jmp 0x2b15
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x138(%rbp)
movl %eax, -0x13c(%rbp)
jmp 0x2b09
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x138(%rbp)
movl %eax, -0x13c(%rbp)
leaq -0x3d8(%rbp), %rdi
callq 0x2e10
jmp 0x2b09
movl -0x3dc(%rbp), %eax
addl -0x3e0(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x2a69
leaq -0xe0(%rbp), %rsi
leaq -0x3c0(%rbp), %rdi
callq 0x2130
jmp 0x2a67
jmp 0x2a80
leaq -0x3c0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x2130
jmp 0x2a7e
jmp 0x2a80
jmp 0x2a82
jmp 0x2a84
movl -0x3e0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3e0(%rbp)
jmp 0x28bd
movq 0x7529(%rip), %rsi      # 0x9fc8
leaq -0x3c0(%rbp), %rdi
callq 0x2190
jmp 0x2aad
jmp 0x2aaf
movl -0x3dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3dc(%rbp)
jmp 0x2886
leaq -0x3c0(%rbp), %rdi
callq 0x21d0
jmp 0x2ad1
leaq -0x3d8(%rbp), %rdi
callq 0x2e10
leaq -0x3c0(%rbp), %rdi
callq 0x21f0
leaq -0x160(%rbp), %rdi
callq 0x20e0
movl -0x140(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x140(%rbp)
jmp 0x2783
leaq -0x3c0(%rbp), %rdi
callq 0x21f0
leaq -0x160(%rbp), %rdi
callq 0x20e0
jmp 0x2b5b
movb $0x1, -0x109(%rbp)
testb $0x1, -0x109(%rbp)
jne 0x2b3f
movq -0x3f0(%rbp), %rdi
callq 0x20e0
leaq -0x100(%rbp), %rdi
callq 0x33f0
movq -0x3e8(%rbp), %rax
addq $0x410, %rsp            # imm = 0x410
popq %rbp
retq
movq -0x3f0(%rbp), %rdi
callq 0x20e0
leaq -0x100(%rbp), %rdi
callq 0x33f0
movq -0x138(%rbp), %rdi
callq 0x2260
nop