#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 ENOMEM;
scalar_t__ calloc(size_t, int);
int errno;
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ puts(char *);
size_t const rand();
size_t strlen(char const *);
scalar_t__ time(int /*<<< orphan*/ *);
int main(void) {
  static const char *ASCII_CHARSET =
      "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  const size_t ASCII_CHARSET_COUNT = strlen(ASCII_CHARSET);
  unsigned int seed = (unsigned int)time(NULL);
  size_t randStringCount = 10;
  size_t randStringLength = 10;
  char *stringBuffer =
      (char *)calloc(randStringCount * (randStringLength + 1), sizeof(char *));
  if (!stringBuffer) {
    errno = ENOMEM;
    return errno;
  }
  for (size_t i = 0; i < randStringCount; ++i) {
    for (size_t j = 0; j < randStringLength; ++j) {
      size_t randIndex = rand() % ASCII_CHARSET_COUNT;
      stringBuffer[i * (randStringLength + 1) + j] = ASCII_CHARSET[randIndex];
    }
    puts(&stringBuffer[i * (randStringLength + 1)]);
  }
  free(stringBuffer);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ed2(%rip),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
mov    %eax,-0x14(%rbp)
movq   $0xa,-0x20(%rbp)
movq   $0xa,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rax
add    $0x1,%rax
imul   %rax,%rdi
mov    $0x8,%esi
call   1060 <calloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    11f7 <main+0x87>
mov    0x2e05(%rip),%rax
mov    (%rax),%ecx
mov    0x2df4(%rip),%rax
mov    %ecx,(%rax)
mov    0x2deb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12b4 <main+0x144>
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    129d <main+0x12d>
movq   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1270 <main+0x100>
mov    $0x0,%al
call   1090 <rand@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x48(%rbp)
mov    0x2e1b(%rip),%rax
mov    -0x48(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    -0x28(%rbp),%rsi
add    $0x1,%rsi
imul   %rsi,%rcx
add    -0x40(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1215 <main+0xa5>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rax
mov    -0x28(%rbp),%rcx
add    $0x1,%rcx
imul   %rcx,%rax
add    %rax,%rdi
call   1040 <puts@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    11ff <main+0x8f>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1070 <getchar@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
xor    %edi,%edi
call   1070 <time@plt>
mov    $0x6e,%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
test   %rax,%rax
je     13b7 <main+0x257>
mov    %rax,%r13
movabs $0x8421084210842109,%r15
08 21 84
lea    0xe64(%rip),%r12
xor    %ebx,%ebx
xchg   %ax,%ax
xor    %eax,%eax
call   1080 <rand@plt>
mov    %rax,%rcx
shr    %rax
mul    %r15
shr    $0x4,%rdx
mov    %rdx,%rax
shl    $0x6,%rax
mov    %rdx,%rsi
sub    %rax,%rsi
add    %rdx,%rsi
add    %rcx,%rsi
movzbl (%r12,%rsi,1),%eax
lea    (%rbx,%r13,1),%r14
mov    %al,0x0(%r13,%rbx,1)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %rax,%rcx
shr    %rax
mul    %r15
shr    $0x4,%rdx
mov    %rdx,%rax
shl    $0x6,%rax
mov    %rdx,%rsi
sub    %rax,%rsi
add    %rdx,%rsi
add    %rcx,%rsi
movzbl (%r12,%rsi,1),%eax
mov    %al,0x1(%r13,%rbx,1)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %rax,%rcx
shr    %rax
mul    %r15
shr    $0x4,%rdx
mov    %rdx,%rax
shl    $0x6,%rax
mov    %rdx,%rsi
sub    %rax,%rsi
add    %rdx,%rsi
add    %rcx,%rsi
movzbl (%r12,%rsi,1),%eax
mov    %al,0x2(%r13,%rbx,1)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %rax,%rcx
shr    %rax
mul    %r15
shr    $0x4,%rdx
mov    %rdx,%rax
shl    $0x6,%rax
mov    %rdx,%rsi
sub    %rax,%rsi
add    %rdx,%rsi
add    %rcx,%rsi
movzbl (%r12,%rsi,1),%eax
mov    %al,0x3(%r13,%rbx,1)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %rax,%rcx
shr    %rax
mul    %r15
shr    $0x4,%rdx
mov    %rdx,%rax
shl    $0x6,%rax
mov    %rdx,%rsi
sub    %rax,%rsi
add    %rdx,%rsi
add    %rcx,%rsi
movzbl (%r12,%rsi,1),%eax
mov    %al,0x4(%r13,%rbx,1)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %rax,%rcx
shr    %rax
mul    %r15
shr    $0x4,%rdx
mov    %rdx,%rax
shl    $0x6,%rax
mov    %rdx,%rsi
sub    %rax,%rsi
add    %rdx,%rsi
add    %rcx,%rsi
movzbl (%r12,%rsi,1),%eax
mov    %al,0x5(%r13,%rbx,1)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %rax,%rcx
shr    %rax
mul    %r15
shr    $0x4,%rdx
mov    %rdx,%rax
shl    $0x6,%rax
mov    %rdx,%rsi
sub    %rax,%rsi
add    %rdx,%rsi
add    %rcx,%rsi
movzbl (%r12,%rsi,1),%eax
mov    %al,0x6(%r13,%rbx,1)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %rax,%rcx
shr    %rax
mul    %r15
shr    $0x4,%rdx
mov    %rdx,%rax
shl    $0x6,%rax
mov    %rdx,%rsi
sub    %rax,%rsi
add    %rdx,%rsi
add    %rcx,%rsi
movzbl (%r12,%rsi,1),%eax
mov    %al,0x7(%r13,%rbx,1)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %rax,%rcx
shr    %rax
mul    %r15
shr    $0x4,%rdx
mov    %rdx,%rax
shl    $0x6,%rax
mov    %rdx,%rsi
sub    %rax,%rsi
add    %rdx,%rsi
add    %rcx,%rsi
movzbl (%r12,%rsi,1),%eax
mov    %al,0x8(%r13,%rbx,1)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %rax,%rcx
shr    %rax
mul    %r15
shr    $0x4,%rdx
mov    %rdx,%rax
shl    $0x6,%rax
mov    %rdx,%rsi
sub    %rax,%rsi
add    %rdx,%rsi
add    %rcx,%rsi
movzbl (%r12,%rsi,1),%eax
mov    %al,0x9(%r13,%rbx,1)
mov    %r14,%rdi
call   1040 <puts@plt>
add    $0xb,%rbx
cmp    $0x6e,%rbx
jne    11a0 <main+0x40>
mov    %r13,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <getchar@plt>
jmp    13c9 <main+0x269>
mov    0x2c22(%rip),%rax
mov    (%rax),%ebx
mov    0x2c11(%rip),%rax
mov    %ebx,(%rax)
mov    %ebx,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@main.ASCII_CHARSET = internal global i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i32 0, i32 0)
@.str = [63 x i8] c"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\00"
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i32 0, i32* %1
%10 = load i8*, i8** @main.ASCII_CHARSET
%11 = call i64 @strlen(i8* %10)
store i64 %11, i64* %2
%12 = call i64 @time(i32* null)
%13 = trunc i64 %12 to i32
store i32 %13, i32* %3
store i64 10, i64* %4
store i64 10, i64* %5
%14 = load i64, i64* %4
%15 = load i64, i64* %5
%16 = add i64 %15, 1
%17 = mul i64 %14, %16
%18 = call i64 @calloc(i64 %17, i32 8)
%19 = inttoptr i64 %18 to i8*
store i8* %19, i8** %6
%20 = load i8*, i8** %6
%21 = icmp ne i8* %20, null
br i1 %21, label %25, label %22
22: ; preds = %0
%23 = load i32, i32* @ENOMEM
store i32 %23, i32* @errno
%24 = load i32, i32* @errno
store i32 %24, i32* %1
br label %69
25: ; preds = %0
store i64 0, i64* %7
br label %26
26: ; preds = %62, %25
%27 = load i64, i64* %7
%28 = load i64, i64* %4
%29 = icmp ult i64 %27, %28
br i1 %29, label %30, label %65
30: ; preds = %26
store i64 0, i64* %8
br label %31
31: ; preds = %51, %30
%32 = load i64, i64* %8
%33 = load i64, i64* %5
%34 = icmp ult i64 %32, %33
br i1 %34, label %35, label %54
35: ; preds = %31
%36 = call i64 (...) @rand()
%37 = load i64, i64* %2
%38 = urem i64 %36, %37
store i64 %38, i64* %9
%39 = load i8*, i8** @main.ASCII_CHARSET
%40 = load i64, i64* %9
%41 = getelementptr inbounds i8, i8* %39, i64 %40
%42 = load i8, i8* %41
%43 = load i8*, i8** %6
%44 = load i64, i64* %7
%45 = load i64, i64* %5
%46 = add i64 %45, 1
%47 = mul i64 %44, %46
%48 = load i64, i64* %8
%49 = add i64 %47, %48
%50 = getelementptr inbounds i8, i8* %43, i64 %49
store i8 %42, i8* %50
br label %51
51: ; preds = %35
%52 = load i64, i64* %8
%53 = add i64 %52, 1
store i64 %53, i64* %8
br label %31
54: ; preds = %31
%55 = load i8*, i8** %6
%56 = load i64, i64* %7
%57 = load i64, i64* %5
%58 = add i64 %57, 1
%59 = mul i64 %56, %58
%60 = getelementptr inbounds i8, i8* %55, i64 %59
%61 = call i32 @puts(i8* %60)
br label %62
62: ; preds = %54
%63 = load i64, i64* %7
%64 = add i64 %63, 1
store i64 %64, i64* %7
br label %26
65: ; preds = %26
%66 = load i8*, i8** %6
%67 = call i32 @free(i8* %66)
%68 = call i32 (...) @getchar()
store i32 0, i32* %1
br label %69
69: ; preds = %65, %22
%70 = load i32, i32* %1
ret i32 %70
}

LLVM IR (-O2):
@.str = [63 x i8] c"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\00"
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @main() {
%1 = tail call i64 @time(i32* null)
%2 = tail call i64 @calloc(i64 110, i32 8)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* @ENOMEM
store i32 %6, i32* @errno
br label %75
7: ; preds = %0, %7
%8 = phi i64 [ %70, %7 ], [ 0, %0 ]
%9 = mul nuw nsw i64 %8, 11
%10 = tail call i64 (...) @rand()
%11 = urem i64 %10, 62
%12 = getelementptr inbounds [63 x i8], [63 x i8]* @.str, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = getelementptr inbounds i8, i8* %3, i64 %9
store i8 %13, i8* %14
%15 = tail call i64 (...) @rand()
%16 = urem i64 %15, 62
%17 = getelementptr inbounds [63 x i8], [63 x i8]* @.str, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = add nuw nsw i64 %9, 1
%20 = getelementptr inbounds i8, i8* %3, i64 %19
store i8 %18, i8* %20
%21 = tail call i64 (...) @rand()
%22 = urem i64 %21, 62
%23 = getelementptr inbounds [63 x i8], [63 x i8]* @.str, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = add nuw nsw i64 %9, 2
%26 = getelementptr inbounds i8, i8* %3, i64 %25
store i8 %24, i8* %26
%27 = tail call i64 (...) @rand()
%28 = urem i64 %27, 62
%29 = getelementptr inbounds [63 x i8], [63 x i8]* @.str, i64 0, i64 %28
%30 = load i8, i8* %29
%31 = add nuw nsw i64 %9, 3
%32 = getelementptr inbounds i8, i8* %3, i64 %31
store i8 %30, i8* %32
%33 = tail call i64 (...) @rand()
%34 = urem i64 %33, 62
%35 = getelementptr inbounds [63 x i8], [63 x i8]* @.str, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = add nuw nsw i64 %9, 4
%38 = getelementptr inbounds i8, i8* %3, i64 %37
store i8 %36, i8* %38
%39 = tail call i64 (...) @rand()
%40 = urem i64 %39, 62
%41 = getelementptr inbounds [63 x i8], [63 x i8]* @.str, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = add nuw nsw i64 %9, 5
%44 = getelementptr inbounds i8, i8* %3, i64 %43
store i8 %42, i8* %44
%45 = tail call i64 (...) @rand()
%46 = urem i64 %45, 62
%47 = getelementptr inbounds [63 x i8], [63 x i8]* @.str, i64 0, i64 %46
%48 = load i8, i8* %47
%49 = add nuw nsw i64 %9, 6
%50 = getelementptr inbounds i8, i8* %3, i64 %49
store i8 %48, i8* %50
%51 = tail call i64 (...) @rand()
%52 = urem i64 %51, 62
%53 = getelementptr inbounds [63 x i8], [63 x i8]* @.str, i64 0, i64 %52
%54 = load i8, i8* %53
%55 = add nuw nsw i64 %9, 7
%56 = getelementptr inbounds i8, i8* %3, i64 %55
store i8 %54, i8* %56
%57 = tail call i64 (...) @rand()
%58 = urem i64 %57, 62
%59 = getelementptr inbounds [63 x i8], [63 x i8]* @.str, i64 0, i64 %58
%60 = load i8, i8* %59
%61 = add nuw nsw i64 %9, 8
%62 = getelementptr inbounds i8, i8* %3, i64 %61
store i8 %60, i8* %62
%63 = tail call i64 (...) @rand()
%64 = urem i64 %63, 62
%65 = getelementptr inbounds [63 x i8], [63 x i8]* @.str, i64 0, i64 %64
%66 = load i8, i8* %65
%67 = add nuw nsw i64 %9, 9
%68 = getelementptr inbounds i8, i8* %3, i64 %67
store i8 %66, i8* %68
%69 = tail call i32 @puts(i8* %14)
%70 = add nuw nsw i64 %8, 1
%71 = icmp eq i64 %70, 10
br i1 %71, label %72, label %7
72: ; preds = %7
%73 = tail call i32 @free(i8* %3)
%74 = tail call i32 (...) @getchar()
br label %75
75: ; preds = %72, %5
%76 = phi i32 [ 0, %72 ], [ %6, %5 ]
ret i32 %76
}