// File: /workspace/github_c_makefile_star2_O3/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
pushq %rax
movq %rdi, %rbx
movabsq $0x2545f4914f6cdd1d, %r14 # imm = 0x2545F4914F6CDD1D
movq 0xd057(%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, 0xd032(%rip)      # 0x131e8
imulq %r14, %rax
addl $-0x6, %esi
movslq %esi, %rcx
xorl %r15d, %r15d
xorl %edx, %edx
divq %rcx
addl $0x6, %edx
testl %edx, %edx
jle 0x6325
movl %edx, %r12d
leaq 0x1883(%rip), %r13      # 0x7a60
movss 0x1873(%rip), %xmm3     # 0x7a58
movss 0x186f(%rip), %xmm4     # 0x7a5c
movq 0x16db(%rip), %xmm5     # 0x78d0
movapd 0x16e3(%rip), %xmm6     # 0x78e0
movsd 0x184b(%rip), %xmm7     # 0x7a50
xorl %ebp, %ebp
movq 0xcfda(%rip), %rax      # 0x131e8
testq %rbp, %rbp
je 0x6284
xorps %xmm0, %xmm0
cvtsi2ss %r15d, %xmm0
divss %xmm3, %xmm0
mulss %xmm4, %xmm0
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, 0xcfa0(%rip)      # 0x131e8
movq %rax, %rcx
imulq %r14, %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 0x628e
movb $0x20, (%rbx,%rbp)
xorl %r15d, %r15d
jmp 0x6317
movl $0x5, %ecx
movq %r13, %rsi
jmp 0x62a9
movl %ebp, %ecx
andl $0x1, %ecx
shll $0x4, %ecx
orq $0x5, %rcx
testb $0x1, %bpl
leaq 0x17c1(%rip), %rsi      # 0x7a66
cmoveq %r13, %rsi
movq %rax, %rdx
shrq $0xc, %rdx
xorq %rax, %rdx
movq %rdx, %rdi
shlq $0x19, %rdi
xorq %rdx, %rdi
movq %rdi, %rax
shrq $0x1b, %rax
xorq %rdi, %rax
movq %rax, 0xcf1a(%rip)      # 0x131e8
imulq %r14, %rax
xorl %edx, %edx
divq %rcx
movsbl (%rsi,%rdx), %edi
movb %dil, (%rbx,%rbp)
testl %r15d, %r15d
jne 0x6314
callq 0x1050
movsd 0x175f(%rip), %xmm7     # 0x7a50
movapd 0x15e7(%rip), %xmm6     # 0x78e0
movq 0x15cf(%rip), %xmm5     # 0x78d0
movss 0x1753(%rip), %xmm4     # 0x7a5c
movss 0x1747(%rip), %xmm3     # 0x7a58
movb %al, (%rbx,%rbp)
incl %r15d
incq %rbp
cmpq %r12, %rbp
jb 0x6207
jmp 0x6328
movslq %edx, %r12
movb $0x0, (%rbx,%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq