// File: /workspace/github_cpp_makefile_star2_O3/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 0x1eae4(%rip), %rsi     # 0x32018
leaq 0x8(%rsp), %rdi
movl $0x10, %edx
callq 0x1399c
movq (%r14), %rdi
movq 0x8(%r14), %rsi
addq %rdi, %rsi
leaq 0x30(%rsp), %rdx
leaq 0x8(%rsp), %rcx
xorl %r8d, %r8d
callq 0x1ecc7
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x13a04
testb %bpl, %bpl
je 0x138cf
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
xorl %eax, %eax
movq %rax, 0x8(%rbx)
movb %al, 0x10(%rbx)
leaq 0x30(%rbx), %rcx
movq %rcx, 0x20(%rbx)
movq %rax, 0x28(%rbx)
movb %al, 0x30(%rbx)
movb %al, 0x44(%rbx)
leaq 0x58(%rbx), %rcx
movq %rcx, 0x48(%rbx)
movq %rax, 0x50(%rbx)
movb %al, 0x58(%rbx)
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movabsq $-0x5555555555555555, %r15 # imm = 0xAAAAAAAAAAAAAAAB
subq %rax, %rcx
je 0x135d9
movq %rcx, %rdx
sarq $0x3, %rdx
imulq %r15, %rdx
addq $-0x5, %rdx
cmpq $-0x3, %rdx
ja 0x135d9
addq $0x18, %rax
jmp 0x135e0
addq %rcx, %rax
addq $-0x48, %rax
cmpb $0x1, 0x10(%rax)
jne 0x13602
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x8(%rsp), %rdi
callq 0x20d1c
jmp 0x13616
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 0x13640
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
subq %rax, %rcx
je 0x1366a
movq %rcx, %rdx
sarq $0x3, %rdx
imulq %r15, %rdx
addq $-0x6, %rdx
cmpq $-0x4, %rdx
ja 0x1366a
addq $0x30, %rax
jmp 0x13671
addq %rcx, %rax
addq $-0x48, %rax
cmpb $0x1, 0x10(%rax)
jne 0x13693
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x8(%rsp), %rdi
callq 0x20d1c
jmp 0x136a6
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 0x136cc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
leaq 0x48(%rbx), %rbp
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rdx
movq %rdx, %rcx
subq %rax, %rcx
je 0x13703
movq %rcx, %rsi
sarq $0x3, %rsi
imulq %r15, %rsi
addq $-0x7, %rsi
cmpq $-0x4, %rsi
jae 0x13711
cmpb $0x0, 0x58(%rax)
je 0x13749
addq $0x48, %rax
jmp 0x1371f
cmpb $0x0, -0x38(%rax,%rcx)
jne 0x13718
xorl %ecx, %ecx
jmp 0x13827
cmpb $0x0, -0x38(%rax,%rcx)
je 0x13749
addq %rcx, %rax
addq $-0x48, %rax
cmpb $0x1, 0x10(%rax)
jne 0x13751
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x8(%rsp), %rdi
callq 0x20d1c
movq %r12, %r14
movq 0x8(%rsp), %r12
jmp 0x13767
movq %rdx, %rcx
jmp 0x137fe
movq %r12, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq %r12, %r14
callq 0xb090
movq %rax, %r15
movl (%rax), %eax
movl %eax, 0x2c(%rsp)
movl $0x0, (%r15)
leaq 0x50(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0xb920
cmpq %r12, (%r13)
je 0x13901
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x1390d
movl (%r15), %ecx
cmpl $0x22, %ecx
je 0x1390d
testl %ecx, %ecx
movq %r14, %r12
jne 0x137c1
movl 0x2c(%rsp), %ecx
movl %ecx, (%r15)
movl %eax, %eax
btsq $0x20, %rax
movq %rax, 0x40(%rbx)
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x137e7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rcx, %rdx
movabsq $-0x5555555555555555, %r15 # imm = 0xAAAAAAAAAAAAAAAB
subq %rax, %rcx
cmpq %rdx, %rax
je 0x13827
movq %rcx, %rdx
sarq $0x3, %rdx
imulq %r15, %rdx
addq $-0x8, %rdx
cmpq $-0x5, %rdx
jae 0x13827
cmpb $0x0, 0x70(%rax)
je 0x13851
addq $0x60, %rax
jmp 0x13835
cmpb $0x0, -0x38(%rax,%rcx)
je 0x13851
addq %rcx, %rax
addq $-0x48, %rax
cmpb $0x1, 0x10(%rax)
jne 0x1386e
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
callq 0x20d1c
jmp 0x13881
movq 0x50(%rbx), %rdx
leaq 0x1e7ff(%rip), %rcx     # 0x3205b
movl $0x1, %r8d
movq %rbp, %rdi
xorl %esi, %esi
callq 0xba50
jmp 0x138a6
movq %r12, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
leaq 0x8(%rsp), %r15
movq %rbp, %rdi
movq %r15, %rsi
callq 0xb7d0
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x138a6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x138bd
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 0x1e76b(%rip), %rsi     # 0x3204e
movq %rax, %rdi
callq 0xbcd0
movq 0x336c6(%rip), %rsi     # 0x46fb8
movq 0x33697(%rip), %rdx     # 0x46f90
movq %rbx, %rdi
callq 0xbb60
leaq 0x1e755(%rip), %rdi     # 0x3205d
callq 0xb3e0
leaq 0x1e749(%rip), %rdi     # 0x3205d
callq 0xb9a0
jmp 0x13921
jmp 0x13921
jmp 0x13921
jmp 0x13921
movq %rax, %r14
movq %rbx, %rdi
callq 0xdc54
jmp 0x1397c
jmp 0x13979
movq %rax, %r14
movq %rbx, %rdi
callq 0xb4b0
jmp 0x1397c
movq %rax, %r14
cmpl $0x0, (%r15)
jne 0x1394d
movl 0x2c(%rsp), %eax
movl %eax, (%r15)
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x13924
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
jmp 0x13924
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x13a04
jmp 0x1397c
movq %rax, %r14
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x13993
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0xb600
movq %r14, %rdi
callq 0xbbb0
nop