// File: /workspace/github_cpp_makefile_star2_O3/alfanick[P]rest-cpp/src/rest/router.cpp
// Function: REST::Router::find(REST::Request&, int)
Service* Router::find(Request &request, int worker_id) {
    const std::string &path = request.path;

    for (const auto &route : instance()->routes) {
      std::smatch matches;
      std::regex_match(path, matches, std::get<0>(route).first);

      if (!matches.empty()) {
        const auto &params = std::get<0>(route).second;

        for (size_t i = 1; i < matches.size(); i++) {
          request.parameters[params[i-1]] = matches[i];
          request.parameters[std::to_string(i)] = matches[i];
        }

        return std::get<2>(route)[worker_id];
      }
    }

    return nullptr;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq 0x248b6(%rip), %rax     # 0x4cfa0
movq %rdi, 0x20(%rsp)
movl %esi, %ebp
movb (%rax), %al
testb %al, %al
je 0x289ca
movq 0x248c6(%rip), %rax     # 0x4cfc8
movq (%rax), %rbx
movq 0x8(%rax), %rax
movq %rax, 0x58(%rsp)
cmpq %rax, %rbx
je 0x289b3
movq 0x20(%rsp), %rax
movslq %ebp, %rcx
leaq 0x78(%rsp), %r15
leaq 0x68(%rsp), %r13
movabsq $0x346dc5d63886594b, %r12 # imm = 0x346DC5D63886594B
movq %rcx, 0x50(%rsp)
addq $0x58, %rax
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rax
vxorps %xmm0, %xmm0, %xmm0
leaq 0x38(%rbx), %rcx
vmovups %ymm0, 0x30(%rsp)
movq 0x8(%rax), %rdi
movq 0x10(%rax), %rsi
addq %rdi, %rsi
leaq 0x30(%rsp), %rdx
xorl %r8d, %r8d
vzeroupper
callq 0x22fc0
movq 0x38(%rsp), %rax
movq 0x30(%rsp), %rdi
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
movq %rax, %rdx
subq %rdi, %rdx
sarq $0x3, %rdx
imulq %rcx, %rdx
movq %rdx, 0x60(%rsp)
cmpq $0x4, %rdx
jb 0x28992
cmpq %rax, %rdi
je 0x28986
movl $0x1, %ebp
subq %rdi, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
sarq $0x3, %rax
imulq %rcx, %rax
addq $-0x3, %rax
cmpq %rax, %rbp
jae 0x28986
movq %r13, %r14
movq %r15, %r13
leaq (%rbp,%rbp,2), %r15
cmpb $0x1, 0x10(%rdi,%r15,8)
jne 0x28801
leaq (%rdi,%r15,8), %rax
movq 0x8(%rax), %rdx
movq (%rax), %rsi
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rsp, %rdi
callq 0x226d0
jmp 0x28818
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq 0x58(%rbx), %rax
movq %rbp, %rcx
shlq $0x5, %rcx
leaq -0x20(%rax,%rcx), %rsi
movq 0x28(%rsp), %rdi
callq 0x210b0
movq %rax, %rdi
movq %rsp, %rsi
callq 0x22620
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x28850
callq 0x22130
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
subq %rax, %rcx
je 0x28883
movq %rcx, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
addq $-0x3, %rdx
cmpq %rbp, %rdx
jbe 0x28883
leaq (%rax,%r15,8), %rax
jmp 0x28888
leaq -0x48(%rax,%rcx), %rax
cmpb $0x1, 0x10(%rax)
movq %r13, %r15
movq %r14, %r13
jne 0x288ae
movq 0x8(%rax), %rdx
movq (%rax), %rsi
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rsp, %rdi
callq 0x226d0
jmp 0x288c5
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movl $0x1, %eax
cmpq $0xa, %rbp
jb 0x28914
movl $0x4, %eax
movq %rbp, %rdx
cmpq $0x63, %rdx
jbe 0x2890d
cmpq $0x3e7, %rdx            # imm = 0x3E7
jbe 0x28912
cmpq $0x2710, %rdx           # imm = 0x2710
jb 0x28914
mulxq %r12, %rcx, %rcx
addl $0x4, %eax
shrq $0xb, %rcx
cmpq $0x1869f, %rdx          # imm = 0x1869F
movq %rcx, %rdx
ja 0x288d8
addl $-0x3, %eax
jmp 0x28914
addl $-0x2, %eax
jmp 0x28914
decl %eax
movl %eax, %esi
movq %r15, 0x68(%rsp)
movq %r13, %rdi
xorl %edx, %edx
callq 0x22520
movq 0x68(%rsp), %rdi
movl 0x70(%rsp), %esi
movq %rbp, %rdx
callq 0x22110
movq 0x28(%rsp), %rdi
movq %r13, %rsi
callq 0x23320
movq %rax, %rdi
movq %rsp, %rsi
callq 0x22620
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x2895d
callq 0x22130
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x28970
callq 0x22130
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rax
incq %rbp
cmpq %rax, %rdi
jne 0x287ae
movq (%rbx), %rax
movq 0x50(%rsp), %rcx
movq (%rax,%rcx,8), %rbp
testq %rdi, %rdi
je 0x2899c
callq 0x22130
cmpq $0x4, 0x60(%rsp)
jae 0x289b5
addq $0x70, %rbx
cmpq 0x58(%rsp), %rbx
jne 0x28741
xorl %ebp, %ebp
movq %rbp, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x245cf(%rip), %rdi     # 0x4cfa0
callq 0x231d0
testl %eax, %eax
je 0x286fb
movq 0x245e3(%rip), %rdi     # 0x4cfc8
callq 0x231b0
movq 0x24267(%rip), %rdi     # 0x4cc58
movq 0x245d0(%rip), %rsi     # 0x4cfc8
leaq 0x25891(%rip), %rdx     # 0x4e290
callq 0x21fa0
movq 0x24595(%rip), %rdi     # 0x4cfa0
callq 0x21b30
jmp 0x286fb
movq 0x24584(%rip), %rdi     # 0x4cfa0
movq %rax, %rbx
callq 0x21ac0
jmp 0x28a6a
jmp 0x28a2a
jmp 0x28a2a
movq %rax, %rbx
jmp 0x28a5b
movq 0x68(%rsp), %rdi
movq %rax, %rbx
cmpq %r15, %rdi
je 0x28a48
callq 0x22130
jmp 0x28a48
jmp 0x28a45
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x28a5b
callq 0x22130
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x28a6a
callq 0x22130
movq %rbx, %rdi
callq 0x23160