#include "thread-pool-runner.hh"
#include "runtime-infos.hh"
#include "kernels.hh"
#include "../runtime/node.hh"
#include "../runtime/nodes-list.hh"

#include <chrono>
#include <iostream>

namespace cpu
{


    namespace
    {

        bool task_ready(std::size_t pos, RuntimeInfos* infos)
        {
            for (auto n : infos->tasks_->preds()[pos])
                if (!infos->tasks_status_[n])
                    return false;
            return true;
        }

        void exec_kernel(rt::Node* node)
        {
            std::size_t id = node->type;
            if (node->use_simd)
                id += KERNEL_SIMD_OFFSET;
            kernels_list[id](node);
        }
        

        void exec_graph(RuntimeInfos* infos)
        {

            while (infos->exec_graph)
            {

                std::size_t task = infos->next_task_++;
                if (task >= infos->tasks_->size())
                    break;

                rt::Node* node = infos->tasks_->nodes()[task];
                //wait for predecessors to finish
                while (!task_ready(task, infos))
                    std::this_thread::sleep_for(std::chrono::milliseconds(1));
                exec_kernel(node);
                infos->tasks_status_[task] = 1;
            }

            //no more operands to be executed but some didn't finish executing operations
            infos->exec_graph = false;

            //set flag if graph terminated
            for (auto s : infos->tasks_status_)
                if (s == 0)
                    return;
            infos->graph_completed = true;
        }

        void thread_runner(RuntimeInfos* infos)
        {

            //std::cout << "begin\n";

            while (!infos->quit)
            {

                if (infos->exec_graph)
                    exec_graph(infos);
                else
                    std::this_thread::sleep_for(std::chrono::milliseconds(10));
            }

            //std::cout << "end\n";
            
        }
        
    }
    
    

    ThreadPoolRunner::ThreadPoolRunner(std::size_t nthreads)
    {

        infos_ = new RuntimeInfos;
        infos_->quit = false;
        infos_->exec_graph = false;

        for (std::size_t i = 0; i < nthreads; ++i)
            ths_.emplace_back(&thread_runner, infos_); 
    }

    ThreadPoolRunner::~ThreadPoolRunner()
    {
        infos_->quit = true;
        for (auto& t : ths_)
            t.join();
        delete infos_;
    }

    void ThreadPoolRunner::run(rt::NodesList& tasks)
    {
        infos_->tasks_ = &tasks;
        infos_->next_task_ = 0;
        infos_->graph_completed = false;
        infos_->tasks_status_ = std::vector<int>(tasks.size(), 0);
        
        infos_->exec_graph = true;
        while (!infos_->graph_completed)
        {
            std::this_thread::sleep_for(std::chrono::milliseconds(100));
        }
        
    }
    
}

	.file	"tmpxft_003a9f59_00000000-6_thread-pool-runner.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.section	.text._ZNSt6thread24_M_thread_deps_never_runEv,"axG",@progbits,_ZNSt6thread24_M_thread_deps_never_runEv,comdat
	.weak	_ZNSt6thread24_M_thread_deps_never_runEv
	.type	_ZNSt6thread24_M_thread_deps_never_runEv, @function
_ZNSt6thread24_M_thread_deps_never_runEv:
.LFB2496:
	.cfi_startproc
	endbr64
	ret
	.cfi_endproc
.LFE2496:
	.size	_ZNSt6thread24_M_thread_deps_never_runEv, .-_ZNSt6thread24_M_thread_deps_never_runEv
	.section	.text._ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED2Ev,"axG",@progbits,_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED5Ev,comdat
	.align 2
	.weak	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED2Ev
	.type	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED2Ev, @function
_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED2Ev:
.LFB5985:
	.cfi_startproc
	endbr64
	leaq	16+_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE(%rip), %rax
	movq	%rax, (%rdi)
	jmp	_ZNSt6thread6_StateD2Ev@PLT
	.cfi_endproc
.LFE5985:
	.size	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED2Ev, .-_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED2Ev
	.weak	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED1Ev
	.set	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED1Ev,_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED2Ev
	.section	.text._ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED0Ev,"axG",@progbits,_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED5Ev,comdat
	.align 2
	.weak	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED0Ev
	.type	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED0Ev, @function
_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED0Ev:
.LFB5987:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movq	%rdi, 8(%rsp)
	call	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED1Ev
	movq	8(%rsp), %rdi
	movl	$24, %esi
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	jmp	_ZdlPvm@PLT
	.cfi_endproc
.LFE5987:
	.size	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED0Ev, .-_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED0Ev
	.text
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4932:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4932:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.text._ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv,"axG",@progbits,_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv,comdat
	.align 2
	.weak	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv
	.type	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv, @function
_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv:
.LFB5988:
	.cfi_startproc
	endbr64
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rax
	movq	%rdx, %rdi
	jmp	*%rax
	.cfi_endproc
.LFE5988:
	.size	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv, .-_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv
	.text
	.type	_ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000EEEEvRKNSt6chrono8durationIT_T0_EE.isra.0, @function
_ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000EEEEvRKNSt6chrono8durationIT_T0_EE.isra.0:
.LFB6011:
	.cfi_startproc
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rdx
	movq	%rdx, 24(%rsp)
	xorl	%edx, %edx
	testq	%rdi, %rdi
	jle	.L7
	movq	%rdi, %rax
	movl	$1000, %ecx
	leaq	8(%rsp), %rbx
	cqto
	idivq	%rcx
	imulq	$1000000, %rdx, %rdx
	movq	%rax, 8(%rsp)
	movq	%rdx, 16(%rsp)
.L10:
	movq	%rbx, %rsi
	movq	%rbx, %rdi
	call	nanosleep@PLT
	incl	%eax
	jne	.L7
	call	__errno_location@PLT
	cmpl	$4, (%rax)
	je	.L10
.L7:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE6011:
	.size	_ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000EEEEvRKNSt6chrono8durationIT_T0_EE.isra.0, .-_ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000EEEEvRKNSt6chrono8durationIT_T0_EE.isra.0
	.globl	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6210task_readyEmPNS_12RuntimeInfosE
	.hidden	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6210task_readyEmPNS_12RuntimeInfosE
	.type	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6210task_readyEmPNS_12RuntimeInfosE, @function
_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6210task_readyEmPNS_12RuntimeInfosE:
.LFB4890:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	pushq	%rcx
	.cfi_def_cfa_offset 32
	movq	8(%rsi), %rdi
	call	_ZNK2rt9NodesList5predsEv@PLT
	imulq	$24, %rbx, %rdi
	addq	(%rax), %rdi
	movq	8(%rdi), %rdx
	movq	(%rdi), %rax
.L16:
	movq	%rax, %rcx
	cmpq	%rax, %rdx
	je	.L21
	movq	(%rcx), %rsi
	movq	24(%rbp), %rcx
	addq	$8, %rax
	cmpl	$0, (%rcx,%rsi,4)
	jne	.L16
	xorl	%eax, %eax
	jmp	.L15
.L21:
	movb	$1, %al
.L15:
	popq	%rdx
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4890:
	.size	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6210task_readyEmPNS_12RuntimeInfosE, .-_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6210task_readyEmPNS_12RuntimeInfosE
	.globl	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6211exec_kernelEPN2rt4NodeE
	.hidden	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6211exec_kernelEPN2rt4NodeE
	.type	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6211exec_kernelEPN2rt4NodeE, @function
_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6211exec_kernelEPN2rt4NodeE:
.LFB4891:
	.cfi_startproc
	endbr64
	cmpb	$0, 56(%rdi)
	movslq	(%rdi), %rax
	je	.L23
	addq	$300, %rax
.L23:
	leaq	_ZN3cpu12kernels_listE(%rip), %rdx
	jmp	*(%rdx,%rax,8)
	.cfi_endproc
.LFE4891:
	.size	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6211exec_kernelEPN2rt4NodeE, .-_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6211exec_kernelEPN2rt4NodeE
	.globl	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6210exec_graphEPNS_12RuntimeInfosE
	.hidden	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6210exec_graphEPNS_12RuntimeInfosE
	.type	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6210exec_graphEPNS_12RuntimeInfosE, @function
