// File: /workspace/github_cpp_makefile_star2_O2/lvandeve[P]base256/base256.cpp
// Function: utf8_to_unicode(std::vector<unsigned char, std::allocator<unsigned char>> const&)
std::vector<int> utf8_to_unicode(const std::vector<uint8_t>& a) {
  std::vector<int> result;
  for(int i = 0; i < a.size(); i++) {
    int b0 = a[i];
    int b1 = i + 1 < a.size() ? a[i + 1] : 255;
    int b2 = i + 2 < a.size() ? a[i + 2] : 255;
    int b3 = i + 3 < a.size() ? a[i + 3] : 255;

    if(b0 < 128) {
      result.push_back(b0);
    } else if(b0 < 194) {
      result.push_back(REPL_CHAR);
    } else if(b0 < 224) {
      if((b1 & 192) != 128) { result.push_back(REPL_CHAR); continue; }
      i++;
      result.push_back(((b0 & 31) << 6) + (b1 & 63));
    } else if(b0 < 240) {
      if((b1 & 192) != 128) { result.push_back(REPL_CHAR); continue; }
      if(b0 == 224 && b1 < 160) { result.push_back(REPL_CHAR); continue; };
      i++;
      if((b2 & 192) != 128) { result.push_back(REPL_CHAR); continue; }
      i++;
      result.push_back(((b0 & 15) << 12) + ((b1 & 63) << 6) + (b2 & 63));
    } else if(b0 < 245) {
      if((b1 & 192) != 128) { result.push_back(REPL_CHAR); continue; }
      if(b0 == 240 && b1 < 144) { result.push_back(REPL_CHAR); continue; };
      if(b0 == 244 && b1 >= 144) { result.push_back(REPL_CHAR); continue; };
      i++;
      if((b2 & 192) != 128) { result.push_back(REPL_CHAR); continue; }
      i++;
      if((b3 & 192) != 128) { result.push_back(REPL_CHAR); continue; }
      i++;
      result.push_back(((b0 & 7) << 18) + ((b1 & 63) << 12) + ((b2 & 63) << 6) + (b3 & 63));
    } else {
      result.push_back(REPL_CHAR);
    }
  }
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
xorl %ebp, %ebp
movslq %ebp, %r13
movq (%r14), %rsi
movq 0x8(%r14), %r8
subq %rsi, %r8
cmpq %r13, %r8
jbe 0x4cae
movzbl (%rsi,%r13), %edx
movl %edx, 0x4(%rsp)
leaq 0x1(%r13), %r12
movl $0xff, %ecx
movl $0xff, %eax
cmpq %r12, %r8
jbe 0x4af4
movzbl (%rsi,%r12), %eax
leaq 0x2(%r13), %r15
cmpq %r15, %r8
jbe 0x4b02
movzbl (%rsi,%r15), %ecx
addq $0x3, %r13
movl $0xff, %edi
cmpq %r13, %r8
jbe 0x4b15
movzbl (%rsi,%r13), %edi
leaq 0x4(%rsp), %rsi
testb %dl, %dl
jns 0x4b2a
leaq 0x894b(%rip), %rsi      # 0xd470
cmpb $-0x3e, %dl
jae 0x4b36
movq %rbx, %rdi
callq 0x76e4
incl %ebp
jmp 0x4abd
cmpb $-0x21, %dl
ja 0x4b6d
movl %eax, %ecx
andl $-0x40, %ecx
leaq 0x8929(%rip), %rsi      # 0xd470
cmpl $0x80, %ecx
jne 0x4b2a
andl $0x1f, %edx
shll $0x6, %edx
andl $0x3f, %eax
orl %edx, %eax
movl %eax, (%rsp)
movq %rbx, %rdi
movq %rsp, %rsi
callq 0xc5b4
movl %r12d, %ebp
jmp 0x4b32
cmpb $-0x11, %dl
ja 0x4bd6
movl %eax, %edi
andl $-0x40, %edi
leaq 0x88f2(%rip), %rsi      # 0xd470
cmpl $0x80, %edi
jne 0x4b2a
cmpl $0xe0, %edx
jne 0x4b9c
leaq 0x88db(%rip), %rsi      # 0xd470
cmpl $0xa0, %eax
jb 0x4b2a
movl %ecx, %esi
andl $-0x40, %esi
cmpl $0x80, %esi
jne 0x4c80
shll $0xc, %edx
movzwl %dx, %edx
andl $0x3f, %eax
shll $0x6, %eax
orl %edx, %eax
andl $0x3f, %ecx
orl %eax, %ecx
movl %ecx, (%rsp)
movq %rbx, %rdi
movq %rsp, %rsi
callq 0xc5b4
movl %r15d, %ebp
jmp 0x4b32
leaq 0x8893(%rip), %rsi      # 0xd470
cmpb $-0xc, %dl
ja 0x4b2a
movl %eax, %r8d
andl $-0x40, %r8d
leaq 0x887c(%rip), %rsi      # 0xd470
cmpl $0x80, %r8d
jne 0x4b2a
cmpl $0xf0, %edx
jne 0x4c1b
leaq 0x8860(%rip), %rsi      # 0xd470
cmpl $0x90, %eax
jb 0x4b2a
cmpl $0xf4, %edx
jne 0x4c35
leaq 0x8846(%rip), %rsi      # 0xd470
cmpl $0x8f, %eax
ja 0x4b2a
movl %ecx, %esi
andl $-0x40, %esi
cmpl $0x80, %esi
jne 0x4c80
movl %edi, %esi
andl $-0x40, %esi
cmpl $0x80, %esi
jne 0x4c97
andl $0x7, %edx
shll $0x12, %edx
andl $0x3f, %eax
shll $0xc, %eax
orl %edx, %eax
andl $0x3f, %ecx
shll $0x6, %ecx
orl %eax, %ecx
andl $0x3f, %edi
orl %ecx, %edi
movl %edi, (%rsp)
movq %rbx, %rdi
movq %rsp, %rsi
callq 0xc5b4
movl %r13d, %ebp
jmp 0x4b32
movq %rbx, %rdi
leaq 0x87e6(%rip), %rsi      # 0xd470
callq 0x76e4
movl %r12d, %ebp
jmp 0x4b32
movq %rbx, %rdi
leaq 0x87cf(%rip), %rsi      # 0xd470
callq 0x76e4
movl %r15d, %ebp
jmp 0x4b32
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4cc6
jmp 0x4cc6
jmp 0x4cc6
movq %rax, %r14
movq %rbx, %rdi
callq 0x9eba
movq %r14, %rdi
callq 0x43a0