// File: /workspace/github_c_makefile_star2_O1/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, %ebx
movq %rdi, %r14
orl %esi, %edx
jne 0x2361
leaq 0x111a0(%rip), %rdi     # 0x134fc
callq 0x2060
movq 0x20(%r14), %rdx
testq %rdx, %rdx
je 0x268d
leaq 0x20(%r14), %r12
xorl %r15d, %r15d
movl $0x0, 0x24(%rsp)
xorl %ebp, %ebp
movl %ebx, 0x14(%rsp)
testl %ebx, %ebx
je 0x23a7
movq 0x18(%r14), %rsi
testq %rsi, %rsi
leaq 0x10cd3(%rip), %rax     # 0x13068
cmoveq %rax, %rsi
leaq 0x10cb6(%rip), %rdi     # 0x13056
xorl %eax, %eax
callq 0x2080
cmpq $0x0, 0x18(%r14)
je 0x23f3
testq %rbp, %rbp
je 0x23bb
movq %rbp, %rdi
callq 0x66b1
movq 0x18(%r14), %rdi
xorl %esi, %esi
cmpb $0x0, (%rdi,%rsi)
leaq 0x1(%rsi), %rsi
jne 0x23c1
decl %esi
movl 0x10(%r14), %edx
leaq 0x34(%rsp), %rcx
callq 0x2848
cmpl $0x0, 0x34(%rsp)
jne 0x274a
movq %rax, %rbp
testq %rax, %rax
jne 0x23fe
jmp 0x2786
cmpl $0x0, 0x10(%r14)
jne 0x27b7
leal 0x1(%r15), %eax
movl %eax, 0x20(%rsp)
movq (%r12), %rax
leal -0x1(%rax), %r13d
incl %r13d
cmpb $0x0, (%rax)
leaq 0x1(%rax), %rax
jne 0x240e
movq %rbp, %rdi
callq 0x66cc
testq %rax, %rax
je 0x2706
movq %rax, %rbx
movq %rbp, 0x28(%rsp)
movq (%r12), %rsi
movl %r13d, %edx
subl %esi, %edx
movq %rax, %rdi
callq 0x69ae
movq %rbx, %rdi
leaq 0x1c(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x689e
movl %eax, %ebp
movq %rbx, %rdi
callq 0x69aa
cmpl (%r14), %ebp
jne 0x2540
movl 0x1c(%rsp), %ecx
cmpl 0x4(%r14), %ecx
jne 0x2540
movl 0x18(%rsp), %ecx
cmpl 0x8(%r14), %ecx
jne 0x2540
movl 0xc(%r14), %ecx
cmpl $-0x1, %ecx
je 0x249d
xorl %edx, %edx
testl %eax, %eax
setne %dl
cmpl %edx, %ecx
jne 0x2612
movq %rbx, %rdi
callq 0x6847
movq (%r12), %rsi
subl %esi, %r13d
movq %rbx, %rdi
movl %r13d, %edx
callq 0x6898
movq %rbx, %rdi
leaq 0x1c(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x689e
movl %eax, %r13d
movq %rbx, %rdi
callq 0x69aa
movl %eax, %ebp
movq %rbx, %rdi
callq 0x6893
cmpl (%r14), %r13d
jne 0x25c0
movl 0x1c(%rsp), %eax
cmpl 0x4(%r14), %eax
jne 0x25c0
movl 0x18(%rsp), %eax
cmpl 0x8(%r14), %eax
jne 0x25c0
movl 0xc(%r14), %eax
cmpl $-0x1, %eax
movl 0x14(%rsp), %ebx
movl 0x20(%rsp), %r13d
je 0x2524
xorl %ecx, %ecx
testl %ebp, %ebp
setne %cl
cmpl %ecx, %eax
jne 0x264f
testl %ebx, %ebx
je 0x2534
leaq 0x11083(%rip), %rdi     # 0x135b2
callq 0x2060
incl 0x24(%rsp)
movl %r15d, %r13d
jmp 0x2683
movl 0x14(%rsp), %ebx
testl %ebx, %ebx
jne 0x256c
movq 0x18(%r14), %rsi
testq %rsi, %rsi
leaq 0x10b12(%rip), %rax     # 0x13068
cmoveq %rax, %rsi
movq (%r12), %rdx
leaq 0x10af1(%rip), %rdi     # 0x13056
xorl %eax, %eax
callq 0x2080
movl (%r14), %esi
movl 0x4(%r14), %ecx
movl 0x1c(%rsp), %r8d
movl 0x8(%r14), %r9d
movl 0x18(%rsp), %eax
movl %eax, (%rsp)
leaq 0x10af9(%rip), %rdi     # 0x13083
movl %ebp, %edx
xorl %eax, %eax
callq 0x2080
movq 0x28(%rsp), %rbp
movl 0x20(%rsp), %r13d
leaq 0x28(%r14), %rax
movq 0x48(%r14), %rdx
addq $0x48, %r14
movq %r14, %r12
movl %r13d, %r15d
movq %rax, %r14
testq %rdx, %rdx
jne 0x2383
jmp 0x269a
movl 0x14(%rsp), %ebx
testl %ebx, %ebx
jne 0x25ec
movq 0x18(%r14), %rsi
testq %rsi, %rsi
leaq 0x10a92(%rip), %rax     # 0x13068
cmoveq %rax, %rsi
movq (%r12), %rdx
leaq 0x10a71(%rip), %rdi     # 0x13056
xorl %eax, %eax
callq 0x2080
movl (%r14), %esi
movl 0x4(%r14), %ecx
movl 0x1c(%rsp), %r8d
movl 0x8(%r14), %r9d
movl 0x18(%rsp), %eax
movl %eax, (%rsp)
leaq 0x10ab3(%rip), %rdi     # 0x130bd
movl %r13d, %edx
jmp 0x258c
movl 0x14(%rsp), %ebx
testl %ebx, %ebx
jne 0x263e
movq 0x18(%r14), %rsi
testq %rsi, %rsi
leaq 0x10a40(%rip), %rax     # 0x13068
cmoveq %rax, %rsi
movq (%r12), %rdx
leaq 0x10a1f(%rip), %rdi     # 0x13056
xorl %eax, %eax
callq 0x2080
leaq 0x10f8a(%rip), %rdi     # 0x135cf
callq 0x2060
jmp 0x2593
testl %ebx, %ebx
jne 0x2677
movq 0x18(%r14), %rsi
testq %rsi, %rsi
leaq 0x10a07(%rip), %rax     # 0x13068
cmoveq %rax, %rsi
movq (%r12), %rdx
leaq 0x109e6(%rip), %rdi     # 0x13056
xorl %eax, %eax
callq 0x2080
leaq 0x10f3c(%rip), %rdi     # 0x135ba
callq 0x2060
movq 0x28(%rsp), %rbp
jmp 0x259d
xorl %ebp, %ebp
movl $0x0, 0x24(%rsp)
xorl %r13d, %r13d
testq %rbp, %rbp
je 0x26a7
movq %rbp, %rdi
callq 0x66b1
leaq 0x10a49(%rip), %rdi     # 0x130f7
xorl %eax, %eax
callq 0x2080
testl %r13d, %r13d
je 0x26dd
imull $0x64, %r13d, %eax
movl 0x24(%rsp), %ecx
addl %r13d, %ecx
cltd
idivl %ecx
leaq 0x10a55(%rip), %rdi     # 0x13124
movl %r13d, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x2080
jmp 0x26eb
leaq 0x10a21(%rip), %rdi     # 0x13105
xorl %eax, %eax
callq 0x2080
callq 0x66c7
leaq 0x10a5b(%rip), %rdi     # 0x13152
movq %rax, %rsi
xorl %eax, %eax
callq 0x2080
jmp 0x27e0
cmpl $0x0, 0x14(%rsp)
jne 0x2731
movq 0x18(%r14), %rax
testq %rax, %rax
leaq 0x1094d(%rip), %rsi     # 0x13068
cmovneq %rax, %rsi
movq (%r12), %rdx
leaq 0x1092c(%rip), %rdi     # 0x13056
xorl %eax, %eax
callq 0x2080
leaq 0x10e54(%rip), %rdi     # 0x1358c
callq 0x2060
movq %rbp, %rdi
callq 0x66b1
jmp 0x27e0
testl %ebx, %ebx
jne 0x2772
movq 0x18(%r14), %rax
testq %rax, %rax
leaq 0x1090c(%rip), %rsi     # 0x13068
cmovneq %rax, %rsi
movq (%r12), %rdx
leaq 0x108eb(%rip), %rdi     # 0x13056
xorl %eax, %eax
callq 0x2080
movl 0x34(%rsp), %esi
leaq 0x108f5(%rip), %rdi     # 0x13072
xorl %eax, %eax
callq 0x2080
jmp 0x27e0
testl %ebx, %ebx
jne 0x27ae
movq 0x18(%r14), %rax
testq %rax, %rax
leaq 0x108d0(%rip), %rsi     # 0x13068
cmovneq %rax, %rsi
movq (%r12), %rdx
leaq 0x108af(%rip), %rdi     # 0x13056
xorl %eax, %eax
callq 0x2080
leaq 0x10da0(%rip), %rdi     # 0x13555
jmp 0x27db
testl %ebx, %ebx
jne 0x27d4
movq (%r12), %rdx
leaq 0x10890(%rip), %rdi     # 0x13056
leaq 0x1089b(%rip), %rsi     # 0x13068
xorl %eax, %eax
callq 0x2080
leaq 0x10d56(%rip), %rdi     # 0x13531
callq 0x2060
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq