// File: /workspace/github_c_makefile_star2_O3/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 $0x38, %rsp
movl %esi, %r13d
movq %rdi, %r14
orl %esi, %edx
jne 0x2362
leaq 0x1119f(%rip), %rdi     # 0x134fc
callq 0x2060
movq 0x20(%r14), %rdx
testq %rdx, %rdx
je 0x2675
leaq 0x20(%r14), %r15
xorl %r12d, %r12d
movl $0x0, 0x28(%rsp)
xorl %ebp, %ebp
testl %r13d, %r13d
je 0x23a5
movq 0x18(%r14), %rsi
testq %rsi, %rsi
leaq 0x10cd5(%rip), %rax     # 0x13068
cmoveq %rax, %rsi
leaq 0x10cb8(%rip), %rdi     # 0x13056
xorl %eax, %eax
callq 0x2080
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0x23f4
testq %rbp, %rbp
je 0x23bf
movq %rbp, %rdi
callq 0x6616
movq 0x18(%r14), %rdi
xorl %esi, %esi
cmpb $0x0, (%rdi,%rsi)
leaq 0x1(%rsi), %rsi
jne 0x23c1
decl %esi
movl 0x10(%r14), %edx
leaq 0x2c(%rsp), %rcx
callq 0x2824
movl 0x2c(%rsp), %esi
testl %esi, %esi
jne 0x2737
movq %rax, %rbp
testq %rax, %rax
jne 0x23ff
jmp 0x2773
cmpl $0x0, 0x10(%r14)
jne 0x27a4
movq %r12, 0x30(%rsp)
leal 0x1(%r12), %eax
movl %eax, 0x1c(%rsp)
movq (%r15), %rax
leal -0x1(%rax), %r12d
incl %r12d
cmpb $0x0, (%rax)
leaq 0x1(%rax), %rax
jne 0x2414
movq %rbp, %rdi
callq 0x6631
testq %rax, %rax
je 0x26ac
movq %rax, %rbx
movq %rbp, 0x20(%rsp)
movq (%r15), %rsi
movl %r12d, %edx
subl %esi, %edx
movq %rax, %rdi
callq 0x6909
movq %rbx, %rdi
leaq 0x18(%rsp), %rsi
leaq 0x14(%rsp), %rdx
callq 0x67f9
movl %eax, %ebp
movq %rbx, %rdi
callq 0x6905
movl (%r14), %esi
cmpl %esi, %ebp
jne 0x2545
movl 0x18(%rsp), %ecx
cmpl 0x4(%r14), %ecx
jne 0x2545
movl 0x14(%rsp), %ecx
cmpl 0x8(%r14), %ecx
jne 0x2545
movl 0xc(%r14), %ecx
cmpl $-0x1, %ecx
je 0x24a4
xorl %edx, %edx
testl %eax, %eax
setne %dl
cmpl %edx, %ecx
jne 0x260b
movq %rbx, %rdi
callq 0x67a5
movq (%r15), %rsi
subl %esi, %r12d
movq %rbx, %rdi
movl %r12d, %edx
callq 0x67f3
movq %rbx, %rdi
leaq 0x18(%rsp), %rsi
leaq 0x14(%rsp), %rdx
callq 0x67f9
movl %eax, %r12d
movq %rbx, %rdi
callq 0x6905
movl %eax, %ebp
movq %rbx, %rdi
callq 0x67ee
movl (%r14), %esi
cmpl %esi, %r12d
jne 0x25c0
movl 0x18(%rsp), %eax
cmpl 0x4(%r14), %eax
jne 0x25c0
movl 0x14(%rsp), %eax
cmpl 0x8(%r14), %eax
jne 0x25c0
movl 0xc(%r14), %eax
cmpl $-0x1, %eax
je 0x2524
xorl %ecx, %ecx
testl %ebp, %ebp
setne %cl
cmpl %ecx, %eax
jne 0x2644
testl %r13d, %r13d
je 0x2535
leaq 0x11082(%rip), %rdi     # 0x135b2
callq 0x2060
incl 0x28(%rsp)
movq 0x20(%rsp), %rbp
movq 0x30(%rsp), %r12
jmp 0x25a0
testl %r13d, %r13d
jne 0x2570
movq 0x18(%r14), %rsi
testq %rsi, %rsi
leaq 0x10b10(%rip), %rax     # 0x13068
cmoveq %rax, %rsi
movq (%r15), %rdx
leaq 0x10af0(%rip), %rdi     # 0x13056
xorl %eax, %eax
callq 0x2080
movl (%r14), %esi
movl 0x18(%rsp), %r8d
movl 0x4(%r14), %ecx
movl 0x8(%r14), %r9d
movl 0x14(%rsp), %eax
movl %eax, (%rsp)
leaq 0x10af8(%rip), %rdi     # 0x13083
movl %ebp, %edx
xorl %eax, %eax
callq 0x2080
movl 0x1c(%rsp), %eax
movl %eax, %r12d
movq 0x20(%rsp), %rbp
leaq 0x28(%r14), %rax
movq 0x48(%r14), %rdx
addq $0x48, %r14
movq %r14, %r15
movq %rax, %r14
testq %rdx, %rdx
jne 0x2380
jmp 0x26ed
testl %r13d, %r13d
jne 0x25eb
movq 0x18(%r14), %rsi
testq %rsi, %rsi
leaq 0x10a95(%rip), %rax     # 0x13068
cmoveq %rax, %rsi
movq (%r15), %rdx
leaq 0x10a75(%rip), %rdi     # 0x13056
xorl %eax, %eax
callq 0x2080
movl (%r14), %esi
movl 0x18(%rsp), %r8d
movl 0x4(%r14), %ecx
movl 0x8(%r14), %r9d
movl 0x14(%rsp), %eax
movl %eax, (%rsp)
leaq 0x10ab7(%rip), %rdi     # 0x130bd
movl %r12d, %edx
jmp 0x258d
testl %r13d, %r13d
jne 0x2633
movq 0x18(%r14), %rsi
testq %rsi, %rsi
leaq 0x10a4a(%rip), %rax     # 0x13068
cmoveq %rax, %rsi
movq (%r15), %rdx
leaq 0x10a2a(%rip), %rdi     # 0x13056
xorl %eax, %eax
callq 0x2080
leaq 0x10f95(%rip), %rdi     # 0x135cf
callq 0x2060
jmp 0x2594
testl %r13d, %r13d
jne 0x266c
movq 0x18(%r14), %rsi
testq %rsi, %rsi
leaq 0x10a11(%rip), %rax     # 0x13068
cmoveq %rax, %rsi
movq (%r15), %rdx
leaq 0x109f1(%rip), %rdi     # 0x13056
xorl %eax, %eax
callq 0x2080
leaq 0x10f47(%rip), %rdi     # 0x135ba
jmp 0x263a
leaq 0x10a7b(%rip), %rdi     # 0x130f7
xorl %eax, %eax
callq 0x2080
leaq 0x10a7b(%rip), %rdi     # 0x13105
xorl %eax, %eax
callq 0x2080
callq 0x662c
leaq 0x10ab5(%rip), %rdi     # 0x13152
movq %rax, %rsi
xorl %eax, %eax
callq 0x2080
jmp 0x27cd
testl %r13d, %r13d
jne 0x26d4
movq 0x18(%r14), %rax
testq %rax, %rax
leaq 0x109a9(%rip), %rsi     # 0x13068
cmovneq %rax, %rsi
movq (%r15), %rdx
leaq 0x10989(%rip), %rdi     # 0x13056
xorl %eax, %eax
callq 0x2080
leaq 0x10eb1(%rip), %rdi     # 0x1358c
callq 0x2060
movq %rbp, %rdi
callq 0x6616
jmp 0x27cd
testq %rbp, %rbp
je 0x26fa
movq %rbp, %rdi
callq 0x6616
leaq 0x109f6(%rip), %rdi     # 0x130f7
xorl %eax, %eax
callq 0x2080
testl %r12d, %r12d
je 0x2683
imull $0x64, %r12d, %eax
movl 0x28(%rsp), %ecx
addl %r12d, %ecx
cltd
idivl %ecx
leaq 0x109fe(%rip), %rdi     # 0x13124
movl %r12d, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x2080
jmp 0x2691
testl %r13d, %r13d
jne 0x2763
movq 0x18(%r14), %rax
testq %rax, %rax
leaq 0x1091e(%rip), %rsi     # 0x13068
cmovneq %rax, %rsi
movq (%r15), %rdx
leaq 0x108fe(%rip), %rdi     # 0x13056
xorl %eax, %eax
callq 0x2080
movl 0x2c(%rsp), %esi
leaq 0x10908(%rip), %rdi     # 0x13072
xorl %eax, %eax
callq 0x2080
jmp 0x27cd
testl %r13d, %r13d
jne 0x279b
movq 0x18(%r14), %rax
testq %rax, %rax
leaq 0x108e2(%rip), %rsi     # 0x13068
cmovneq %rax, %rsi
movq (%r15), %rdx
leaq 0x108c2(%rip), %rdi     # 0x13056
xorl %eax, %eax
callq 0x2080
leaq 0x10db3(%rip), %rdi     # 0x13555
jmp 0x27c8
testl %r13d, %r13d
jne 0x27c1
movq (%r15), %rdx
leaq 0x108a3(%rip), %rdi     # 0x13056
leaq 0x108ae(%rip), %rsi     # 0x13068
xorl %eax, %eax
callq 0x2080
leaq 0x10d69(%rip), %rdi     # 0x13531
callq 0x2060
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq