// File: /workspace/github_c_makefile_star2_O3/younix[P]stack/test.c
// Function: main
int
main(int argc, char*argv[])
{
	struct cstack c;
	struct istack i;
	struct fstack f;
	struct dstack d;

	char   cval = '1';
	int    ival = 1;
	float  fval = 1.0;
	double dval = 1.0;

	cstack_init(&c);
	istack_init(&i);
	fstack_init(&f);
	dstack_init(&d);

	for (int p = 0; p < BUFSIZ; p++) {
		if (cstack_push(&c, cval) == false) goto err;
		if (istack_push(&i, ival) == false) goto err;
		if (fstack_push(&f, fval) == false) goto err;
		if (dstack_push(&d, dval) == false) goto err;
	}

	if (cstack_push(&c, cval) == true) goto err;
	if (istack_push(&i, ival) == true) goto err;
	if (fstack_push(&f, fval) == true) goto err;
	if (dstack_push(&d, dval) == true) goto err;

	for (int p = 0; p < BUFSIZ; p++) {
		if (cstack_pop(&c, &cval) == false) goto err;
		if (istack_pop(&i, &ival) == false) goto err;
		if (fstack_pop(&f, &fval) == false) goto err;
		if (dstack_pop(&d, &dval) == false) goto err;

		if (cstack_push(&c, cval) == false) goto err;
		if (istack_push(&i, ival) == false) goto err;
		if (fstack_push(&f, fval) == false) goto err;
		if (dstack_push(&d, dval) == false) goto err;

		if (cstack_pop(&c, NULL) == false) goto err;
		if (istack_pop(&i, NULL) == false) goto err;
		if (fstack_pop(&f, NULL) == false) goto err;
		if (dstack_pop(&d, NULL) == false) goto err;
	}

	if (cstack_pop(&c, NULL) == true) goto err;
	if (istack_pop(&i, NULL) == true) goto err;
	if (fstack_pop(&f, NULL) == true) goto err;
	if (dstack_pop(&d, NULL) == true) goto err;

	return EXIT_SUCCESS;
 err:
	return EXIT_FAILURE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x22038, %rsp          # imm = 0x22038
movb $0x31, 0x7(%rsp)
movl $0x1, 0xc(%rsp)
movl $0x3f800000, 0x8(%rsp)  # imm = 0x3F800000
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x10(%rsp)
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x401940
leaq 0xa028(%rsp), %r14
movq %r14, %rdi
callq 0x401990
leaq 0x2020(%rsp), %r15
movq %r15, %rdi
callq 0x4019e0
leaq 0x12030(%rsp), %r12
movq %r12, %rdi
callq 0x401a34
movl $0x2000, %ebp           # imm = 0x2000
movq %rbx, %rdi
movl $0x31, %esi
callq 0x40194c
testb %al, %al
je 0x4017b0
movq %r14, %rdi
movl $0x1, %esi
callq 0x40199c
testb %al, %al
je 0x4017b0
movq %r15, %rdi
movss 0x968d0(%rip), %xmm0    # 0x498004
callq 0x4019ec
testb %al, %al
je 0x4017b0
movq %r12, %rdi
movsd 0x968c0(%rip), %xmm0    # 0x498008
callq 0x401a40
testb %al, %al
je 0x4017b0
decl %ebp
jne 0x4016ff
leaq 0x18(%rsp), %rdi
movl $0x31, %esi
callq 0x40194c
testb %al, %al
jne 0x4017b0
leaq 0xa028(%rsp), %rdi
movl $0x1, %esi
callq 0x40199c
testb %al, %al
jne 0x4017b0
leaq 0x2020(%rsp), %rdi
movss 0x96876(%rip), %xmm0    # 0x498004
callq 0x4019ec
testb %al, %al
jne 0x4017b0
leaq 0x12030(%rsp), %rdi
movsd 0x96861(%rip), %xmm0    # 0x498008
callq 0x401a40
testb %al, %al
je 0x4017c9
movl $0x1, %ebx
movl %ebx, %eax
addq $0x22038, %rsp          # imm = 0x22038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x2000, %r12d          # imm = 0x2000
leaq 0x18(%rsp), %rbx
leaq 0x7(%rsp), %r14
leaq 0xa028(%rsp), %r15
leaq 0x2020(%rsp), %r13
leaq 0x12030(%rsp), %rbp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x40196d
testb %al, %al
je 0x4017b0
movq %r15, %rdi
leaq 0xc(%rsp), %rsi
callq 0x4019bc
testb %al, %al
je 0x4017b0
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
callq 0x401a0e
testb %al, %al
je 0x4017b0
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
callq 0x401a62
testb %al, %al
je 0x4017b0
movsbl 0x7(%rsp), %esi
movq %rbx, %rdi
callq 0x40194c
testb %al, %al
je 0x4017b0
movl 0xc(%rsp), %esi
movq %r15, %rdi
callq 0x40199c
testb %al, %al
je 0x4017b0
movss 0x8(%rsp), %xmm0
movq %r13, %rdi
callq 0x4019ec
testb %al, %al
je 0x4017b0
movsd 0x10(%rsp), %xmm0
movq %rbp, %rdi
callq 0x401a40
testb %al, %al
je 0x4017b0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x40196d
testb %al, %al
je 0x4017b0
movq %r15, %rdi
xorl %esi, %esi
callq 0x4019bc
testb %al, %al
je 0x4017b0
movq %r13, %rdi
xorl %esi, %esi
callq 0x401a0e
testb %al, %al
je 0x4017b0
movq %rbp, %rdi
xorl %esi, %esi
callq 0x401a62
testb %al, %al
je 0x4017b0
decl %r12d
jne 0x4017f1
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x40196d
testb %al, %al
jne 0x4017b0
leaq 0xa028(%rsp), %rdi
xorl %esi, %esi
callq 0x4019bc
testb %al, %al
jne 0x4017b0
xorl %ebx, %ebx
leaq 0x2020(%rsp), %rdi
xorl %esi, %esi
callq 0x401a0e
testb %al, %al
jne 0x4017b0
leaq 0x12030(%rsp), %rdi
xorl %esi, %esi
callq 0x401a62
testb %al, %al
jne 0x4017b0
jmp 0x4017b5
nopl (%rax)