// File: /workspace/github_c_makefile_star2_O2/mmcco[P]sljit/regex_src/regexMain.c
// Function: run_tests
void run_tests(struct test_case* test, int verbose, int silent)
{
	int error;
	const regex_char_t *ptr;
	struct regex_machine* machine = NULL;
	struct regex_match* match;
	int begin, end, id, finished;
	int success = 0, fail = 0;

	if (!verbose && !silent)
		printf("Pass -v to enable verbose, -s to disable this hint.\n\n");

	for ( ; test->string ; test++) {
		if (verbose)
			printf("test: '%s' '%s': ", test->pattern ? test->pattern : "[[REUSE]]", test->string);
		fail++;

		if (test->pattern) {
			if (machine)
				regex_free_machine(machine);

			ptr = test->pattern;
			while (*ptr)
				ptr++;

			machine = regex_compile(test->pattern, ptr - test->pattern, test->flags, &error);

			if (error) {
				if (!verbose)
					printf("test: '%s' '%s': ", test->pattern ? test->pattern : "[[REUSE]]", test->string);
				printf("ABORT: Error %d\n", error);
				return;
			}
			if (!machine) {
				if (!verbose)
					printf("test: '%s' '%s': ", test->pattern ? test->pattern : "[[REUSE]]", test->string);
				printf("ABORT: machine must be exists. Report this bug, please\n");
				return;
			}
		}
		else if (test->flags != 0) {
			if (!verbose)
				printf("test: '%s' '%s': ", test->pattern ? test->pattern : "[[REUSE]]", test->string);
			printf("ABORT: flag must be 0 if no pattern\n");
			return;
		}

		ptr = test->string;
		while (*ptr)
			ptr++;

		match = regex_begin_match(machine);
#ifdef REGEX_MATCH_VERBOSE
		if (!match) {
			if (!verbose)
				printf("test: '%s' '%s': ", test->pattern ? test->pattern : "[[REUSE]]", test->string);
			printf("ABORT: Not enough memory for matching\n");
			regex_free_machine(machine);
			return;
		}
		regex_continue_match_debug(match, test->string, ptr - test->string);
		begin = regex_get_result(match, &end, &id);
		finished = regex_is_match_finished(match);

		if (begin != test->begin || end != test->end || id != test->id) {
			if (!verbose)
				printf("test: '%s' '%s': ", test->pattern ? test->pattern : "[[REUSE]]", test->string);
			printf("FAIL A: begin: %d != %d || end: %d != %d || id: %d != %d\n", test->begin, begin, test->end, end, test->id, id);
			continue;
		}
		if (test->finished != -1 && test->finished != !!finished) {
			if (!verbose)
				printf("test: '%s' '%s': ", test->pattern ? test->pattern : "[[REUSE]]", test->string);
			printf("FAIL A: finish check\n");
			continue;
		}
#endif

		regex_reset_match(match);
		regex_continue_match(match, test->string, ptr - test->string);
		begin = regex_get_result(match, &end, &id);
		finished = regex_is_match_finished(match);
		regex_free_match(match);

		if (begin != test->begin || end != test->end || id != test->id) {
			if (!verbose)
				printf("test: '%s' '%s': ", test->pattern ? test->pattern : "[[REUSE]]", test->string);
			printf("FAIL B: begin: %d != %d || end: %d != %d || id: %d != %d\n", test->begin, begin, test->end, end, test->id, id);
			continue;
		}
		if (test->finished != -1 && test->finished != !!finished) {
			if (!verbose)
				printf("test: '%s' '%s': ", test->pattern ? test->pattern : "[[REUSE]]", test->string);
			printf("FAIL B: finish check\n");
			continue;
		}

		if (verbose)
			printf("SUCCESS\n");
		fail--;
		success++;
	}
	if (machine)
		regex_free_machine(machine);

	printf("REGEX tests: ");
	if (fail == 0)
		printf("all tests are " COLOR_GREEN "PASSED" COLOR_DEFAULT " ");
	else
		printf(COLOR_RED "%d" COLOR_DEFAULT " (" COLOR_RED "%d%%" COLOR_DEFAULT ") tests are failed ", fail, fail * 100 / (success + fail));
	printf("on " COLOR_ARCH "%s" COLOR_DEFAULT "\n", regex_get_platform_name());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %r15d
movq %rdi, %r14
orl %esi, %edx
jne 0x2360
leaq 0x101a1(%rip), %rdi     # 0x124fc
callq 0x2060
xorl %r13d, %r13d
movl $0x0, 0x18(%rsp)
xorl %r12d, %r12d
movq 0x20(%r14), %rdx
testq %rdx, %rdx
je 0x2651
testl %r15d, %r15d
je 0x23a0
movq 0x18(%r14), %rsi
testq %rsi, %rsi
leaq 0xfcda(%rip), %rax      # 0x12068
cmoveq %rax, %rsi
leaq 0xfcbd(%rip), %rdi      # 0x12056
xorl %eax, %eax
callq 0x2080
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0x23ef
testq %r13, %r13
je 0x23ba
movq %r13, %rdi
callq 0x623e
movq 0x18(%r14), %rdi
xorl %esi, %esi
cmpb $0x0, (%rdi,%rsi)
leaq 0x1(%rsi), %rsi
jne 0x23bc
decl %esi
movl 0x10(%r14), %edx
leaq 0x1c(%rsp), %rcx
callq 0x27f4
movl 0x1c(%rsp), %esi
testl %esi, %esi
jne 0x26dd
movq %rax, %r13
testq %rax, %rax
jne 0x23fa
jmp 0x271d
cmpl $0x0, 0x10(%r14)
jne 0x2775
movq %r12, 0x20(%rsp)
leal 0x1(%r12), %ebp
movq 0x20(%r14), %rax
leal -0x1(%rax), %r12d
incl %r12d
cmpb $0x0, (%rax)
leaq 0x1(%rax), %rax
jne 0x240c
movq %r13, %rdi
callq 0x6259
testq %rax, %rax
je 0x269b
movq %rax, %rbx
movl %ebp, 0x14(%rsp)
movq 0x20(%r14), %rsi
movl %r12d, %edx
subl %esi, %edx
movq %rax, %rdi
callq 0x64eb
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0x63e0
movl %eax, %ebp
movq %rbx, %rdi
callq 0x64e7
movl (%r14), %esi
cmpl %esi, %ebp
jne 0x2539
movl 0x10(%rsp), %ecx
cmpl 0x4(%r14), %ecx
jne 0x2539
movl 0xc(%rsp), %ecx
cmpl 0x8(%r14), %ecx
jne 0x2539
movl 0xc(%r14), %ecx
cmpl $-0x1, %ecx
je 0x249c
xorl %edx, %edx
testl %eax, %eax
setne %dl
cmpl %edx, %ecx
jne 0x25e5
movq %rbx, %rdi
callq 0x6392
movq 0x20(%r14), %rsi
subl %esi, %r12d
movq %rbx, %rdi
movl %r12d, %edx
callq 0x63da
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0x63e0
movl %eax, %r12d
movq %rbx, %rdi
callq 0x64e7
movl %eax, %ebp
movq %rbx, %rdi
callq 0x63d5
movl (%r14), %esi
cmpl %esi, %r12d
jne 0x2599
movl 0x10(%rsp), %eax
cmpl 0x4(%r14), %eax
jne 0x2599
movl 0xc(%rsp), %eax
cmpl 0x8(%r14), %eax
jne 0x2599
movl 0xc(%r14), %eax
cmpl $-0x1, %eax
je 0x251d
xorl %ecx, %ecx
testl %ebp, %ebp
setne %cl
cmpl %ecx, %eax
jne 0x261f
testl %r15d, %r15d
je 0x252e
leaq 0x10089(%rip), %rdi     # 0x125b2
callq 0x2060
incl 0x18(%rsp)
movq 0x20(%rsp), %rax
jmp 0x258d
testl %r15d, %r15d
jne 0x2565
movq 0x18(%r14), %rsi
movq 0x20(%r14), %rdx
testq %rsi, %rsi
leaq 0xfb18(%rip), %rax      # 0x12068
cmoveq %rax, %rsi
leaq 0xfafb(%rip), %rdi      # 0x12056
xorl %eax, %eax
callq 0x2080
movl (%r14), %esi
movl 0x10(%rsp), %r8d
movl 0x4(%r14), %ecx
movl 0x8(%r14), %r9d
movl 0xc(%rsp), %eax
movl %eax, (%rsp)
leaq 0xfb03(%rip), %rdi      # 0x12083
movl %ebp, %edx
xorl %eax, %eax
callq 0x2080
movl 0x14(%rsp), %eax
addq $0x28, %r14
movl %eax, %r12d
jmp 0x236e
testl %r15d, %r15d
jne 0x25c5
movq 0x18(%r14), %rsi
movq 0x20(%r14), %rdx
testq %rsi, %rsi
leaq 0xfab8(%rip), %rax      # 0x12068
cmoveq %rax, %rsi
leaq 0xfa9b(%rip), %rdi      # 0x12056
xorl %eax, %eax
callq 0x2080
movl (%r14), %esi
movl 0x10(%rsp), %r8d
movl 0x4(%r14), %ecx
movl 0x8(%r14), %r9d
movl 0xc(%rsp), %eax
movl %eax, (%rsp)
leaq 0xfadd(%rip), %rdi      # 0x120bd
movl %r12d, %edx
jmp 0x2582
testl %r15d, %r15d
jne 0x260e
movq 0x18(%r14), %rsi
movq 0x20(%r14), %rdx
testq %rsi, %rsi
leaq 0xfa6c(%rip), %rax      # 0x12068
cmoveq %rax, %rsi
leaq 0xfa4f(%rip), %rdi      # 0x12056
xorl %eax, %eax
callq 0x2080
leaq 0xffba(%rip), %rdi      # 0x125cf
callq 0x2060
jmp 0x2589
testl %r15d, %r15d
jne 0x2648
movq 0x18(%r14), %rsi
movq 0x20(%r14), %rdx
testq %rsi, %rsi
leaq 0xfa32(%rip), %rax      # 0x12068
cmoveq %rax, %rsi
leaq 0xfa15(%rip), %rdi      # 0x12056
xorl %eax, %eax
callq 0x2080
leaq 0xff6b(%rip), %rdi      # 0x125ba
jmp 0x2615
testq %r13, %r13
je 0x265e
movq %r13, %rdi
callq 0x623e
leaq 0xfa92(%rip), %rdi      # 0x120f7
xorl %eax, %eax
callq 0x2080
testl %r12d, %r12d
je 0x274f
imull $0x64, %r12d, %eax
movl 0x18(%rsp), %ecx
addl %r12d, %ecx
cltd
idivl %ecx
leaq 0xfa9a(%rip), %rdi      # 0x12124
movl %r12d, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x2080
jmp 0x275d
testl %r15d, %r15d
jne 0x26c4
movq 0x18(%r14), %rax
movq 0x20(%r14), %rdx
testq %rax, %rax
leaq 0xf9b6(%rip), %rsi      # 0x12068
cmovneq %rax, %rsi
leaq 0xf999(%rip), %rdi      # 0x12056
xorl %eax, %eax
callq 0x2080
leaq 0xfec1(%rip), %rdi      # 0x1258c
callq 0x2060
movq %r13, %rdi
callq 0x623e
jmp 0x279f
testl %r15d, %r15d
jne 0x270a
movq 0x18(%r14), %rax
movq 0x20(%r14), %rdx
testq %rax, %rax
leaq 0xf974(%rip), %rsi      # 0x12068
cmovneq %rax, %rsi
leaq 0xf957(%rip), %rdi      # 0x12056
xorl %eax, %eax
callq 0x2080
movl 0x1c(%rsp), %esi
leaq 0xf961(%rip), %rdi      # 0x12072
xorl %eax, %eax
callq 0x2080
jmp 0x279f
testl %r15d, %r15d
jne 0x2746
movq 0x18(%r14), %rax
movq 0x20(%r14), %rdx
testq %rax, %rax
leaq 0xf934(%rip), %rsi      # 0x12068
cmovneq %rax, %rsi
leaq 0xf917(%rip), %rdi      # 0x12056
xorl %eax, %eax
callq 0x2080
leaq 0xfe08(%rip), %rdi      # 0x12555
jmp 0x279a
leaq 0xf9af(%rip), %rdi      # 0x12105
xorl %eax, %eax
callq 0x2080
callq 0x6254
leaq 0xf9e9(%rip), %rdi      # 0x12152
movq %rax, %rsi
xorl %eax, %eax
callq 0x2080
jmp 0x279f
testl %r15d, %r15d
jne 0x2793
movq 0x20(%r14), %rdx
leaq 0xf8d1(%rip), %rdi      # 0x12056
leaq 0xf8dc(%rip), %rsi      # 0x12068
xorl %eax, %eax
callq 0x2080
leaq 0xfd97(%rip), %rdi      # 0x12531
callq 0x2060
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq