// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x300, %rsp            # imm = 0x300
movq %rdi, -0x2b0(%rbp)
movq %rdi, %rax
movq %rax, -0x2a8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x17da0
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0xe4e0
jmp 0x180c3
jmp 0x180c5
movq -0x50(%rbp), %rax
movq %rax, -0x2b8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x31c20
movq %rax, %rcx
movq -0x2b8(%rbp), %rax
cmpq %rcx, %rax
jae 0x18574
jmp 0x180ee
movq -0x50(%rbp), %rax
movq %rax, -0x2c8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x31c20
movq -0x2c8(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x2b9(%rbp)
jae 0x18132
movq -0x50(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x31c40
cmpl $0x0, (%rax)
sete %al
movb %al, -0x2b9(%rbp)
movb -0x2b9(%rbp), %al
testb $0x1, %al
jne 0x1813e
jmp 0x1817b
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x180ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e0(%rbp)
movl %eax, -0x1e4(%rbp)
jmp 0x185c4
leaq -0x40(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x31c60
movq %rax, -0x2d0(%rbp)
jmp 0x18191
movq -0x2d0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1f0(%rbp)
movq -0x40(%rbp), %rsi
movq -0x1f0(%rbp), %rax
subq %rax, %rsi
incq %rsi
movq -0x48(%rbp), %rdx
subq %rax, %rdx
incq %rdx
leaq -0x260(%rbp), %rdi
callq 0x185e0
jmp 0x181cb
movq -0x1f0(%rbp), %rax
movq %rax, -0x268(%rbp)
cmpq $0x0, -0x268(%rbp)
jbe 0x1826c
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x268(%rbp), %rax
subq %rax, %rsi
callq 0x30800
movq %rax, %rdi
callq 0xe2b0
movq %rax, %rdx
leaq -0x260(%rbp), %rdi
movl $0x20, %esi
callq 0x18650
jmp 0x1821c
jmp 0x1821e
movq -0x268(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x268(%rbp)
jmp 0x181d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e0(%rbp)
movl %eax, -0x1e4(%rbp)
jmp 0x185b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e0(%rbp)
movl %eax, -0x1e4(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x18890
jmp 0x185b8
movq $0x0, -0x270(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x2d8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x31c20
movq %rax, %rcx
movq -0x2d8(%rbp), %rax
cmpq %rcx, %rax
jae 0x184e2
movq -0x270(%rbp), %rax
cmpq -0x20(%rbp), %rax
jb 0x183b5
leaq -0x38(%rbp), %rdi
callq 0x31ca0
movq %rax, -0x280(%rbp)
movq -0x50(%rbp), %rsi
leaq -0x280(%rbp), %rdi
callq 0x31cd0
movq %rax, -0x278(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x31d50
movq %rax, -0x288(%rbp)
leaq -0x278(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x31d10
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x2d9(%rbp)
jne 0x1830a
jmp 0x18322
leaq -0x278(%rbp), %rdi
callq 0x31d80
cmpl $0x0, (%rax)
sete %al
movb %al, -0x2d9(%rbp)
movb -0x2d9(%rbp), %al
testb $0x1, %al
jne 0x1832e
jmp 0x1833c
leaq -0x278(%rbp), %rdi
callq 0x31da0
jmp 0x182d6
leaq -0x38(%rbp), %rdi
callq 0x31d50
movq %rax, -0x290(%rbp)
leaq -0x278(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x31dc0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x2da(%rbp)
jne 0x183a2
leaq -0x38(%rbp), %rdi
callq 0x31ca0
movq %rax, -0x298(%rbp)
leaq -0x278(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x31e00
subq -0x50(%rbp), %rax
cmpq -0x20(%rbp), %rax
setae %al
movb %al, -0x2da(%rbp)
movb -0x2da(%rbp), %al
testb $0x1, %al
jne 0x183ae
jmp 0x183b3
jmp 0x184e2
jmp 0x183b5
movq -0x50(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x31c40
movl (%rax), %eax
movl %eax, -0x29c(%rbp)
cmpl $0x0, -0x29c(%rbp)
jne 0x183e7
movq -0x270(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2e8(%rbp)
jmp 0x183f2
xorl %eax, %eax
movq %rax, -0x2e8(%rbp)
jmp 0x183f2
movq -0x2e8(%rbp), %rax
movq %rax, -0x270(%rbp)
cmpl $0x0, -0x29c(%rbp)
je 0x1841b
cmpl $0x2, -0x29c(%rbp)
je 0x1841b
cmpl $0x3, -0x29c(%rbp)
jne 0x18464
movl -0x29c(%rbp), %eax
movl %eax, -0x2ec(%rbp)
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x30800
movq %rax, %rdi
callq 0xe2b0
movq %rax, %rdx
movl -0x2ec(%rbp), %eax
testl %eax, %eax
movl $0x20, %eax
movl $0x2d, %esi
cmovel %eax, %esi
leaq -0x260(%rbp), %rdi
callq 0x18650
jmp 0x18462
jmp 0x18464
cmpl $0x1, -0x29c(%rbp)
je 0x18476
cmpl $0x3, -0x29c(%rbp)
jne 0x184a3
movq -0x18(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x30800
movq %rax, %rdi
callq 0xe2b0
movq %rax, %rdx
leaq -0x260(%rbp), %rdi
movl $0x2b, %esi
callq 0x18650
jmp 0x184a1
jmp 0x184a3
cmpl $0x1, -0x29c(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %eax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpl $0x2, -0x29c(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %eax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x18277
leaq -0x260(%rbp), %rdi
callq 0x18770
movb %al, -0x2ed(%rbp)
jmp 0x184f6
movb -0x2ed(%rbp), %al
testb $0x1, %al
jne 0x1850e
jmp 0x18502
movl $0x3, -0x2a0(%rbp)
jmp 0x18555
xorl %eax, %eax
leaq -0x1d8(%rbp), %rcx
cmpq $0x0, %rcx
movq %rax, -0x2f8(%rbp)
je 0x18536
leaq -0x1d8(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x2f8(%rbp)
movq -0x2f8(%rbp), %rsi
leaq -0x260(%rbp), %rdi
callq 0x187b0
jmp 0x1854b
movl $0x0, -0x2a0(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x18890
movl -0x2a0(%rbp), %eax
testl %eax, %eax
je 0x1856f
jmp 0x1856d
jmp 0x18574
jmp 0x180c5
movq -0x2b0(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0xe740
jmp 0x18589
movl $0x1, -0x2a0(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0xe550
leaq -0x38(%rbp), %rdi
callq 0x317f0
movq -0x2a8(%rbp), %rax
addq $0x300, %rsp            # imm = 0x300
popq %rbp
retq
leaq -0x1d8(%rbp), %rdi
callq 0xe550
leaq -0x38(%rbp), %rdi
callq 0x317f0
movq -0x1e0(%rbp), %rdi
callq 0xee80
nopl (%rax)