// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/unittest/googletest/googletest/src/gtest.cc
// Function: testing::internal::edit_distance::CalculateOptimalEdits(std::vector<unsigned long, std::allocator<unsigned long>> const&, std::vector<unsigned long, std::allocator<unsigned long>> const&)
std::vector<EditType> CalculateOptimalEdits(const std::vector<size_t>& left,
                                            const std::vector<size_t>& right) {
  std::vector<std::vector<double> > costs(
      left.size() + 1, std::vector<double>(right.size() + 1));
  std::vector<std::vector<EditType> > best_move(
      left.size() + 1, std::vector<EditType>(right.size() + 1));

  // Populate for empty right.
  for (size_t l_i = 0; l_i < costs.size(); ++l_i) {
    costs[l_i][0] = static_cast<double>(l_i);
    best_move[l_i][0] = kRemove;
  }
  // Populate for empty left.
  for (size_t r_i = 1; r_i < costs[0].size(); ++r_i) {
    costs[0][r_i] = static_cast<double>(r_i);
    best_move[0][r_i] = kAdd;
  }

  for (size_t l_i = 0; l_i < left.size(); ++l_i) {
    for (size_t r_i = 0; r_i < right.size(); ++r_i) {
      if (left[l_i] == right[r_i]) {
        // Found a match. Consume it.
        costs[l_i + 1][r_i + 1] = costs[l_i][r_i];
        best_move[l_i + 1][r_i + 1] = kMatch;
        continue;
      }

      const double add = costs[l_i + 1][r_i];
      const double remove = costs[l_i][r_i + 1];
      const double replace = costs[l_i][r_i];
      if (add < remove && add < replace) {
        costs[l_i + 1][r_i + 1] = add + 1;
        best_move[l_i + 1][r_i + 1] = kAdd;
      } else if (remove < add && remove < replace) {
        costs[l_i + 1][r_i + 1] = remove + 1;
        best_move[l_i + 1][r_i + 1] = kRemove;
      } else {
        // We make replace a little more expensive than add/remove to lower
        // their priority.
        costs[l_i + 1][r_i + 1] = replace + 1.00001;
        best_move[l_i + 1][r_i + 1] = kReplace;
      }
    }
  }

  // Reconstruct the best path. We do it in reverse order.
  std::vector<EditType> best_path;
  for (size_t l_i = left.size(), r_i = right.size(); l_i > 0 || r_i > 0;) {
    EditType move = best_move[l_i][r_i];
    best_path.push_back(move);
    l_i -= move != kAdd;
    r_i -= move != kRemove;
  }
  std::reverse(best_path.begin(), best_path.end());
  return best_path;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x128(%rbp)
movq %rdi, %rax
movq %rax, -0x120(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x314b0
incq %rax
movq %rax, -0x118(%rbp)
movq -0x18(%rbp), %rdi
callq 0x314b0
incq %rax
movq %rax, -0x110(%rbp)
leaq -0x49(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x314d0
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rdx
leaq -0x48(%rbp), %rdi
callq 0x314f0
jmp 0x17537
leaq -0x5d(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x31560
movq -0x118(%rbp), %rsi
movq -0x130(%rbp), %rcx
leaq -0x30(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x31580
jmp 0x17564
leaq -0x5d(%rbp), %rdi
callq 0x31600
leaq -0x48(%rbp), %rdi
callq 0x31620
leaq -0x49(%rbp), %rdi
callq 0x31680
movq -0x10(%rbp), %rdi
callq 0x314b0
incq %rax
movq %rax, -0x148(%rbp)
movq -0x18(%rbp), %rdi
callq 0x314b0
incq %rax
movq %rax, -0x140(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x316a0
movq -0x140(%rbp), %rsi
movq -0x138(%rbp), %rdx
leaq -0x90(%rbp), %rdi
callq 0x316c0
jmp 0x175d4
leaq -0x92(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x31730
movq -0x148(%rbp), %rsi
movq -0x150(%rbp), %rcx
leaq -0x78(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x31750
jmp 0x17607
leaq -0x92(%rbp), %rdi
callq 0x317d0
leaq -0x90(%rbp), %rdi
callq 0x317f0
leaq -0x91(%rbp), %rdi
callq 0x31850
movq $0x0, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x158(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x31870
movq %rax, %rcx
movq -0x158(%rbp), %rax
cmpq %rcx, %rax
jae 0x17770
movaps 0x719b9(%rip), %xmm1    # 0x89020
movq -0xa0(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x719b5(%rip), %xmm1    # 0x89030
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, -0x160(%rbp)
movq -0xa0(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x318a0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x318c0
movsd -0x160(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0xa0(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x318e0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x31900
movl $0x2, (%rax)
movq -0xa0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa0(%rbp)
jmp 0x17636
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1771f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x5d(%rbp), %rdi
callq 0x31600
leaq -0x48(%rbp), %rdi
callq 0x31620
leaq -0x49(%rbp), %rdi
callq 0x31680
jmp 0x17d96
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1775f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x92(%rbp), %rdi
callq 0x317d0
leaq -0x90(%rbp), %rdi
callq 0x317f0
leaq -0x91(%rbp), %rdi
callq 0x31850
jmp 0x17d8d
movq $0x1, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x168(%rbp)
leaq -0x30(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x318a0
movq %rax, %rdi
callq 0x31920
movq %rax, %rcx
movq -0x168(%rbp), %rax
cmpq %rcx, %rax
jae 0x17844
movaps 0x71868(%rip), %xmm1    # 0x89020
movq -0xa8(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x71864(%rip), %xmm1    # 0x89030
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, -0x170(%rbp)
leaq -0x30(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x318a0
movq %rax, %rdi
movq -0xa8(%rbp), %rsi
callq 0x318c0
movsd -0x170(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq -0x78(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x318e0
movq %rax, %rdi
movq -0xa8(%rbp), %rsi
callq 0x31900
movl $0x1, (%rax)
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
jmp 0x1777b
movq $0x0, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x10(%rbp), %rdi
callq 0x314b0
movq %rax, %rcx
movq -0x178(%rbp), %rax
cmpq %rcx, %rax
jae 0x17c07
movq $0x0, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x18(%rbp), %rdi
callq 0x314b0
movq %rax, %rcx
movq -0x180(%rbp), %rax
cmpq %rcx, %rax
jae 0x17bee
movq -0x10(%rbp), %rdi
movq -0xb0(%rbp), %rsi
callq 0x31940
movq (%rax), %rax
movq %rax, -0x188(%rbp)
movq -0x18(%rbp), %rdi
movq -0xb8(%rbp), %rsi
callq 0x31940
movq %rax, %rcx
movq -0x188(%rbp), %rax
cmpq (%rcx), %rax
jne 0x1797b
movq -0xb0(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x318a0
movq %rax, %rdi
movq -0xb8(%rbp), %rsi
callq 0x318c0
movsd (%rax), %xmm0
movsd %xmm0, -0x190(%rbp)
movq -0xb0(%rbp), %rsi
addq $0x1, %rsi
leaq -0x30(%rbp), %rdi
callq 0x318a0
movq %rax, %rdi
movq -0xb8(%rbp), %rsi
addq $0x1, %rsi
callq 0x318c0
movsd -0x190(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0xb0(%rbp), %rsi
addq $0x1, %rsi
leaq -0x78(%rbp), %rdi
callq 0x318e0
movq %rax, %rdi
movq -0xb8(%rbp), %rsi
addq $0x1, %rsi
callq 0x31900
movl $0x0, (%rax)
jmp 0x17bd7
movq -0xb0(%rbp), %rsi
addq $0x1, %rsi
leaq -0x30(%rbp), %rdi
callq 0x318a0
movq %rax, %rdi
movq -0xb8(%rbp), %rsi
callq 0x318c0
movsd (%rax), %xmm0
movsd %xmm0, -0xc0(%rbp)
movq -0xb0(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x318a0
movq %rax, %rdi
movq -0xb8(%rbp), %rsi
addq $0x1, %rsi
callq 0x318c0
movsd (%rax), %xmm0
movsd %xmm0, -0xc8(%rbp)
movq -0xb0(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x318a0
movq %rax, %rdi
movq -0xb8(%rbp), %rsi
callq 0x318c0
movsd (%rax), %xmm0
movsd %xmm0, -0xd0(%rbp)
movsd -0xc0(%rbp), %xmm1
movsd -0xc8(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x17ab1
movsd -0xc0(%rbp), %xmm1
movsd -0xd0(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x17ab1
movsd 0x715d4(%rip), %xmm0    # 0x89010
addsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0x198(%rbp)
movq -0xb0(%rbp), %rsi
addq $0x1, %rsi
leaq -0x30(%rbp), %rdi
callq 0x318a0
movq %rax, %rdi
movq -0xb8(%rbp), %rsi
addq $0x1, %rsi
callq 0x318c0
movsd -0x198(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0xb0(%rbp), %rsi
addq $0x1, %rsi
leaq -0x78(%rbp), %rdi
callq 0x318e0
movq %rax, %rdi
movq -0xb8(%rbp), %rsi
addq $0x1, %rsi
callq 0x31900
movl $0x1, (%rax)
jmp 0x17bd5
movsd -0xc8(%rbp), %xmm1
movsd -0xc0(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x17b5b
movsd -0xc8(%rbp), %xmm1
movsd -0xd0(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x17b5b
movsd 0x71527(%rip), %xmm0    # 0x89010
addsd -0xc8(%rbp), %xmm0
movsd %xmm0, -0x1a0(%rbp)
movq -0xb0(%rbp), %rsi
addq $0x1, %rsi
leaq -0x30(%rbp), %rdi
callq 0x318a0
movq %rax, %rdi
movq -0xb8(%rbp), %rsi
addq $0x1, %rsi
callq 0x318c0
movsd -0x1a0(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0xb0(%rbp), %rsi
addq $0x1, %rsi
leaq -0x78(%rbp), %rdi
callq 0x318e0
movq %rax, %rdi
movq -0xb8(%rbp), %rsi
addq $0x1, %rsi
callq 0x31900
movl $0x2, (%rax)
jmp 0x17bd3
movsd 0x714a5(%rip), %xmm0    # 0x89008
addsd -0xd0(%rbp), %xmm0
movsd %xmm0, -0x1a8(%rbp)
movq -0xb0(%rbp), %rsi
addq $0x1, %rsi
leaq -0x30(%rbp), %rdi
callq 0x318a0
movq %rax, %rdi
movq -0xb8(%rbp), %rsi
addq $0x1, %rsi
callq 0x318c0
movsd -0x1a8(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0xb0(%rbp), %rsi
addq $0x1, %rsi
leaq -0x78(%rbp), %rdi
callq 0x318e0
movq %rax, %rdi
movq -0xb8(%rbp), %rsi
addq $0x1, %rsi
callq 0x31900
movl $0x3, (%rax)
jmp 0x17bd5
jmp 0x17bd7
movq -0xb8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb8(%rbp)
jmp 0x17884
jmp 0x17bf0
movq -0xb0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb0(%rbp)
jmp 0x1784f
movq -0x128(%rbp), %rdi
movb $0x0, -0xd1(%rbp)
callq 0x31960
movq -0x10(%rbp), %rdi
callq 0x314b0
movq %rax, -0xe0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x314b0
movq %rax, -0xe8(%rbp)
movb $0x1, %al
cmpq $0x0, -0xe0(%rbp)
movb %al, -0x1a9(%rbp)
ja 0x17c5d
cmpq $0x0, -0xe8(%rbp)
seta %al
movb %al, -0x1a9(%rbp)
movb -0x1a9(%rbp), %al
testb $0x1, %al
jne 0x17c6c
jmp 0x17d14
movq -0xe0(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x318e0
movq %rax, %rdi
movq -0xe8(%rbp), %rsi
callq 0x31900
movq -0x128(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xec(%rbp)
leaq -0xec(%rbp), %rsi
callq 0x31980
jmp 0x17ca8
cmpl $0x1, -0xec(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, %ecx
movq -0xe0(%rbp), %rax
subq %rcx, %rax
movq %rax, -0xe0(%rbp)
cmpl $0x2, -0xec(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, %ecx
movq -0xe8(%rbp), %rax
subq %rcx, %rax
movq %rax, -0xe8(%rbp)
jmp 0x17c3a
movq -0x128(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
callq 0x317f0
leaq -0x78(%rbp), %rdi
callq 0x31a90
jmp 0x17d8d
movq -0x128(%rbp), %rdi
callq 0x31a30
movq -0x128(%rbp), %rdi
movq %rax, -0xf8(%rbp)
callq 0x31a60
movq %rax, -0x100(%rbp)
movq -0xf8(%rbp), %rdi
movq -0x100(%rbp), %rsi
callq 0x319f0
jmp 0x17d4f
movb $0x1, -0xd1(%rbp)
testb $0x1, -0xd1(%rbp)
jne 0x17d6b
movq -0x128(%rbp), %rdi
callq 0x317f0
leaq -0x78(%rbp), %rdi
callq 0x31a90
leaq -0x30(%rbp), %rdi
callq 0x31af0
movq -0x120(%rbp), %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x31af0
movq -0x58(%rbp), %rdi
callq 0xee80
nop