_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6210exec_graphEPNS_12RuntimeInfosE:
.LFB4892:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
.L25:
	cmpb	$0, 1(%rbx)
	je	.L31
	movl	$1, %ebp
	lock xaddq	%rbp, 16(%rbx)
	movq	8(%rbx), %rdi
	call	_ZNK2rt9NodesList4sizeEv@PLT
	cmpq	%rax, %rbp
	jb	.L26
.L31:
	movq	32(%rbx), %rdx
	movq	24(%rbx), %rax
	movb	$0, 1(%rbx)
	jmp	.L27
.L26:
	movq	8(%rbx), %rdi
	call	_ZNK2rt9NodesList5nodesEv@PLT
	movq	(%rax), %rax
	movq	(%rax,%rbp,8), %r12
.L28:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6210task_readyEmPNS_12RuntimeInfosE
	testb	%al, %al
	jne	.L35
	movl	$1, %edi
	call	_ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000EEEEvRKNSt6chrono8durationIT_T0_EE.isra.0
	jmp	.L28
.L35:
	movq	%r12, %rdi
	call	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6211exec_kernelEPN2rt4NodeE
	movq	24(%rbx), %rax
	movl	$1, (%rax,%rbp,4)
	jmp	.L25
.L33:
	addq	$4, %rax
	cmpl	$0, -4(%rax)
	je	.L24
.L27:
	cmpq	%rax, %rdx
	jne	.L33
	movb	$1, 2(%rbx)
.L24:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4892:
	.size	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6210exec_graphEPNS_12RuntimeInfosE, .-_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6210exec_graphEPNS_12RuntimeInfosE
	.globl	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6213thread_runnerEPNS_12RuntimeInfosE
	.hidden	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6213thread_runnerEPNS_12RuntimeInfosE
	.type	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6213thread_runnerEPNS_12RuntimeInfosE, @function
_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6213thread_runnerEPNS_12RuntimeInfosE:
.LFB4893:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
.L37:
	cmpb	$0, (%rbx)
	jne	.L42
	cmpb	$0, 1(%rbx)
	je	.L38
	movq	%rbx, %rdi
	call	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6210exec_graphEPNS_12RuntimeInfosE
	jmp	.L37
.L38:
	movl	$10, %edi
	call	_ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000EEEEvRKNSt6chrono8durationIT_T0_EE.isra.0
	jmp	.L37
.L42:
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4893:
	.size	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6213thread_runnerEPNS_12RuntimeInfosE, .-_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6213thread_runnerEPNS_12RuntimeInfosE
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4955:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE4955:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorISt6threadSaIS0_EED2Ev,"axG",@progbits,_ZNSt6vectorISt6threadSaIS0_EED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorISt6threadSaIS0_EED2Ev
	.type	_ZNSt6vectorISt6threadSaIS0_EED2Ev, @function
_ZNSt6vectorISt6threadSaIS0_EED2Ev:
.LFB5380:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	movq	8(%rdi), %rcx
	movq	%rax, %rdx
.L46:
	cmpq	%rdx, %rcx
	je	.L53
	cmpq	$0, (%rdx)
	je	.L47
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_ZSt9terminatev@PLT
.L47:
	.cfi_def_cfa_offset 8
	addq	$8, %rdx
	jmp	.L46
.L53:
	testq	%rax, %rax
	je	.L45
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L45:
	ret
	.cfi_endproc
.LFE5380:
	.size	_ZNSt6vectorISt6threadSaIS0_EED2Ev, .-_ZNSt6vectorISt6threadSaIS0_EED2Ev
	.weak	_ZNSt6vectorISt6threadSaIS0_EED1Ev
	.set	_ZNSt6vectorISt6threadSaIS0_EED1Ev,_ZNSt6vectorISt6threadSaIS0_EED2Ev
	.section	.text._ZNSt6vectorIiSaIiEED2Ev,"axG",@progbits,_ZNSt6vectorIiSaIiEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEED2Ev
	.type	_ZNSt6vectorIiSaIiEED2Ev, @function
_ZNSt6vectorIiSaIiEED2Ev:
.LFB5392:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L54
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L54:
	ret
	.cfi_endproc
.LFE5392:
	.size	_ZNSt6vectorIiSaIiEED2Ev, .-_ZNSt6vectorIiSaIiEED2Ev
	.weak	_ZNSt6vectorIiSaIiEED1Ev
	.set	_ZNSt6vectorIiSaIiEED1Ev,_ZNSt6vectorIiSaIiEED2Ev
	.text
	.align 2
	.globl	_ZN3cpu16ThreadPoolRunnerD2Ev
	.type	_ZN3cpu16ThreadPoolRunnerD2Ev, @function
_ZN3cpu16ThreadPoolRunnerD2Ev:
.LFB4924:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4924
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	24(%rdi), %rax
	movq	%rdi, %rbx
	movq	8(%rdi), %r12
	movq	(%rdi), %rbp
	movb	$1, (%rax)
.L57:
	cmpq	%r12, %rbp
	je	.L64
	movq	%rbp, %rdi
	addq	$8, %rbp
	call	_ZNSt6thread4joinEv@PLT
	jmp	.L57
