// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x378, %rsp            # imm = 0x378
movq %rsi, %r14
movq %rdi, -0x30(%rbp)
leaq -0x398(%rbp), %rbx
movl $0x90, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x20c0
leaq -0x108(%rbp), %rdi
callq 0x290e
leaq 0x1aa9(%rip), %rdi      # 0x402c
movq %rbx, %rsi
callq 0x2100
cmpl $-0x1, %eax
jne 0x25a1
leaq 0x1a95(%rip), %rdi      # 0x402c
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x2090
xorl %edi, %edi
callq 0x2110
leaq -0x308(%rbp), %rdi
movq %rax, %rsi
callq 0x29af
leaq 0x1a79(%rip), %rsi      # 0x4037
leaq -0x308(%rbp), %rdx
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x2981
leaq -0x308(%rbp), %r15
movq %r15, %rdi
callq 0x2080
movq (%rbx), %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x2090
xorl %r12d, %r12d
leaq -0x68(%rbp), %r13
pushq $0x40
popq %rbx
movq %r14, -0x38(%rbp)
movq 0x8(%r14), %rax
subq (%r14), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
cmpq %r12, %rax
jbe 0x2756
movq %r13, %rdi
movq -0x30(%rbp), %rsi
leaq 0x1a20(%rip), %rdx      # 0x4041
callq 0x2aa9
leaq -0xa8(%rbp), %r14
movq %r14, %rdi
movl %r12d, %esi
callq 0x2ae1
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x2a38
leaq -0x88(%rbp), %rdi
movq %r15, %rsi
leaq 0x19ec(%rip), %rdx      # 0x4043
callq 0x2a0f
movq %r15, %rdi
callq 0x2080
leaq -0xa8(%rbp), %rdi
callq 0x2080
movq %r13, %rdi
callq 0x2080
movq -0x88(%rbp), %rsi
movq %r15, %rdi
pushq $0x10
popq %rdx
callq 0x2150
movq %r12, -0x40(%rbp)
imulq $0x18, %r12, %rsi
movq -0x38(%rbp), %rax
addq (%rax), %rsi
movq %r13, %rdi
callq 0x28b6
xorl %r14d, %r14d
xorl %r13d, %r13d
movq -0x68(%rbp), %rax
movq -0x60(%rbp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r13, %rdx
jbe 0x271e
movq %r14, -0x48(%rbp)
xorl %r12d, %r12d
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r12, %rcx
jbe 0x2709
movl (%rax,%r13,4), %ecx
movq %rbx, %rax
cmpq %rcx, %r12
je 0x26e5
movl %r14d, %eax
notl %eax
andl $0x20, %eax
leaq (%rax,%rbp), %rsi
addq $-0x108, %rsi           # imm = 0xFEF8
movq %r15, %rdi
callq 0x20f0
incq %r12
movq -0x68(%rbp), %rax
movq -0x60(%rbp), %rcx
addq $0x20, %r14
jmp 0x26c5
movq %r15, %rdi
callq 0x20a0
incq %r13
movq -0x48(%rbp), %r14
addq $0x20, %r14
jmp 0x26a7
movq %r15, %rdi
callq 0x2190
leaq -0x68(%rbp), %r13
movq %r13, %rdi
callq 0x2f10
movq %r15, %rdi
callq 0x21b0
leaq -0x88(%rbp), %rdi
callq 0x2080
movq -0x40(%rbp), %r12
incq %r12
movq -0x38(%rbp), %r14
jmp 0x25fb
leaq -0x108(%rbp), %rdi
callq 0x2b42
movq -0x30(%rbp), %rax
addq $0x378, %rsp            # imm = 0x378
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x308(%rbp), %rdi
jmp 0x27ef
movq %rax, %rbx
jmp 0x27f4
jmp 0x27c7
movq %rax, %rbx
jmp 0x27d3
movq %rax, %rbx
jmp 0x27bf
movq %rax, %rbx
jmp 0x27eb
movq %rax, %rbx
jmp 0x27df
movq %rax, %rbx
jmp 0x27b3
movq %rax, %rbx
leaq -0x308(%rbp), %rdi
callq 0x2080
leaq -0xa8(%rbp), %rdi
callq 0x2080
leaq -0x68(%rbp), %rdi
jmp 0x27e6
jmp 0x27c7
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x2f10
leaq -0x308(%rbp), %rdi
callq 0x21b0
leaq -0x88(%rbp), %rdi
callq 0x2080
movq -0x30(%rbp), %rdi
callq 0x2080
leaq -0x108(%rbp), %rdi
callq 0x2b42
movq %rbx, %rdi
callq 0x2220