// File: /workspace/github_cpp_makefile_star2_O1/Kobzol[P]sigmod-2016/src/job.h
// Function: JobQueue::add_job(JobType, unsigned int, unsigned int)
void add_job(JobType type, sigint from, sigint to)
    {
        std::unique_lock<std::mutex> guard(this->lock);

#ifdef THREAD_USE_JOB_SYNC
        while (this->size >= this->jobs.capacity)
        {
            this->bufferFull.wait(guard);
        }
#endif

        Barrier* barrier = this->barrier;
        Barrier* modifyBarrier = barrier;
        bool allocated = false;

        if (type != JobType::Query || this->barrier->modification)
        {
            Barrier* newBarrier = &BarrierMemory[BarrierIndex++];
            assert(BarrierIndex < BARRIER_BUFFER_COUNT);
            newBarrier->modification = type != JobType::Query;
            newBarrier->waiting = 1;
            modifyBarrier = newBarrier;
            this->barrier = modifyBarrier;
        }
        else if (!this->barrier->modification)
        {
            barrier->push();
        }

        this->jobs[this->end] = Job(type, from, to, barrier, modifyBarrier, allocated);
        this->end = (this->end + 1) % this->jobs.size;

        this->size++;

#ifdef THREAD_USE_JOB_SYNC
        this->bufferEmpty.notify_one();
#endif

        assert(this->size <= this->jobs.capacity);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
leaq 0xb0(%rdi), %rax
leaq 0x8(%rsp), %r12
movq %rax, (%r12)
movb $0x0, 0x8(%r12)
movq %r12, %rdi
callq 0x442c
movb $0x1, 0x8(%r12)
movq 0x98(%rbx), %rax
cmpq 0xe0(%rbx), %rax
jb 0x349e
leaq 0x130(%rbx), %r12
leaq 0x8(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x2070
movq 0x98(%rbx), %rax
cmpq 0xe0(%rbx), %rax
jae 0x3483
movq 0xf0(%rbx), %rax
testl %r15d, %r15d
jne 0x34b3
cmpb $0x1, (%rax)
jne 0x3594
movq 0x312116(%rip), %rdx    # 0x3155d0
leaq 0x1(%rdx), %rcx
movq %rcx, 0x31210b(%rip)    # 0x3155d0
cmpq $0x30d40, %rcx          # imm = 0x30D40
jae 0x35bf
shlq $0x4, %rdx
leaq 0x4cf3(%rip), %rsi      # 0x81d0
leaq (%rsi,%rdx), %rcx
testl %r15d, %r15d
setne (%rdx,%rsi)
movq $0x1, 0x8(%rdx,%rsi)
movq %rcx, 0xf0(%rbx)
movq 0x3120d9(%rip), %rdx    # 0x3155d8
leaq 0x1(%rdx), %rsi
movq %rsi, 0x3120ce(%rip)    # 0x3155d8
movslq 0xa8(%rbx), %rsi
movq 0xe8(%rbx), %rdi
leaq (%rsi,%rsi,2), %rsi
shlq $0x4, %rsi
movq %rdx, (%rdi,%rsi)
movl %r15d, 0x8(%rdi,%rsi)
movl %r14d, 0xc(%rdi,%rsi)
movl %ebp, 0x10(%rdi,%rsi)
movq %rax, 0x18(%rdi,%rsi)
movq %rcx, 0x20(%rdi,%rsi)
movb $0x0, 0x28(%rdi,%rsi)
movq 0xa8(%rbx), %rax
incq %rax
xorl %edx, %edx
divq 0xd8(%rbx)
movq %rdx, 0xa8(%rbx)
incq 0x98(%rbx)
leaq 0x68(%rbx), %rdi
callq 0x20d0
movq 0x98(%rbx), %rax
cmpq 0xe0(%rbx), %rax
ja 0x35a0
leaq 0x8(%rsp), %rdi
callq 0x3414
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incq 0x8(%rax)
movq %rax, %rcx
jmp 0x34f8
leaq 0x1cc5(%rip), %rdi      # 0x526c
leaq 0x1c84(%rip), %rsi      # 0x5232
leaq 0x1c87(%rip), %rcx      # 0x523c
movl $0x7b, %edx
callq 0x2100
leaq 0x1c48(%rip), %rdi      # 0x520e
leaq 0x1c65(%rip), %rsi      # 0x5232
leaq 0x1c68(%rip), %rcx      # 0x523c
movl $0x67, %edx
callq 0x2100