// File: dsharlet[P]array/test/split.cpp
// Function: nda::test_split_uneven_nonconstant_body()
TEST(split_uneven_nonconstant) {
  dense_array<int, 3> a({dense_dim<>(2, 8), dim<>(1, 9), 4});
  size_t total_size = 0;
  for (auto zo : split(a.z(), 12)) {
    for (auto xo : split(a.x(), 5)) {
      auto a_inner = a(xo, _, zo);
      total_size += a_inner.size();
      fill_pattern(a_inner);
    }
  }
  // The total number of items in the inner splits should be equal to the size
  // of the array (no overlap among inner splits).
  ASSERT_EQ(total_size, a.size());
  check_pattern(a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x550, %rsp            # imm = 0x550
leaq -0xc8(%rbp), %rdi
movl $0x2, %esi
movl $0x8, %edx
movl $0x1, %ecx
movq %rcx, -0x468(%rbp)
callq 0x16d70
movq -0x468(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
movl $0x9, %edx
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
callq 0x10c60
movq -0xd0(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x28(%rax)
movups -0xe0(%rbp), %xmm0
movups %xmm0, 0x18(%rax)
movq -0xb8(%rbp), %rcx
movq %rcx, 0x10(%rax)
movups -0xc8(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x460(%rbp)
movl $0x4, %esi
callq 0x1cc5c0
movq -0x460(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0x458(%rbp)
callq 0x10d10
movq -0x458(%rbp), %rdi
movq $0x0, -0xe8(%rbp)
callq 0x1cc8c0
movq %rax, -0x450(%rbp)
jmp 0x1c98ec
movq -0x450(%rbp), %rsi
leaq -0x120(%rbp), %rdi
movl $0xc, %edx
callq 0x162910
jmp 0x1c9906
leaq -0x120(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rsi
leaq -0x148(%rbp), %rdi
callq 0x162980
jmp 0x1c9929
movq -0xf0(%rbp), %rsi
leaq -0x160(%rbp), %rdi
callq 0x1629b0
jmp 0x1c993e
jmp 0x1c9940
leaq -0x148(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x1629e0
movb %al, -0x469(%rbp)
jmp 0x1c995b
movb -0x469(%rbp), %al
testb $0x1, %al
jne 0x1c996a
jmp 0x1c9b40
leaq -0x148(%rbp), %rdi
callq 0x162a30
movq %rdx, -0x480(%rbp)
movq %rax, -0x478(%rbp)
jmp 0x1c9986
movq -0x480(%rbp), %rax
movq -0x478(%rbp), %rcx
movq %rcx, -0x170(%rbp)
movq %rax, -0x168(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x1cc3d0
movq %rax, -0x488(%rbp)
jmp 0x1c99b4
movq -0x488(%rbp), %rsi
leaq -0x1a8(%rbp), %rdi
movl $0x5, %edx
callq 0x1cc9a0
jmp 0x1c99ce
leaq -0x1a8(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rsi
leaq -0x1c0(%rbp), %rdi
callq 0x162980
jmp 0x1c99f1
movq -0x178(%rbp), %rsi
leaq -0x1d8(%rbp), %rdi
callq 0x1629b0
jmp 0x1c9a06
jmp 0x1c9a08
leaq -0x1c0(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x1629e0
movb %al, -0x489(%rbp)
jmp 0x1c9a23
movb -0x489(%rbp), %al
testb $0x1, %al
jne 0x1c9a32
jmp 0x1c9b2b
leaq -0x1c0(%rbp), %rdi
callq 0x162a30
movq %rdx, -0x4a0(%rbp)
movq %rax, -0x498(%rbp)
jmp 0x1c9a4e
movq -0x4a0(%rbp), %rax
movq -0x498(%rbp), %rcx
movq %rcx, -0x1e8(%rbp)
movq %rax, -0x1e0(%rbp)
movups -0x1e8(%rbp), %xmm0
movaps %xmm0, -0x250(%rbp)
movw 0xc8a23(%rip), %ax      # 0x2924a2
movw %ax, -0x252(%rbp)
movups -0x170(%rbp), %xmm0
movaps %xmm0, -0x270(%rbp)
movq -0x250(%rbp), %rdx
movq -0x248(%rbp), %rcx
movq -0x270(%rbp), %r8
movq -0x268(%rbp), %r9
leaq -0x238(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x1cca10
jmp 0x1c9ac2
leaq -0x238(%rbp), %rdi
callq 0x1cc960
movq %rax, -0x4a8(%rbp)
jmp 0x1c9ad7
movq -0x4a8(%rbp), %rcx
movq -0xe8(%rbp), %rax
addq %rcx, %rax
movq %rax, -0xe8(%rbp)
leaq -0x238(%rbp), %rdi
xorl %esi, %esi
callq 0x10c390
jmp 0x1c9aff
jmp 0x1c9b01
leaq -0x1c0(%rbp), %rdi
callq 0x162cb0
jmp 0x1c9b0f
jmp 0x1c9a08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x1c9d9e
jmp 0x1c9b2d
leaq -0x148(%rbp), %rdi
callq 0x162cb0
jmp 0x1c9b3b
jmp 0x1c9940
movq -0xe8(%rbp), %rax
movq %rax, -0x4b8(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x1cc980
movq %rax, -0x4b0(%rbp)
jmp 0x1c9b60
movq -0x4b0(%rbp), %rcx
movq -0x4b8(%rbp), %rax
subq %rcx, %rax
sete %al
movb %al, -0x4c1(%rbp)
leaq -0x421(%rbp), %rdi
movq %rdi, -0x4c0(%rbp)
callq 0x33b0
movq -0x4c0(%rbp), %rdx
leaq 0x338c7(%rip), %rsi     # 0x1fd462
leaq -0x420(%rbp), %rdi
callq 0x10a90
jmp 0x1c9ba9
movb -0x4c1(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x400(%rbp), %rdi
leaq -0x420(%rbp), %rdx
callq 0x10f80
jmp 0x1c9bca
leaq 0x12c14(%rip), %rsi     # 0x1dc7e5
leaq -0x400(%rbp), %rdi
callq 0x34320
movq %rax, -0x4d0(%rbp)
jmp 0x1c9be6
movq -0x4d0(%rbp), %rdi
leaq 0x33ccd(%rip), %rsi     # 0x1fd8c1
callq 0x34570
movq %rax, -0x4d8(%rbp)
jmp 0x1c9c02
movq -0x4d8(%rbp), %rdi
leaq 0x16b9c(%rip), %rsi     # 0x1e07ac
callq 0x34320
movq %rax, -0x4e0(%rbp)
jmp 0x1c9c1e
movq -0x4e0(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x355c0
movq %rax, -0x4e8(%rbp)
jmp 0x1c9c3a
movq -0x4e8(%rbp), %rdi
leaq 0x12b9d(%rip), %rsi     # 0x1dc7e5
callq 0x34320
movq %rax, -0x4f0(%rbp)
jmp 0x1c9c56
movq -0x4f0(%rbp), %rdi
leaq 0x3380c(%rip), %rsi     # 0x1fd470
callq 0x36600
movq %rax, -0x4f8(%rbp)
jmp 0x1c9c72
movq -0x4f8(%rbp), %rdi
leaq 0x16b2c(%rip), %rsi     # 0x1e07ac
callq 0x34320
movq %rax, -0x500(%rbp)
jmp 0x1c9c8e
leaq -0x68(%rbp), %rdi
callq 0x1cc980
movq %rax, -0x508(%rbp)
jmp 0x1c9ca0
movq -0x500(%rbp), %rdi
movq -0x508(%rbp), %rax
movq %rax, -0x430(%rbp)
leaq -0x430(%rbp), %rsi
callq 0x355c0
movq %rax, -0x510(%rbp)
jmp 0x1c9cca
movq -0x510(%rbp), %rdi
leaq 0x2c7a3(%rip), %rsi     # 0x1f647b
callq 0x34320
jmp 0x1c9cdf
leaq -0x400(%rbp), %rdi
callq 0x10ff0
jmp 0x1c9ced
leaq -0x420(%rbp), %rdi
callq 0x3100
leaq -0x421(%rbp), %rdi
callq 0x3290
leaq -0x448(%rbp), %rdi
movq %rdi, -0x518(%rbp)
callq 0x35c10
movq -0x518(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x35be0
jmp 0x1c9d2a
leaq -0x68(%rbp), %rdi
callq 0x11110
addq $0x550, %rsp            # imm = 0x550
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x1c9d92
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x1c9d86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
leaq -0x400(%rbp), %rdi
callq 0x10ff0
jmp 0x1c9d84
jmp 0x1c9d86
leaq -0x420(%rbp), %rdi
callq 0x3100
leaq -0x421(%rbp), %rdi
callq 0x3290
leaq -0x68(%rbp), %rdi
callq 0x11110
movq -0x128(%rbp), %rdi
callq 0x33a0
movq %rax, %rdi
callq 0x116d0
nopl (%rax,%rax)