// File: /workspace/github_c_makefile_star2_O0/erikdubbelboer[P]discnt/src/memtest.c
// Function: memtest_fill_random
void memtest_fill_random(unsigned long *l, size_t bytes) {
    unsigned long step = 4096/sizeof(unsigned long);
    unsigned long words = bytes/sizeof(unsigned long)/2;
    unsigned long iwords = words/step;  /* words per iteration */
    unsigned long off, w, *l1, *l2;

    assert((bytes & 4095) == 0);
    for (off = 0; off < step; off++) {
        l1 = l+off;
        l2 = l1+words;
        for (w = 0; w < iwords; w++) {
#ifdef MEMTEST_32BIT
            *l1 = *l2 = ((unsigned long)     (rand()&0xffff)) |
                        (((unsigned long)    (rand()&0xffff)) << 16);
#else
            *l1 = *l2 = ((unsigned long)     (rand()&0xffff)) |
                        (((unsigned long)    (rand()&0xffff)) << 16) |
                        (((unsigned long)    (rand()&0xffff)) << 32) |
                        (((unsigned long)    (rand()&0xffff)) << 48);
#endif
            l1 += step;
            l2 += step;
            if ((w & 0xffff) == 0)
                memtest_progress_step(w+iwords*off,words,'R');
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x200, -0x18(%rbp)     # imm = 0x200
movq -0x10(%rbp), %rax
shrq $0x3, %rax
shrq %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x18(%rbp)
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
andq $0xfff, %rax            # imm = 0xFFF
cmpq $0x0, %rax
jne 0x36cb9
jmp 0x36cd8
leaq 0x711d3(%rip), %rdi     # 0xa7e93
leaq 0x711e0(%rip), %rsi     # 0xa7ea7
movl $0x7c, %edx
leaq 0x711de(%rip), %rcx     # 0xa7eb1
callq 0x12340
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x36e11
movq -0x8(%rbp), %rax
movq -0x30(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x20(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x36dfe
callq 0x12990
andl $0xffff, %eax           # imm = 0xFFFF
cltq
movq %rax, -0x60(%rbp)
callq 0x12990
movl %eax, %ecx
movq -0x60(%rbp), %rax
andl $0xffff, %ecx           # imm = 0xFFFF
movslq %ecx, %rcx
shlq $0x10, %rcx
orq %rcx, %rax
movq %rax, -0x58(%rbp)
callq 0x12990
movl %eax, %ecx
movq -0x58(%rbp), %rax
andl $0xffff, %ecx           # imm = 0xFFFF
movslq %ecx, %rcx
shlq $0x20, %rcx
orq %rcx, %rax
movq %rax, -0x50(%rbp)
callq 0x12990
movq -0x50(%rbp), %rcx
andl $0xffff, %eax           # imm = 0xFFFF
cltq
shlq $0x30, %rax
orq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
shlq $0x3, %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
shlq $0x3, %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpq $0x0, %rax
jne 0x36deb
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rax
imulq -0x30(%rbp), %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
movl $0x52, %edx
callq 0x36ac0
jmp 0x36ded
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x36d1c
jmp 0x36e00
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x36ce0
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)