// File: /workspace/github_c_makefile_star2_O1/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, 0x8(%rsp)
movq %rdi, 0xa0(%rsp)
leaq 0x10(%rsp), %rdi
movq %rsi, 0x98(%rsp)
movq %rdx, 0xa8(%rsp)
callq 0x137ca
leaq 0xb0(%rsp), %rdi
callq 0xc3f0
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 0x13e92
leaq (%rbx,%rax), %rdx
subq %r13, %rdx
leaq (%r14,%rax), %rsi
subq %r13, %rsi
cmpl $0x0, (%rcx,%r13,4)
jne 0x13a73
incq %rbx
incq %r14
incq %r13
cmpq %r13, %rax
jne 0x13a55
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 0x13b27
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 0x13f54
addq $0x20, %r12
decq %r15
jne 0x13b00
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rdx, %r13
jae 0x13c4f
xorl %r15d, %r15d
cmpq 0x8(%rsp), %r15
jb 0x13b80
leaq (%rax,%r13,4), %rdx
cmpq %rcx, %rdx
je 0x13b62
cmpl $0x0, (%rdx)
jne 0x13b62
addq $0x4, %rdx
jmp 0x13b52
cmpq %rcx, %rdx
je 0x13c4f
subq %rax, %rdx
sarq $0x2, %rdx
subq %r13, %rdx
cmpq 0x8(%rsp), %rdx
jae 0x13c4f
movl (%rax,%r13,4), %ebp
incq %r15
testl %ebp, %ebp
movl $0x0, %eax
cmovneq %rax, %r15
cmpl $0x3, %ebp
ja 0x13bcb
cmpl $0x1, %ebp
je 0x13bcb
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 0x13f54
movl %ebp, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
jne 0x13c14
movq 0xa8(%rsp), %rax
movq (%rax), %rax
movq %r14, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %r12
incq 0x38(%rsp)
movl $0x20, %edi
callq 0xc5d0
movb $0x2b, 0x10(%rax)
movq %r12, 0x18(%rax)
movq %rax, %rdi
leaq 0x68(%rsp), %rsi
callq 0xc0a0
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 0x13b47
movq 0x40(%rsp), %rax
orq 0x38(%rsp), %rax
setne 0x6(%rsp)
je 0x13e1a
movl $0x3, %edx
leaq 0xc0(%rsp), %rdi
leaq 0x4087a(%rip), %rsi     # 0x544f2
callq 0xc700
cmpq $0x0, 0x40(%rsp)
je 0x13cd9
movl $0x1, %edx
leaq 0xc0(%rsp), %rdi
leaq 0x40188(%rip), %rsi     # 0x53e21
callq 0xc700
movq 0x28(%rsp), %rsi
leaq 0xc0(%rsp), %rdi
callq 0xc3c0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x40834(%rip), %rsi     # 0x544f6
callq 0xc700
movq 0x48(%rsp), %rsi
addq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0xc3c0
cmpq $0x0, 0x40(%rsp)
je 0x13d02
cmpq $0x0, 0x38(%rsp)
je 0x13d02
movl $0x1, %edx
leaq 0xc0(%rsp), %rdi
leaq 0x3f43c(%rip), %rsi     # 0x53139
callq 0xc700
cmpq $0x0, 0x38(%rsp)
je 0x13d5e
movl $0x1, %edx
leaq 0xc0(%rsp), %rdi
leaq 0x407da(%rip), %rsi     # 0x544f8
callq 0xc700
movq 0x30(%rsp), %rsi
leaq 0xc0(%rsp), %rdi
callq 0xc3c0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x407af(%rip), %rsi     # 0x544f6
callq 0xc700
movq 0x48(%rsp), %rsi
addq 0x38(%rsp), %rsi
movq %r15, %rdi
callq 0xc3c0
movl $0x4, %edx
leaq 0xc0(%rsp), %rdi
leaq 0x40788(%rip), %rsi     # 0x544fa
callq 0xc700
leaq 0x28(%rsp), %rdi
callq 0x27bba
movq 0x50(%rsp), %r12
leaq 0x50(%rsp), %rax
cmpq %rax, %r12
je 0x13e1a
movb 0x10(%r12), %al
movb %al, 0x7(%rsp)
movl $0x1, %edx
leaq 0xc0(%rsp), %rdi
leaq 0x7(%rsp), %rsi
callq 0xc700
movq %rax, %r15
movq 0x18(%r12), %rbp
testq %rbp, %rbp
je 0x13dde
movq %rbp, %rdi
callq 0xc260
movq %r15, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0xc700
leaq 0x68(%rsp), %rbp
jmp 0x13dfd
movq (%r15), %rax
movq -0x18(%rax), %rax
movq %r15, %rdi
addq %rax, %rdi
movl 0x20(%r15,%rax), %esi
orl $0x1, %esi
callq 0xcb40
leaq 0x68(%rsp), %rbp
movl $0x1, %edx
movq %r15, %rdi
leaq 0x3fa7c(%rip), %rsi     # 0x53888
callq 0xc700
movq (%r12), %r12
jmp 0x13d86
movq 0x80(%rsp), %rdi
leaq 0x80(%rsp), %r12
cmpq %r12, %rdi
je 0x13e44
movq (%rdi), %r15
movl $0x20, %esi
callq 0xc600
movq %r15, %rdi
cmpq %r12, %r15
jne 0x13e2f
movq 0x68(%rsp), %rdi
cmpq %rbp, %rdi
leaq 0x50(%rsp), %r12
je 0x13e68
movq (%rdi), %r15
movl $0x20, %esi
callq 0xc600
movq %r15, %rdi
cmpq %rbp, %r15
jne 0x13e53
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x13e87
movq (%rdi), %r15
movl $0x20, %esi
callq 0xc600
movq %r15, %rdi
cmpq %r12, %r15
jne 0x13e72
cmpb $0x0, 0x6(%rsp)
jne 0x13a2d
leaq 0xc8(%rsp), %rsi
movq 0xa0(%rsp), %rbx
movq %rbx, %rdi
callq 0xca80
movq 0x5f0ef(%rip), %rsi     # 0x72fa0
leaq 0xb0(%rsp), %rdi
callq 0xc440
leaq 0x130(%rsp), %rdi
callq 0xc1d0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x13ee2
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0xc600
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 0x13f14
movq %rax, %rbx
jmp 0x13f35
jmp 0x13f07
jmp 0x13f07
jmp 0x13f07
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x13fdc
movq 0x5f085(%rip), %rsi     # 0x72fa0
leaq 0xb0(%rsp), %rdi
callq 0xc440
leaq 0x130(%rsp), %rdi
callq 0xc1d0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x13f4c
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0xc600
movq %rbx, %rdi
callq 0xcbb0