// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/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
movl %ecx, %ebx
movq %rsi, %r15
movq %rdi, %r12
negl %edx
movq %rdx, 0x8(%rsp)
xorl %ecx, %ecx
pushq $0x1
popq %r13
pushq $0x4
popq %r14
movq 0x8(%rsp), %rax
addl %r13d, %eax
cmpl $0x1, %eax
je 0x677e1
movq %rcx, 0x10(%rsp)
testl %ebx, %ebx
je 0x6768d
leaq 0x54b92(%rip), %rdi     # 0xbc217
movl %r13d, %esi
callq 0x67108
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x67228
movl %eax, %ebp
testl %ebx, %ebx
je 0x676c8
callq 0x671c7
leaq 0x54b7b(%rip), %rdi     # 0xbc227
movl %r13d, %esi
callq 0x67108
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x672f6
callq 0x671c7
jmp 0x676d5
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x672f6
movq %r12, %rdi
movq %r15, %rsi
movl %r13d, %edx
movl %r14d, %ecx
movl %ebx, %r8d
callq 0x675d6
movl %eax, 0x4(%rsp)
testl %ebx, %ebx
je 0x6771e
leaq 0x54b3b(%rip), %rdi     # 0xbc233
movl %r13d, %esi
callq 0x67108
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
pushq $-0x1
popq %rcx
pushq $0x53
popq %r8
movl %ebx, %r9d
callq 0x6740c
callq 0x671c7
jmp 0x67735
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
pushq $-0x1
popq %rcx
pushq $0x53
popq %r8
xorl %r9d, %r9d
callq 0x6740c
movq %r12, %rdi
movq %r15, %rsi
movl %r13d, %edx
movl %r14d, %ecx
movl %ebx, %r8d
callq 0x675d6
movl %eax, %r14d
testl %ebx, %ebx
je 0x6778c
leaq 0x54ae7(%rip), %rdi     # 0xbc23e
movl %r13d, %esi
callq 0x67108
movq %r12, %rdi
movq %r15, %rsi
movabsq $-0x5555555555555556, %rdx # imm = 0xAAAAAAAAAAAAAAAA
movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555
pushq $0x43
popq %r8
movl %ebx, %r9d
callq 0x6740c
callq 0x671c7
jmp 0x677b2
movq %r12, %rdi
movq %r15, %rsi
movabsq $-0x5555555555555556, %rdx # imm = 0xAAAAAAAAAAAAAAAA
movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555
pushq $0x43
popq %r8
xorl %r9d, %r9d
callq 0x6740c
addl 0x10(%rsp), %ebp
addl 0x4(%rsp), %ebp
addl %r14d, %ebp
movq %r12, %rdi
movq %r15, %rsi
movl %r13d, %edx
pushq $0x4
popq %r14
movl %r14d, %ecx
movl %ebx, %r8d
callq 0x675d6
movl %eax, %ecx
addl %ebp, %ecx
incl %r13d
jmp 0x67664
movl %ecx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq