#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 rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void pop_mtx(char m[10][10]) {
  srand(time(NULL));
  int i, j;
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 10; j++) {
      m[i][j] = rand() % 26 + 97;
    }
  }
}


x86 assembly (clang, -O0):
<pop_mtx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    11b7 <pop_mtx+0x87>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    11a4 <pop_mtx+0x74>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x61,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1164 <pop_mtx+0x34>
jmp    11a9 <pop_mtx+0x79>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <pop_mtx+0x23>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop_mtx>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x9,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x61,%al
mov    %al,-0x9(%r14,%rbx,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x61,%al
mov    %al,-0x8(%r14,%rbx,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x61,%al
mov    %al,-0x7(%r14,%rbx,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x61,%al
mov    %al,-0x6(%r14,%rbx,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x61,%al
mov    %al,-0x5(%r14,%rbx,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x61,%al
mov    %al,-0x4(%r14,%rbx,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x61,%al
mov    %al,-0x3(%r14,%rbx,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x61,%al
mov    %al,-0x2(%r14,%rbx,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x61,%al
mov    %al,-0x1(%r14,%rbx,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x61,%al
mov    %al,(%r14,%rbx,1)
add    $0xa,%rbx
cmp    $0x6d,%rbx
jne    1150 <pop_mtx+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @pop_mtx([10 x i8]* %0) {
%2 = alloca [10 x i8]*
%3 = alloca i32
%4 = alloca i32
store [10 x i8]* %0, [10 x i8]** %2
%5 = call i32 @time(i32* null)
%6 = call i32 @srand(i32 %5)
store i32 0, i32* %3
br label %7
7: ; preds = %30, %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %33
10: ; preds = %7
store i32 0, i32* %4
br label %11
11: ; preds = %26, %10
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 10
br i1 %13, label %14, label %29
14: ; preds = %11
%15 = call i32 (...) @rand()
%16 = srem i32 %15, 26
%17 = add nsw i32 %16, 97
%18 = trunc i32 %17 to i8
%19 = load [10 x i8]*, [10 x i8]** %2
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [10 x i8], [10 x i8]* %19, i64 %21
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [10 x i8], [10 x i8]* %22, i64 0, i64 %24
store i8 %18, i8* %25
br label %26
26: ; preds = %14
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %11
29: ; preds = %11
br label %30
30: ; preds = %29
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %7
33: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @pop_mtx([10 x i8]* nocapture writeonly %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
br label %4
4: ; preds = %1, %4
%5 = phi i64 [ 0, %1 ], [ %56, %4 ]
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 26
%8 = trunc i32 %7 to i8
%9 = add nsw i8 %8, 97
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %0, i64 %5, i64 0
store i8 %9, i8* %10
%11 = tail call i32 (...) @rand()
%12 = srem i32 %11, 26
%13 = trunc i32 %12 to i8
%14 = add nsw i8 %13, 97
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %0, i64 %5, i64 1
store i8 %14, i8* %15
%16 = tail call i32 (...) @rand()
%17 = srem i32 %16, 26
%18 = trunc i32 %17 to i8
%19 = add nsw i8 %18, 97
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %0, i64 %5, i64 2
store i8 %19, i8* %20
%21 = tail call i32 (...) @rand()
%22 = srem i32 %21, 26
%23 = trunc i32 %22 to i8
%24 = add nsw i8 %23, 97
%25 = getelementptr inbounds [10 x i8], [10 x i8]* %0, i64 %5, i64 3
store i8 %24, i8* %25
%26 = tail call i32 (...) @rand()
%27 = srem i32 %26, 26
%28 = trunc i32 %27 to i8
%29 = add nsw i8 %28, 97
%30 = getelementptr inbounds [10 x i8], [10 x i8]* %0, i64 %5, i64 4
store i8 %29, i8* %30
%31 = tail call i32 (...) @rand()
%32 = srem i32 %31, 26
%33 = trunc i32 %32 to i8
%34 = add nsw i8 %33, 97
%35 = getelementptr inbounds [10 x i8], [10 x i8]* %0, i64 %5, i64 5
store i8 %34, i8* %35
%36 = tail call i32 (...) @rand()
%37 = srem i32 %36, 26
%38 = trunc i32 %37 to i8
%39 = add nsw i8 %38, 97
%40 = getelementptr inbounds [10 x i8], [10 x i8]* %0, i64 %5, i64 6
store i8 %39, i8* %40
%41 = tail call i32 (...) @rand()
%42 = srem i32 %41, 26
%43 = trunc i32 %42 to i8
%44 = add nsw i8 %43, 97
%45 = getelementptr inbounds [10 x i8], [10 x i8]* %0, i64 %5, i64 7
store i8 %44, i8* %45
%46 = tail call i32 (...) @rand()
%47 = srem i32 %46, 26
%48 = trunc i32 %47 to i8
%49 = add nsw i8 %48, 97
%50 = getelementptr inbounds [10 x i8], [10 x i8]* %0, i64 %5, i64 8
store i8 %49, i8* %50
%51 = tail call i32 (...) @rand()
%52 = srem i32 %51, 26
%53 = trunc i32 %52 to i8
%54 = add nsw i8 %53, 97
%55 = getelementptr inbounds [10 x i8], [10 x i8]* %0, i64 %5, i64 9
store i8 %54, i8* %55
%56 = add nuw nsw i64 %5, 1
%57 = icmp eq i64 %56, 10
br i1 %57, label %58, label %4
58: ; preds = %4
ret void
}