// File: /workspace/github_c_makefile_star2_O3/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 $0x248, %rsp            # imm = 0x248
movq %rcx, 0x18(%rsp)
movq %rsi, %r12
movq %rdi, 0xb0(%rsp)
leaq 0x20(%rsp), %rdi
movq %rdx, 0xb8(%rsp)
callq 0x136f5
leaq 0xc0(%rsp), %rdi
callq 0xc3f0
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 0x13e0f
leaq (%rbx,%rdx), %rsi
subq %r13, %rsi
leaq (%rdx,%rbp), %rdi
subq %r13, %rdi
cmpl $0x0, (%rax,%r13,4)
jne 0x1399a
incq %rbx
incq %rbp
incq %r13
cmpq %r13, %rdx
jne 0x1397c
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 0x13a6b
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 0x13ed2
addq $0x20, %r15
decq %r14
jne 0x13a37
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rdx, %r13
jae 0x13bad
leaq (,%r13,4), %r14
xorl %edi, %edi
cmpq 0x18(%rsp), %rdi
jb 0x13acb
leaq (%rax,%r13,4), %rsi
cmpq %rcx, %rsi
je 0x13bad
leaq (%rax,%r14), %rdx
subq %rax, %rdx
cmpl $0x0, (%rsi)
jne 0x13ab0
addq $0x4, %rsi
addq $0x4, %rdx
cmpq %rcx, %rsi
jne 0x13a99
jmp 0x13bad
cmpq %rcx, %rsi
je 0x13bad
sarq $0x2, %rdx
subq %r13, %rdx
cmpq 0x18(%rsp), %rdx
jae 0x13bad
movl (%rax,%r13,4), %r12d
incq %rdi
testl %r12d, %r12d
movl $0x0, %eax
cmovneq %rax, %rdi
movq %rdi, 0x10(%rsp)
cmpl $0x3, %r12d
ja 0x13b1f
cmpl $0x1, %r12d
je 0x13b1f
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 0x13ed2
movl %r12d, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
jne 0x13b6c
movq 0xb8(%rsp), %rax
movq (%rax), %rax
movq %rbp, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %r15
incq 0x48(%rsp)
movl $0x20, %edi
callq 0xc5d0
movb $0x2b, 0x10(%rax)
movq %r15, 0x18(%rax)
movq %rax, %rdi
leaq 0x78(%rsp), %rsi
callq 0xc0a0
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 0x13a7e
movq 0x50(%rsp), %rax
orq 0x48(%rsp), %rax
setne 0x10(%rsp)
je 0x13d85
movl $0x3, %edx
leaq 0xd0(%rsp), %rdi
leaq 0x3f94c(%rip), %rsi     # 0x53522
callq 0xc700
leaq 0x60(%rsp), %r14
cmpq $0x0, 0x50(%rsp)
je 0x13c71
movl $0x1, %edx
leaq 0xd0(%rsp), %rdi
leaq 0x3f251(%rip), %rsi     # 0x52e51
callq 0xc700
movq 0x38(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
callq 0xc3c0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3f8fd(%rip), %rsi     # 0x53526
callq 0xc700
movq 0x58(%rsp), %rsi
addq 0x50(%rsp), %rsi
movq %r15, %rdi
callq 0xc3c0
cmpq $0x0, 0x50(%rsp)
sete %cl
movq 0x48(%rsp), %rax
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x13c76
movl $0x1, %edx
leaq 0xd0(%rsp), %rdi
leaq 0x3e4fd(%rip), %rsi     # 0x52169
callq 0xc700
movq 0x48(%rsp), %rax
testq %rax, %rax
je 0x13ccf
movl $0x1, %edx
leaq 0xd0(%rsp), %rdi
leaq 0x3f899(%rip), %rsi     # 0x53528
callq 0xc700
movq 0x40(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
callq 0xc3c0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3f86e(%rip), %rsi     # 0x53526
callq 0xc700
movq 0x58(%rsp), %rsi
addq 0x48(%rsp), %rsi
movq %r15, %rdi
callq 0xc3c0
movl $0x4, %edx
leaq 0xd0(%rsp), %rdi
leaq 0x3f847(%rip), %rsi     # 0x5352a
callq 0xc700
leaq 0x38(%rsp), %rdi
callq 0x27802
movq 0x60(%rsp), %r12
cmpq %r14, %r12
je 0x13d85
movb 0x10(%r12), %al
movb %al, 0xf(%rsp)
movl $0x1, %edx
leaq 0xd0(%rsp), %rdi
leaq 0xf(%rsp), %rsi
callq 0xc700
movq %rax, %r15
movq 0x18(%r12), %r14
testq %r14, %r14
je 0x13d45
movq %r14, %rdi
callq 0xc260
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xc700
jmp 0x13d5f
movq (%r15), %rax
movq -0x18(%rax), %rax
movq %r15, %rdi
addq %rax, %rdi
movl 0x20(%r15,%rax), %esi
orl $0x1, %esi
callq 0xcb40
movl $0x1, %edx
movq %r15, %rdi
leaq 0x3eb4a(%rip), %rsi     # 0x528b8
callq 0xc700
movq (%r12), %r12
leaq 0x60(%rsp), %rax
cmpq %rax, %r12
jne 0x13d00
movq 0x90(%rsp), %rdi
leaq 0x90(%rsp), %r15
cmpq %r15, %rdi
je 0x13daf
movq (%rdi), %r14
movl $0x20, %esi
callq 0xc600
movq %r14, %rdi
cmpq %r15, %r14
jne 0x13d9a
movq 0x78(%rsp), %rdi
leaq 0x78(%rsp), %r15
cmpq %r15, %rdi
movq 0xa8(%rsp), %r12
je 0x13ddb
movq (%rdi), %r14
movl $0x20, %esi
callq 0xc600
movq %r14, %rdi
cmpq %r15, %r14
jne 0x13dc6
movq 0x60(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x13e04
movq (%rdi), %r14
movl $0x20, %esi
callq 0xc600
movq %r14, %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %r14
jne 0x13dea
cmpb $0x0, 0x10(%rsp)
jne 0x13951
leaq 0xd8(%rsp), %rsi
movq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0xca80
movq 0x5e172(%rip), %rsi     # 0x71fa0
leaq 0xc0(%rsp), %rdi
callq 0xc440
leaq 0x140(%rsp), %rdi
callq 0xc1d0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x13e5f
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0xc600
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 0x13e91
movq %rax, %rbx
jmp 0x13eb2
jmp 0x13e84
jmp 0x13e84
jmp 0x13e84
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x13f5a
movq 0x5e108(%rip), %rsi     # 0x71fa0
leaq 0xc0(%rsp), %rdi
callq 0xc440
leaq 0x140(%rsp), %rdi
callq 0xc1d0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x13ec9
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0xc600
movq %rbx, %rdi
callq 0xcbb0
nop