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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4b0, %rsp            # imm = 0x4B0
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x420(%rbp)
movl $0x8, %esi
movl $0x9, %edx
movl $0x4, %ecx
callq 0x34640
movq -0x420(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0x418(%rbp)
callq 0x10d10
movq -0x418(%rbp), %rdi
callq 0x1cc340
movq %rax, -0x410(%rbp)
jmp 0x1c8959
movq -0x410(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
callq 0x162a50
jmp 0x1c896e
leaq -0xe8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rsi
leaq -0x110(%rbp), %rdi
callq 0x162ac0
jmp 0x1c8991
movq -0xb8(%rbp), %rsi
leaq -0x128(%rbp), %rdi
callq 0x162af0
jmp 0x1c89a6
jmp 0x1c89a8
leaq -0x110(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x162b20
movb %al, -0x421(%rbp)
jmp 0x1c89c3
movb -0x421(%rbp), %al
testb $0x1, %al
jne 0x1c89d2
jmp 0x1c8d63
leaq -0x110(%rbp), %rdi
callq 0x162b70
movq %rax, -0x430(%rbp)
jmp 0x1c89e7
movq -0x430(%rbp), %rax
movq %rax, -0x138(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x1cc3d0
movq %rax, -0x438(%rbp)
jmp 0x1c8a07
movq -0x438(%rbp), %rsi
leaq -0x170(%rbp), %rdi
callq 0x1cc360
jmp 0x1c8a1c
leaq -0x170(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rsi
leaq -0x188(%rbp), %rdi
callq 0x1cc3f0
jmp 0x1c8a3f
movq -0x140(%rbp), %rsi
leaq -0x1a0(%rbp), %rdi
callq 0x1cc420
jmp 0x1c8a54
jmp 0x1c8a56
leaq -0x188(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x1cc450
movb %al, -0x439(%rbp)
jmp 0x1c8a71
movb -0x439(%rbp), %al
testb $0x1, %al
jne 0x1c8a80
jmp 0x1c8d4e
leaq -0x188(%rbp), %rdi
callq 0x1cc4a0
movq %rax, -0x448(%rbp)
jmp 0x1c8a95
movq -0x448(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movups -0x1b0(%rbp), %xmm0
movaps %xmm0, -0x210(%rbp)
movups -0x138(%rbp), %xmm0
movaps %xmm0, -0x220(%rbp)
movw 0xc99dc(%rip), %ax      # 0x2924a2
movw %ax, -0x222(%rbp)
movq -0x210(%rbp), %rdx
movq -0x220(%rbp), %rcx
leaq -0x1f8(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x1cc4d0
jmp 0x1c8aed
leaq -0x1f8(%rbp), %rdi
callq 0x1cc550
movq %rax, -0x450(%rbp)
jmp 0x1c8b02
movq -0x450(%rbp), %rax
subq $0x30, %rax
sete %al
movb %al, -0x459(%rbp)
leaq -0x3d9(%rbp), %rdi
movq %rdi, -0x458(%rbp)
callq 0x33b0
movq -0x458(%rbp), %rdx
leaq 0x348c5(%rip), %rsi     # 0x1fd3fc
leaq -0x3d8(%rbp), %rdi
callq 0x10a90
jmp 0x1c8b45
movb -0x459(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x3b8(%rbp), %rdi
leaq -0x3d8(%rbp), %rdx
callq 0x10f80
jmp 0x1c8b66
leaq 0x13c78(%rip), %rsi     # 0x1dc7e5
leaq -0x3b8(%rbp), %rdi
callq 0x34320
movq %rax, -0x468(%rbp)
jmp 0x1c8b82
movq -0x468(%rbp), %rdi
leaq 0x34881(%rip), %rsi     # 0x1fd411
callq 0x36fb0
movq %rax, -0x470(%rbp)
jmp 0x1c8b9e
movq -0x470(%rbp), %rdi
leaq 0x17c00(%rip), %rsi     # 0x1e07ac
callq 0x34320
movq %rax, -0x478(%rbp)
jmp 0x1c8bba
leaq -0x1f8(%rbp), %rdi
callq 0x1cc550
movq %rax, -0x480(%rbp)
jmp 0x1c8bcf
movq -0x478(%rbp), %rdi
movq -0x480(%rbp), %rax
movq %rax, -0x3e8(%rbp)
leaq -0x3e8(%rbp), %rsi
callq 0x355c0
movq %rax, -0x488(%rbp)
jmp 0x1c8bf9
movq -0x488(%rbp), %rdi
leaq 0x13bde(%rip), %rsi     # 0x1dc7e5
callq 0x34320
movq %rax, -0x490(%rbp)
jmp 0x1c8c15
movq -0x490(%rbp), %rdi
leaq 0x347eb(%rip), %rsi     # 0x1fd40e
callq 0x34840
movq %rax, -0x498(%rbp)
jmp 0x1c8c31
movq -0x498(%rbp), %rdi
leaq 0x17b6d(%rip), %rsi     # 0x1e07ac
callq 0x34320
movq %rax, -0x4a0(%rbp)
jmp 0x1c8c4d
movq -0x4a0(%rbp), %rdi
movl $0x30, -0x3ec(%rbp)
leaq -0x3ec(%rbp), %rsi
callq 0x343a0
movq %rax, -0x4a8(%rbp)
jmp 0x1c8c73
movq -0x4a8(%rbp), %rdi
leaq 0x2d7fa(%rip), %rsi     # 0x1f647b
callq 0x34320
jmp 0x1c8c88
leaq -0x3b8(%rbp), %rdi
callq 0x10ff0
jmp 0x1c8c96
leaq -0x3d8(%rbp), %rdi
callq 0x3100
leaq -0x3d9(%rbp), %rdi
callq 0x3290
leaq -0x1f8(%rbp), %rdi
xorl %esi, %esi
callq 0x1cc570
jmp 0x1c8cbe
jmp 0x1c8cc0
leaq -0x188(%rbp), %rdi
callq 0x1cc5a0
jmp 0x1c8cce
jmp 0x1c8a56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf0(%rbp)
movl %eax, -0xf4(%rbp)
jmp 0x1c8d9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf0(%rbp)
movl %eax, -0xf4(%rbp)
jmp 0x1c8d40
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf0(%rbp)
movl %eax, -0xf4(%rbp)
jmp 0x1c8d34
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf0(%rbp)
movl %eax, -0xf4(%rbp)
leaq -0x3b8(%rbp), %rdi
callq 0x10ff0
jmp 0x1c8d32
jmp 0x1c8d34
leaq -0x3d8(%rbp), %rdi
callq 0x3100
leaq -0x3d9(%rbp), %rdi
callq 0x3290
jmp 0x1c8d9a
jmp 0x1c8d50
leaq -0x110(%rbp), %rdi
callq 0x162c90
jmp 0x1c8d5e
jmp 0x1c89a8
leaq -0x408(%rbp), %rdi
movq %rdi, -0x4b0(%rbp)
callq 0x35c10
movq -0x4b0(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x35be0
jmp 0x1c8d88
leaq -0x68(%rbp), %rdi
callq 0x11110
addq $0x4b0, %rsp            # imm = 0x4B0
popq %rbp
retq
leaq -0x68(%rbp), %rdi
callq 0x11110
movq -0xf0(%rbp), %rdi
callq 0x33a0
movq %rax, %rdi
callq 0x116d0
nopw (%rax,%rax)