// File: /workspace/github_cpp_makefile_star2_O1/kztomita[P]http-dump/url.cc
// Function: parse_url(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
url_components parse_url(const std::string& url) {
  std::smatch m;
  if (!std::regex_search(url, m, std::regex(R"((^[a-z][a-z0-9+.-]*)://([^ /]+?)(?::(\d+))?(/[\S]*)?$)"))) {
    throw std::invalid_argument("invalid url.");
  }

  url_components c;
  c.scheme = m[1].str();
  c.host = m[2].str();

  if (m[3].matched) {
    c.port = static_cast<unsigned int>(std::stoi(m[3].str()));
  }

  if (m[4].matched) {
    c.path_and_query = m[4].str();
  } else {
    c.path_and_query = "/";
  }

  return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
leaq 0x1f9a0(%rip), %rsi     # 0x33018
leaq 0x8(%rsp), %rdi
movl $0x10, %edx
callq 0x13afa
movq (%r14), %rdi
movq 0x8(%r14), %rsi
addq %rdi, %rsi
leaq 0x30(%rsp), %rdx
leaq 0x8(%rsp), %rcx
xorl %r8d, %r8d
callq 0x1ee10
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x13b62
testb %bpl, %bpl
je 0x13a32
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
xorl %ecx, %ecx
movq %rcx, 0x8(%rbx)
movb %cl, 0x10(%rbx)
leaq 0x30(%rbx), %rax
movq %rax, 0x20(%rbx)
movq %rcx, 0x28(%rbx)
movb %cl, 0x30(%rbx)
movb %cl, 0x44(%rbx)
leaq 0x58(%rbx), %rax
movq %rax, 0x48(%rbx)
movq %rcx, 0x50(%rbx)
movb %cl, 0x58(%rbx)
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %rax
movabsq $-0x5555555555555555, %r13 # imm = 0xAAAAAAAAAAAAAAAB
cmpq %rax, %rdx
je 0x1371b
movq %rax, %rcx
subq %rdx, %rcx
sarq $0x3, %rcx
imulq %r13, %rcx
addq $-0x5, %rcx
cmpq $-0x2, %rcx
setb %cl
addq $0x18, %rdx
addq $-0x48, %rax
testb %cl, %cl
cmovneq %rdx, %rax
cmpb $0x1, 0x10(%rax)
jne 0x1374b
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x8(%rsp), %rdi
callq 0x20e56
jmp 0x1375f
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb7d0
movq (%r14), %rdi
leaq 0x18(%rsp), %r12
cmpq %r12, %rdi
je 0x13789
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rax
cmpq %rax, %rcx
je 0x137b3
movq %rax, %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
imulq %r13, %rdx
addq $-0x6, %rdx
cmpq $-0x3, %rdx
setb %dl
jmp 0x137b5
xorl %edx, %edx
addq $0x30, %rcx
addq $-0x48, %rax
testb %dl, %dl
cmovneq %rcx, %rax
cmpb $0x1, 0x10(%rax)
jne 0x137df
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
callq 0x20e56
jmp 0x137f2
movq %r12, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
leaq 0x20(%rbx), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0xb7d0
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x13818
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rax
cmpq %rax, %rcx
je 0x13843
movq %rax, %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
imulq %r13, %rdx
addq $-0x7, %rdx
cmpq $-0x4, %rdx
setb %dil
jmp 0x13845
xorl %edi, %edi
leaq 0x48(%rcx), %rsi
leaq -0x48(%rax), %rdx
testb %dil, %dil
movq %rdx, %rdi
cmovneq %rsi, %rdi
cmpb $0x1, 0x10(%rdi)
jne 0x13933
cmpq %rax, %rcx
je 0x1387d
subq %rcx, %rax
sarq $0x3, %rax
imulq %r13, %rax
addq $-0x7, %rax
cmpq $-0x4, %rax
cmovbq %rsi, %rdx
cmpb $0x1, 0x10(%rdx)
jne 0x1389c
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
leaq 0x8(%rsp), %rdi
movq %r12, %rbp
movq %r12, (%rdi)
callq 0x20e56
jmp 0x138b2
movq %r12, %rbp
movq %r12, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq 0x8(%rsp), %r14
callq 0xb090
movq %rax, %r15
movl (%rax), %eax
movl %eax, 0x2c(%rsp)
movl $0x0, (%r15)
leaq 0x50(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0xb920
cmpq %r14, (%r12)
je 0x13a64
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x13a70
movl (%r15), %ecx
cmpl $0x22, %ecx
je 0x13a70
testl %ecx, %ecx
movq %rbp, %r12
jne 0x13911
movl 0x2c(%rsp), %ecx
movl %ecx, (%r15)
movl %eax, %eax
btsq $0x20, %rax
movq %rax, 0x40(%rbx)
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x13933
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rax
cmpq %rax, %rcx
je 0x1395e
movq %rax, %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
imulq %r13, %rdx
addq $-0x8, %rdx
cmpq $-0x5, %rdx
setb %dil
jmp 0x13960
xorl %edi, %edi
leaq 0x48(%rbx), %r14
leaq 0x60(%rcx), %rsi
leaq -0x48(%rax), %rdx
testb %dil, %dil
movq %rdx, %rdi
cmovneq %rsi, %rdi
cmpb $0x1, 0x10(%rdi)
jne 0x139b4
cmpq %rax, %rcx
je 0x13998
subq %rcx, %rax
sarq $0x3, %rax
imulq %r13, %rax
addq $-0x8, %rax
cmpq $-0x5, %rax
cmovbq %rsi, %rdx
cmpb $0x1, 0x10(%rdx)
jne 0x139d1
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
callq 0x20e56
jmp 0x139e4
movq 0x50(%rbx), %rdx
leaq 0x1f69c(%rip), %rcx     # 0x3305b
movl $0x1, %r8d
movq %r14, %rdi
xorl %esi, %esi
callq 0xba50
jmp 0x13a09
movq %r12, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xb7d0
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x13a09
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x13a20
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0xb600
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0xb300
movq %rax, %rbx
leaq 0x1f608(%rip), %rsi     # 0x3304e
movq %rax, %rdi
callq 0xbcd0
movq 0x3456b(%rip), %rsi     # 0x47fc0
movq 0x3453c(%rip), %rdx     # 0x47f98
movq %rbx, %rdi
callq 0xbb60
leaq 0x1f5f2(%rip), %rdi     # 0x3305d
callq 0xb3e0
leaq 0x1f5e6(%rip), %rdi     # 0x3305d
callq 0xb9a0
jmp 0x13a84
jmp 0x13a84
jmp 0x13a84
jmp 0x13a84
movq %rax, %r14
movq %rbx, %rdi
callq 0xdc92
jmp 0x13adb
jmp 0x13ad8
movq %rax, %r14
movq %rbx, %rdi
callq 0xb4b0
jmp 0x13adb
movq %rax, %r14
cmpl $0x0, (%r15)
jne 0x13ab0
movl 0x2c(%rsp), %eax
movl %eax, (%r15)
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x13a87
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
jmp 0x13a87
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x13b62
jmp 0x13adb
movq %rax, %r14
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x13af2
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0xb600
movq %r14, %rdi
callq 0xbbb0