#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 time_random_between(int /*<<< orphan*/, int);
char *time_get_random_str(int cnt) {
  static char str[1000];
  register int i = 0, j = 0;
  int length;
  while (--cnt >= 0) {
    length = time_random_between(0, 25) % 10 + 2;
    for (i = 0; i < length; i++, j++)
      str[j] = 'a' + time_random_between(0, 25);
    str[j++] = ' ';
  }
  str[--j] = '\0';
  return str;
}


x86 assembly (clang, -O0):
<time_get_random_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jl     11c2 <time_get_random_str+0xb2>
xor    %edi,%edi
mov    $0x19,%esi
call   1030 <time_random_between@plt>
movsbl %al,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x2,%edx
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11a4 <time_get_random_str+0x94>
xor    %edi,%edi
mov    $0x19,%esi
call   1030 <time_random_between@plt>
movsbl %al,%eax
add    $0x61,%eax
mov    %al,%dl
movslq -0xc(%rbp),%rcx
lea    0x2eb6(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115f <time_get_random_str+0x4f>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %eax,%rcx
lea    0x2e87(%rip),%rax
movb   $0x20,(%rax,%rcx,1)
jmp    1129 <time_get_random_str+0x19>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
movslq %eax,%rcx
lea    0x2e6b(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2e60(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_get_random_str>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    11c6 <time_get_random_str+0xb6>
mov    %edi,%r14d
xor    %r15d,%r15d
lea    0x2f10(%rip),%r12
jmp    115c <time_get_random_str+0x4c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15d,%eax
lea    -0x1(%r14),%ecx
lea    0x1(%rax),%r15d
movslq %eax,%rdx
movb   $0x20,(%rdx,%r12,1)
cmp    $0x1,%r14d
mov    %ecx,%r14d
jle    11cb <time_get_random_str+0xbb>
xor    %edi,%edi
mov    $0x19,%esi
call   1030 <time_random_between@plt>
movsbl %al,%eax
imul   $0x67,%eax,%ecx
movzwl %cx,%edx
shr    $0xa,%ecx
shr    $0xf,%edx
add    %cl,%dl
movzbl %dl,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
cmp    $0xff,%al
jl     1140 <time_get_random_str+0x30>
movslq %r15d,%r13
add    $0x2,%al
movzbl %al,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
mov    $0x19,%esi
call   1030 <time_random_between@plt>
add    $0x61,%al
lea    (%rbx,%r13,1),%rcx
mov    %al,(%r12,%rcx,1)
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    11a0 <time_get_random_str+0x90>
add    %ebx,%r15d
jmp    1140 <time_get_random_str+0x30>
mov    $0xffffffff,%eax
movslq %eax,%rcx
lea    0x2e6b(%rip),%rax
movb   $0x0,(%rcx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@time_get_random_str.str = internal global [1000 x i8] zeroinitializer
define i8* @time_get_random_str(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %32, %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %37
10: ; preds = %6
%11 = call signext i8 @time_random_between(i32 0, i32 25)
%12 = sext i8 %11 to i32
%13 = srem i32 %12, 10
%14 = add nsw i32 %13, 2
store i32 %14, i32* %5
store i32 0, i32* %3
br label %15
15: ; preds = %27, %10
%16 = load i32, i32* %3
%17 = load i32, i32* %5
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %32
19: ; preds = %15
%20 = call signext i8 @time_random_between(i32 0, i32 25)
%21 = sext i8 %20 to i32
%22 = add nsw i32 97, %21
%23 = trunc i32 %22 to i8
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [1000 x i8], [1000 x i8]* @time_get_random_str.str, i64 0, i64 %25
store i8 %23, i8* %26
br label %27
27: ; preds = %19
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %15
32: ; preds = %15
%33 = load i32, i32* %4
%34 = add nsw i32 %33, 1
store i32 %34, i32* %4
%35 = sext i32 %33 to i64
%36 = getelementptr inbounds [1000 x i8], [1000 x i8]* @time_get_random_str.str, i64 0, i64 %35
store i8 32, i8* %36
br label %6
37: ; preds = %6
%38 = load i32, i32* %4
%39 = add nsw i32 %38, -1
store i32 %39, i32* %4
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [1000 x i8], [1000 x i8]* @time_get_random_str.str, i64 0, i64 %40
store i8 0, i8* %41
ret i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @time_get_random_str.str, i64 0, i64 0)
}

LLVM IR (-O2):
@time_get_random_str.str = internal global [1000 x i8] zeroinitializer
define i8* @time_get_random_str(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %31
3: ; preds = %1, %25
%4 = phi i32 [ %6, %25 ], [ %0, %1 ]
%5 = phi i32 [ %27, %25 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call signext i8 @time_random_between(i32 0, i32 25)
%8 = srem i8 %7, 10
%9 = icmp sgt i8 %8, -2
br i1 %9, label %10, label %25
10: ; preds = %3
%11 = sext i32 %5 to i64
%12 = add nsw i8 %8, 2
%13 = zext i8 %12 to i32
br label %14
14: ; preds = %10, %14
%15 = phi i64 [ %11, %10 ], [ %21, %14 ]
%16 = phi i32 [ 0, %10 ], [ %20, %14 ]
%17 = tail call signext i8 @time_random_between(i32 0, i32 25)
%18 = add i8 %17, 97
%19 = getelementptr inbounds [1000 x i8], [1000 x i8]* @time_get_random_str.str, i64 0, i64 %15
store i8 %18, i8* %19
%20 = add nuw nsw i32 %16, 1
%21 = add nsw i64 %15, 1
%22 = icmp eq i32 %20, %13
br i1 %22, label %23, label %14
23: ; preds = %14
%24 = trunc i64 %21 to i32
br label %25
25: ; preds = %23, %3
%26 = phi i32 [ %5, %3 ], [ %24, %23 ]
%27 = add nsw i32 %26, 1
%28 = sext i32 %26 to i64
%29 = getelementptr inbounds [1000 x i8], [1000 x i8]* @time_get_random_str.str, i64 0, i64 %28
store i8 32, i8* %29
%30 = icmp sgt i32 %4, 1
br i1 %30, label %3, label %31
31: ; preds = %25, %1
%32 = phi i32 [ -1, %1 ], [ %26, %25 ]
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [1000 x i8], [1000 x i8]* @time_get_random_str.str, i64 0, i64 %33
store i8 0, i8* %34
ret i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @time_get_random_str.str, i64 0, i64 0)
}