// File: /workspace/github_cpp_makefile_star2_O3/dsharlet[P]array/test/sort.cpp
// Function: nda::test_sort_body()
TEST(sort) {
  for (int size = 0; size < 100; size++) {
    std::vector<int> unordered(size);
    for (int& i : unordered) {
      i = rand() % 100;
    }

    std::vector<int> std_sorted(unordered);
    std::vector<int> sorted(unordered);

    std::sort(std_sorted.begin(), std_sorted.end());
    internal::bubble_sort(sorted.begin(), sorted.end());

    for (size_t i = 0; i < unordered.size(); i++) {
      ASSERT_EQ(std_sorted[i], sorted[i]);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
xorl %esi, %esi
movq %rsp, %rbx
leaq 0x78(%rsp), %rbp
leaq 0x68e6(%rip), %r14      # 0xa3684
leaq 0xa4b1(%rip), %r15      # 0xa7256
movq %rbx, %rdi
movq %rsi, 0x70(%rsp)
movq %rbp, %rdx
callq 0x9d0c0
movq (%rsp), %rbx
movq 0x8(%rsp), %r12
cmpq %r12, %rbx
je 0x9cdeb
callq 0x2330
cltq
imulq $0x51eb851f, %rax, %rcx # imm = 0x51EB851F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rcx
addl %edx, %ecx
imull $0x64, %ecx, %ecx
subl %ecx, %eax
movl %eax, (%rbx)
addq $0x4, %rbx
jmp 0x9cdbe
leaq 0x38(%rsp), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x9d14c
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x9d14c
movq 0x38(%rsp), %r12
movq 0x40(%rsp), %rbx
cmpq %rbx, %r12
je 0x9ce44
movq %rbx, %rax
subq %r12, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x9d1cc
movq %r12, %rdi
movq %rbx, %rsi
callq 0x9d2af
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
cmpq %rcx, %rax
je 0x9ce71
movq %rax, %rdx
movl (%rdx), %esi
movl (%rax), %edi
cmpl %edi, %esi
jge 0x9ce62
movl %esi, (%rax)
movl %edi, (%rdx)
addq $0x4, %rdx
cmpq %rcx, %rdx
jne 0x9ce56
addq $0x4, %rax
jmp 0x9ce4e
movq 0x8(%rsp), %rax
cmpq (%rsp), %rax
je 0x9cfc2
xorl %ecx, %ecx
movq %r15, %r12
movq %r14, %r15
movq 0x38(%rsp), %rax
movl (%rax,%rcx,4), %ebx
movq 0x20(%rsp), %rax
movq %rcx, 0x18(%rsp)
movl (%rax,%rcx,4), %r13d
leaq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x50(%rsp), %r14
movq %r14, %rdi
leaq 0x237ea(%rip), %rsi     # 0xc06a1
leaq 0x237fd(%rip), %rdx     # 0xc06bb
callq 0xd14c
xorl %esi, %esi
cmpl %r13d, %ebx
sete %sil
movq %rbp, %rdi
movq %r14, %rdx
callq 0xbf80
movq %r15, %r14
movq %r12, %r15
movq %rbp, %rdi
movq %r14, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x237ca(%rip), %rsi     # 0xc06bc
callq 0x1910a
movq %rax, %rdi
movq %r15, %rsi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x9cf27
movq 0x38(%rsp), %rax
movq %rbx, %rdi
addq $0x10, %rdi
movq 0x18(%rsp), %rcx
movl (%rax,%rcx,4), %esi
callq 0x22f0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x23776(%rip), %rsi     # 0xc06b2
callq 0x1902a
movq %rax, %rdi
movq %r15, %rsi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x9cf71
movq 0x20(%rsp), %rax
movq %rbx, %rdi
addq $0x10, %rdi
movq 0x18(%rsp), %rcx
movl (%rax,%rcx,4), %esi
callq 0x22f0
movq %rbx, %rdi
leaq 0x1d31e(%rip), %rsi     # 0xba299
callq 0x18fba
movq %rbp, %rdi
callq 0xbfd8
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x9cfa4
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x18(%rsp), %rcx
incq %rcx
movq 0x8(%rsp), %rax
subq (%rsp), %rax
sarq $0x2, %rax
cmpq %rax, %rcx
jb 0x9ce82
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x9cfd9
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21f0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
movq %rsp, %rbx
je 0x9cff3
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x21f0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x9d009
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21f0
movq 0x70(%rsp), %rsi
incq %rsi
cmpq $0x64, %rsi
jne 0x9cda5
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x9d09a
movq %rax, %rbx
jmp 0x9d083
jmp 0x9d039
movq %rax, %rbx
jmp 0x9d06c
movq %rax, %rbx
jmp 0x9d050
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0xbfd8
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x9d06c
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x9d083
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21f0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x9d09a
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x21f0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x9d0b0
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x2300
movq %rax, %rdi
callq 0xc0a9