// File: /workspace/github_cpp_makefile_star2_O3/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 $0x248, %rsp            # imm = 0x248
movq %rcx, 0x18(%rsp)
movq %rsi, %r12
movq %rdi, 0xb0(%rsp)
leaq 0x20(%rsp), %rdi
movq %rdx, 0xb8(%rsp)
callq 0x2a5e9
leaq 0xc0(%rsp), %rdi
callq 0x1d310
xorl %ebx, %ebx
xorl %r13d, %r13d
xorl %ebp, %ebp
movq %r12, 0xa8(%rsp)
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rdx, %r13
jae 0x2ad03
leaq (%rbx,%rdx), %rsi
subq %r13, %rsi
leaq (%rdx,%rbp), %rdi
subq %r13, %rdi
cmpl $0x0, (%rax,%r13,4)
jne 0x2a88e
incq %rbx
incq %rbp
incq %r13
cmpq %r13, %rdx
jne 0x2a870
movq %rsi, %rbx
movq %rdx, %r13
movq %rdi, %rbp
movq 0x18(%rsp), %r14
cmpq %r14, %rbx
cmovbq %rbx, %r14
movq %rbx, %rsi
subq %r14, %rsi
incq %rsi
movq %rbp, %rdi
subq %r14, %rdi
incq %rdi
movq %rsi, 0x38(%rsp)
movq %rdi, 0x40(%rsp)
leaq 0x48(%rsp), %rsi
xorl %edi, %edi
movq %rdi, 0x10(%rsi)
xorps %xmm0, %xmm0
movups %xmm0, (%rsi)
leaq 0x60(%rsp), %rsi
movq %rsi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq %rdi, 0x70(%rsp)
leaq 0x78(%rsp), %rsi
movq %rsi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdi, 0x88(%rsp)
leaq 0x90(%rsp), %rsi
movq %rsi, 0x98(%rsp)
movq %rsi, 0x90(%rsp)
movq %rdi, 0xa0(%rsp)
testq %r14, %r14
je 0x2a95f
movq %rbx, %r15
shlq $0x5, %r15
movq %r14, %rax
shlq $0x5, %rax
subq %rax, %r15
movq (%r12), %rax
movq (%rax,%r15), %rdx
leaq 0x38(%rsp), %rdi
movl $0x20, %esi
callq 0x2adc6
addq $0x20, %r15
decq %r14
jne 0x2a92b
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rdx, %r13
jae 0x2aaa1
leaq (,%r13,4), %r14
xorl %edi, %edi
cmpq 0x18(%rsp), %rdi
jb 0x2a9bf
leaq (%rax,%r13,4), %rsi
cmpq %rcx, %rsi
je 0x2aaa1
leaq (%rax,%r14), %rdx
subq %rax, %rdx
cmpl $0x0, (%rsi)
jne 0x2a9a4
addq $0x4, %rsi
addq $0x4, %rdx
cmpq %rcx, %rsi
jne 0x2a98d
jmp 0x2aaa1
cmpq %rcx, %rsi
je 0x2aaa1
sarq $0x2, %rdx
subq %r13, %rdx
cmpq 0x18(%rsp), %rdx
jae 0x2aaa1
movl (%rax,%r13,4), %r12d
incq %rdi
testl %r12d, %r12d
movl $0x0, %eax
cmovneq %rax, %rdi
movq %rdi, 0x10(%rsp)
cmpl $0x3, %r12d
ja 0x2aa13
cmpl $0x1, %r12d
je 0x2aa13
movq %rbx, %rax
shlq $0x5, %rax
testl %r12d, %r12d
movq 0xa8(%rsp), %rcx
movq (%rcx), %rcx
movq (%rcx,%rax), %rdx
movl $0x2d, %esi
movl $0x20, %eax
cmovel %eax, %esi
leaq 0x38(%rsp), %rdi
callq 0x2adc6
movl %r12d, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
jne 0x2aa60
movq 0xb8(%rsp), %rax
movq (%rax), %rax
movq %rbp, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %r15
incq 0x48(%rsp)
movl $0x20, %edi
callq 0x1d430
movb $0x2b, 0x10(%rax)
movq %r15, 0x18(%rax)
movq %rax, %rdi
leaq 0x78(%rsp), %rsi
callq 0x1d090
incq 0x88(%rsp)
xorl %eax, %eax
cmpl $0x1, %r12d
setne %al
addq %rax, %rbx
xorl %eax, %eax
cmpl $0x2, %r12d
setne %al
addq %rax, %rbp
incq %r13
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
addq $0x4, %r14
cmpq %rdx, %r13
movq 0x10(%rsp), %rdi
jb 0x2a972
movq 0x50(%rsp), %rax
orq 0x48(%rsp), %rax
setne 0x10(%rsp)
je 0x2ac79
movl $0x3, %edx
leaq 0xd0(%rsp), %rdi
leaq 0x220b3(%rip), %rsi     # 0x4cb7d
callq 0x1d540
leaq 0x60(%rsp), %r14
cmpq $0x0, 0x50(%rsp)
je 0x2ab65
movl $0x1, %edx
leaq 0xd0(%rsp), %rdi
leaq 0x218f3(%rip), %rsi     # 0x4c3e7
callq 0x1d540
movq 0x38(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
callq 0x1d2e0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x22064(%rip), %rsi     # 0x4cb81
callq 0x1d540
movq 0x58(%rsp), %rsi
addq 0x50(%rsp), %rsi
movq %r15, %rdi
callq 0x1d2e0
cmpq $0x0, 0x50(%rsp)
sete %cl
movq 0x48(%rsp), %rax
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x2ab6a
movl $0x1, %edx
leaq 0xd0(%rsp), %rdi
leaq 0x21b13(%rip), %rsi     # 0x4c673
callq 0x1d540
movq 0x48(%rsp), %rax
testq %rax, %rax
je 0x2abc3
movl $0x1, %edx
leaq 0xd0(%rsp), %rdi
leaq 0x22000(%rip), %rsi     # 0x4cb83
callq 0x1d540
movq 0x40(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
callq 0x1d2e0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x21fd5(%rip), %rsi     # 0x4cb81
callq 0x1d540
movq 0x58(%rsp), %rsi
addq 0x48(%rsp), %rsi
movq %r15, %rdi
callq 0x1d2e0
movl $0x4, %edx
leaq 0xd0(%rsp), %rdi
leaq 0x21fae(%rip), %rsi     # 0x4cb85
callq 0x1d540
leaq 0x38(%rsp), %rdi
callq 0x3e41a
movq 0x60(%rsp), %r12
cmpq %r14, %r12
je 0x2ac79
movb 0x10(%r12), %al
movb %al, 0xf(%rsp)
movl $0x1, %edx
leaq 0xd0(%rsp), %rdi
leaq 0xf(%rsp), %rsi
callq 0x1d540
movq %rax, %r15
movq 0x18(%r12), %r14
testq %r14, %r14
je 0x2ac39
movq %r14, %rdi
callq 0x1d1e0
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1d540
jmp 0x2ac53
movq (%r15), %rax
movq -0x18(%rax), %rax
movq %r15, %rdi
addq %rax, %rdi
movl 0x20(%r15,%rax), %esi
orl $0x1, %esi
callq 0x1d890
movl $0x1, %edx
movq %r15, %rdi
leaq 0x21237(%rip), %rsi     # 0x4be99
callq 0x1d540
movq (%r12), %r12
leaq 0x60(%rsp), %rax
cmpq %rax, %r12
jne 0x2abf4
movq 0x90(%rsp), %rdi
leaq 0x90(%rsp), %r15
cmpq %r15, %rdi
je 0x2aca3
movq (%rdi), %r14
movl $0x20, %esi
callq 0x1d460
movq %r14, %rdi
cmpq %r15, %r14
jne 0x2ac8e
movq 0x78(%rsp), %rdi
leaq 0x78(%rsp), %r15
cmpq %r15, %rdi
movq 0xa8(%rsp), %r12
je 0x2accf
movq (%rdi), %r14
movl $0x20, %esi
callq 0x1d460
movq %r14, %rdi
cmpq %r15, %r14
jne 0x2acba
movq 0x60(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x2acf8
movq (%rdi), %r14
movl $0x20, %esi
callq 0x1d460
movq %r14, %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %r14
jne 0x2acde
cmpb $0x0, 0x10(%rsp)
jne 0x2a845
leaq 0xd8(%rsp), %rsi
movq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0x1d820
movq 0x3527e(%rip), %rsi     # 0x5ffa0
leaq 0xc0(%rsp), %rdi
callq 0x1d340
leaq 0x140(%rsp), %rdi
callq 0x1d170
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x2ad53
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x1d460
movq %rbx, %rax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2ad85
movq %rax, %rbx
jmp 0x2ada6
jmp 0x2ad78
jmp 0x2ad78
jmp 0x2ad78
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x2ae4e
movq 0x35214(%rip), %rsi     # 0x5ffa0
leaq 0xc0(%rsp), %rdi
callq 0x1d340
leaq 0x140(%rsp), %rdi
callq 0x1d170
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x2adbd
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x1d460
movq %rbx, %rdi
callq 0x1d900
nop