#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*/ getpid();
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
void insert(int (*stdmrk)[10], int row, int col) {
  int i, j;
  srand(getpid());
  for (i = 0; i < row; i++)
    for (j = 0; j < col; j++)
      stdmrk[i][j] = rand() % 101;
}


x86 assembly (clang, -O0):
<insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11bc <insert+0x8c>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11a9 <insert+0x79>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x65,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116a <insert+0x3a>
jmp    11ae <insert+0x7e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1157 <insert+0x27>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
call   1040 <srand@plt>
test   %r14d,%r14d
jle    11c0 <insert+0x90>
mov    %r14d,%r14d
mov    %r15d,%r13d
xor    %r12d,%r12d
jmp    117d <insert+0x4d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%r12
add    $0x28,%rbx
cmp    %r14,%r12
je     11c0 <insert+0x90>
test   %r15d,%r15d
jle    1170 <insert+0x40>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x288df0cb,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x65,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%rbx,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1190 <insert+0x60>
jmp    1170 <insert+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @insert([10 x i32]* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 @srand(i32 %4)
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %23
7: ; preds = %3
%8 = icmp sgt i32 %2, 0
%9 = zext i32 %1 to i64
%10 = zext i32 %2 to i64
br label %11
11: ; preds = %7, %20
%12 = phi i64 [ 0, %7 ], [ %21, %20 ]
br i1 %8, label %13, label %20
13: ; preds = %11, %13
%14 = phi i64 [ %18, %13 ], [ 0, %11 ]
%15 = tail call i32 (...) @rand()
%16 = srem i32 %15, 101
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 %12, i64 %14
store i32 %16, i32* %17
%18 = add nuw nsw i64 %14, 1
%19 = icmp eq i64 %18, %10
br i1 %19, label %20, label %13
20: ; preds = %13, %11
%21 = add nuw nsw i64 %12, 1
%22 = icmp eq i64 %21, %9
br i1 %22, label %23, label %11
23: ; preds = %20, %3
ret void
}