#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
size_t random_in_range(int, int);
int create_random_name(char *name) {
  int length;
  char *alphabet = "abcdefghijklmnopqrstuvwxyz";
  int i;
  length = random_in_range(6, 14 - 1);
  name[0] = '/';
  name[length] = '\0';
  i = length;
  while (--i)
    name[i] = alphabet[random_in_range(0, 25)];
  return length;
}


x86 assembly (clang, -O0):
<create_random_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    $0x6,%edi
mov    $0xd,%esi
call   1030 <random_in_range@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2f,(%rax)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1192 <create_random_name+0x82>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
xor    %edi,%edi
mov    $0x19,%esi
call   1030 <random_in_range@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1152 <create_random_name+0x42>
mov    -0xc(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_random_name>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%r15
mov    $0x6,%edi
mov    $0xd,%esi
call   1030 <random_in_range@plt>
mov    %rax,%r14
movb   $0x2f,(%r15)
movslq %r14d,%rax
movb   $0x0,(%r15,%rax,1)
add    $0xffffffff,%eax
je     117e <create_random_name+0x6e>
cltq
add    %rax,%r15
mov    $0x1,%r12d
sub    %r14d,%r12d
xor    %ebx,%ebx
lea    0xeaa(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
xor    %edi,%edi
mov    $0x19,%esi
call   1030 <random_in_range@plt>
movzbl (%rax,%r13,1),%eax
mov    %al,(%r15,%rbx,1)
add    $0xffffffffffffffff,%rbx
cmp    %ebx,%r12d
jne    1160 <create_random_name+0x50>
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
define i32 @create_random_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %2
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %4
%6 = call i64 @random_in_range(i32 6, i32 13)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 47, i8* %9
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
store i8 0, i8* %13
%14 = load i32, i32* %3
store i32 %14, i32* %5
br label %15
15: ; preds = %19, %1
%16 = load i32, i32* %5
%17 = add nsw i32 %16, -1
store i32 %17, i32* %5
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %28
19: ; preds = %15
%20 = load i8*, i8** %4
%21 = call i64 @random_in_range(i32 0, i32 25)
%22 = getelementptr inbounds i8, i8* %20, i64 %21
%23 = load i8, i8* %22
%24 = load i8*, i8** %2
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
store i8 %23, i8* %27
br label %15
28: ; preds = %15
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
@.str = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
define i32 @create_random_name(i8* nocapture writeonly %0) {
%2 = tail call i64 @random_in_range(i32 6, i32 13)
%3 = trunc i64 %2 to i32
store i8 47, i8* %0
%4 = shl i64 %2, 32
%5 = ashr exact i64 %4, 32
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
%7 = add i32 %3, -1
%8 = icmp eq i32 %7, 0
br i1 %8, label %20, label %9
9: ; preds = %1
%10 = sext i32 %7 to i64
br label %11
11: ; preds = %9, %11
%12 = phi i64 [ %10, %9 ], [ %17, %11 ]
%13 = tail call i64 @random_in_range(i32 0, i32 25)
%14 = getelementptr inbounds [27 x i8], [27 x i8]* @.str, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = getelementptr inbounds i8, i8* %0, i64 %12
store i8 %15, i8* %16
%17 = add nsw i64 %12, -1
%18 = trunc i64 %17 to i32
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %11
20: ; preds = %11, %1
ret i32 %3
}