// File: /workspace/github_cpp_makefile_star2_O1/interimadd[P]M5Stack-PixelArt/test/lib/googletest/googletest/src/gtest.cc
// Function: testing::internal::edit_distance::CreateUnifiedDiff(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, unsigned long)
std::string CreateUnifiedDiff(const std::vector<std::string>& left,
                              const std::vector<std::string>& right,
                              size_t context) {
  const std::vector<EditType> edits = CalculateOptimalEdits(left, right);

  size_t l_i = 0, r_i = 0, edit_i = 0;
  std::stringstream ss;
  while (edit_i < edits.size()) {
    // Find first edit.
    while (edit_i < edits.size() && edits[edit_i] == kMatch) {
      ++l_i;
      ++r_i;
      ++edit_i;
    }

    // Find the first line to include in the hunk.
    const size_t prefix_context = std::min(l_i, context);
    Hunk hunk(l_i - prefix_context + 1, r_i - prefix_context + 1);
    for (size_t i = prefix_context; i > 0; --i) {
      hunk.PushLine(' ', left[l_i - i].c_str());
    }

    // Iterate the edits until we found enough suffix for the hunk or the input
    // is over.
    size_t n_suffix = 0;
    for (; edit_i < edits.size(); ++edit_i) {
      if (n_suffix >= context) {
        // Continue only if the next hunk is very close.
        std::vector<EditType>::const_iterator it = edits.begin() + edit_i;
        while (it != edits.end() && *it == kMatch) ++it;
        if (it == edits.end() || (it - edits.begin()) - edit_i >= context) {
          // There is no next edit or it is too far away.
          break;
        }
      }

      EditType edit = edits[edit_i];
      // Reset count when a non match is found.
      n_suffix = edit == kMatch ? n_suffix + 1 : 0;

      if (edit == kMatch || edit == kRemove || edit == kReplace) {
        hunk.PushLine(edit == kMatch ? ' ' : '-', left[l_i].c_str());
      }
      if (edit == kAdd || edit == kReplace) {
        hunk.PushLine('+', right[r_i].c_str());
      }

      // Advance indices, depending on edit type.
      l_i += edit != kAdd;
      r_i += edit != kRemove;
    }

    if (!hunk.has_edits()) {
      // We are done. We don't want this hunk.
      break;
    }

    hunk.PrintTo(&ss);
  }
  return ss.str();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rcx, 0x8(%rsp)
movq %rdi, 0xa0(%rsp)
leaq 0x10(%rsp), %rdi
movq %rsi, 0x98(%rsp)
movq %rdx, 0xa8(%rsp)
callq 0x2acf2
leaq 0xb0(%rsp), %rdi
callq 0x1d310
leaq 0x50(%rsp), %r12
leaq 0x68(%rsp), %rbp
xorl %ebx, %ebx
xorl %r13d, %r13d
xorl %r14d, %r14d
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
subq %rcx, %rax
sarq $0x2, %rax
cmpq %rax, %r13
jae 0x2b3ba
leaq (%rbx,%rax), %rdx
subq %r13, %rdx
leaq (%r14,%rax), %rsi
subq %r13, %rsi
cmpl $0x0, (%rcx,%r13,4)
jne 0x2af9b
incq %rbx
incq %r14
incq %r13
cmpq %r13, %rax
jne 0x2af7d
movq %rdx, %rbx
movq %rax, %r13
movq %rsi, %r14
movq 0x8(%rsp), %r15
cmpq %r15, %rbx
cmovbq %rbx, %r15
movq %rbx, %rax
subq %r15, %rax
incq %rax
movq %r14, %rcx
subq %r15, %rcx
incq %rcx
movq %rax, 0x28(%rsp)
movq %rcx, 0x30(%rsp)
leaq 0x38(%rsp), %rax
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %r12, 0x58(%rsp)
movq %r12, 0x50(%rsp)
movq %rcx, 0x60(%rsp)
movq %rbp, 0x70(%rsp)
movq %rbp, 0x68(%rsp)
movq %rcx, 0x78(%rsp)
leaq 0x80(%rsp), %rax
movq %rax, 0x88(%rsp)
movq %rax, 0x80(%rsp)
movq %rcx, 0x90(%rsp)
testq %r15, %r15
je 0x2b04f
movq %rbx, %r12
shlq $0x5, %r12
movq %r15, %rax
shlq $0x5, %rax
subq %rax, %r12
movq 0x98(%rsp), %rax
movq (%rax), %rax
movq (%rax,%r12), %rdx
leaq 0x28(%rsp), %rdi
movl $0x20, %esi
callq 0x2b47c
addq $0x20, %r12
decq %r15
jne 0x2b028
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rdx, %r13
jae 0x2b177
xorl %r15d, %r15d
cmpq 0x8(%rsp), %r15
jb 0x2b0a8
leaq (%rax,%r13,4), %rdx
cmpq %rcx, %rdx
je 0x2b08a
cmpl $0x0, (%rdx)
jne 0x2b08a
addq $0x4, %rdx
jmp 0x2b07a
cmpq %rcx, %rdx
je 0x2b177
subq %rax, %rdx
sarq $0x2, %rdx
subq %r13, %rdx
cmpq 0x8(%rsp), %rdx
jae 0x2b177
movl (%rax,%r13,4), %ebp
incq %r15
testl %ebp, %ebp
movl $0x0, %eax
cmovneq %rax, %r15
cmpl $0x3, %ebp
ja 0x2b0f3
cmpl $0x1, %ebp
je 0x2b0f3
movq %rbx, %rax
shlq $0x5, %rax
testl %ebp, %ebp
movq 0x98(%rsp), %rcx
movq (%rcx), %rcx
movq (%rcx,%rax), %rdx
movl $0x2d, %esi
movl $0x20, %eax
cmovel %eax, %esi
leaq 0x28(%rsp), %rdi
callq 0x2b47c
movl %ebp, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
jne 0x2b13c
movq 0xa8(%rsp), %rax
movq (%rax), %rax
movq %r14, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %r12
incq 0x38(%rsp)
movl $0x20, %edi
callq 0x1d430
movb $0x2b, 0x10(%rax)
movq %r12, 0x18(%rax)
movq %rax, %rdi
leaq 0x68(%rsp), %rsi
callq 0x1d090
incq 0x78(%rsp)
xorl %eax, %eax
cmpl $0x1, %ebp
setne %al
addq %rax, %rbx
xorl %eax, %eax
cmpl $0x2, %ebp
setne %al
addq %rax, %r14
incq %r13
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rdx, %r13
leaq 0x68(%rsp), %rbp
jb 0x2b06f
movq 0x40(%rsp), %rax
orq 0x38(%rsp), %rax
setne 0x6(%rsp)
je 0x2b342
movl $0x3, %edx
leaq 0xc0(%rsp), %rdi
leaq 0x219ad(%rip), %rsi     # 0x4cb4d
callq 0x1d540
cmpq $0x0, 0x40(%rsp)
je 0x2b201
movl $0x1, %edx
leaq 0xc0(%rsp), %rdi
leaq 0x211f6(%rip), %rsi     # 0x4c3b7
callq 0x1d540
movq 0x28(%rsp), %rsi
leaq 0xc0(%rsp), %rdi
callq 0x1d2e0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x21967(%rip), %rsi     # 0x4cb51
callq 0x1d540
movq 0x48(%rsp), %rsi
addq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x1d2e0
cmpq $0x0, 0x40(%rsp)
je 0x2b22a
cmpq $0x0, 0x38(%rsp)
je 0x2b22a
movl $0x1, %edx
leaq 0xc0(%rsp), %rdi
leaq 0x2141e(%rip), %rsi     # 0x4c643
callq 0x1d540
cmpq $0x0, 0x38(%rsp)
je 0x2b286
movl $0x1, %edx
leaq 0xc0(%rsp), %rdi
leaq 0x2190d(%rip), %rsi     # 0x4cb53
callq 0x1d540
movq 0x30(%rsp), %rsi
leaq 0xc0(%rsp), %rdi
callq 0x1d2e0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x218e2(%rip), %rsi     # 0x4cb51
callq 0x1d540
movq 0x48(%rsp), %rsi
addq 0x38(%rsp), %rsi
movq %r15, %rdi
callq 0x1d2e0
movl $0x4, %edx
leaq 0xc0(%rsp), %rdi
leaq 0x218bb(%rip), %rsi     # 0x4cb55
callq 0x1d540
leaq 0x28(%rsp), %rdi
callq 0x3ee02
movq 0x50(%rsp), %r12
leaq 0x50(%rsp), %rax
cmpq %rax, %r12
je 0x2b342
movb 0x10(%r12), %al
movb %al, 0x7(%rsp)
movl $0x1, %edx
leaq 0xc0(%rsp), %rdi
leaq 0x7(%rsp), %rsi
callq 0x1d540
movq %rax, %r15
movq 0x18(%r12), %rbp
testq %rbp, %rbp
je 0x2b306
movq %rbp, %rdi
callq 0x1d1e0
movq %r15, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x1d540
leaq 0x68(%rsp), %rbp
jmp 0x2b325
movq (%r15), %rax
movq -0x18(%rax), %rax
movq %r15, %rdi
addq %rax, %rdi
movl 0x20(%r15,%rax), %esi
orl $0x1, %esi
callq 0x1d890
leaq 0x68(%rsp), %rbp
movl $0x1, %edx
movq %r15, %rdi
leaq 0x20b35(%rip), %rsi     # 0x4be69
callq 0x1d540
movq (%r12), %r12
jmp 0x2b2ae
movq 0x80(%rsp), %rdi
leaq 0x80(%rsp), %r12
cmpq %r12, %rdi
je 0x2b36c
movq (%rdi), %r15
movl $0x20, %esi
callq 0x1d460
movq %r15, %rdi
cmpq %r12, %r15
jne 0x2b357
movq 0x68(%rsp), %rdi
cmpq %rbp, %rdi
leaq 0x50(%rsp), %r12
je 0x2b390
movq (%rdi), %r15
movl $0x20, %esi
callq 0x1d460
movq %r15, %rdi
cmpq %rbp, %r15
jne 0x2b37b
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x2b3af
movq (%rdi), %r15
movl $0x20, %esi
callq 0x1d460
movq %r15, %rdi
cmpq %r12, %r15
jne 0x2b39a
cmpb $0x0, 0x6(%rsp)
jne 0x2af55
leaq 0xc8(%rsp), %rsi
movq 0xa0(%rsp), %rbx
movq %rbx, %rdi
callq 0x1d820
movq 0x34bc7(%rip), %rsi     # 0x5ffa0
leaq 0xb0(%rsp), %rdi
callq 0x1d340
leaq 0x130(%rsp), %rdi
callq 0x1d170
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2b40a
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x1d460
movq %rbx, %rax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2b43c
movq %rax, %rbx
jmp 0x2b45d
jmp 0x2b42f
jmp 0x2b42f
jmp 0x2b42f
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x2b504
movq 0x34b5d(%rip), %rsi     # 0x5ffa0
leaq 0xb0(%rsp), %rdi
callq 0x1d340
leaq 0x130(%rsp), %rdi
callq 0x1d170
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2b474
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x1d460
movq %rbx, %rdi
callq 0x1d900