#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 */
char *malloc(int);
int rand();
int /*<<< orphan*/ strcpy(char *, char *);
char *temporary_name() {
  char template[] = "tmp_deem_XXXXXX";
  char *result = malloc(16);
  char base36[] = "abcdefghijklmnopqrstuvwxyz0123456789";
  int count;
  strcpy(result, template);
  for (count = 9; count < 15; count++)
    result[count] = base36[rand() % 36];
  return result;
}


x86 assembly (clang, -O0):
<temporary_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xeb1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeae(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    $0x10,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xe99(%rip),%rsi
mov    $0x25,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x9,-0x44(%rbp)
cmpl   $0xf,-0x44(%rbp)
jge    11ce <temporary_name+0x8e>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x24,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x40(%rbp,%rax,1),%dl
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1195 <temporary_name+0x55>
mov    -0x18(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<temporary_name>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movaps 0xec2(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rsp,%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
cltq
lea    0xe88(%rip),%r14
mov    (%rax,%r14,1),%al
mov    %al,0x9(%rbx)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
cltq
mov    (%rax,%r14,1),%al
mov    %al,0xa(%rbx)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
cltq
mov    (%rax,%r14,1),%al
mov    %al,0xb(%rbx)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
cltq
mov    (%rax,%r14,1),%al
mov    %al,0xc(%rbx)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
cltq
mov    (%rax,%r14,1),%al
mov    %al,0xd(%rbx)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
cltq
mov    (%rax,%r14,1),%al
mov    %al,0xe(%rbx)
mov    %rbx,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.temporary_name.template = [16 x i8] c"tmp_deem_XXXXXX\00"
@__const.temporary_name.base36 = [37 x i8] c"abcdefghijklmnopqrstuvwxyz0123456789\00"
define i8* @temporary_name() {
%1 = alloca [16 x i8]
%2 = alloca i8*
%3 = alloca [37 x i8]
%4 = alloca i32
%5 = bitcast [16 x i8]* %1 to i8*
%6 = call i8* @malloc(i32 16)
store i8* %6, i8** %2
%7 = bitcast [37 x i8]* %3 to i8*
%8 = load i8*, i8** %2
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%10 = call i32 @strcpy(i8* %8, i8* %9)
store i32 9, i32* %4
br label %11
11: ; preds = %24, %0
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 15
br i1 %13, label %14, label %27
14: ; preds = %11
%15 = call i32 (...) @rand()
%16 = srem i32 %15, 36
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [37 x i8], [37 x i8]* %3, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = load i8*, i8** %2
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 %19, i8* %23
br label %24
24: ; preds = %14
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %11
27: ; preds = %11
%28 = load i8*, i8** %2
ret i8* %28
}

LLVM IR (-O2):
@__const.temporary_name.template = [16 x i8] c"tmp_deem_XXXXXX\00"
@__const.temporary_name.base36 = [37 x i8] c"abcdefghijklmnopqrstuvwxyz0123456789\00"
define i8* @temporary_name() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = tail call dereferenceable_or_null(16) i8* @malloc(i32 16)
%4 = call i32 @strcpy(i8* %3, i8* %2)
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 36
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [37 x i8], [37 x i8]* @__const.temporary_name.base36, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %3, i64 9
store i8 %9, i8* %10
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 36
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [37 x i8], [37 x i8]* @__const.temporary_name.base36, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = getelementptr inbounds i8, i8* %3, i64 10
store i8 %15, i8* %16
%17 = call i32 (...) @rand()
%18 = srem i32 %17, 36
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [37 x i8], [37 x i8]* @__const.temporary_name.base36, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = getelementptr inbounds i8, i8* %3, i64 11
store i8 %21, i8* %22
%23 = call i32 (...) @rand()
%24 = srem i32 %23, 36
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [37 x i8], [37 x i8]* @__const.temporary_name.base36, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = getelementptr inbounds i8, i8* %3, i64 12
store i8 %27, i8* %28
%29 = call i32 (...) @rand()
%30 = srem i32 %29, 36
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [37 x i8], [37 x i8]* @__const.temporary_name.base36, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = getelementptr inbounds i8, i8* %3, i64 13
store i8 %33, i8* %34
%35 = call i32 (...) @rand()
%36 = srem i32 %35, 36
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [37 x i8], [37 x i8]* @__const.temporary_name.base36, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = getelementptr inbounds i8, i8* %3, i64 14
store i8 %39, i8* %40
ret i8* %3
}