#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 */
int /*<<< orphan*/ create_random_name(char *);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  int i;
  char name[14 + 1];
  srand((unsigned int)time(NULL));
  for (i = 0; i < 1000000; i++) {
    create_random_name(name);
    printf("%s\n", name);
    memset(name, '~', 14 + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jge    11bd <main+0x6d>
lea    -0x17(%rbp),%rdi
call   1070 <create_random_name@plt>
lea    -0x17(%rbp),%rsi
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
lea    -0x17(%rbp),%rdi
mov    $0x7e,%esi
mov    $0xf,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1176 <main+0x26>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0xf4240,%ebp
lea    0x1(%rsp),%rbx
lea    0xe89(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1070 <create_random_name@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7e,%esi
mov    $0xf,%edx
call   1040 <memset@plt>
add    $0xffffffff,%ebp
jne    1180 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [15 x i8]
store i32 0, i32* %1
%4 = call i64 @time(i32* null)
%5 = trunc i64 %4 to i32
%6 = call i32 @srand(i32 %5)
store i32 0, i32* %2
br label %7
7: ; preds = %17, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 1000000
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%12 = call i32 @create_random_name(i8* %11)
%13 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%16 = call i32 @memset(i8* %15, i8 signext 126, i32 15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %7
20: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = tail call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @srand(i32 %4)
br label %6
6: ; preds = %0, %6
%7 = phi i32 [ 0, %0 ], [ %11, %6 ]
%8 = call i32 @create_random_name(i8* %2)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%10 = call i32 @memset(i8* %2, i8 signext 126, i32 15)
%11 = add nuw nsw i32 %7, 1
%12 = icmp eq i32 %11, 1000000
br i1 %12, label %13, label %6
13: ; preds = %6
ret i32 0
}