// File: /workspace/github_cpp_makefile_star2_O2/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, 0x18(%rsp)
movq %rsi, %r12
movq %rdi, %r15
leaq 0x90(%rsp), %rdi
movq %rdx, 0xa8(%rsp)
callq 0x2fc60
leaq 0xb0(%rsp), %rdi
callq 0x25310
leaq 0x48(%rsp), %r14
leaq 0xc0(%rsp), %rbp
movq $0x0, (%rsp)
xorl %r13d, %r13d
movq $0x0, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
movq %rdx, %rsi
subq %r13, %rsi
jbe 0x301d2
movq (%rsp), %r8
movq %r8, %rbx
shlq $0x5, %rbx
leaq (%rax,%r13,4), %rdi
xorl %ecx, %ecx
movq %r8, %rax
cmpq %rcx, %rsi
je 0x2fea4
cmpl $0x0, (%rdi,%rcx,4)
jne 0x2fea9
incq %rax
incq %rcx
addq $0x20, %rbx
jmp 0x2fe8d
movq %rdx, %r13
jmp 0x2feac
addq %rcx, %r13
movq (%rsp), %rdi
addq %rcx, %rdi
movq 0x18(%rsp), %rdx
cmpq %rdx, %rdi
movq %rdx, %r15
cmovbq %rdi, %r15
cmpq %rax, %rdx
cmovbq %rdx, %rax
pushq $0x1
popq %rdx
subq %rax, %rdx
movq %rdi, (%rsp)
leaq (%rdi,%rdx), %rsi
movq 0x8(%rsp), %rdi
addq %rcx, %rdi
movq %rdi, 0x8(%rsp)
addq %rdi, %rdx
movq %rsi, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
leaq 0x30(%rsp), %rcx
xorps %xmm0, %xmm0
movups %xmm0, (%rcx)
andq $0x0, 0x10(%rcx)
movq %r14, 0x50(%rsp)
movq %r14, 0x48(%rsp)
andq $0x0, 0x58(%rsp)
leaq 0x60(%rsp), %rcx
movq %rcx, 0x68(%rsp)
movq %rcx, 0x60(%rsp)
andq $0x0, 0x70(%rsp)
leaq 0x78(%rsp), %rcx
movq %rcx, 0x80(%rsp)
movq %rcx, 0x78(%rsp)
andq $0x0, 0x88(%rsp)
shlq $0x5, %rax
subq %rax, %rbx
subq $0x1, %r15
jb 0x2ff69
movq (%r12), %rax
movq (%rax,%rbx), %rdx
leaq 0x20(%rsp), %rdi
pushq $0x20
popq %rsi
callq 0x30250
addq $0x20, %rbx
jmp 0x2ff48
movq %r13, %rbx
leaq (,%r13,4), %rdi
xorl %r15d, %r15d
movq 0x18(%rsp), %r13
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rdx, %rbx
jae 0x3008d
cmpq %r13, %r15
jb 0x2ffd8
movq %rdi, %rdx
leaq (%rax,%rdx), %rsi
cmpq %rcx, %rsi
je 0x3008d
cmpl $0x0, (%rsi)
jne 0x2ffbf
addq $0x4, %rdx
jmp 0x2ffa7
cmpq %rcx, %rsi
je 0x3008d
sarq $0x2, %rdx
subq %rbx, %rdx
cmpq %r13, %rdx
jae 0x3008d
movq %rdi, %rbp
movq %r13, %r14
movl (%rax,%rbx,4), %r13d
incq %r15
testl %r13d, %r13d
movl $0x0, %eax
cmovneq %rax, %r15
cmpl $0x3, %r13d
ja 0x30023
cmpl $0x1, %r13d
je 0x30023
movq (%rsp), %rax
shlq $0x5, %rax
testl %r13d, %r13d
movq (%r12), %rcx
movq (%rcx,%rax), %rdx
pushq $0x2d
popq %rsi
pushq $0x20
popq %rax
cmovel %eax, %esi
leaq 0x20(%rsp), %rdi
callq 0x30250
movl %r13d, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
jne 0x30053
movq 0xa8(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rsp), %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %rdx
leaq 0x20(%rsp), %rdi
pushq $0x2b
popq %rsi
callq 0x30250
xorl %eax, %eax
cmpl $0x1, %r13d
setne %al
addq %rax, (%rsp)
xorl %eax, %eax
cmpl $0x2, %r13d
setne %al
addq %rax, 0x8(%rsp)
incq %rbx
movq %rbp, %rdi
addq $0x4, %rdi
movq %r14, %r13
leaq 0x48(%rsp), %r14
leaq 0xc0(%rsp), %rbp
jmp 0x2ff7c
movq 0x38(%rsp), %rax
orq 0x30(%rsp), %rax
je 0x301c3
movq %rbp, %rdi
leaq 0x18aa6(%rip), %rsi     # 0x48b4d
callq 0x25440
movq 0x10(%rsp), %r15
cmpq $0x0, 0x38(%rsp)
je 0x3011d
movq %rbp, %rdi
leaq 0x182f4(%rip), %rsi     # 0x483b7
callq 0x25440
movq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x252f0
movq %rax, %rdi
leaq 0x18a72(%rip), %rsi     # 0x48b51
callq 0x25440
movq 0x40(%rsp), %rsi
addq 0x38(%rsp), %rsi
movq %rax, %rdi
callq 0x252f0
cmpq $0x0, 0x38(%rsp)
sete %cl
movq 0x30(%rsp), %rax
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x30122
movq %rbp, %rdi
leaq 0x1852b(%rip), %rsi     # 0x48643
callq 0x25440
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x30164
movq %rbp, %rdi
leaq 0x18a22(%rip), %rsi     # 0x48b53
callq 0x25440
movq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x252f0
movq %rax, %rdi
leaq 0x18a04(%rip), %rsi     # 0x48b51
callq 0x25440
movq 0x40(%rsp), %rsi
addq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x252f0
movq %rbp, %rdi
leaq 0x189e7(%rip), %rsi     # 0x48b55
callq 0x25440
movq %rbx, %r13
leaq 0x20(%rsp), %rdi
callq 0x3c3b8
movq %r14, %rbx
movq (%rbx), %rbx
cmpq %r14, %rbx
je 0x301b4
movsbl 0x10(%rbx), %esi
movq %rbp, %rdi
callq 0x25590
movq 0x18(%rbx), %rsi
movq %rax, %rdi
callq 0x25440
movq %rax, %rdi
leaq 0x17cbc(%rip), %rsi     # 0x47e69
callq 0x25440
jmp 0x30183
leaq 0x20(%rsp), %rdi
callq 0x302bc
jmp 0x2fe56
leaq 0x20(%rsp), %rdi
callq 0x302bc
movq 0x10(%rsp), %r15
leaq 0xc8(%rsp), %rsi
movq %r15, %rdi
callq 0x25870
leaq 0xb0(%rsp), %rdi
callq 0x25350
leaq 0x90(%rsp), %rdi
callq 0x42430
movq %r15, %rax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x3022e
movq %rax, %rbx
jmp 0x3023b
jmp 0x30221
jmp 0x30221
jmp 0x30221
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x302bc
leaq 0xb0(%rsp), %rdi
callq 0x25350
leaq 0x90(%rsp), %rdi
callq 0x42430
movq %rbx, %rdi
callq 0x25930