.L64:
	movq	24(%rbx), %rbp
	testq	%rbp, %rbp
	je	.L59
	leaq	24(%rbp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movl	$48, %esi
	movq	%rbp, %rdi
	call	_ZdlPvm@PLT
.L59:
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	_ZNSt6vectorISt6threadSaIS0_EED1Ev
	.cfi_endproc
.LFE4924:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4924:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4924-.LLSDACSB4924
.LLSDACSB4924:
.LLSDACSE4924:
	.text
	.size	_ZN3cpu16ThreadPoolRunnerD2Ev, .-_ZN3cpu16ThreadPoolRunnerD2Ev
	.globl	_ZN3cpu16ThreadPoolRunnerD1Ev
	.set	_ZN3cpu16ThreadPoolRunnerD1Ev,_ZN3cpu16ThreadPoolRunnerD2Ev
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"cannot create std::vector larger than max_size()"
	.text
	.align 2
	.globl	_ZN3cpu16ThreadPoolRunner3runERN2rt9NodesListE
	.type	_ZN3cpu16ThreadPoolRunner3runERN2rt9NodesListE, @function
_ZN3cpu16ThreadPoolRunner3runERN2rt9NodesListE:
.LFB4926:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xorl	%edx, %edx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	movq	24(%rbx), %rax
	movq	%rsi, 8(%rax)
	xchgq	16(%rax), %rdx
	movq	24(%rbx), %rax
	movb	$0, 2(%rax)
	call	_ZNK2rt9NodesList4sizeEv@PLT
	movq	%rax, %r12
	movabsq	$2305843009213693951, %rax
	cmpq	%r12, %rax
	jnb	.L66
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L80
	leaq	.LC0(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L66:
	leaq	0(,%r12,4), %rbp
	xorl	%eax, %eax
	testq	%r12, %r12
	je	.L68
	movq	%rbp, %rdi
	call	_Znwm@PLT
.L68:
	leaq	(%rax,%rbp), %rcx
	movq	%rax, %rsi
	movq	%rax, %rdx
	testq	%r12, %r12
	je	.L69
.L70:
	cmpq	%rdx, %rcx
	je	.L81
	xorl	%esi, %esi
	addq	$4, %rdx
	movl	%esi, -4(%rdx)
	jmp	.L70
.L81:
	movq	%rcx, %rsi
.L69:
	movq	24(%rbx), %rdx
	movq	40(%rdx), %rdi
	movq	24(%rdx), %r9
	movq	%rcx, 40(%rdx)
	movq	32(%rdx), %r8
	movq	%rax, 24(%rdx)
	xorl	%eax, %eax
	movq	%rsi, 32(%rdx)
	movq	%rdi, 48(%rsp)
	leaq	32(%rsp), %rdi
	movq	%rax, 8(%rsp)
	movq	%rax, 16(%rsp)
	movq	%rax, 24(%rsp)
	movq	%r9, 32(%rsp)
	movq	%r8, 40(%rsp)
	call	_ZNSt6vectorIiSaIiEED1Ev
	leaq	8(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movq	24(%rbx), %rax
	movb	$1, 1(%rax)
.L72:
	movq	24(%rbx), %rax
	cmpb	$0, 2(%rax)
	jne	.L82
	movl	$100, %edi
	call	_ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000EEEEvRKNSt6chrono8durationIT_T0_EE.isra.0
	jmp	.L72
.L82:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L74
.L80:
	call	__stack_chk_fail@PLT
.L74:
	addq	$64, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4926:
	.size	_ZN3cpu16ThreadPoolRunner3runERN2rt9NodesListE, .-_ZN3cpu16ThreadPoolRunner3runERN2rt9NodesListE
	.section	.text._ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev,"axG",@progbits,_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED5Ev,comdat
	.align 2
	.weak	_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev
	.type	_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev, @function
_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev:
.LFB5886:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	je	.L83
	movq	(%rdi), %rax
	jmp	*8(%rax)
.L83:
	ret
	.cfi_endproc
.LFE5886:
	.size	_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev, .-_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev
	.weak	_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED1Ev
	.set	_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED1Ev,_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev
	.section	.text._ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_,"axG",@progbits,_ZNSt6threadC5IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_,comdat
	.align 2
	.weak	_ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_
	.type	_ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_, @function
_ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_:
.LFB5829:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA5829
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rsi, %rbp
	xorl	%esi, %esi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsi, (%rdi)
	movl	$24, %edi
.LEHB0:
	call	_Znwm@PLT
.LEHE0:
	movq	(%r12), %rdx
	leaq	16+_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE(%rip), %rcx
	movq	%rbx, %rdi
	movq	%rcx, (%rax)
	movq	%rdx, 8(%rax)
	movq	0(%rbp), %rdx
	movq	%rsp, %rbp
	movq	%rbp, %rsi
	movq	%rax, (%rsp)
	movq	%rdx, 16(%rax)
	leaq	_ZNSt6thread24_M_thread_deps_never_runEv(%rip), %rdx
.LEHB1:
	call	_ZNSt6thread15_M_start_threadESt10unique_ptrINS_6_StateESt14default_deleteIS1_EEPFvvE@PLT
.LEHE1:
	movq	%rbp, %rdi
	call	_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED1Ev
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L88
	jmp	.L90
.L89:
	endbr64
	movq	%rax, %rbx
.L86:
	movq	%rbp, %rdi
	call	_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED1Ev
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L90
	movq	%rbx, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L90:
	call	__stack_chk_fail@PLT
.L88:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5829:
	.section	.gcc_except_table
.LLSDA5829:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE5829-.LLSDACSB5829
.LLSDACSB5829:
	.uleb128 .LEHB0-.LFB5829
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB5829
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L89-.LFB5829
	.uleb128 0
	.uleb128 .LEHB2-.LFB5829
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE5829:
	.section	.text._ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_,"axG",@progbits,_ZNSt6threadC5IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_,comdat
	.size	_ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_, .-_ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_
	.weak	_ZNSt6threadC1IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_
	.set	_ZNSt6threadC1IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_,_ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_
	.section	.rodata._ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_.str1.1,"aMS",@progbits,1
.LC1:
	.string	"vector::_M_realloc_insert"
	.section	.text._ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_,"axG",@progbits,_ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_,comdat
	.align 2
	.weak	_ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_
	.type	_ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_, @function
_ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_:
.LFB5600:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA5600
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rsi, %r15
	movq	%rdx, %rsi
	movq	%rcx, %rdx
	movabsq	$1152921504606846975, %rcx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	8(%rdi), %r14
	movq	(%rdi), %r13
	movq	%r14, %rbx
	subq	%r13, %rbx
	sarq	$3, %rbx
	cmpq	%rcx, %rbx
	jne	.L93
	leaq	.LC1(%rip), %rdi
.LEHB3:
	call	_ZSt20__throw_length_errorPKc@PLT
.L93:
	cmpq	%r13, %r14
	movl	$1, %eax
	movq	%rdi, %r12
	movq	%r15, %rdi
	cmovne	%rbx, %rax
	addq	%rax, %rbx
	setc	%al
	subq	%r13, %rdi
	movzbl	%al, %eax
	movq	%rdi, 8(%rsp)
	testq	%rax, %rax
	jne	.L109
	xorl	%ebp, %ebp
	testq	%rbx, %rbx
	je	.L98
	movabsq	$1152921504606846975, %rax
	cmpq	%rax, %rbx
	cmova	%rax, %rbx
	jmp	.L97
.L109:
	movq	%rcx, %rbx
.L97:
	leaq	0(,%rbx,8), %rdi
	movq	%rdx, 24(%rsp)
	movq	%rsi, 16(%rsp)
	call	_Znwm@PLT
.LEHE3:
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rsi
	movq	%rax, %rbp
.L98:
	movq	8(%rsp), %rax
	addq	%rbp, %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
.LEHB4:
	call	_ZNSt6threadC1IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_
.LEHE4:
	movq	%rbp, %rcx
	movq	%r13, %rdx
.L99:
	addq	$8, %rcx
	cmpq	%rdx, %r15
	leaq	8(%rdx), %rax
	je	.L121
	movq	(%rdx), %rdx
	movq	%rdx, -8(%rcx)
	movq	%rax, %rdx
	jmp	.L99
.L121:
	subq	%r13, %rax
	movq	%rdx, %rsi
	addq	%rbp, %rax
	movq	%rax, %rcx
.L101:
	cmpq	%rdx, %r14
	je	.L122
	movq	(%rdx), %rdi
	addq	$8, %rcx
	addq	$8, %rdx
	movq	%rdi, -8(%rcx)
	jmp	.L101
.L122:
	subq	%rsi, %r14
	addq	%rax, %r14
	testq	%r13, %r13
	je	.L103
	movq	16(%r12), %rsi
	movq	%r13, %rdi
	subq	%r13, %rsi
	call	_ZdlPvm@PLT
.L103:
	leaq	0(%rbp,%rbx,8), %rax
	movq	%rbp, (%r12)
	movq	%r14, 8(%r12)
	movq	%rax, 16(%r12)
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L112:
	.cfi_restore_state
	endbr64
	movq	%rax, %rdi
.L104:
	call	__cxa_begin_catch@PLT
	testq	%rbp, %rbp
	jne	.L105
	movq	8(%rsp), %rax
	cmpq	$0, (%rax)
	je	.L106
	call	_ZSt9terminatev@PLT
.L105:
	leaq	0(,%rbx,8), %rsi
	movq	%rbp, %rdi
	call	_ZdlPvm@PLT
.L106:
.LEHB5:
	call	__cxa_rethrow@PLT
.LEHE5:
.L113:
	endbr64
	movq	%rax, %rbx
.L107:
	call	__cxa_end_catch@PLT
	movq	%rbx, %rdi
.LEHB6:
	call	_Unwind_Resume@PLT
.LEHE6:
	.cfi_endproc
.LFE5600:
	.section	.gcc_except_table
	.align 4
.LLSDA5600:
	.byte	0xff
	.byte	0x9b
	.uleb128 .LLSDATT5600-.LLSDATTD5600
.LLSDATTD5600:
	.byte	0x1
	.uleb128 .LLSDACSE5600-.LLSDACSB5600
.LLSDACSB5600:
	.uleb128 .LEHB3-.LFB5600
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB4-.LFB5600
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L112-.LFB5600
	.uleb128 0x1
	.uleb128 .LEHB5-.LFB5600
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L113-.LFB5600
	.uleb128 0
	.uleb128 .LEHB6-.LFB5600
	.uleb128 .LEHE6-.LEHB6
	.uleb128 0
	.uleb128 0
.LLSDACSE5600:
	.byte	0x1
	.byte	0
	.align 4
	.long	0

.LLSDATT5600:
	.section	.text._ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_,"axG",@progbits,_ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_,comdat
	.size	_ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_, .-_ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_
	.text
	.align 2
	.globl	_ZN3cpu16ThreadPoolRunnerC2Em
	.type	_ZN3cpu16ThreadPoolRunnerC2Em, @function
_ZN3cpu16ThreadPoolRunnerC2Em:
.LFB4918:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4918
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xorl	%ecx, %ecx
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rdi, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rcx, (%rdi)
	movq	%rcx, 8(%rdi)
	movq	%rcx, 16(%rdi)
	movl	$48, %edi
.LEHB7:
	call	_Znwm@PLT
	xorl	%edx, %edx
	movq	%rax, 24(%rbx)
	xorl	%r12d, %r12d
	leaq	_ZN3cpu54_GLOBAL__N__6400ea2c_21_thread_pool_runner_cu_ff86dc6213thread_runnerEPNS_12RuntimeInfosE(%rip), %r13
	movq	%rdx, 24(%rax)
	movq	%rdx, 32(%rax)
	movq	%rdx, 40(%rax)
	movw	$0, (%rax)
.L124:
	cmpq	%rbp, %r12
	je	.L135
	movq	8(%rbx), %rdi
	cmpq	16(%rbx), %rdi
	movq	%r13, (%rsp)
	leaq	24(%rbx), %rdx
	movq	%rsp, %rsi
	je	.L125
	call	_ZNSt6threadC1IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_
	addq	$8, 8(%rbx)
	jmp	.L126
.L125:
	movq	%rdx, %rcx
	movq	%rsi, %rdx
	movq	%rdi, %rsi
	movq	%rbx, %rdi
	call	_ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_
.LEHE7:
.L126:
	incq	%r12
	jmp	.L124
.L131:
	endbr64
	movq	%rax, %rbp
.L128:
	movq	%rbx, %rdi
	call	_ZNSt6vectorISt6threadSaIS0_EED1Ev
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L134
	movq	%rbp, %rdi
.LEHB8:
	call	_Unwind_Resume@PLT
.LEHE8:
.L135:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L130
.L134:
	call	__stack_chk_fail@PLT
.L130:
	addq	$24, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4918:
	.section	.gcc_except_table
.LLSDA4918:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4918-.LLSDACSB4918
.LLSDACSB4918:
	.uleb128 .LEHB7-.LFB4918
	.uleb128 .LEHE7-.LEHB7
	.uleb128 .L131-.LFB4918
	.uleb128 0
	.uleb128 .LEHB8-.LFB4918
	.uleb128 .LEHE8-.LEHB8
	.uleb128 0
	.uleb128 0
.LLSDACSE4918:
	.text
	.size	_ZN3cpu16ThreadPoolRunnerC2Em, .-_ZN3cpu16ThreadPoolRunnerC2Em
	.globl	_ZN3cpu16ThreadPoolRunnerC1Em
	.set	_ZN3cpu16ThreadPoolRunnerC1Em,_ZN3cpu16ThreadPoolRunnerC2Em
	.weak	_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE
	.section	.rodata._ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE,"aG",@progbits,_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE,comdat
	.align 32
	.type	_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE, @object
	.size	_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE, 82
_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE:
	.string	"NSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE"
	.weak	_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE
	.section	.data.rel.ro._ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE,"awG",@progbits,_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE,comdat
	.align 8
	.type	_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE, @object
	.size	_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE, 24
_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE:
	.quad	_ZTVN10__cxxabiv120__si_class_type_infoE+16
	.quad	_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE
	.quad	_ZTINSt6thread6_StateE
	.weak	_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE
	.section	.data.rel.ro.local._ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE,"awG",@progbits,_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE,comdat
	.align 8
	.type	_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE, @object
	.size	_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE, 40
_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE:
	.quad	0
	.quad	_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE
	.quad	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED1Ev
	.quad	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED0Ev
	.quad	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include "thread-pool-runner.hh"
#include "runtime-infos.hh"
#include "kernels.hh"
#include "../runtime/node.hh"
#include "../runtime/nodes-list.hh"

#include <chrono>
#include <iostream>

namespace cpu
{


    namespace
    {

        bool task_ready(std::size_t pos, RuntimeInfos* infos)
        {
            for (auto n : infos->tasks_->preds()[pos])
                if (!infos->tasks_status_[n])
                    return false;
            return true;
        }

        void exec_kernel(rt::Node* node)
        {
            std::size_t id = node->type;
            if (node->use_simd)
                id += KERNEL_SIMD_OFFSET;
            kernels_list[id](node);
        }
        

        void exec_graph(RuntimeInfos* infos)
        {

            while (infos->exec_graph)
            {

                std::size_t task = infos->next_task_++;
                if (task >= infos->tasks_->size())
                    break;

                rt::Node* node = infos->tasks_->nodes()[task];
                //wait for predecessors to finish
                while (!task_ready(task, infos))
                    std::this_thread::sleep_for(std::chrono::milliseconds(1));
                exec_kernel(node);
                infos->tasks_status_[task] = 1;
            }

            //no more operands to be executed but some didn't finish executing operations
            infos->exec_graph = false;

            //set flag if graph terminated
            for (auto s : infos->tasks_status_)
                if (s == 0)
                    return;
            infos->graph_completed = true;
        }

        void thread_runner(RuntimeInfos* infos)
        {

            //std::cout << "begin\n";

            while (!infos->quit)
            {

                if (infos->exec_graph)
                    exec_graph(infos);
                else
                    std::this_thread::sleep_for(std::chrono::milliseconds(10));
            }

            //std::cout << "end\n";
            
        }
        
    }
    
    

    ThreadPoolRunner::ThreadPoolRunner(std::size_t nthreads)
    {

        infos_ = new RuntimeInfos;
        infos_->quit = false;
        infos_->exec_graph = false;

        for (std::size_t i = 0; i < nthreads; ++i)
            ths_.emplace_back(&thread_runner, infos_); 
    }

    ThreadPoolRunner::~ThreadPoolRunner()
    {
        infos_->quit = true;
        for (auto& t : ths_)
            t.join();
        delete infos_;
    }

    void ThreadPoolRunner::run(rt::NodesList& tasks)
    {
        infos_->tasks_ = &tasks;
        infos_->next_task_ = 0;
        infos_->graph_completed = false;
        infos_->tasks_status_ = std::vector<int>(tasks.size(), 0);
        
        infos_->exec_graph = true;
        while (!infos_->graph_completed)
        {
            std::this_thread::sleep_for(std::chrono::milliseconds(100));
        }
        
    }
    
}

	.text
	.file	"thread-pool-runner.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _ZN3cpu16ThreadPoolRunnerC2Em
.LCPI0_0:
	.zero	16
	.text
	.globl	_ZN3cpu16ThreadPoolRunnerC2Em
	.p2align	1, 0x90
	.type	_ZN3cpu16ThreadPoolRunnerC2Em,@function
_ZN3cpu16ThreadPoolRunnerC2Em:          # @_ZN3cpu16ThreadPoolRunnerC2Em
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %r14
	movq	%rdi, %rbx
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rdi)
	movq	$0, 16(%rdi)
.Ltmp0:
	movl	$48, %edi
	callq	_Znwm
.Ltmp1:
# %bb.1:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%rax)
	movq	$0, 40(%rax)
	movq	%rax, 24(%rbx)
	movw	$0, (%rax)
	testq	%r14, %r14
	je	.LBB0_5
# %bb.2:
	leaq	24(%rbx), %r15
	movq	%rsp, %r12
.LBB0_3:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	$_ZN3cpu12_GLOBAL__N_113thread_runnerEPNS_12RuntimeInfosE, (%rsp)
.Ltmp3:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_ZNSt6vectorISt6threadSaIS0_EE12emplace_backIJPFvPN3cpu12RuntimeInfosEERS6_EEERS0_DpOT_
.Ltmp4:
# %bb.4:                                #   in Loop: Header=BB0_3 Depth=1
	decq	%r14
	jne	.LBB0_3
.LBB0_5:                                # %._crit_edge
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB0_8:
	.cfi_def_cfa_offset 48
.Ltmp2:
	jmp	.LBB0_7
.LBB0_6:
.Ltmp5:
.LBB0_7:
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_ZNSt6vectorISt6threadSaIS0_EED2Ev
	movq	%r14, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end0:
	.size	_ZN3cpu16ThreadPoolRunnerC2Em, .Lfunc_end0-_ZN3cpu16ThreadPoolRunnerC2Em
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table0:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 1 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp4-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Lfunc_end0-.Ltmp4             #   Call between .Ltmp4 and .Lfunc_end0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt6vectorISt6threadSaIS0_EE12emplace_backIJPFvPN3cpu12RuntimeInfosEERS6_EEERS0_DpOT_,"axG",@progbits,_ZNSt6vectorISt6threadSaIS0_EE12emplace_backIJPFvPN3cpu12RuntimeInfosEERS6_EEERS0_DpOT_,comdat
	.weak	_ZNSt6vectorISt6threadSaIS0_EE12emplace_backIJPFvPN3cpu12RuntimeInfosEERS6_EEERS0_DpOT_ # -- Begin function _ZNSt6vectorISt6threadSaIS0_EE12emplace_backIJPFvPN3cpu12RuntimeInfosEERS6_EEERS0_DpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorISt6threadSaIS0_EE12emplace_backIJPFvPN3cpu12RuntimeInfosEERS6_EEERS0_DpOT_,@function
_ZNSt6vectorISt6threadSaIS0_EE12emplace_backIJPFvPN3cpu12RuntimeInfosEERS6_EEERS0_DpOT_: # @_ZNSt6vectorISt6threadSaIS0_EE12emplace_backIJPFvPN3cpu12RuntimeInfosEERS6_EEERS0_DpOT_
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdx, %rcx
	movq	%rsi, %rdx
	movq	%rdi, %rbx
	movq	8(%rdi), %rsi
	cmpq	16(%rdi), %rsi
	je	.LBB1_2
# %bb.1:
	movq	%rsi, %rdi
	movq	%rdx, %rsi
	movq	%rcx, %rdx
	callq	_ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_
	movq	8(%rbx), %rax
	addq	$8, %rax
	movq	%rax, 8(%rbx)
	jmp	.LBB1_3
.LBB1_2:
	movq	%rbx, %rdi
	callq	_ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_
	movq	8(%rbx), %rax
.LBB1_3:
	addq	$-8, %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_ZNSt6vectorISt6threadSaIS0_EE12emplace_backIJPFvPN3cpu12RuntimeInfosEERS6_EEERS0_DpOT_, .Lfunc_end1-_ZNSt6vectorISt6threadSaIS0_EE12emplace_backIJPFvPN3cpu12RuntimeInfosEERS6_EEERS0_DpOT_
	.cfi_endproc
                                        # -- End function
	.text
	.type	_ZN3cpu12_GLOBAL__N_113thread_runnerEPNS_12RuntimeInfosE,@function # -- Begin function _ZN3cpu12_GLOBAL__N_113thread_runnerEPNS_12RuntimeInfosE
_ZN3cpu12_GLOBAL__N_113thread_runnerEPNS_12RuntimeInfosE: # @_ZN3cpu12_GLOBAL__N_113thread_runnerEPNS_12RuntimeInfosE
	.cfi_startproc
# %bb.0:
	cmpb	$0, (%rdi)
	je	.LBB2_1
# %bb.24:                               # %._crit_edge
	retq
.LBB2_1:                                # %.lr.ph
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movq	%rsp, %r14
.LBB2_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_3 Depth 2
                                        #       Child Loop BB2_5 Depth 3
                                        #         Child Loop BB2_8 Depth 4
                                        #         Child Loop BB2_10 Depth 4
                                        #     Child Loop BB2_16 Depth 2
                                        #     Child Loop BB2_20 Depth 2
	cmpb	$0, 1(%rbx)
	je	.LBB2_19
.LBB2_3:                                # %.lr.ph.i
                                        #   Parent Loop BB2_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB2_5 Depth 3
                                        #         Child Loop BB2_8 Depth 4
                                        #         Child Loop BB2_10 Depth 4
	movl	$1, %r12d
	lock		xaddq	%r12, 16(%rbx)
	movq	8(%rbx), %rdi
	callq	_ZNK2rt9NodesList4sizeEv
	cmpq	%rax, %r12
	jae	.LBB2_14
# %bb.4:                                #   in Loop: Header=BB2_3 Depth=2
	movq	8(%rbx), %rdi
	callq	_ZNK2rt9NodesList5nodesEv
	movq	(%rax), %rax
	movq	(%rax,%r12,8), %r15
	movq	8(%rbx), %rdi
	callq	_ZNK2rt9NodesList5predsEv
	movq	(%rax), %rcx
	leaq	(%r12,%r12,2), %r13
.LBB2_5:                                #   Parent Loop BB2_2 Depth=1
                                        #     Parent Loop BB2_3 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB2_8 Depth 4
                                        #         Child Loop BB2_10 Depth 4
	movq	(%rcx,%r13,8), %rax
	movq	8(%rcx,%r13,8), %rcx
	cmpq	%rcx, %rax
	je	.LBB2_13
# %bb.6:                                # %.lr.ph.i.i
                                        #   in Loop: Header=BB2_5 Depth=3
	movq	24(%rbx), %rdx
.LBB2_8:                                #   Parent Loop BB2_2 Depth=1
                                        #     Parent Loop BB2_3 Depth=2
                                        #       Parent Loop BB2_5 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	movq	(%rax), %rsi
	cmpl	$0, (%rdx,%rsi,4)
	je	.LBB2_9
# %bb.7:                                #   in Loop: Header=BB2_8 Depth=4
	addq	$8, %rax
	cmpq	%rcx, %rax
	jne	.LBB2_8
	jmp	.LBB2_13
.LBB2_9:                                # %_ZN3cpu12_GLOBAL__N_110task_readyEmPNS_12RuntimeInfosE.exit.i
                                        #   in Loop: Header=BB2_5 Depth=3
	movq	$0, (%rsp)
	movq	$1000000, 8(%rsp)               # imm = 0xF4240
.LBB2_10:                               #   Parent Loop BB2_2 Depth=1
                                        #     Parent Loop BB2_3 Depth=2
                                        #       Parent Loop BB2_5 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	movq	%r14, %rdi
	movq	%r14, %rsi
	callq	nanosleep
	cmpl	$-1, %eax
	jne	.LBB2_12
# %bb.11:                               #   in Loop: Header=BB2_10 Depth=4
	callq	__errno_location
	cmpl	$4, (%rax)
	je	.LBB2_10
.LBB2_12:                               # %_ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000EEEEvRKNSt6chrono8durationIT_T0_EE.exit.i
                                        #   in Loop: Header=BB2_5 Depth=3
	movq	8(%rbx), %rdi
	callq	_ZNK2rt9NodesList5predsEv
	movq	(%rax), %rcx
	jmp	.LBB2_5
.LBB2_13:                               # %.loopexit37.i
                                        #   in Loop: Header=BB2_3 Depth=2
	movslq	(%r15), %rax
	leaq	300(%rax), %rcx
	cmpb	$0, 56(%r15)
	cmoveq	%rax, %rcx
	movq	%r15, %rdi
	callq	*_ZN3cpu12kernels_listE(,%rcx,8)
	movq	24(%rbx), %rax
	movl	$1, (%rax,%r12,4)
	cmpb	$0, 1(%rbx)
	jne	.LBB2_3
.LBB2_14:                               # %.thread.i
                                        #   in Loop: Header=BB2_2 Depth=1
	movb	$0, 1(%rbx)
	movq	24(%rbx), %rax
	movq	32(%rbx), %rcx
.LBB2_16:                               #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	cmpq	%rcx, %rax
	je	.LBB2_18
# %bb.17:                               # %.lr.ph44.i
                                        #   in Loop: Header=BB2_16 Depth=2
	cmpl	$0, (%rax)
	je	.LBB2_22
# %bb.15:                               #   in Loop: Header=BB2_16 Depth=2
	addq	$4, %rax
	jmp	.LBB2_16
.LBB2_18:                               # %._crit_edge.i
                                        #   in Loop: Header=BB2_2 Depth=1
	movb	$1, 2(%rbx)
	jmp	.LBB2_22
.LBB2_19:                               #   in Loop: Header=BB2_2 Depth=1
	movq	$0, (%rsp)
	movq	$10000000, 8(%rsp)              # imm = 0x989680
.LBB2_20:                               #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	%r14, %rdi
	movq	%r14, %rsi
	callq	nanosleep
	cmpl	$-1, %eax
	jne	.LBB2_22
# %bb.21:                               #   in Loop: Header=BB2_20 Depth=2
	callq	__errno_location
	cmpl	$4, (%rax)
	je	.LBB2_20
.LBB2_22:                               # %_ZN3cpu12_GLOBAL__N_110exec_graphEPNS_12RuntimeInfosE.exit
                                        #   in Loop: Header=BB2_2 Depth=1
	cmpb	$0, (%rbx)
	je	.LBB2_2
# %bb.23:
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r13
	.cfi_restore %r14
	.cfi_restore %r15
	retq
.Lfunc_end2:
	.size	_ZN3cpu12_GLOBAL__N_113thread_runnerEPNS_12RuntimeInfosE, .Lfunc_end2-_ZN3cpu12_GLOBAL__N_113thread_runnerEPNS_12RuntimeInfosE
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorISt6threadSaIS0_EED2Ev,"axG",@progbits,_ZNSt6vectorISt6threadSaIS0_EED2Ev,comdat
	.weak	_ZNSt6vectorISt6threadSaIS0_EED2Ev # -- Begin function _ZNSt6vectorISt6threadSaIS0_EED2Ev
	.p2align	1, 0x90
	.type	_ZNSt6vectorISt6threadSaIS0_EED2Ev,@function
_ZNSt6vectorISt6threadSaIS0_EED2Ev:     # @_ZNSt6vectorISt6threadSaIS0_EED2Ev
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdi, %rax
	movq	(%rdi), %rdi
	movq	8(%rax), %rax
	cmpq	%rax, %rdi
	je	.LBB3_5
# %bb.1:
	movq	%rdi, %rcx
.LBB3_3:                                # %_ZSt8_DestroyISt6threadEvPT_.exit.i.i.i
                                        # =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rcx)
	jne	.LBB3_4
# %bb.2:                                #   in Loop: Header=BB3_3 Depth=1
	addq	$8, %rcx
	cmpq	%rax, %rcx
	jne	.LBB3_3
.LBB3_5:                                # %_ZSt8_DestroyIPSt6threadS0_EvT_S2_RSaIT0_E.exit
	testq	%rdi, %rdi
	je	.LBB3_6
# %bb.7:
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_ZdlPv                          # TAILCALL
.LBB3_6:                                # %_ZNSt12_Vector_baseISt6threadSaIS0_EED2Ev.exit
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	retq
.LBB3_4:
	.cfi_def_cfa_offset 16
	callq	_ZSt9terminatev
.Lfunc_end3:
	.size	_ZNSt6vectorISt6threadSaIS0_EED2Ev, .Lfunc_end3-_ZNSt6vectorISt6threadSaIS0_EED2Ev
	.cfi_endproc
                                        # -- End function
	.text
	.globl	_ZN3cpu16ThreadPoolRunnerD2Ev   # -- Begin function _ZN3cpu16ThreadPoolRunnerD2Ev
	.p2align	1, 0x90
	.type	_ZN3cpu16ThreadPoolRunnerD2Ev,@function
_ZN3cpu16ThreadPoolRunnerD2Ev:          # @_ZN3cpu16ThreadPoolRunnerD2Ev
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movq	24(%rdi), %r14
	movb	$1, (%r14)
	movq	(%rdi), %r15
	movq	8(%rdi), %r12
	cmpq	%r12, %r15
	je	.LBB4_4
.LBB4_1:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
.Ltmp6:
	movq	%r15, %rdi
	callq	_ZNSt6thread4joinEv
.Ltmp7:
# %bb.2:                                #   in Loop: Header=BB4_1 Depth=1
	addq	$8, %r15
	cmpq	%r12, %r15
	jne	.LBB4_1
# %bb.3:                                # %._crit_edge
	movq	24(%rbx), %r14
	testq	%r14, %r14
	je	.LBB4_7
.LBB4_4:                                # %._crit_edge.thread
	movq	24(%r14), %rdi
	testq	%rdi, %rdi
	je	.LBB4_6
# %bb.5:
	callq	_ZdlPv
.LBB4_6:                                # %_ZN3cpu12RuntimeInfosD2Ev.exit
	movq	%r14, %rdi
	callq	_ZdlPv
.LBB4_7:
	movq	%rbx, %rdi
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	_ZNSt6vectorISt6threadSaIS0_EED2Ev # TAILCALL
.LBB4_8:
	.cfi_def_cfa_offset 48
.Ltmp8:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end4:
	.size	_ZN3cpu16ThreadPoolRunnerD2Ev, .Lfunc_end4-_ZN3cpu16ThreadPoolRunnerD2Ev
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table4:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Ltmp6-.Lfunc_begin1           # >> Call Site 1 <<
	.uleb128 .Ltmp7-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp7
	.uleb128 .Ltmp8-.Lfunc_begin1           #     jumps to .Ltmp8
	.byte	1                               #   On action: 1
.Lcst_end1:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text.__clang_call_terminate,"axG",@progbits,__clang_call_terminate,comdat
	.hidden	__clang_call_terminate          # -- Begin function __clang_call_terminate
	.weak	__clang_call_terminate
	.type	__clang_call_terminate,@function
__clang_call_terminate:                 # @__clang_call_terminate
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__cxa_begin_catch
	callq	_ZSt9terminatev
.Lfunc_end5:
	.size	__clang_call_terminate, .Lfunc_end5-__clang_call_terminate
	.cfi_endproc
                                        # -- End function
	.text
	.globl	_ZN3cpu16ThreadPoolRunner3runERN2rt9NodesListE # -- Begin function _ZN3cpu16ThreadPoolRunner3runERN2rt9NodesListE
	.p2align	1, 0x90
	.type	_ZN3cpu16ThreadPoolRunner3runERN2rt9NodesListE,@function
_ZN3cpu16ThreadPoolRunner3runERN2rt9NodesListE: # @_ZN3cpu16ThreadPoolRunner3runERN2rt9NodesListE
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rdi, %rbx
	movq	24(%rdi), %rax
	movq	%rsi, 8(%rax)
	xorl	%ecx, %ecx
	xchgq	%rcx, 16(%rax)
	movq	24(%rdi), %rax
	movb	$0, 2(%rax)
	movq	%rsi, %rdi
	callq	_ZNK2rt9NodesList4sizeEv
	leaq	12(%rsp), %rdx
	movl	$0, (%rdx)
	leaq	16(%rsp), %r14
	leaq	11(%rsp), %rcx
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_
	movq	24(%rbx), %rax
	movq	24(%rax), %rdi
	movq	(%r14), %rcx
	movq	%rcx, 24(%rax)
	movq	8(%r14), %rcx
	movq	%rcx, 32(%rax)
	movq	16(%r14), %rcx
	movq	%rcx, 40(%rax)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, (%r14)
	movq	$0, 16(%r14)
	testq	%rdi, %rdi
	je	.LBB6_3
# %bb.1:                                # %_ZNSt6vectorIiSaIiEEaSEOS1_.exit
	callq	_ZdlPv
	movq	16(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB6_3
# %bb.2:
	callq	_ZdlPv
.LBB6_3:                                # %_ZNSt6vectorIiSaIiEED2Ev.exit
	movq	24(%rbx), %rax
	movb	$1, 1(%rax)
	cmpb	$0, 2(%rax)
	jne	.LBB6_9
# %bb.4:                                # %.lr.ph
	leaq	16(%rsp), %r14
.LBB6_5:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_6 Depth 2
	movq	$0, 16(%rsp)
	movq	$100000000, 24(%rsp)            # imm = 0x5F5E100
.LBB6_6:                                #   Parent Loop BB6_5 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	%r14, %rdi
	movq	%r14, %rsi
	callq	nanosleep
	cmpl	$-1, %eax
	jne	.LBB6_8
# %bb.7:                                #   in Loop: Header=BB6_6 Depth=2
	callq	__errno_location
	cmpl	$4, (%rax)
	je	.LBB6_6
.LBB6_8:                                # %_ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000EEEEvRKNSt6chrono8durationIT_T0_EE.exit
                                        #   in Loop: Header=BB6_5 Depth=1
	movq	24(%rbx), %rax
	cmpb	$0, 2(%rax)
	je	.LBB6_5
.LBB6_9:                                # %._crit_edge
	addq	$40, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	_ZN3cpu16ThreadPoolRunner3runERN2rt9NodesListE, .Lfunc_end6-_ZN3cpu16ThreadPoolRunner3runERN2rt9NodesListE
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIiSaIiEEC2EmRKiRKS0_,"axG",@progbits,_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_,comdat
	.weak	_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_ # -- Begin function _ZNSt6vectorIiSaIiEEC2EmRKiRKS0_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_,@function
_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_:       # @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %rax
	shrq	$61, %rax
	jne	.LBB7_6
# %bb.1:                                # %_ZNSt6vectorIiSaIiEE17_S_check_init_lenEmRKS0_.exit
	movq	%rsi, %r14
	movq	%rdi, %rbx
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rdi)
	movq	$0, 16(%rdi)
	testq	%rsi, %rsi
	je	.LBB7_2
# %bb.3:
	movq	%rdx, %r15
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIiE8allocateEmPKv
	movq	%rax, (%rbx)
	leaq	(%rax,%r14,4), %rcx
	movq	%rcx, 16(%rbx)
	movl	(%r15), %edx
	shlq	$2, %r14
.LBB7_4:                                # %.lr.ph.i.i.i.i.i.i.i.i
                                        # =>This Inner Loop Header: Depth=1
	movl	%edx, (%rax,%r12)
	addq	$4, %r12
	cmpq	%r12, %r14
	jne	.LBB7_4
	jmp	.LBB7_5
.LBB7_2:                                # %_ZNSt12_Vector_baseIiSaIiEEC2EmRKS0_.exit.thread
	movups	%xmm0, (%rbx)
	movq	$0, 16(%rbx)
	xorl	%ecx, %ecx
.LBB7_5:                                # %.loopexit
	movq	%rcx, 8(%rbx)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB7_6:
	.cfi_def_cfa_offset 48
	movl	$.L.str.1, %edi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end7:
	.size	_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_, .Lfunc_end7-_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_,"axG",@progbits,_ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_,comdat
	.weak	_ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_ # -- Begin function _ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_,@function
_ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_: # @_ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_
.Lfunc_begin2:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception2
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rcx, 16(%rsp)                  # 8-byte Spill
	movq	%rdx, 8(%rsp)                   # 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	$1, %esi
	movl	$.L.str, %edx
	callq	_ZNKSt6vectorISt6threadSaIS0_EE12_M_check_lenEmPKc
	movq	(%rbx), %r12
	movq	8(%rbx), %r14
	movq	%r15, %rbp
	subq	%r12, %rbp
	sarq	$3, %rbp
	testq	%rax, %rax
	movq	%rax, (%rsp)                    # 8-byte Spill
	je	.LBB8_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorISt6threadE8allocateEmPKv
	movq	%rax, %r13
	jmp	.LBB8_3
.LBB8_1:
	xorl	%r13d, %r13d
.LBB8_3:                                # %_ZNSt12_Vector_baseISt6threadSaIS0_EE11_M_allocateEm.exit
	leaq	(,%rbp,8), %rbp
	addq	%r13, %rbp
.Ltmp9:
	movq	%rbp, %rdi
	movq	8(%rsp), %rsi                   # 8-byte Reload
	movq	16(%rsp), %rdx                  # 8-byte Reload
	callq	_ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_
.Ltmp10:
# %bb.4:                                # %_ZNSt16allocator_traitsISaISt6threadEE9constructIS0_JPFvPN3cpu12RuntimeInfosEERS6_EEEvRS1_PT_DpOT0_.exit
	movq	%r13, %rbp
	cmpq	%r15, %r12
	je	.LBB8_7
# %bb.5:                                # %.lr.ph.i.i.i.preheader
	movq	%r13, %rbp
	movq	%r12, %rax
.LBB8_6:                                # %.lr.ph.i.i.i
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rax), %rcx
	movq	%rcx, (%rbp)
	movq	$0, (%rax)
	addq	$8, %rax
	addq	$8, %rbp
	cmpq	%r15, %rax
	jne	.LBB8_6
.LBB8_7:                                # %_ZNSt6vectorISt6threadSaIS0_EE11_S_relocateEPS0_S3_S3_RS1_.exit
	addq	$8, %rbp
	cmpq	%r15, %r14
	je	.LBB8_9
.LBB8_8:                                # %.lr.ph.i.i.i30
                                        # =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movq	%rax, (%rbp)
	movq	$0, (%r15)
	addq	$8, %r15
	addq	$8, %rbp
	cmpq	%r14, %r15
	jne	.LBB8_8
.LBB8_9:                                # %_ZNSt6vectorISt6threadSaIS0_EE11_S_relocateEPS0_S3_S3_RS1_.exit35
	testq	%r12, %r12
	je	.LBB8_11
# %bb.10:
	movq	%r12, %rdi
	callq	_ZdlPv
.LBB8_11:                               # %_ZNSt12_Vector_baseISt6threadSaIS0_EE13_M_deallocateEPS0_m.exit
	movq	%r13, (%rbx)
	movq	%rbp, 8(%rbx)
	movq	(%rsp), %rax                    # 8-byte Reload
	leaq	(,%rax,8), %rax
	addq	%r13, %rax
	movq	%rax, 16(%rbx)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB8_12:
	.cfi_def_cfa_offset 80
.Ltmp11:
	movq	%rax, %rdi
	callq	__cxa_begin_catch
	testq	%r13, %r13
	jne	.LBB8_15
# %bb.13:
	cmpq	$0, (%rbp)
	je	.LBB8_16
# %bb.14:
	callq	_ZSt9terminatev
.LBB8_15:                               # %_ZNSt16allocator_traitsISaISt6threadEE7destroyIS0_EEvRS1_PT_.exit
	movq	%r13, %rdi
	callq	_ZdlPv
.LBB8_16:                               # %_ZNSt12_Vector_baseISt6threadSaIS0_EE13_M_deallocateEPS0_m.exit38
.Ltmp12:
	callq	__cxa_rethrow
.Ltmp13:
# %bb.20:
.LBB8_17:
.Ltmp14:
	movq	%rax, %rbx
.Ltmp15:
	callq	__cxa_end_catch
.Ltmp16:
# %bb.18:
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.LBB8_19:
.Ltmp17:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end8:
	.size	_ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_, .Lfunc_end8-_ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_
	.cfi_endproc
	.section	.gcc_except_table._ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_,"aG",@progbits,_ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJPFvPN3cpu12RuntimeInfosEERS6_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_,comdat
	.p2align	2, 0x0
GCC_except_table8:
.Lexception2:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase1-.Lttbaseref1
.Lttbaseref1:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end2-.Lcst_begin2
.Lcst_begin2:
	.uleb128 .Lfunc_begin2-.Lfunc_begin2    # >> Call Site 1 <<
	.uleb128 .Ltmp9-.Lfunc_begin2           #   Call between .Lfunc_begin2 and .Ltmp9
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp9-.Lfunc_begin2           # >> Call Site 2 <<
	.uleb128 .Ltmp10-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp10
	.uleb128 .Ltmp11-.Lfunc_begin2          #     jumps to .Ltmp11
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp10-.Lfunc_begin2          # >> Call Site 3 <<
	.uleb128 .Ltmp12-.Ltmp10                #   Call between .Ltmp10 and .Ltmp12
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp12-.Lfunc_begin2          # >> Call Site 4 <<
	.uleb128 .Ltmp13-.Ltmp12                #   Call between .Ltmp12 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin2          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp15-.Lfunc_begin2          # >> Call Site 5 <<
	.uleb128 .Ltmp16-.Ltmp15                #   Call between .Ltmp15 and .Ltmp16
	.uleb128 .Ltmp17-.Lfunc_begin2          #     jumps to .Ltmp17
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp16-.Lfunc_begin2          # >> Call Site 6 <<
	.uleb128 .Lfunc_end8-.Ltmp16            #   Call between .Ltmp16 and .Lfunc_end8
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end2:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase1:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_,"axG",@progbits,_ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_,comdat
	.weak	_ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_ # -- Begin function _ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_
	.p2align	1, 0x90
	.type	_ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_,@function
_ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_: # @_ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_
.Lfunc_begin3:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception3
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	$0, (%rdi)
	movl	$24, %edi
	callq	_Znwm
	movq	$_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE+16, (%rax)
	movq	(%rbx), %rcx
	movq	%rcx, 8(%rax)
	movq	(%r14), %rcx
	movq	%rcx, 16(%rax)
	leaq	8(%rsp), %rsi
	movq	%rax, (%rsi)
.Ltmp18:
	movl	$_ZNSt6thread24_M_thread_deps_never_runEv, %edx
	movq	%r15, %rdi
	callq	_ZNSt6thread15_M_start_threadESt10unique_ptrINS_6_StateESt14default_deleteIS1_EEPFvvE
.Ltmp19:
# %bb.1:
	movq	8(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB9_3
# %bb.2:                                # %_ZNKSt14default_deleteINSt6thread6_StateEEclEPS1_.exit.i
	movq	(%rdi), %rax
	callq	*8(%rax)
.LBB9_3:                                # %_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev.exit
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB9_4:
	.cfi_def_cfa_offset 48
.Ltmp20:
	movq	%rax, %rbx
	movq	8(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB9_6
# %bb.5:                                # %_ZNKSt14default_deleteINSt6thread6_StateEEclEPS1_.exit.i7
	movq	(%rdi), %rax
	callq	*8(%rax)
.LBB9_6:                                # %_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev.exit8
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end9:
	.size	_ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_, .Lfunc_end9-_ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_
	.cfi_endproc
	.section	.gcc_except_table._ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_,"aG",@progbits,_ZNSt6threadC2IPFvPN3cpu12RuntimeInfosEEJRS3_EvEEOT_DpOT0_,comdat
	.p2align	2, 0x0
GCC_except_table9:
.Lexception3:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end3-.Lcst_begin3
.Lcst_begin3:
	.uleb128 .Lfunc_begin3-.Lfunc_begin3    # >> Call Site 1 <<
	.uleb128 .Ltmp18-.Lfunc_begin3          #   Call between .Lfunc_begin3 and .Ltmp18
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp18-.Lfunc_begin3          # >> Call Site 2 <<
	.uleb128 .Ltmp19-.Ltmp18                #   Call between .Ltmp18 and .Ltmp19
	.uleb128 .Ltmp20-.Lfunc_begin3          #     jumps to .Ltmp20
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp19-.Lfunc_begin3          # >> Call Site 3 <<
	.uleb128 .Lfunc_end9-.Ltmp19            #   Call between .Ltmp19 and .Lfunc_end9
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end3:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt6thread24_M_thread_deps_never_runEv,"axG",@progbits,_ZNSt6thread24_M_thread_deps_never_runEv,comdat
	.weak	_ZNSt6thread24_M_thread_deps_never_runEv # -- Begin function _ZNSt6thread24_M_thread_deps_never_runEv
	.p2align	1, 0x90
	.type	_ZNSt6thread24_M_thread_deps_never_runEv,@function
_ZNSt6thread24_M_thread_deps_never_runEv: # @_ZNSt6thread24_M_thread_deps_never_runEv
	.cfi_startproc
# %bb.0:
	retq
.Lfunc_end10:
	.size	_ZNSt6thread24_M_thread_deps_never_runEv, .Lfunc_end10-_ZNSt6thread24_M_thread_deps_never_runEv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED0Ev,"axG",@progbits,_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED0Ev,comdat
	.weak	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED0Ev # -- Begin function _ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED0Ev
	.p2align	1, 0x90
	.type	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED0Ev,@function
_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED0Ev: # @_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED0Ev
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	callq	_ZNSt6thread6_StateD2Ev
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	_ZdlPv                          # TAILCALL
.Lfunc_end11:
	.size	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED0Ev, .Lfunc_end11-_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED0Ev
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv,"axG",@progbits,_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv,comdat
	.weak	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv # -- Begin function _ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv
	.p2align	1, 0x90
	.type	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv,@function
_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv: # @_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rax
	movq	8(%rdi), %rdi
	jmpq	*16(%rax)                       # TAILCALL
.Lfunc_end12:
	.size	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv, .Lfunc_end12-_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNKSt6vectorISt6threadSaIS0_EE12_M_check_lenEmPKc,"axG",@progbits,_ZNKSt6vectorISt6threadSaIS0_EE12_M_check_lenEmPKc,comdat
	.weak	_ZNKSt6vectorISt6threadSaIS0_EE12_M_check_lenEmPKc # -- Begin function _ZNKSt6vectorISt6threadSaIS0_EE12_M_check_lenEmPKc
	.p2align	1, 0x90
	.type	_ZNKSt6vectorISt6threadSaIS0_EE12_M_check_lenEmPKc,@function
_ZNKSt6vectorISt6threadSaIS0_EE12_M_check_lenEmPKc: # @_ZNKSt6vectorISt6threadSaIS0_EE12_M_check_lenEmPKc
	.cfi_startproc
# %bb.0:
	movabsq	$1152921504606846975, %rcx      # imm = 0xFFFFFFFFFFFFFFF
	movq	8(%rdi), %r8
	subq	(%rdi), %r8
	sarq	$3, %r8
	movq	%rcx, %rax
	subq	%r8, %rax
	cmpq	%rsi, %rax
	jb	.LBB13_2
# %bb.1:
	cmpq	%rsi, %r8
	cmovaq	%r8, %rsi
	leaq	(%rsi,%r8), %rax
	cmpq	%rcx, %rax
	cmovaeq	%rcx, %rax
	addq	%r8, %rsi
	cmovbq	%rcx, %rax
	retq
.LBB13_2:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdx, %rdi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end13:
	.size	_ZNKSt6vectorISt6threadSaIS0_EE12_M_check_lenEmPKc, .Lfunc_end13-_ZNKSt6vectorISt6threadSaIS0_EE12_M_check_lenEmPKc
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorISt6threadE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorISt6threadE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorISt6threadE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorISt6threadE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorISt6threadE8allocateEmPKv,@function
_ZNSt15__new_allocatorISt6threadE8allocateEmPKv: # @_ZNSt15__new_allocatorISt6threadE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$60, %rax
	jne	.LBB14_1
# %bb.3:
	shlq	$3, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB14_1:
	.cfi_def_cfa_offset 16
	shrq	$61, %rsi
	je	.LBB14_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB14_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end14:
	.size	_ZNSt15__new_allocatorISt6threadE8allocateEmPKv, .Lfunc_end14-_ZNSt15__new_allocatorISt6threadE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIiE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIiE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIiE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIiE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIiE8allocateEmPKv,@function
_ZNSt15__new_allocatorIiE8allocateEmPKv: # @_ZNSt15__new_allocatorIiE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$61, %rax
	jne	.LBB15_1
# %bb.3:
	shlq	$2, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB15_1:
	.cfi_def_cfa_offset 16
	shrq	$62, %rsi
	je	.LBB15_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB15_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end15:
	.size	_ZNSt15__new_allocatorIiE8allocateEmPKv, .Lfunc_end15-_ZNSt15__new_allocatorIiE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.type	_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE,@object # @_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE
	.section	.rodata._ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE,"aG",@progbits,_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE,comdat
	.weak	_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE
	.p2align	3, 0x0
_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE:
	.quad	0
	.quad	_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE
	.quad	_ZNSt6thread6_StateD2Ev
	.quad	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEED0Ev
	.quad	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEE6_M_runEv
	.size	_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE, 40

	.type	_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE,@object # @_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE
	.section	.rodata._ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE,"aG",@progbits,_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE,comdat
	.weak	_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE
_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE:
	.asciz	"NSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE"
	.size	_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE, 82

	.type	_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE,@object # @_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE
	.section	.rodata._ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE,"aG",@progbits,_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE,comdat
	.weak	_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE
	.p2align	3, 0x0
_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE:
	.quad	_ZTVN10__cxxabiv120__si_class_type_infoE+16
	.quad	_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE
	.quad	_ZTINSt6thread6_StateE
	.size	_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE, 24

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"vector::_M_realloc_insert"
	.size	.L.str, 26

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"cannot create std::vector larger than max_size()"
	.size	.L.str.1, 49

	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.globl	_ZN3cpu16ThreadPoolRunnerC1Em
	.type	_ZN3cpu16ThreadPoolRunnerC1Em,@function
.set _ZN3cpu16ThreadPoolRunnerC1Em, _ZN3cpu16ThreadPoolRunnerC2Em
	.globl	_ZN3cpu16ThreadPoolRunnerD1Ev
	.type	_ZN3cpu16ThreadPoolRunnerD1Ev,@function
.set _ZN3cpu16ThreadPoolRunnerD1Ev, _ZN3cpu16ThreadPoolRunnerD2Ev
	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym _ZN3cpu12_GLOBAL__N_113thread_runnerEPNS_12RuntimeInfosE
	.addrsig_sym _ZNSt6thread24_M_thread_deps_never_runEv
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _ZTVN10__cxxabiv120__si_class_type_infoE
	.addrsig_sym _ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE
	.addrsig_sym _ZTINSt6thread6_StateE
	.addrsig_sym _ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN3cpu12RuntimeInfosEES5_EEEEEE
	.addrsig_sym __hip_cuid_

	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
