LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/thread_pool.cc
// Function: hcproxy::ThreadPool::Schedule(std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l>>>, std::function<void ()>)
void ThreadPool::Schedule(Time t, std::function<void()> f) {
  std::condition_variable* wake = nullptr;
  {
    std::unique_lock<std::mutex> lock(mutex_);
    work_.push(Work{std::move(t), ++last_idx_, std::move(f)});
    if (work_.top().idx == last_idx_) wake = have_sleeper_ ? &sleeper_cv_ : &cv_;
  }
  if (wake) wake->notify_one();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x10(%rdi), %rsi
movq %rsp, %rdi
callq 0x1ae8c
leaq 0x98(%rbx), %rdi
leaq 0x20(%rsp), %r14
movq %r12, -0x10(%r14)
movq (%rbx), %rax
incq %rax
movq %rax, (%rbx)
movq %rax, -0x8(%r14)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
andq $0x0, 0x10(%r14)
movq 0x18(%r15), %rax
movq %rax, 0x18(%r14)
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x1bd9c
movups (%r15), %xmm1
addq $0x10, %r15
movups %xmm1, (%r14)
movq %rax, 0x30(%rsp)
movups %xmm0, (%r15)
leaq 0x10(%rsp), %rsi
callq 0x1c08e
movq %r14, %rdi
callq 0x19180
movq 0x98(%rbx), %rax
movq 0x8(%rax), %r14
movq (%rbx), %r15
movb 0x9(%rbx), %bpl
movq %rsp, %rdi
callq 0x1af48
cmpq %r15, %r14
jne 0x1bde5
leaq 0x38(%rbx), %rax
addq $0x68, %rbx
testb $0x1, %bpl
cmoveq %rax, %rbx
movq %rbx, %rdi
callq 0x2d9a0
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x19180
movq %rsp, %rdi
callq 0x1af48
movq %rbx, %rdi
callq 0xcc660
nop
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/thread_pool.cc
// Function: hcproxy::ThreadPool::Loop(unsigned long)
void ThreadPool::Loop(size_t tid) {
  auto Next = [&]() -> std::function<void()> {
    std::unique_lock<std::mutex> lock(mutex_);
    while (true) {
      if (exit_) return nullptr;
      if (work_.empty()) {
        cv_.wait(lock);
        continue;
      }
      Time now = Clock::now();
      const Work& top = work_.top();
      if (top.t <= now) {
        std::function<void()> res = std::move(top.f);
        work_.pop();
        bool notify = !work_.empty() && !have_sleeper_;
        lock.unlock();
        if (notify) cv_.notify_one();
        return res;
      }
      if (have_sleeper_) {
        cv_.wait(lock);
        continue;
      }
      have_sleeper_ = true;
      sleeper_cv_.wait_until(lock, top.t);
      CHECK(have_sleeper_);
      have_sleeper_ = false;
    }
  };
  while (std::function<void()> f = Next()) f();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, 0x40(%rsp)
leaq 0x98(%rdi), %r15
leaq 0x68(%rdi), %r12
leaq 0x38(%rdi), %r13
leaq 0x68(%rsp), %rbp
movq %r12, 0x38(%rsp)
movq %rbp, %rdi
movq 0x40(%rsp), %rsi
callq 0x1ae8c
cmpb $0x1, 0x8(%rbx)
je 0x1bea3
movq 0x98(%rbx), %rax
cmpq 0xa0(%rbx), %rax
je 0x1be77
callq 0x2a710
movq (%r15), %rdx
cmpq (%rdx), %rax
jge 0x1beb2
cmpb $0x1, 0x9(%rbx)
jne 0x1be84
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2d980
jmp 0x1be4e
movb $0x1, 0x9(%rbx)
movq %r12, %rdi
movq %rbp, %rsi
callq 0x1c4c0
cmpb $0x0, 0x9(%rbx)
je 0x1bf68
movb $0x0, 0x9(%rbx)
jmp 0x1be4e
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
jmp 0x1bf25
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
movq 0x28(%rdx), %rax
movq %rax, 0x28(%rsp)
movq 0x20(%rdx), %rax
testq %rax, %rax
je 0x1bee7
movups 0x10(%rdx), %xmm0
addq $0x20, %rdx
movaps %xmm0, 0x10(%rsp)
movq %rax, 0x20(%rsp)
movups %xmm1, (%rdx)
movq %r15, %rdi
callq 0x1c168
movq 0x98(%rbx), %r12
movq 0xa0(%rbx), %r14
movb 0x9(%rbx), %al
movb %al, 0xf(%rsp)
movq %rbp, %rdi
callq 0x1aef8
cmpq %r14, %r12
movq 0x38(%rsp), %r12
je 0x1bf25
testb $0x1, 0xf(%rsp)
jne 0x1bf25
movq %r13, %rdi
callq 0x2d9a0
movq %rbp, %rdi
callq 0x1af48
cmpq $0x0, 0x20(%rsp)
je 0x1bf4f
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x1c0d4
movq %r14, %rdi
callq 0x19180
jmp 0x1be41
leaq 0x10(%rsp), %rdi
callq 0x19180
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb3af2(%rip), %rsi     # 0xcfa61
leaq 0x48(%rsp), %rdi
pushq $0x4b
popq %rdx
pushq $0x3
popq %rcx
callq 0x1f4c8
movq 0x60(%rsp), %rdi
leaq 0xb3ae9(%rip), %rsi     # 0xcfa74
callq 0x8b1d0
movq 0x60(%rsp), %rdi
leaq 0xb832f(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1bfc3
jmp 0x1bfa5
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x19180
jmp 0x1bfd2
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x19180
jmp 0x1bfdc
leaq 0x48(%rsp), %rdi
callq 0x189a6
jmp 0x1bfcf
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x1af48
movq %rbx, %rdi
callq 0xcc660
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/epoll.cc
// Function: hcproxy::EPoll::Add(int, int, void*)
void EPoll::Add(int fd, int events, void* data) {
  epoll_event event = {};
  event.events = events;
  event.data.ptr = data;
  CHECK(epoll_ctl(epoll_, EPOLL_CTL_ADD, fd, &event) == 0) << Errno();
  ++total_events_;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movl %esi, %eax
movq %rdi, %rbx
leaq 0x24(%rsp), %r8
movl %edx, (%r8)
movq %rcx, 0x4(%r8)
movl (%rdi), %edi
pushq $0x1
popq %rsi
movl %eax, %edx
movq %r8, %rcx
callq 0x154e0
testl %eax, %eax
jne 0x1d5cb
incq 0x20(%rbx)
addq $0x30, %rsp
popq %rbx
retq
leaq 0xb2757(%rip), %rsi     # 0xcfd29
movq %rsp, %rbx
pushq $0x23
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb277c(%rip), %rsi     # 0xcfd6a
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb6ccc(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
movq %rsp, %rdi
callq 0x19465
jmp 0x1d60e
movq %rsp, %rdi
callq 0x189a6
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/epoll.cc
// Function: hcproxy::EPoll::Remove(int)
void EPoll::Remove(int fd) {
  CHECK(total_events_ > 0);
  epoll_event event;
  CHECK(epoll_ctl(epoll_, EPOLL_CTL_DEL, fd, &event) == 0) << Errno();
  --total_events_;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
cmpq $0x0, 0x20(%rdi)
je 0x1d644
movl %esi, %edx
movq %rdi, %rbx
movl (%rdi), %edi
pushq $0x2
popq %rsi
leaq 0x24(%rsp), %rcx
callq 0x154e0
testl %eax, %eax
jne 0x1d67f
decq 0x20(%rbx)
addq $0x30, %rsp
popq %rbx
retq
leaq 0xb26de(%rip), %rsi     # 0xcfd29
movq %rsp, %rbx
pushq $0x28
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb2735(%rip), %rsi     # 0xcfd9c
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb6c53(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1d6c4
leaq 0xb26a3(%rip), %rsi     # 0xcfd29
movq %rsp, %rbx
pushq $0x2a
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb270c(%rip), %rsi     # 0xcfdae
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb6c18(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
movq %rsp, %rdi
callq 0x19465
jmp 0x1d6c4
jmp 0x1d6c4
movq %rsp, %rdi
callq 0x189a6
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/epoll.cc
// Function: hcproxy::EPoll::Modify(int, int, void*)
void EPoll::Modify(int fd, int events, void* data) {
  CHECK(total_events_ > 0);
  epoll_event event = {};
  event.events = events;
  event.data.ptr = data;
  CHECK(epoll_ctl(epoll_, EPOLL_CTL_MOD, fd, &event) == 0) << Errno();
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
cmpq $0x0, 0x20(%rdi)
je 0x1d6ff
movl %esi, %eax
leaq 0x24(%rsp), %r8
movl %edx, (%r8)
movq %rcx, 0x4(%r8)
movl (%rdi), %edi
pushq $0x3
popq %rsi
movl %eax, %edx
movq %r8, %rcx
callq 0x154e0
testl %eax, %eax
jne 0x1d73a
addq $0x30, %rsp
popq %rbx
retq
leaq 0xb2623(%rip), %rsi     # 0xcfd29
movq %rsp, %rbx
pushq $0x2f
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb267a(%rip), %rsi     # 0xcfd9c
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb6b98(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1d77f
leaq 0xb25e8(%rip), %rsi     # 0xcfd29
movq %rsp, %rbx
pushq $0x33
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb2683(%rip), %rsi     # 0xcfde0
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb6b5d(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
movq %rsp, %rdi
callq 0x19465
jmp 0x1d77f
jmp 0x1d77f
movq %rsp, %rdi
callq 0x189a6
nop
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/epoll.cc
// Function: hcproxy::EPoll::Wait(std::optional<std::chrono::duration<long, std::ratio<1l, 1000000000l>>>)
void EPoll::Wait(std::optional<Duration> timeout) {
  if (total_events_ > events_.size()) {
    events_.resize(total_events_);
    events_.resize(events_.capacity());
  }
  int ms = timeout ? std::max<int>(0, ceil<milliseconds>(*timeout).count()) : -1;
  CHECK((ready_events_ = epoll_wait(epoll_, events_.data(), events_.size(), ms)) >= 0) << Errno();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %rax
movq 0x20(%rdi), %rsi
subq 0x8(%rdi), %rax
pushq $0xc
popq %r12
cqto
idivq %r12
cmpq %rax, %rsi
jbe 0x1d7da
leaq 0x8(%rbx), %r15
movq %r15, %rdi
callq 0x1d882
movq 0x18(%rbx), %rax
subq 0x8(%rbx), %rax
cqto
idivq %r12
movq %r15, %rdi
movq %rax, %rsi
callq 0x1d882
testb $0x1, %bpl
je 0x1d807
movl $0xf4240, %ecx          # imm = 0xF4240
movq %r14, %rax
cqto
idivq %rcx
imulq $0xf4240, %rax, %rcx    # imm = 0xF4240
xorl %edx, %edx
cmpq %r14, %rcx
setl %dl
addl %eax, %edx
xorl %ecx, %ecx
testl %edx, %edx
cmovgl %edx, %ecx
jmp 0x1d80a
pushq $-0x1
popq %rcx
movl (%rbx), %edi
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
subq %rsi, %rax
cqto
idivq %r12
movl %eax, %edx
callq 0x156d0
movl %eax, 0x28(%rbx)
testl %eax, %eax
js 0x1d837
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb24eb(%rip), %rsi     # 0xcfd29
movq %rsp, %rbx
pushq $0x3c
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb25b8(%rip), %rsi     # 0xcfe12
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb6a60(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
movq %rsp, %rdi
callq 0x19465
jmp 0x1d87a
movq %rsp, %rdi
callq 0x189a6
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/forwarder.cc
// Function: hcproxy::Forwarder::Forward(int, int)
void Forwarder::Forward(int client_fd, int server_fd) {
  CHECK(client_fd >= 0);
  CHECK(server_fd >= 0);
  event_loop_.ScheduleOrRun(
      [=]() { LinkEventHandler::New(&event_loop_, client_fd, server_fd, opt_); });
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
testl %esi, %esi
js 0x1db8e
testl %edx, %edx
js 0x1dbcb
movq 0x18(%rdi), %rax
leaq 0x20(%rsp), %rcx
movq %rdi, (%rcx)
movl %esi, 0x8(%rcx)
movl %edx, 0xc(%rcx)
leaq 0xc4(%rip), %rdx        # 0x1dc28
movq %rdx, 0x18(%rcx)
leaq 0x599(%rip), %rdx       # 0x1e108
movq %rdx, 0x10(%rcx)
movq %rax, %rdi
movq %rcx, %rsi
callq 0x1febc
leaq 0x20(%rsp), %rdi
callq 0x19180
addq $0x40, %rsp
popq %rbx
retq
leaq 0xb22e5(%rip), %rsi     # 0xcfe7a
movq %rsp, %rbx
pushq $0x3
popq %rcx
movq %rbx, %rdi
movl $0x13e, %edx            # imm = 0x13E
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb22d8(%rip), %rsi     # 0xcfe8b
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb6707(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1dc0a
leaq 0xb22a8(%rip), %rsi     # 0xcfe7a
movq %rsp, %rbx
pushq $0x3
popq %rcx
movq %rbx, %rdi
movl $0x13f, %edx            # imm = 0x13F
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb22aa(%rip), %rsi     # 0xcfe9a
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb66ca(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1dc0a
jmp 0x1dc0a
movq %rsp, %rdi
callq 0x189a6
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x19180
movq %rbx, %rdi
callq 0xcc660
nop
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/forwarder.cc
// Function: hcproxy::(anonymous namespace)::LinkEventHandler::OnEvent(hcproxy::EventLoop*, int)
void OnEvent(EventLoop* loop, int events) override {
    // Returns true if some data has been transferred and the link isn't broken.
    auto Process = [&]() -> bool {
      if (HasBits(events, EPOLLERR)) {
        LOG(INFO) << "[" << fd() << "] (" << name_ << ") "
                  << "connection broke: " << Errno(SockError(fd()));
        Terminate(loop);
        return false;
      }
      return (HasBits(events, EPOLLOUT) && ForwardFromOther(loop)) |
             (HasBits(events, EPOLLIN) && other_->ForwardFromOther(loop));
    };
    other_->IncRef();
    if (Process()) {
      Refresh(loop);
      other_->Refresh(loop);
    }
    other_->DecRef();
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x58(%rdi), %rdi
callq 0x1f2fa
testb $0x8, %bpl
jne 0x1e41e
xorl %r15d, %r15d
movl $0x0, %r12d
testb $0x4, %bpl
je 0x1e3e3
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1e6e6
movzbl %al, %r12d
testb $0x1, %bpl
je 0x1e3f9
movq 0x58(%rbx), %rdi
movq %r14, %rsi
callq 0x1e6e6
movzbl %al, %r15d
orl %r12d, %r15d
je 0x1e4c2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1e6a8
movq 0x58(%rbx), %rdi
movq %r14, %rsi
callq 0x1e6a8
jmp 0x1e4c2
leaq 0xb1a55(%rip), %rsi     # 0xcfe7a
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movl $0xb5, %edx
xorl %ecx, %ecx
callq 0x1f4c8
movq 0x18(%r15), %rdi
leaq 0xb0cff(%rip), %rsi     # 0xcf143
callq 0x8b1d0
movl 0x18(%rbx), %esi
movq 0x28(%rsp), %rdi
callq 0x8b570
movq 0x28(%rsp), %rdi
leaq 0xb1a86(%rip), %rsi     # 0xcfee8
callq 0x8b1d0
leaq 0x38(%rbx), %rsi
leaq 0x10(%rsp), %rdi
callq 0x1f2d2
leaq 0xb1a8c(%rip), %rsi     # 0xcff08
movq %rax, %rdi
callq 0x1f29c
leaq 0xb1a80(%rip), %rsi     # 0xcff0b
movq %rax, %rdi
callq 0x1f3c3
movq %rax, %r15
movl 0x18(%rbx), %edi
callq 0x1f3fc
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movq %r15, %rdi
callq 0x193d1
leaq 0x10(%rsp), %rdi
callq 0x19502
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1e6c4
movq 0x58(%rbx), %rdi
callq 0x1f358
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1e4dc
jmp 0x1e4dc
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x19502
movq %rbx, %rdi
callq 0xcc660
nop
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/forwarder.cc
// Function: hcproxy::(anonymous namespace)::LinkEventHandler::OnTimeout(hcproxy::EventLoop*)
void OnTimeout(EventLoop* loop) override {
    LOG(INFO) << "[" << fd() << "] (" << name_ << ") timed out waiting for IO";
    other_->IncRef();
    Terminate(loop);
    other_->DecRef();
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xb1972(%rip), %rsi     # 0xcfe7a
movq %rsp, %r15
movq %r15, %rdi
movl $0xc6, %edx
xorl %ecx, %ecx
callq 0x1f4c8
movq 0x18(%r15), %rdi
leaq 0xb0c1e(%rip), %rsi     # 0xcf143
callq 0x8b1d0
movl 0x18(%rbx), %esi
movq 0x18(%rsp), %rdi
callq 0x8b570
movq 0x18(%rsp), %rdi
leaq 0xb19a5(%rip), %rsi     # 0xcfee8
callq 0x8b1d0
leaq 0x38(%rbx), %rsi
movq %rsp, %rdi
callq 0x1f2d2
leaq 0xb1b2c(%rip), %rsi     # 0xd0087
movq %rax, %rdi
callq 0x1f3e7
movq %rsp, %rdi
callq 0x19502
movq 0x58(%rbx), %rdi
callq 0x1f2fa
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1e6c4
movq 0x58(%rbx), %rdi
callq 0x1f358
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x1e594
movq %rax, %rbx
movq %rsp, %rdi
callq 0x19502
movq %rbx, %rdi
callq 0xcc660
nop
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/forwarder.cc
// Function: hcproxy::(anonymous namespace)::LinkEventHandler::Close(hcproxy::EventLoop*)
void Close(EventLoop* loop) {
    if (readable_ || writable_) {
      LOG(INFO) << "[" << fd() << "] (" << name_ << ") close";
      readable_ = false;
      writable_ = false;
      other_->DecRef();
      loop->Remove(this);
      CHECK(close(fd()) == 0) << Errno();
    }
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x0, 0x50(%rdi)
jne 0x1f1a1
cmpb $0x1, 0x51(%rbx)
jne 0x1f230
leaq 0xb0cd2(%rip), %rsi     # 0xcfe7a
movq %rsp, %r15
movq %r15, %rdi
movl $0x11e, %edx            # imm = 0x11E
xorl %ecx, %ecx
callq 0x1f4c8
movq 0x18(%r15), %rdi
leaq 0xaff7e(%rip), %rsi     # 0xcf143
callq 0x8b1d0
movl 0x18(%rbx), %esi
movq 0x18(%rsp), %rdi
callq 0x8b570
movq 0x18(%rsp), %rdi
leaq 0xb0d05(%rip), %rsi     # 0xcfee8
callq 0x8b1d0
leaq 0x38(%rbx), %rsi
movq %rsp, %rdi
callq 0x1f2d2
leaq 0xb0cf1(%rip), %rsi     # 0xcfeec
movq %rax, %rdi
callq 0x1f2c0
movq %rsp, %rdi
callq 0x19502
andw $0x0, 0x50(%rbx)
movq 0x58(%rbx), %rdi
callq 0x1f358
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1fb6c
movl 0x18(%rbx), %edi
callq 0x15140
testl %eax, %eax
jne 0x1f23a
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0xb0c39(%rip), %rsi     # 0xcfe7a
movq %rsp, %rbx
pushq $0x3
popq %rcx
movq %rbx, %rdi
movl $0x123, %edx            # imm = 0x123
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb0465(%rip), %rsi     # 0xcf6c4
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb505b(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
movq %rsp, %rdi
callq 0x19465
jmp 0x1f27f
movq %rsp, %rdi
callq 0x189a6
jmp 0x1f289
movq %rax, %rbx
movq %rsp, %rdi
callq 0x19502
movq %rbx, %rdi
callq 0xcc660
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/sock.cc
// Function: hcproxy::SockError(int)
int SockError(int fd) {
  int err = 0;
  socklen_t len = sizeof(err);
  CHECK(getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &len) == 0) << Errno();
  CHECK(len == sizeof(err));
  return err;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
leaq 0xc(%rsp), %rcx
andl $0x0, (%rcx)
leaq 0x8(%rsp), %r8
movl $0x4, (%r8)
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
callq 0x15510
testl %eax, %eax
jne 0x1f435
cmpl $0x4, 0x8(%rsp)
jne 0x1f47c
movl 0xc(%rsp), %eax
addq $0x30, %rsp
popq %rbx
retq
leaq 0xb0e4b(%rip), %rsi     # 0xd0287
leaq 0x10(%rsp), %rbx
pushq $0x1b
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb0e39(%rip), %rsi     # 0xd0293
callq 0x8b1d0
movq 0x28(%rsp), %rdi
leaq 0xb4e60(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
leaq 0x10(%rsp), %rdi
callq 0x19465
jmp 0x1f4bb
leaq 0xb0e04(%rip), %rsi     # 0xd0287
leaq 0x10(%rsp), %rbx
pushq $0x1c
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb0e28(%rip), %rsi     # 0xd02c9
callq 0x8b1d0
movq 0x28(%rsp), %rdi
leaq 0xb4e19(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1f4bb
jmp 0x1f4bb
leaq 0x10(%rsp), %rdi
callq 0x189a6
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/logging.cc
// Function: hcproxy::internal_logging::LogStreamBase::Flush()
void LogStreamBase::Flush() {
  std::time_t time = std::time(nullptr);
  char time_str[64];
  if (std::strftime(time_str, sizeof(time_str), "%F %T", std::localtime(&time)) == 0) {
    std::strcpy(time_str, "undef");
  }
  std::string msg = strm_->str();
  std::fprintf(stderr, "[%s %s %s:%d] %s\n", time_str, Str(severity_), file_, line_, msg.c_str());
  strm_.reset();
  errno = errno_;
}

// Assembly:
pushq %rbx
subq $0x70, %rsp
movq %rdi, %rbx
xorl %edi, %edi
callq 0x15930
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
callq 0x15880
leaq 0xb0d73(%rip), %rdx     # 0xd02dc
leaq 0x30(%rsp), %rdi
pushq $0x40
popq %rsi
movq %rax, %rcx
callq 0x158c0
testq %rax, %rax
jne 0x1f58d
movw $0x66, 0x34(%rsp)
movl $0x65646e75, 0x30(%rsp) # imm = 0x65646E75
movq 0x18(%rbx), %rsi
addq $0x8, %rsi
leaq 0x10(%rsp), %rdi
callq 0x90de0
movq 0xf28e2(%rip), %rax     # 0x111e88
movq (%rax), %rdi
movl 0x14(%rbx), %eax
cmpq $0x3, %rax
ja 0x1f5c2
leaq 0xb0d5f(%rip), %rdx     # 0xd0318
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
jmp 0x1f5c9
leaq 0xb0d47(%rip), %rcx     # 0xd0310
movq 0x8(%rbx), %r8
movl 0x10(%rbx), %r9d
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
leaq 0xb0d07(%rip), %rsi     # 0xd02e8
leaq 0x30(%rsp), %rdx
xorl %eax, %eax
callq 0x15870
movq 0x18(%rbx), %rdi
andq $0x0, 0x18(%rbx)
testq %rdi, %rdi
je 0x1f601
movq (%rdi), %rax
callq *0x8(%rax)
movl (%rbx), %ebx
callq 0x15640
movl %ebx, (%rax)
leaq 0x10(%rsp), %rdi
callq 0x9b0d0
addq $0x70, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/event_loop.cc
// Function: hcproxy::EventLoop::EventLoop(std::chrono::duration<long, std::ratio<1l, 1000000000l>>)
EventLoop::EventLoop(Duration timeout) : timeout_(std::move(timeout)) {
  CHECK(timeout_ > Duration::zero());
  // Passing O_DIRECT to pipe2() doesn't work on WSL.
  // Setting it via fcntl() doesn't work on Linux.
  if (pipe2(pipe_, O_DIRECT) != 0) {
    CHECK(pipe(pipe_) == 0) << Errno();
    for (int fd : pipe_) AddFlags(fd, O_DIRECT);
  }
  epoll_.Add(pipe_[0], EPOLLIN, nullptr);
  loop_ = std::thread(&EventLoop::Loop, this);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r12
movq %rdi, %r15
leaq 0x8(%rdi), %rbx
movq %rbx, %rdi
callq 0x1d490
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%r15)
movq %r12, 0x48(%r15)
leaq 0x50(%r15), %rax
movq %rax, 0x20(%rsp)
andq $0x0, 0x50(%r15)
testq %r12, %r12
jle 0x1f7d3
movq %r15, %rdi
movl $0x4000, %esi           # imm = 0x4000
callq 0x15070
testl %eax, %eax
je 0x1f776
movq %r15, %rdi
callq 0x15460
testl %eax, %eax
jne 0x1f80c
pushq $0x3
popq %rbp
pushq $0x4
popq %r12
xorl %r14d, %r14d
cmpq $0x8, %r14
je 0x1f776
movl (%r15,%r14), %r13d
movl %r13d, %edi
movl %ebp, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x158f0
orl $0x4000, %eax           # imm = 0x4000
movl %r13d, %edi
movl %r12d, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x158f0
addq $0x4, %r14
testl %eax, %eax
je 0x1f6fe
leaq 0xb0bef(%rip), %rsi     # 0xd0328
movq %rsp, %rdi
pushq $0x26
popq %rdx
pushq $0x3
popq %rcx
callq 0x1f4c8
movq 0x18(%rsp), %rdi
leaq 0xb0ce7(%rip), %rsi     # 0xd043a
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb4b67(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
movq %rsp, %rdi
callq 0x19465
jmp 0x1f859
movl (%r15), %esi
pushq $0x1
popq %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x1d598
leaq 0xf3(%rip), %rax        # 0x1f880
movq %rsp, %rsi
movq %rax, (%rsi)
andq $0x0, 0x8(%rsi)
leaq 0x30(%rsp), %rdx
movq %r15, (%rdx)
leaq 0x28(%rsp), %rdi
callq 0x20108
leaq 0x28(%rsp), %rbx
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x20186
movq %rbx, %rdi
callq 0x1c562
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb0b4e(%rip), %rsi     # 0xd0328
movq %rsp, %rdi
pushq $0x2c
popq %rdx
pushq $0x3
popq %rcx
callq 0x1f4c8
movq 0x18(%rsp), %rdi
leaq 0xb0b46(%rip), %rsi     # 0xd033a
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb4ac6(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1f859
leaq 0xb0b15(%rip), %rsi     # 0xd0328
movq %rsp, %rdi
pushq $0x30
popq %rdx
pushq $0x3
popq %rcx
callq 0x1f4c8
movq 0x18(%rsp), %rdi
leaq 0xb0b29(%rip), %rsi     # 0xd0356
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb4a8d(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
movq %rsp, %rdi
callq 0x19465
jmp 0x1f859
jmp 0x1f859
jmp 0x1f863
jmp 0x1f859
jmp 0x1f863
jmp 0x1f863
jmp 0x1f863
movq %rsp, %rdi
callq 0x189a6
jmp 0x1f863
movq %rax, %r15
movq 0x20(%rsp), %rdi
callq 0x1c562
movq %rbx, %rdi
callq 0x1d524
movq %r15, %rdi
callq 0xcc660
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/event_loop.cc
// Function: hcproxy::EventLoop::Loop()
void EventLoop::Loop() {
  while (true) {
    epoll_.Wait(timeout_);
    for (const epoll_event& ev : epoll_) {
      if (ev.data.ptr != nullptr) {
        static_cast<EventHandler*>(ev.data.ptr)->IncRef();
      }
    }
    for (const epoll_event& ev : epoll_) {
      if (ev.data.ptr == nullptr) {
        PopFunc(pipe_[0]);
      } else {
        auto* eh = static_cast<EventHandler*>(ev.data.ptr);
        if (eh->event_loop_ == this) {
          eh->OnEvent(this, ev.events);
        }
        eh->DecRef();
      }
    }
    while (true) {
      auto* eh = static_cast<EventHandler*>(expire_.head());
      if (!eh || eh->deadline_ > Clock::now()) break;
      CHECK(eh->event_loop_ == this);
      eh->IncRef();
      eh->OnTimeout(this);
      if (eh->event_loop_ == this) Refresh(eh);
      eh->DecRef();
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
movq %rax, 0x28(%rsp)
pushq $0x20
popq %r13
movq 0x48(%rbx), %rsi
movq 0x28(%rsp), %rdi
pushq $0x1
popq %rdx
callq 0x1d788
movq 0x10(%rbx), %r14
movslq 0x30(%rbx), %rax
imulq $0xc, %rax, %r15
testq %r15, %r15
je 0x1f8d8
movq 0x4(%r14), %rdi
testq %rdi, %rdi
je 0x1f8ce
callq 0x1f2fa
addq $0xc, %r14
addq $-0xc, %r15
jmp 0x1f8bb
movq 0x10(%rbx), %r14
movslq 0x30(%rbx), %rax
imulq $0xc, %rax, %r15
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x1f98c
movq 0x4(%r14,%r12), %rbp
testq %rbp, %rbp
je 0x1f91a
cmpq %rbx, 0x28(%rbp)
jne 0x1f910
movl (%r14,%r12), %edx
movq (%rbp), %rax
movq %rbp, %rdi
movq %rbx, %rsi
callq *(%rax)
movq %rbp, %rdi
callq 0x1f358
jmp 0x1f952
movl (%rbx), %edi
leaq 0x30(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x15250
cmpl $0x8, %eax
jne 0x1f9ea
movq 0x30(%rsp), %rbp
movq %rbp, %rdi
callq 0x1c0d4
movq %rbp, %rdi
callq 0x19180
movq %rbp, %rdi
movq %r13, %rsi
callq 0x20470
addq $0xc, %r12
jmp 0x1f8e7
cmpq %rbx, 0x20(%r14)
jne 0x1f9ad
movq %rbp, %rdi
callq 0x1f2fa
movq -0x8(%r14), %rax
movq %rbp, %rdi
movq %rbx, %rsi
callq *0x8(%rax)
cmpq %rbx, 0x20(%r14)
jne 0x1f984
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x1ff86
movq %rbp, %rdi
callq 0x1f358
movq 0x38(%rbx), %r14
leaq -0x8(%r14), %rbp
testq %r14, %r14
je 0x1f89e
callq 0x2a710
cmpq 0x18(%r14), %rax
jge 0x1f958
jmp 0x1f89e
leaq 0xb0974(%rip), %rsi     # 0xd0328
leaq 0x8(%rsp), %rbx
pushq $0x79
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb09d6(%rip), %rsi     # 0xd03a8
callq 0x8b1d0
movq 0x20(%rsp), %rdi
leaq 0xb48e8(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1fa33
leaq 0xb0937(%rip), %rsi     # 0xd0328
leaq 0x8(%rsp), %rbx
pushq $0x1f
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb0a4a(%rip), %rsi     # 0xd0459
callq 0x8b1d0
movq 0x20(%rsp), %rdi
leaq 0xb48ab(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
leaq 0x8(%rsp), %rdi
callq 0x19465
jmp 0x1fa33
jmp 0x1fa33
leaq 0x8(%rsp), %rdi
callq 0x189a6
nop
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/event_loop.cc
// Function: hcproxy::EventLoop::Add(hcproxy::EventHandler*, int)
void EventLoop::Add(EventHandler* eh, int events) {
  CHECK(eh);
  CHECK(!eh->event_loop_);
  CHECK(std::this_thread::get_id() == loop_.get_id());
  eh->IncRef();
  eh->event_loop_ = this;
  eh->deadline_ = Clock::now() + timeout_;
  expire_.AddTail(eh);
  epoll_.Add(eh->fd_, events, eh);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
testq %rsi, %rsi
je 0x1faaf
movq %rsi, %rbx
cmpq $0x0, 0x28(%rsi)
jne 0x1faea
movl %edx, %ebp
movq %rdi, %r14
callq 0x15490
cmpq 0x50(%r14), %rax
jne 0x1fb25
movq %rbx, %rdi
callq 0x1f2fa
movq %r14, 0x28(%rbx)
callq 0x2a710
addq 0x48(%r14), %rax
movq %rax, 0x20(%rbx)
leaq 0x38(%r14), %rdi
leaq 0x8(%rbx), %rsi
callq 0x1852c
addq $0x8, %r14
movl 0x18(%rbx), %esi
movq %r14, %rdi
movl %ebp, %edx
movq %rbx, %rcx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x1d598
leaq 0xb0872(%rip), %rsi     # 0xd0328
movq %rsp, %rbx
pushq $0x38
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb0895(%rip), %rsi     # 0xd0367
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb47e8(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1fb64
leaq 0xb0837(%rip), %rsi     # 0xd0328
movq %rsp, %rbx
pushq $0x39
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb085d(%rip), %rsi     # 0xd036a
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb47ad(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1fb64
leaq 0xb07fc(%rip), %rsi     # 0xd0328
movq %rsp, %rbx
pushq $0x3a
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb0833(%rip), %rsi     # 0xd037b
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb4772(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1fb64
jmp 0x1fb64
jmp 0x1fb64
movq %rsp, %rdi
callq 0x189a6
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/event_loop.cc
// Function: hcproxy::EventLoop::Remove(hcproxy::EventHandler*)
void EventLoop::Remove(EventHandler* eh) {
  CHECK(eh);
  CHECK(eh->event_loop_ == this);
  CHECK(std::this_thread::get_id() == loop_.get_id());
  expire_.Erase(eh);
  epoll_.Remove(eh->fd_);
  eh->event_loop_ = nullptr;
  eh->DecRef();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
testq %rsi, %rsi
je 0x1fbc3
movq %rsi, %rbx
movq %rdi, %r14
cmpq %rdi, 0x28(%rsi)
jne 0x1fc00
callq 0x15490
cmpq 0x50(%r14), %rax
jne 0x1fc3d
leaq 0x38(%r14), %rdi
leaq 0x8(%rbx), %rsi
callq 0x18712
addq $0x8, %r14
movl 0x18(%rbx), %esi
movq %r14, %rdi
callq 0x1d616
andq $0x0, 0x28(%rbx)
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r14
jmp 0x1f358
leaq 0xb075e(%rip), %rsi     # 0xd0328
leaq 0x8(%rsp), %rbx
pushq $0x43
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb077f(%rip), %rsi     # 0xd0367
callq 0x8b1d0
movq 0x20(%rsp), %rdi
leaq 0xb46d2(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1fc7e
leaq 0xb0721(%rip), %rsi     # 0xd0328
leaq 0x8(%rsp), %rbx
pushq $0x44
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb0783(%rip), %rsi     # 0xd03a8
callq 0x8b1d0
movq 0x20(%rsp), %rdi
leaq 0xb4695(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1fc7e
leaq 0xb06e4(%rip), %rsi     # 0xd0328
leaq 0x8(%rsp), %rbx
pushq $0x45
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb0719(%rip), %rsi     # 0xd037b
callq 0x8b1d0
movq 0x20(%rsp), %rdi
leaq 0xb4658(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1fc7e
jmp 0x1fc7e
jmp 0x1fc7e
leaq 0x8(%rsp), %rdi
callq 0x189a6
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/event_loop.cc
// Function: hcproxy::EventLoop::Modify(hcproxy::EventHandler*, int)
void EventLoop::Modify(EventHandler* eh, int events) {
  CHECK(eh);
  CHECK(eh->event_loop_ == this);
  CHECK(std::this_thread::get_id() == loop_.get_id());
  epoll_.Modify(eh->fd_, events, eh);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
testq %rsi, %rsi
je 0x1fcce
movq %rsi, %rbx
movq %rdi, %r14
cmpq %rdi, 0x28(%rsi)
jne 0x1fd09
movl %edx, %ebp
callq 0x15490
cmpq 0x50(%r14), %rax
jne 0x1fd44
addq $0x8, %r14
movl 0x18(%rbx), %esi
movq %r14, %rdi
movl %ebp, %edx
movq %rbx, %rcx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x1d6cc
leaq 0xb0653(%rip), %rsi     # 0xd0328
movq %rsp, %rbx
pushq $0x4d
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb0676(%rip), %rsi     # 0xd0367
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb45c9(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1fd83
leaq 0xb0618(%rip), %rsi     # 0xd0328
movq %rsp, %rbx
pushq $0x4e
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb067c(%rip), %rsi     # 0xd03a8
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb458e(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1fd83
leaq 0xb05dd(%rip), %rsi     # 0xd0328
movq %rsp, %rbx
pushq $0x4f
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb0614(%rip), %rsi     # 0xd037b
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xb4553(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1fd83
jmp 0x1fd83
jmp 0x1fd83
movq %rsp, %rdi
callq 0x189a6
nop
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/event_loop.cc
// Function: hcproxy::EventLoop::Refresh(hcproxy::EventHandler*)
void EventLoop::Refresh(EventHandler* eh) {
  CHECK(eh);
  CHECK(eh->event_loop_ == this);
  CHECK(std::this_thread::get_id() == loop_.get_id());
  eh->deadline_ = Clock::now() + timeout_;
  if (auto* tail = static_cast<EventHandler*>(expire_.tail())) {
    CHECK(eh->deadline_ >= tail->deadline_);
  }
  expire_.Erase(eh);
  expire_.AddTail(eh);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
testq %rsi, %rsi
je 0x1fff6
movq %rsi, %rbx
movq %rdi, %r14
cmpq %rdi, 0x28(%rsi)
jne 0x20038
callq 0x15490
cmpq 0x50(%r14), %rax
jne 0x2007a
callq 0x2a710
addq 0x48(%r14), %rax
movq %rax, 0x20(%rbx)
movq 0x40(%r14), %rcx
testq %rcx, %rcx
je 0x1ffd1
cmpq 0x18(%rcx), %rax
jl 0x200b9
addq $0x38, %r14
addq $0x8, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x18712
movq %r14, %rdi
movq %rbx, %rsi
addq $0x28, %rsp
popq %rbx
popq %r14
jmp 0x1852c
leaq 0xb032b(%rip), %rsi     # 0xd0328
leaq 0x8(%rsp), %rbx
pushq $0x3
popq %rcx
movq %rbx, %rdi
movl $0x83, %edx
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb034a(%rip), %rsi     # 0xd0367
callq 0x8b1d0
movq 0x20(%rsp), %rdi
leaq 0xb429d(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x200fe
leaq 0xb02e9(%rip), %rsi     # 0xd0328
leaq 0x8(%rsp), %rbx
pushq $0x3
popq %rcx
movq %rbx, %rdi
movl $0x84, %edx
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb0349(%rip), %rsi     # 0xd03a8
callq 0x8b1d0
movq 0x20(%rsp), %rdi
leaq 0xb425b(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x200fe
leaq 0xb02a7(%rip), %rsi     # 0xd0328
leaq 0x8(%rsp), %rbx
pushq $0x3
popq %rcx
movq %rbx, %rdi
movl $0x85, %edx
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb02da(%rip), %rsi     # 0xd037b
callq 0x8b1d0
movq 0x20(%rsp), %rdi
leaq 0xb4219(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x200fe
leaq 0xb0268(%rip), %rsi     # 0xd0328
leaq 0x8(%rsp), %rbx
pushq $0x3
popq %rcx
movq %rbx, %rdi
movl $0x88, %edx
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb0339(%rip), %rsi     # 0xd0419
callq 0x8b1d0
movq 0x20(%rsp), %rdi
leaq 0xb41da(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x200fe
jmp 0x200fe
jmp 0x200fe
jmp 0x200fe
leaq 0x8(%rsp), %rdi
callq 0x189a6
// File: /workspace/github_cpp_makefile_star2_O2/hantaoyin[P]ffxiv-crafting-mcts/ffxiv-crafting-mcts.C
// Function: main
int main() {
  Driver driver;
  for (size_t count = 0; ; ++count) {
    driver.simulate();
    driver.train();
  }
  return 0;
}

// Assembly:
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x2530
movq %rbx, %rdi
callq 0x25e2
movq %rbx, %rdi
callq 0x2bfa
jmp 0x244a
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2cd4
movq %rbx, %rdi
callq 0x2270
nop
// File: /workspace/github_cpp_makefile_star2_O2/hantaoyin[P]ffxiv-crafting-mcts/ffxiv-crafting-mcts.C
// Function: Driver::train()
void train() {
    bool track_simulation = simulate_count % 16 == 0;
    const size_t size = training_data.size();
    for (size_t i = 0; i < 100; ++i) {
      ++train_count;
      size_t id = size * random_real();
      auto& example = training_data[id];
      scn.train(std::get<0>(example), std::get<1>(example), std::get<2>(example), step_size, track_simulation && i == 0);
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq (%rdi), %r13
andl $0xf, %r13d
addq $0x1b0, %rdi            # imm = 0x1B0
callq 0x5170
movq %rax, %xmm0
punpckldq 0x44d5(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x44dd(%rip), %xmm0     # 0x7110
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
leaq 0x1c0(%rbx), %r14
leaq 0x10(%rbx), %r15
xorl %ebp, %ebp
leaq 0x98a0(%rip), %r12      # 0xc4f8
cmpq $0x64, %rbp
je 0x2cc5
incq 0x8(%rbx)
movq %r12, %rdi
callq 0x2508
mulsd (%rsp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x43a5(%rip), %xmm0     # 0x7028
cvttsd2si %xmm0, %rsi
andq %rcx, %rsi
orq %rax, %rsi
movq %r14, %rdi
callq 0x64b0
leaq 0xf0(%rax), %rsi
movsd (%rax), %xmm0
leaq 0x8(%rax), %rdx
xorl %ecx, %ecx
movq %rbp, %rax
orq %r13, %rax
sete %cl
movq %r15, %rdi
movsd 0x4375(%rip), %xmm1     # 0x7030
callq 0x65ae
incq %rbp
jmp 0x2c58
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/hantaoyin[P]ffxiv-crafting-mcts/ffxiv-crafting-mcts.C
// Function: mlp::AffineMap::backward_propagate(double)
void backward_propagate(double step_size) override final {
    for (size_t j = 0; j < x.size(); ++j) {
      x.D(j) = 0.0;
    }
    for (size_t i = 0; i < y.size(); ++i) {
      for (size_t j = 0; j < x.size(); ++j) {
        x.D(j) += y.D(i) * w[i * x.size() + j];
        w[i * x.size() + j] = w[i * x.size() + j] * (1. - 2. * weight_decay * step_size) - step_size * y.D(i) * x(j);
      }
      b[i] = b[i] * (1. - 2. * weight_decay * step_size) - step_size * y.D(i);
    }
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x8(%rdi), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x3d96
movq 0x18(%rax), %r8
andq $0x0, (%r8,%rsi,8)
incq %rsi
jmp 0x3d83
movq 0x10(%rdi), %rsi
movq 0x30(%rdi), %r8
movq 0x8(%rsi), %r9
subq (%rsi), %r9
movsd 0x32ab(%rip), %xmm1     # 0x7058
mulsd %xmm0, %xmm1
addsd 0x324f(%rip), %xmm1     # 0x7008
sarq $0x3, %r9
leaq (,%rdx,8), %r10
xorl %r11d, %r11d
xorl %ebx, %ebx
cmpq %r9, %rbx
je 0x3e5a
movq 0x18(%rdi), %r14
addq %r11, %r14
xorl %r15d, %r15d
cmpq %r15, %rdx
je 0x3e2d
movq 0x18(%rsi), %r12
movsd (%r12,%rbx,8), %xmm2
movq 0x18(%rax), %r13
mulsd (%r14,%r15,8), %xmm2
addsd (%r13,%r15,8), %xmm2
movsd %xmm2, (%r13,%r15,8)
movsd (%r12,%rbx,8), %xmm2
mulsd %xmm0, %xmm2
mulsd (%rcx,%r15,8), %xmm2
movsd (%r14,%r15,8), %xmm3
mulsd %xmm1, %xmm3
subsd %xmm2, %xmm3
movsd %xmm3, (%r14,%r15,8)
incq %r15
jmp 0x3ddd
movq 0x18(%rsi), %r14
movsd (%r14,%rbx,8), %xmm2
mulsd %xmm0, %xmm2
movsd (%r8,%rbx,8), %xmm3
mulsd %xmm1, %xmm3
subsd %xmm2, %xmm3
movsd %xmm3, (%r8,%rbx,8)
incq %rbx
addq %r10, %r11
jmp 0x3dca
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/hantaoyin[P]ffxiv-crafting-mcts/ffxiv-crafting-mcts.C
// Function: mlp::SoftMaxAndSigmoid::forward()
void forward(void) override final {
    // SoftMax
    double xmax = x(0);
    for (size_t i = 1; i < size; ++i) {
      xmax = std::max(xmax, x(i));
    }
    ASSERT(std::fabs(xmax) < 1.e100) << xmax;

    double sum = 0.;
    for (size_t i = 0; i < size; ++i) {
      y(i) = std::exp(x(i) - xmax);
      sum += y(i);
    }
    ASSERT(sum >= 1.0 && sum <= 1.01 * size) << sum;

    sum = 1.0 / sum;
    for (size_t i = 0; i < size; ++i) {
      y(i) *= sum;
    }

    // Sigmoid
    y(size) = 1. / (1. + std::exp(bias - x(size)));
  }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rcx
movq 0x18(%rdi), %rax
movq (%rcx), %rcx
movsd (%rcx), %xmm1
pushq $0x1
popq %rdx
cmpq %rax, %rdx
jae 0x4105
movsd (%rcx,%rdx,8), %xmm0
maxsd %xmm1, %xmm0
incq %rdx
movapd %xmm0, %xmm1
jmp 0x40ee
xorpd %xmm2, %xmm2
xorl %r14d, %r14d
movsd %xmm1, 0x8(%rsp)
cmpq %rax, %r14
jae 0x4159
movq 0x8(%rbx), %rax
movq (%rax), %rax
movsd (%rax,%r14,8), %xmm0
subsd %xmm1, %xmm0
movsd %xmm2, 0x10(%rsp)
callq 0x2280
movsd 0x10(%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
movq 0x10(%rbx), %rax
movq (%rax), %rax
movsd %xmm0, (%rax,%r14,8)
addsd %xmm0, %xmm2
incq %r14
movq 0x18(%rbx), %rax
jmp 0x4112
movsd 0x2ea7(%rip), %xmm0     # 0x7008
divsd %xmm2, %xmm0
movq 0x10(%rbx), %rcx
xorl %edx, %edx
cmpq %rdx, %rax
je 0x4186
movq (%rcx), %rsi
movsd (%rsi,%rdx,8), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, (%rsi,%rdx,8)
incq %rdx
jmp 0x416b
movq 0x8(%rbx), %rcx
movq (%rcx), %rcx
movsd 0x2ecb(%rip), %xmm0     # 0x7060
subsd (%rcx,%rax,8), %xmm0
callq 0x2280
movsd 0x2e61(%rip), %xmm1     # 0x7008
addsd %xmm1, %xmm0
divsd %xmm0, %xmm1
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rax), %rax
movsd %xmm1, (%rax,%rcx,8)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/hantaoyin[P]ffxiv-crafting-mcts/ffxiv-crafting-mcts.C
// Function: mlp::SoftMaxAndSigmoid::backward_propagate(double)
void backward_propagate(double) override final {
    // SoftMax
    double sum = 0.;
    for (size_t i = 0; i < size; ++i) {
      x.D(i) = y(i) * y.D(i);
      sum += x.D(i);
    }
    for (size_t i = 0; i < size; ++i) {
      x.D(i) -= y(i) * sum;
    }

    // Sigmoid
    x.D(size) = y.D(size) * y(size) * (1. - y(size));
  }

// Assembly:
movq 0x18(%rdi), %rax
movq 0x8(%rdi), %rcx
movq 0x10(%rdi), %rdx
xorpd %xmm0, %xmm0
xorl %esi, %esi
cmpq %rsi, %rax
je 0x4205
movq (%rdx), %r8
movq 0x18(%rdx), %r9
movsd (%r8,%rsi,8), %xmm1
mulsd (%r9,%rsi,8), %xmm1
movq 0x18(%rcx), %r8
movsd %xmm1, (%r8,%rsi,8)
addsd %xmm1, %xmm0
incq %rsi
jmp 0x41da
movq 0x8(%rdi), %rcx
movq 0x10(%rdi), %rdx
xorl %esi, %esi
cmpq %rsi, %rax
je 0x4239
movq (%rdx), %rdi
movq 0x18(%rcx), %r8
movsd (%r8,%rsi,8), %xmm1
movsd (%rdi,%rsi,8), %xmm2
mulsd %xmm0, %xmm2
subsd %xmm2, %xmm1
movsd %xmm1, (%r8,%rsi,8)
incq %rsi
jmp 0x420f
movq (%rdx), %rsi
movq 0x18(%rdx), %rdx
movsd (%rsi,%rax,8), %xmm0
movsd (%rdx,%rax,8), %xmm1
mulsd %xmm0, %xmm1
movsd 0x2db2(%rip), %xmm2     # 0x7008
subsd %xmm0, %xmm2
mulsd %xmm1, %xmm2
movq 0x18(%rcx), %rcx
movsd %xmm2, (%rcx,%rax,8)
retq
// File: /workspace/github_cpp_makefile_star2_O2/hantaoyin[P]ffxiv-crafting-mcts/ffxiv-crafting-mcts.C
// Function: UCT::initState(State const&)
double initState(const State& s) {
    ASSERT(all_states.find(s) == all_states.end()) << s.DebugString();

    StateStatistics stat;
    const mlp::Edge& edge = scn.forward(s);
    const std::array<double, TotalActionCount>& noise = dir.gen();
    const double eps = 0.25;
    for (size_t ac_id = 0; ac_id < TotalActionCount; ++ac_id) {
      Action ac = static_cast<Action>(ac_id);
      stat.prior(ac) = edge(ac_id) * (1. - eps) + eps * noise[ac_id];
      stat.count(ac) = 0;
      stat.value(ac) = 0.;
      if (!s.CanExecuteAction(ac)) {
        stat.setValid(ac, false);
      }
    }
    all_states.emplace(s, stat);
    return edge(TotalActionCount);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2d8, %rsp            # imm = 0x2D8
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsp), %r15
xorl %ebp, %ebp
movl $0x2c0, %edx            # imm = 0x2C0
movq %r15, %rdi
xorl %esi, %esi
callq 0x20a0
movq $0x1fffffff, 0x2c0(%r15) # imm = 0x1FFFFFFF
movq 0x130(%r14), %rdi
movq %rbx, %rsi
callq 0x453e
movq %rax, %r12
movq %r14, 0x8(%rsp)
movq %r14, %rdi
callq 0x45a2
movq %rax, %r13
leaq 0x20(%rsp), %r14
cmpq $0x1d, %rbp
je 0x44ab
movq (%r12), %rax
movsd (%r13,%rbp,8), %xmm0
mulsd 0x2c14(%rip), %xmm0     # 0x7078
movsd (%rax,%rbp,8), %xmm1
mulsd 0x2b9f(%rip), %xmm1     # 0x7010
addsd %xmm0, %xmm1
movsd %xmm1, (%r14)
xorpd %xmm0, %xmm0
movupd %xmm0, -0x10(%r14)
movzbl %bpl, %esi
movq %rbx, %rdi
callq 0x4622
testb %al, %al
jne 0x44a2
movzbl %bpl, %esi
movq %r15, %rdi
xorl %edx, %edx
callq 0x4696
incq %rbp
addq $0x18, %r14
jmp 0x444b
movq 0x8(%rsp), %rdi
addq $0x138, %rdi            # imm = 0x138
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
callq 0x49d2
movq (%r12), %rax
movsd 0xe8(%rax), %xmm0
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/hantaoyin[P]ffxiv-crafting-mcts/ffxiv-crafting-mcts.C
// Function: State::CanExecuteAction(Action) const
bool IsActionSupported(Action ac) const {
    switch (ac) {
    case Action::Reuse:
      return false;
    default:
      return true;
    }
  }

// Assembly:
cmpl $0x18, %esi
je 0x4668
movswl (%rdi), %eax
movzbl %sil, %ecx
movl %ecx, %edx
shll $0x4, %edx
leaq 0x64b6(%rip), %rsi      # 0xaaf0
movsbl 0x8(%rdx,%rsi), %edx
addl %eax, %edx
js 0x4668
movb $0x1, %al
addl $-0x2, %ecx
cmpl $0x18, %ecx
ja 0x4667
leaq 0x2b24(%rip), %rdx      # 0x7178
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movb 0x9(%rdi), %al
decb %al
cmpb $0x2, %al
setb %al
retq
xorl %eax, %eax
retq
cmpb $0x0, 0xa(%rdi)
setne %al
retq
cmpb $0x0, 0x8(%rdi)
jmp 0x4691
cmpb $0x2, 0x8(%rdi)
setae %al
retq
cmpb $0x0, 0x12(%rdi)
jmp 0x4691
cmpb $0x0, 0xf(%rdi)
jmp 0x4691
cmpb $0x0, 0xc(%rdi)
sete %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/hantaoyin[P]ffxiv-crafting-mcts/ffxiv-crafting-mcts.C
// Function: UCT::select(State const&, double)
Action select(const State& s, double inv_temp) {
    ASSERT(all_states.find(s) != all_states.end()) << s.DebugString();
    std::array<double, TotalActionCount> p;

    double sum = 0.;
    StateStatistics& stat = all_states.at(s);
    for (size_t ac_id = 0; ac_id < TotalActionCount; ++ac_id) {
      Action ac = static_cast<Action>(ac_id);
      if (stat.valid(ac)) {
        p[ac_id] = std::pow(stat.count(ac), inv_temp);
        sum += p[ac_id];
      } else {
        p[ac_id] = 0.;
      }
    }
    if (sum == 0.) {
      return Action::NumActions; // Resign.
    }
    double r = random_real() * sum;
    for (size_t ac_id = 0; ac_id < TotalActionCount; ++ac_id) {
      Action ac = static_cast<Action>(ac_id);
      if (!stat.valid(ac)) continue;
      r -= p[ac_id];
      if (r < 0.) {
        return ac;
      }
    }
    ASSERT(false) << s.DebugString() << " " << stat.DebugString();
    return Action::NumActions;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xf8, %rsp
movsd %xmm0, 0x8(%rsp)
addq $0x138, %rdi            # imm = 0x138
callq 0x60e4
movq %rax, %rbx
movq %rax, %r14
addq $0x8, %r14
xorpd %xmm1, %xmm1
xorl %r15d, %r15d
cmpq $0x1d, %r15
je 0x5736
movq 0x2c0(%rbx), %rax
btq %r15, %rax
jae 0x5722
movsd %xmm1, (%rsp)
movsd (%r14), %xmm1
unpcklps 0x1a08(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1a10(%rip), %xmm1     # 0x7110
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movsd 0x8(%rsp), %xmm1
callq 0x2260
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
jmp 0x5726
xorpd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp,%r15,8)
incq %r15
addq $0x18, %r14
jmp 0x56d4
movb $0x1d, %bpl
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x5755
jp 0x5755
movl %ebp, %eax
addq $0xf8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6d9c(%rip), %rdi      # 0xc4f8
movsd %xmm1, (%rsp)
callq 0x2508
movsd (%rsp), %xmm1
mulsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
movq 0x2c0(%rbx), %rcx
xorl %eax, %eax
cmpq $0x1d, %rax
je 0x5745
btq %rax, %rcx
jae 0x5794
subsd 0x10(%rsp,%rax,8), %xmm1
ucomisd %xmm1, %xmm0
ja 0x5799
incq %rax
jmp 0x577c
movl %eax, %ebp
jmp 0x5745
nop
// File: /workspace/github_cpp_makefile_star2_O2/hantaoyin[P]ffxiv-crafting-mcts/ffxiv-crafting-mcts.C
// Function: State::ExecuteAction(Action)
bool ExecuteAction(Action ac) {
    const short percentage = SuccessPercentage(ac);
    const bool is_action_successful = percentage >= 100 ? true : random_real() * 100 < percentage;
    Condition next_condition = RandomlyGenNextCondition(condition);
    return DeterministicExecuteAction(ac, is_action_successful, next_condition);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x6102
movb $0x1, %r15b
cmpw $0x63, %ax
jg 0x5b4d
movl %eax, %r14d
leaq 0x69c8(%rip), %rdi      # 0xc4f8
callq 0x2508
mulsd 0x1573(%rip), %xmm0     # 0x70b0
movswl %r14w, %eax
cvtsi2sd %eax, %xmm1
ucomisd %xmm0, %xmm1
seta %r15b
movzbl 0x9(%rbx), %edi
callq 0x23fc
movzbl %bpl, %esi
movzbl %r15b, %edx
movzbl %al, %ecx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x612a
nop