#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*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL));
  int i, j, n, k;
  n = (rand() % 9) + 2;
  k = (rand() % 9) + 2;
  int gang[k][n];
  for (i = 0; i < k; i++) {
    for (j = 0; j < n; j++)
      printf("%3d", rand() % 11);
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x9,%ecx
cltd
idiv   %ecx
add    $0x2,%edx
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x9,%ecx
cltd
idiv   %ecx
add    $0x2,%edx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
mov    %rsp,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    120f <main+0xcf>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11f3 <main+0xb3>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0xb,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ba <main+0x7a>
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a7 <main+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1070 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%r14
imul   $0x38e38e39,%r14,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
lea    (%rax,%rax,8),%eax
sub    %eax,%r14d
cmp    $0xffffffff,%r14d
jl     1237 <main+0xe7>
movslq %ebx,%r15
imul   $0x38e38e39,%r15,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
lea    (%rax,%rax,8),%eax
sub    %eax,%r15d
mov    $0xffffffff,%r12d
cmovns %r15d,%r12d
add    $0x1,%r14d
add    $0x2,%r12d
lea    0xe2a(%rip),%rbx
xor    %r13d,%r13d
jmp    11f6 <main+0xa6>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r13),%eax
cmp    %r14d,%r13d
mov    %eax,%r13d
je     1237 <main+0xe7>
cmp    $0xffffffff,%r15d
jl     11e0 <main+0x90>
mov    %r12d,%ebp
nop
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rsi
imul   $0x2e8ba2e9,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,2),%eax
sub    %eax,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1200 <main+0xb0>
jmp    11e0 <main+0x90>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%3d\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i32 0, i32* %1
%9 = call i32 @time(i32* null)
%10 = call i32 @srand(i32 %9)
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 9
%13 = add nsw i32 %12, 2
store i32 %13, i32* %4
%14 = call i32 (...) @rand()
%15 = srem i32 %14, 9
%16 = add nsw i32 %15, 2
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = zext i32 %17 to i64
%19 = load i32, i32* %4
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %6
%22 = mul nuw i64 %18, %20
%23 = alloca i32, i64 %22
store i64 %18, i64* %7
store i64 %20, i64* %8
store i32 0, i32* %2
br label %24
24: ; preds = %42, %0
%25 = load i32, i32* %2
%26 = load i32, i32* %5
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %45
28: ; preds = %24
store i32 0, i32* %3
br label %29
29: ; preds = %37, %28
%30 = load i32, i32* %3
%31 = load i32, i32* %4
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %40
33: ; preds = %29
%34 = call i32 (...) @rand()
%35 = srem i32 %34, 11
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %35)
br label %37
37: ; preds = %33
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 1
store i32 %39, i32* %3
br label %29
40: ; preds = %29
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %42
42: ; preds = %40
%43 = load i32, i32* %2
%44 = add nsw i32 %43, 1
store i32 %44, i32* %2
br label %24
45: ; preds = %24
store i32 0, i32* %1
%46 = load i8*, i8** %6
%47 = load i32, i32* %1
ret i32 %47
}

LLVM IR (-O2):
@.str = [4 x i8] c"%3d\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 9
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 9
%7 = icmp sgt i32 %6, -2
br i1 %7, label %8, label %26
8: ; preds = %0
%9 = icmp sgt i32 %4, -2
%10 = call i32 @llvm.smax.i32(i32 %4, i32 -1)
%11 = add nsw i32 %10, 1
%12 = add nsw i32 %6, 1
br label %13
13: ; preds = %8, %22
%14 = phi i32 [ 0, %8 ], [ %24, %22 ]
br i1 %9, label %15, label %22
15: ; preds = %13, %15
%16 = phi i32 [ %20, %15 ], [ 0, %13 ]
%17 = tail call i32 (...) @rand()
%18 = srem i32 %17, 11
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = add nuw nsw i32 %16, 1
%21 = icmp eq i32 %16, %11
br i1 %21, label %22, label %15
22: ; preds = %15, %13
%23 = tail call i32 @putchar(i32 10)
%24 = add nuw nsw i32 %14, 1
%25 = icmp eq i32 %14, %12
br i1 %25, label %26, label %13
26: ; preds = %22, %0
ret i32 0
}