// File: /workspace/github_cpp_makefile_star2_O3/halfflat[P]tinyopt/test/googletest/googletest/src/gtest-internal-inl.h
// Function: void testing::internal::ShuffleRange<int>(testing::internal::Random*, int, int, std::vector<int, std::allocator<int>>*)
void ShuffleRange(internal::Random* random, int begin, int end,
                  std::vector<E>* v) {
  const int size = static_cast<int>(v->size());
  GTEST_CHECK_(0 <= begin && begin <= size)
      << "Invalid shuffle range start " << begin << ": must be in range [0, "
      << size << "].";
  GTEST_CHECK_(begin <= end && end <= size)
      << "Invalid shuffle range finish " << end << ": must be in range ["
      << begin << ", " << size << "].";

  // Fisher-Yates shuffle, from
  // https://en.wikipedia.org/wiki/Fisher-Yates_shuffle
  for (int range_width = end - begin; range_width >= 2; range_width--) {
    const int last_in_range = begin + range_width - 1;
    const int selected =
        begin +
        static_cast<int>(random->Generate(static_cast<uint32_t>(range_width)));
    std::swap((*v)[static_cast<size_t>(selected)],
              (*v)[static_cast<size_t>(last_in_range)]);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %r12d
movl %esi, %ebp
movq %rdi, %r14
movq 0x8(%rcx), %r15
subq (%rcx), %r15
shrq $0x2, %r15
testl %esi, %esi
js 0x64e2a
cmpl %ebp, %r15d
jge 0x64ec3
leaq 0xe279(%rip), %rdx      # 0x730aa
leaq 0x4(%rsp), %rdi
movl $0x3, %esi
movl $0x133, %ecx            # imm = 0x133
callq 0x47006
movq 0x2f1a4(%rip), %rdi     # 0x93ff0
leaq 0xe855(%rip), %rsi      # 0x736a8
movl $0x2e, %edx
callq 0xd600
movq 0x2f18c(%rip), %rdi     # 0x93ff0
leaq 0xe86c(%rip), %rsi      # 0x736d7
movl $0x1c, %edx
callq 0xd600
movq 0x2f174(%rip), %rdi     # 0x93ff0
movl %ebp, %esi
callq 0xda30
movq %rax, %r13
leaq 0xe867(%rip), %rsi      # 0x736f4
movl $0x17, %edx
movq %rax, %rdi
callq 0xd600
movq %r13, %rdi
movl %r15d, %esi
callq 0xda30
leaq 0xe647(%rip), %rsi      # 0x734f3
movl $0x2, %edx
movq %rax, %rdi
callq 0xd600
leaq 0x4(%rsp), %rdi
callq 0x47148
movl %r12d, %r13d
subl %ebp, %r13d
jl 0x64ed4
cmpl %r12d, %r15d
jge 0x64f8b
leaq 0xe1cf(%rip), %rdx      # 0x730aa
movq %rsp, %rdi
movl $0x3, %esi
movl $0x136, %ecx            # imm = 0x136
callq 0x47006
movq 0x2f0fc(%rip), %rdi     # 0x93ff0
leaq 0xe811(%rip), %rsi      # 0x7370c
movl $0x2e, %edx
callq 0xd600
movq 0x2f0e4(%rip), %rdi     # 0x93ff0
leaq 0xe828(%rip), %rsi      # 0x7373b
movl $0x1d, %edx
callq 0xd600
movq 0x2f0cc(%rip), %rdi     # 0x93ff0
movl %r12d, %esi
callq 0xda30
movq %rax, %r12
leaq 0xe823(%rip), %rsi      # 0x73759
movl $0x14, %edx
movq %rax, %rdi
callq 0xd600
movq %r12, %rdi
movl %ebp, %esi
callq 0xda30
movq %rax, %r12
leaq 0xe7b2(%rip), %rsi      # 0x73709
movl $0x2, %edx
movq %rax, %rdi
callq 0xd600
movq %r12, %rdi
movl %r15d, %esi
callq 0xda30
leaq 0xe57d(%rip), %rsi      # 0x734f3
movl $0x2, %edx
movq %rax, %rdi
callq 0xd600
movq %rsp, %rdi
callq 0x47148
cmpl $0x2, %r13d
jl 0x64fd0
movl %r13d, %r15d
movslq %ebp, %rax
leaq -0x4(,%rax,4), %r12
movq %r14, %rdi
movl %r15d, %esi
callq 0x48ec2
addl %ebp, %eax
cltq
movq (%rbx), %rcx
leaq (%rcx,%r12), %rdx
movl (%rcx,%rax,4), %esi
movl (%rdx,%r15,4), %edi
movl %edi, (%rcx,%rax,4)
movl %esi, (%rdx,%r15,4)
leaq -0x1(%r15), %rax
cmpq $0x2, %r15
movq %rax, %r15
ja 0x64f9f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x4(%rsp), %rdi
jmp 0x64fef
movq %rax, %rbx
movq %rsp, %rdi
callq 0x47148
movq %rbx, %rdi
callq 0xda70