// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/memtest.c
// Function: memtest_test
int memtest_test(unsigned long *m, size_t bytes, int passes, int interactive) {
    int pass = 0;
    int errors = 0;

    while (pass != passes) {
        pass++;

        if (interactive) memtest_progress_start("Addressing test",pass);
        errors += memtest_addressing(m,bytes,interactive);
        if (interactive) memtest_progress_end();

        if (interactive) memtest_progress_start("Random fill",pass);
        memtest_fill_random(m,bytes,interactive);
        if (interactive) memtest_progress_end();
        errors += memtest_compare_times(m,bytes,pass,4,interactive);

        if (interactive) memtest_progress_start("Solid fill",pass);
        memtest_fill_value(m,bytes,0,(unsigned long)-1,'S',interactive);
        if (interactive) memtest_progress_end();
        errors += memtest_compare_times(m,bytes,pass,4,interactive);

        if (interactive) memtest_progress_start("Checkerboard fill",pass);
        memtest_fill_value(m,bytes,ULONG_ONEZERO,ULONG_ZEROONE,'C',interactive);
        if (interactive) memtest_progress_end();
        errors += memtest_compare_times(m,bytes,pass,4,interactive);
    }
    return errors;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testl %edx, %edx
je 0x7703b
movl %ecx, %ebx
movq %rsi, %r15
movq %rdi, %r12
negl %edx
movl $0x1, %r13d
xorl %r14d, %r14d
movq %rdx, 0x10(%rsp)
testl %ebx, %ebx
je 0x76e98
leaq 0x574e7(%rip), %rdi     # 0xce377
movl %r13d, %esi
callq 0x768c8
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x769fd
movl %eax, %ebp
testl %ebx, %ebx
je 0x76ee5
leaq 0x57312(%rip), %rdi     # 0xce1c4
xorl %eax, %eax
callq 0x260a0
leaq 0x574c7(%rip), %rdi     # 0xce387
movl %r13d, %esi
callq 0x768c8
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x76ae1
leaq 0x572e8(%rip), %rdi     # 0xce1c4
xorl %eax, %eax
callq 0x260a0
jmp 0x76ef2
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x76ae1
movq %r12, %rdi
movq %r15, %rsi
movl %r13d, %edx
movl $0x4, %ecx
movl %ebx, %r8d
callq 0x76de2
movl %eax, 0xc(%rsp)
testl %ebx, %ebx
je 0x76f4c
leaq 0x5747c(%rip), %rdi     # 0xce393
movl %r13d, %esi
callq 0x768c8
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq $-0x1, %rcx
movl $0x53, %r8d
movl %ebx, %r9d
callq 0x76c06
leaq 0x57281(%rip), %rdi     # 0xce1c4
xorl %eax, %eax
callq 0x260a0
jmp 0x76f69
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq $-0x1, %rcx
movl $0x53, %r8d
movl %ebx, %r9d
callq 0x76c06
movq %r12, %rdi
movq %r15, %rsi
movl %r13d, %edx
movl $0x4, %ecx
movl %ebx, %r8d
callq 0x76de2
movl %eax, 0x8(%rsp)
testl %ebx, %ebx
je 0x76fce
leaq 0x57410(%rip), %rdi     # 0xce39e
movl %r13d, %esi
callq 0x768c8
movq %r12, %rdi
movq %r15, %rsi
movabsq $-0x5555555555555556, %rdx # imm = 0xAAAAAAAAAAAAAAAA
movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555
movl $0x43, %r8d
movl %ebx, %r9d
callq 0x76c06
leaq 0x571ff(%rip), %rdi     # 0xce1c4
xorl %eax, %eax
callq 0x260a0
jmp 0x76ff6
movq %r12, %rdi
movq %r15, %rsi
movabsq $-0x5555555555555556, %rdx # imm = 0xAAAAAAAAAAAAAAAA
movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555
movl $0x43, %r8d
movl %ebx, %r9d
callq 0x76c06
addl %r14d, %ebp
addl 0xc(%rsp), %ebp
addl 0x8(%rsp), %ebp
movq %r12, %rdi
movq %r15, %rsi
movl %r13d, %edx
movl $0x4, %ecx
movl %ebx, %r8d
callq 0x76de2
movl %eax, %r14d
addl %ebp, %r14d
movq 0x10(%rsp), %rdx
leal (%rdx,%r13), %eax
incl %eax
movl %r13d, %ecx
incl %ecx
movl %ecx, %r13d
cmpl $0x1, %eax
jne 0x76e85
jmp 0x7703e
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq