// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/unittest/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 0x1237c
leaq 0xb0(%rsp), %rdi
callq 0xd3f0
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 0x128ee
movq (%rsp), %r8
movq %r8, %rbx
shlq $0x5, %rbx
leaq (%rax,%r13,4), %rdi
xorl %ecx, %ecx
movq %r8, %rax
cmpq %rcx, %rsi
je 0x125c0
cmpl $0x0, (%rdi,%rcx,4)
jne 0x125c5
incq %rax
incq %rcx
addq $0x20, %rbx
jmp 0x125a9
movq %rdx, %r13
jmp 0x125c8
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 0x12685
movq (%r12), %rax
movq (%rax,%rbx), %rdx
leaq 0x20(%rsp), %rdi
pushq $0x20
popq %rsi
callq 0x1296c
addq $0x20, %rbx
jmp 0x12664
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 0x127a9
cmpq %r13, %r15
jb 0x126f4
movq %rdi, %rdx
leaq (%rax,%rdx), %rsi
cmpq %rcx, %rsi
je 0x127a9
cmpl $0x0, (%rsi)
jne 0x126db
addq $0x4, %rdx
jmp 0x126c3
cmpq %rcx, %rsi
je 0x127a9
sarq $0x2, %rdx
subq %rbx, %rdx
cmpq %r13, %rdx
jae 0x127a9
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 0x1273f
cmpl $0x1, %r13d
je 0x1273f
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 0x1296c
movl %r13d, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
jne 0x1276f
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 0x1296c
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 0x12698
movq 0x38(%rsp), %rax
orq 0x30(%rsp), %rax
je 0x128df
movq %rbp, %rdi
leaq 0x32d2f(%rip), %rsi     # 0x454f2
callq 0xd5e0
movq 0x10(%rsp), %r15
cmpq $0x0, 0x38(%rsp)
je 0x12839
movq %rbp, %rdi
leaq 0x32642(%rip), %rsi     # 0x44e21
callq 0xd5e0
movq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0xd3d0
movq %rax, %rdi
leaq 0x32cfb(%rip), %rsi     # 0x454f6
callq 0xd5e0
movq 0x40(%rsp), %rsi
addq 0x38(%rsp), %rsi
movq %rax, %rdi
callq 0xd3d0
cmpq $0x0, 0x38(%rsp)
sete %cl
movq 0x30(%rsp), %rax
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x1283e
movq %rbp, %rdi
leaq 0x31905(%rip), %rsi     # 0x44139
callq 0xd5e0
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x12880
movq %rbp, %rdi
leaq 0x32cab(%rip), %rsi     # 0x454f8
callq 0xd5e0
movq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0xd3d0
movq %rax, %rdi
leaq 0x32c8d(%rip), %rsi     # 0x454f6
callq 0xd5e0
movq 0x40(%rsp), %rsi
addq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0xd3d0
movq %rbp, %rdi
leaq 0x32c70(%rip), %rsi     # 0x454fa
callq 0xd5e0
movq %rbx, %r13
leaq 0x20(%rsp), %rdi
callq 0x1ec9c
movq %r14, %rbx
movq (%rbx), %rbx
cmpq %r14, %rbx
je 0x128d0
movsbl 0x10(%rbx), %esi
movq %rbp, %rdi
callq 0xd750
movq 0x18(%rbx), %rsi
movq %rax, %rdi
callq 0xd5e0
movq %rax, %rdi
leaq 0x31fbf(%rip), %rsi     # 0x44888
callq 0xd5e0
jmp 0x1289f
leaq 0x20(%rsp), %rdi
callq 0x129d8
jmp 0x12572
leaq 0x20(%rsp), %rdi
callq 0x129d8
movq 0x10(%rsp), %r15
leaq 0xc8(%rsp), %rsi
movq %r15, %rdi
callq 0xdad0
leaq 0xb0(%rsp), %rdi
callq 0xd450
leaq 0x90(%rsp), %rdi
callq 0x24e50
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 0x1294a
movq %rax, %rbx
jmp 0x12957
jmp 0x1293d
jmp 0x1293d
jmp 0x1293d
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x129d8
leaq 0xb0(%rsp), %rdi
callq 0xd450
leaq 0x90(%rsp), %rdi
callq 0x24e50
movq %rbx, %rdi
callq 0xdbf0