// File: dsharlet[P]array/test/split.cpp
// Function: nda::test_split_uneven_constant_body()
TEST(split_uneven_constant) {
  dense_array<int, 3> a({dense_dim<>(2, 8), dim<>(1, 9), 4});
  for (auto yo : split<4>(a.y())) {
    for (auto xo : split<5>(a.x())) {
      auto a_inner = a(xo, yo, _);
      // Compile-time constant splits should always be the same size.
      ASSERT_EQ(a_inner.size(), 80);
      fill_pattern(a_inner);
    }
  }
  check_pattern(a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x520, %rsp            # imm = 0x520
leaq -0xc8(%rbp), %rdi
movl $0x2, %esi
movl $0x8, %edx
movl $0x1, %ecx
movq %rcx, -0x458(%rbp)
callq 0x16d70
movq -0x458(%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, -0x450(%rbp)
movl $0x4, %esi
callq 0x1cc5c0
movq -0x450(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0x448(%rbp)
callq 0x10d10
movq -0x448(%rbp), %rdi
callq 0x1cc340
movq %rax, -0x440(%rbp)
jmp 0x1c8e81
movq -0x440(%rbp), %rsi
leaq -0x118(%rbp), %rdi
callq 0x1cc610
jmp 0x1c8e96
leaq -0x118(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0x1cc3f0
jmp 0x1c8eb9
movq -0xe8(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0x1cc420
jmp 0x1c8ece
jmp 0x1c8ed0
leaq -0x140(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x1cc450
movb %al, -0x459(%rbp)
jmp 0x1c8eeb
movb -0x459(%rbp), %al
testb $0x1, %al
jne 0x1c8efa
jmp 0x1c928b
leaq -0x140(%rbp), %rdi
callq 0x1cc4a0
movq %rax, -0x468(%rbp)
jmp 0x1c8f0f
movq -0x468(%rbp), %rax
movq %rax, -0x168(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x1cc3d0
movq %rax, -0x470(%rbp)
jmp 0x1c8f2f
movq -0x470(%rbp), %rsi
leaq -0x1a0(%rbp), %rdi
callq 0x1cc680
jmp 0x1c8f44
leaq -0x1a0(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rsi
leaq -0x1b8(%rbp), %rdi
callq 0x1cc6f0
jmp 0x1c8f67
movq -0x170(%rbp), %rsi
leaq -0x1d0(%rbp), %rdi
callq 0x1cc720
jmp 0x1c8f7c
jmp 0x1c8f7e
leaq -0x1b8(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x1cc750
movb %al, -0x471(%rbp)
jmp 0x1c8f99
movb -0x471(%rbp), %al
testb $0x1, %al
jne 0x1c8fa8
jmp 0x1c9276
leaq -0x1b8(%rbp), %rdi
callq 0x1cc7a0
movq %rax, -0x480(%rbp)
jmp 0x1c8fbd
movq -0x480(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movups -0x1e0(%rbp), %xmm0
movaps %xmm0, -0x240(%rbp)
movups -0x168(%rbp), %xmm0
movaps %xmm0, -0x250(%rbp)
movw 0xc94b4(%rip), %ax      # 0x2924a2
movw %ax, -0x252(%rbp)
movq -0x240(%rbp), %rdx
movq -0x250(%rbp), %rcx
leaq -0x228(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x1cc7d0
jmp 0x1c9015
leaq -0x228(%rbp), %rdi
callq 0x1cc850
movq %rax, -0x488(%rbp)
jmp 0x1c902a
movq -0x488(%rbp), %rax
subq $0x50, %rax
sete %al
movb %al, -0x491(%rbp)
leaq -0x409(%rbp), %rdi
movq %rdi, -0x490(%rbp)
callq 0x33b0
movq -0x490(%rbp), %rdx
leaq 0x343d7(%rip), %rsi     # 0x1fd436
leaq -0x408(%rbp), %rdi
callq 0x10a90
jmp 0x1c906d
movb -0x491(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x3e8(%rbp), %rdi
leaq -0x408(%rbp), %rdx
callq 0x10f80
jmp 0x1c908e
leaq 0x13750(%rip), %rsi     # 0x1dc7e5
leaq -0x3e8(%rbp), %rdi
callq 0x34320
movq %rax, -0x4a0(%rbp)
jmp 0x1c90aa
movq -0x4a0(%rbp), %rdi
leaq 0x34359(%rip), %rsi     # 0x1fd411
callq 0x36fb0
movq %rax, -0x4a8(%rbp)
jmp 0x1c90c6
movq -0x4a8(%rbp), %rdi
leaq 0x176d8(%rip), %rsi     # 0x1e07ac
callq 0x34320
movq %rax, -0x4b0(%rbp)
jmp 0x1c90e2
leaq -0x228(%rbp), %rdi
callq 0x1cc850
movq %rax, -0x4b8(%rbp)
jmp 0x1c90f7
movq -0x4b0(%rbp), %rdi
movq -0x4b8(%rbp), %rax
movq %rax, -0x418(%rbp)
leaq -0x418(%rbp), %rsi
callq 0x355c0
movq %rax, -0x4c0(%rbp)
jmp 0x1c9121
movq -0x4c0(%rbp), %rdi
leaq 0x136b6(%rip), %rsi     # 0x1dc7e5
callq 0x34320
movq %rax, -0x4c8(%rbp)
jmp 0x1c913d
movq -0x4c8(%rbp), %rdi
leaq 0x342fd(%rip), %rsi     # 0x1fd448
callq 0x34840
movq %rax, -0x4d0(%rbp)
jmp 0x1c9159
movq -0x4d0(%rbp), %rdi
leaq 0x17645(%rip), %rsi     # 0x1e07ac
callq 0x34320
movq %rax, -0x4d8(%rbp)
jmp 0x1c9175
movq -0x4d8(%rbp), %rdi
movl $0x50, -0x41c(%rbp)
leaq -0x41c(%rbp), %rsi
callq 0x343a0
movq %rax, -0x4e0(%rbp)
jmp 0x1c919b
movq -0x4e0(%rbp), %rdi
leaq 0x2d2d2(%rip), %rsi     # 0x1f647b
callq 0x34320
jmp 0x1c91b0
leaq -0x3e8(%rbp), %rdi
callq 0x10ff0
jmp 0x1c91be
leaq -0x408(%rbp), %rdi
callq 0x3100
leaq -0x409(%rbp), %rdi
callq 0x3290
leaq -0x228(%rbp), %rdi
xorl %esi, %esi
callq 0x1cc870
jmp 0x1c91e6
jmp 0x1c91e8
leaq -0x1b8(%rbp), %rdi
callq 0x1cc8a0
jmp 0x1c91f6
jmp 0x1c8f7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x1c92c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x1c9268
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x1c925c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x3e8(%rbp), %rdi
callq 0x10ff0
jmp 0x1c925a
jmp 0x1c925c
leaq -0x408(%rbp), %rdi
callq 0x3100
leaq -0x409(%rbp), %rdi
callq 0x3290
jmp 0x1c92c2
jmp 0x1c9278
leaq -0x140(%rbp), %rdi
callq 0x1cc5a0
jmp 0x1c9286
jmp 0x1c8ed0
leaq -0x438(%rbp), %rdi
movq %rdi, -0x4e8(%rbp)
callq 0x35c10
movq -0x4e8(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x35be0
jmp 0x1c92b0
leaq -0x68(%rbp), %rdi
callq 0x11110
addq $0x520, %rsp            # imm = 0x520
popq %rbp
retq
leaq -0x68(%rbp), %rdi
callq 0x11110
movq -0x120(%rbp), %rdi
callq 0x33a0
movq %rax, %rdi
callq 0x116d0
nop