// File: /workspace/github_c_makefile_star2_O2/keithnoguchi[P]pearls-in-action/0x4/main_test.c
// Function: main
int main(void)
{
	int fail = 0;
	int i = 0;

	printf("===============================\n");
	printf("Programming Pearls, Chapter 0x4\n");
	printf("===============================\n");

	if (test_bsearch_0(&i))
		fail++;
	if (test_bsearch_2(&i))
		fail++;
	if (test_bsearch_3(&i))
		fail++;
	if (test_bsearch_10(&i))
		fail++;
	if (test_bsearch_1024(&i))
		fail++;
	if (test_bsearch_with_try_0(&i))
		fail++;
	if (test_bsearch_with_try_2(&i))
		fail++;
	if (test_bsearch_with_try_3(&i))
		fail++;
	if (test_bsearch_with_try_10(&i))
		fail++;
	if (test_bsearch_with_try_1024(&i))
		fail++;
	if (test_bsearch_recursive_0(&i))
		fail++;
	if (test_bsearch_recursive_2(&i))
		fail++;
	if (test_bsearch_recursive_3(&i))
		fail++;
	if (test_bsearch_recursive_10(&i))
		fail++;
	if (test_bsearch_recursive_1024(&i))
		fail++;
	if (test_bsearch_recursive_with_try_0(&i))
		fail++;
	if (test_bsearch_recursive_with_try_2(&i))
		fail++;
	if (test_bsearch_recursive_with_try_3(&i))
		fail++;
	if (test_bsearch_recursive_with_try_10(&i))
		fail++;
	if (test_bsearch_recursive_with_try_1024(&i))
		fail++;

	puts("");

	return fail;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq 0x64(%rsp), %r14
andl $0x0, (%r14)
leaq 0x1e9a(%rip), %rbx      # 0x4024
movq %rbx, %rdi
callq 0x2040
leaq 0x1e6b(%rip), %rdi      # 0x4004
callq 0x2040
movq %rbx, %rdi
callq 0x2040
movq %r14, %rdi
callq 0x2474
xorl %r15d, %r15d
testl %eax, %eax
setne %r15b
movq %r14, %rdi
callq 0x2540
leal 0x1(%r15), %ebx
testl %eax, %eax
cmovel %r15d, %ebx
movq %r14, %rdi
callq 0x25ea
movl %eax, 0x50(%rsp)
movq %r14, %rdi
callq 0x2694
movl %eax, 0x40(%rsp)
movq %r14, %rdi
callq 0x273e
movl %eax, 0x30(%rsp)
movq %r14, %rdi
callq 0x27f3
movl %eax, 0x20(%rsp)
movq %r14, %rdi
callq 0x28c2
movl %eax, 0x1c(%rsp)
movq %r14, %rdi
callq 0x298d
movl %eax, 0x18(%rsp)
movq %r14, %rdi
callq 0x2a58
movl %eax, 0x14(%rsp)
movq %r14, %rdi
callq 0x2b23
movl %eax, 0x10(%rsp)
movq %r14, %rdi
callq 0x2bdd
movl %eax, 0xc(%rsp)
movq %r14, %rdi
callq 0x2c8f
movl %eax, 0x8(%rsp)
movq %r14, %rdi
callq 0x2d39
movl %eax, 0x4(%rsp)
movq %r14, %rdi
callq 0x2de3
movl %eax, %r13d
movq %r14, %rdi
callq 0x2e8d
movl %eax, %ebp
movq %r14, %rdi
callq 0x2f2a
movl %eax, %r15d
movq %r14, %rdi
callq 0x2ff9
movl %eax, %r12d
movq %r14, %rdi
callq 0x30c4
movd %ebp, %xmm12
movd %r15d, %xmm0
movd %r12d, %xmm1
movd %eax, %xmm2
movd 0xc(%rsp), %xmm13
movd 0x8(%rsp), %xmm3
movd 0x4(%rsp), %xmm4
movd %r13d, %xmm5
movss 0x1c(%rsp), %xmm14
movss 0x18(%rsp), %xmm6
movss 0x14(%rsp), %xmm7
movss 0x10(%rsp), %xmm8
movss 0x50(%rsp), %xmm15
movss 0x40(%rsp), %xmm9
movss 0x30(%rsp), %xmm10
movss 0x20(%rsp), %xmm11
punpckldq %xmm0, %xmm12   # xmm12 = xmm12[0],xmm0[0],xmm12[1],xmm0[1]
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
punpcklqdq %xmm1, %xmm12   # xmm12 = xmm12[0],xmm1[0]
movdqa %xmm12, 0x50(%rsp)
punpckldq %xmm3, %xmm13   # xmm13 = xmm13[0],xmm3[0],xmm13[1],xmm3[1]
punpckldq %xmm5, %xmm4    # xmm4 = xmm4[0],xmm5[0],xmm4[1],xmm5[1]
punpcklqdq %xmm4, %xmm13   # xmm13 = xmm13[0],xmm4[0]
movdqa %xmm13, 0x40(%rsp)
unpcklps %xmm6, %xmm14           # xmm14 = xmm14[0],xmm6[0],xmm14[1],xmm6[1]
unpcklps %xmm8, %xmm7            # xmm7 = xmm7[0],xmm8[0],xmm7[1],xmm8[1]
movlhps %xmm7, %xmm14           # xmm14 = xmm14[0],xmm7[0]
movaps %xmm14, 0x30(%rsp)
unpcklps %xmm9, %xmm15           # xmm15 = xmm15[0],xmm9[0],xmm15[1],xmm9[1]
unpcklps %xmm11, %xmm10          # xmm10 = xmm10[0],xmm11[0],xmm10[1],xmm11[1]
movlhps %xmm10, %xmm15          # xmm15 = xmm15[0],xmm10[0]
movaps %xmm15, 0x20(%rsp)
movq %r14, %rdi
callq 0x318f
movl %eax, %ebp
movq %r14, %rdi
callq 0x325a
movdqa 0x20(%rsp), %xmm1
pxor %xmm3, %xmm3
pcmpeqd %xmm3, %xmm1
movdqa 0x30(%rsp), %xmm0
pcmpeqd %xmm3, %xmm0
packssdw %xmm0, %xmm1
movdqa 0x40(%rsp), %xmm2
pcmpeqd %xmm3, %xmm2
movdqa 0x50(%rsp), %xmm0
pcmpeqd %xmm3, %xmm0
packssdw %xmm0, %xmm2
packsswb %xmm2, %xmm1
pmovmskb %xmm1, %ecx
notl %ecx
movl %ecx, %edx
shrl %edx
andl $0x5555, %edx           # imm = 0x5555
subl %edx, %ecx
movl $0x3333, %edx           # imm = 0x3333
movl %ecx, %esi
andl %edx, %esi
shrl $0x2, %ecx
andl %edx, %ecx
addl %esi, %ecx
movl %ecx, %edx
shrl $0x4, %edx
addl %ecx, %edx
andl $0xf0f, %edx            # imm = 0xF0F
movl %edx, %ecx
shrl $0x8, %ecx
addl %edx, %ecx
movzbl %cl, %ecx
cmpl $0x1, %ebp
sbbl $-0x1, %ecx
cmpl $0x1, %eax
sbbl $-0x1, %ebx
addl %ecx, %ebx
pushq $0xa
popq %rdi
callq 0x2030
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)