// File: /workspace/github_c_makefile_star2_O1/skeeto[P]goblin-com/src/rand.c
// Function: rand_name
void
rand_name(char *name, size_t max)
{
    /* This thing sucks ... */
    const char *vowels = "aeiou";
    const char *consonants = "bcdfghjklmnpqrstvwxyz";
    int length = rand_range(6, max);
    int spaces = 0;
    int letters = 0;
    for (int i = 0; i < length; i++) {
        float spacep = letters / 3.0f * powf(0.1f, 1.0f / (10 * spaces + 1));
        if (i > 0 && rand_uniform(0, 1.0) < spacep) {
            name[i] = ' ';
            letters = 0;
        } else {
            if (i % 2)
                name[i] = consonants[rand_range(0, strlen(consonants))];
            else
                name[i] = vowels[rand_range(0, strlen(vowels))];
            if (letters == 0)
                name[i] = toupper((int)name[i]);
            letters++;
        }
    }
    name[length] = '\0';
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r12
movabsq $0x2545f4914f6cdd1d, %r13 # imm = 0x2545F4914F6CDD1D
movq 0xd5d4(%rip), %rax      # 0x131e8
movq %rax, %rcx
shrq $0xc, %rcx
xorq %rax, %rcx
movq %rcx, %rdx
shlq $0x19, %rdx
xorq %rcx, %rdx
movq %rdx, %rax
shrq $0x1b, %rax
xorq %rdx, %rax
movq %rax, 0xd5af(%rip)      # 0x131e8
imulq %r13, %rax
addl $-0x6, %esi
movslq %esi, %rcx
xorl %r14d, %r14d
xorl %edx, %edx
divq %rcx
addl $0x6, %edx
movq %rdx, 0x8(%rsp)
testl %edx, %edx
jle 0x5dc9
movl 0x8(%rsp), %r11d
leaq 0x1d21(%rip), %r8       # 0x7988
leaq 0x1d20(%rip), %r15      # 0x798e
movss 0x1d0a(%rip), %xmm3     # 0x7980
movss 0x1d06(%rip), %xmm4     # 0x7984
movq 0x1bda(%rip), %xmm5     # 0x7860
movapd 0x1be2(%rip), %xmm6     # 0x7870
movsd 0x1ce2(%rip), %xmm7     # 0x7978
xorl %ebp, %ebp
testq %rbp, %rbp
je 0x5d13
xorps %xmm0, %xmm0
cvtsi2ss %r14d, %xmm0
divss %xmm3, %xmm0
mulss %xmm4, %xmm0
movq 0xd534(%rip), %rax      # 0x131e8
movq %rax, %rcx
shrq $0xc, %rcx
xorq %rax, %rcx
movq %rcx, %rax
shlq $0x19, %rax
xorq %rcx, %rax
movq %rax, %rcx
shrq $0x1b, %rcx
xorq %rax, %rcx
movq %rcx, 0xd50f(%rip)      # 0x131e8
imulq %r13, %rcx
movq %rcx, %xmm1
punpckldq %xmm5, %xmm1    # xmm1 = xmm1[0],xmm5[0],xmm1[1],xmm5[1]
subpd %xmm6, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
mulsd %xmm7, %xmm2
xorps %xmm1, %xmm1
cvtsd2ss %xmm2, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x5d13
movb $0x20, (%r12,%rbp)
xorl %r14d, %r14d
jmp 0x5dbd
movq 0xd4ce(%rip), %rax      # 0x131e8
movq %rax, %rcx
shrq $0xc, %rcx
xorq %rax, %rcx
movq %rcx, %rax
shlq $0x19, %rax
xorq %rcx, %rax
movq %rax, %rcx
shrq $0x1b, %rcx
xorq %rax, %rcx
movq %rcx, %rax
imulq %r13, %rax
movl %ebp, %esi
andl $0x1, %esi
shll $0x4, %esi
orq $0x5, %rsi
testb $0x1, %bpl
movq %r15, %rdi
cmoveq %r8, %rdi
movq %rcx, 0xd48b(%rip)      # 0x131e8
xorl %edx, %edx
divq %rsi
movb (%rdi,%rdx), %al
movb %al, (%r12,%rbp)
testl %r14d, %r14d
jne 0x5dba
movsbl (%r12,%rbp), %edi
movq %r14, 0x10(%rsp)
movq %r8, %r14
movq %r11, %rbx
callq 0x1050
movsd 0x1bed(%rip), %xmm7     # 0x7978
movapd 0x1add(%rip), %xmm6     # 0x7870
movq 0x1ac5(%rip), %xmm5     # 0x7860
movss 0x1be1(%rip), %xmm4     # 0x7984
movss 0x1bd5(%rip), %xmm3     # 0x7980
movq %rbx, %r11
movq %r14, %r8
movq 0x10(%rsp), %r14
movb %al, (%r12,%rbp)
incl %r14d
incq %rbp
cmpq %r11, %rbp
jb 0x5c98
movslq 0x8(%rsp), %rax
movb $0x0, (%r12,%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop