#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 */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  if (argc < 2)
    return 1;
  int i, j, rows;
  time_t t;
  srand((unsigned)time(&t));
  rows = argv[1][0];
  for (i = 1; i <= rows; ++i) {
    for (j = 1; j <= i; ++j) {
      printf("* ");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    115c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    11db <main+0xab>
lea    -0x20(%rbp),%rdi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     11d4 <main+0xa4>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11ba <main+0x8a>
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1194 <main+0x64>
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1181 <main+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     11e5 <main+0xa5>
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xc(%rsp),%rdi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    0x8(%rbx),%rax
movzbl (%rax),%r14d
test   %r14b,%r14b
jle    11d7 <main+0x97>
add    $0x1,%r14d
mov    $0x2,%r15d
mov    $0x1,%r12d
lea    0xe6e(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    11b0 <main+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r15),%eax
add    $0x1,%r12d
cmp    %r14d,%r15d
mov    %eax,%r15d
jne    11a0 <main+0x60>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"* \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = icmp slt i32 %0, 2
br i1 %4, label %29, label %5
5: ; preds = %2
%6 = bitcast i32* %3 to i8*
%7 = call i64 @time(i32* %3)
%8 = trunc i64 %7 to i32
%9 = call i32 @srand(i32 %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = icmp slt i8 %12, 1
br i1 %13, label %28, label %14
14: ; preds = %5
%15 = zext i8 %12 to i32
%16 = add nuw nsw i32 %15, 1
br label %17
17: ; preds = %14, %24
%18 = phi i32 [ 2, %14 ], [ %26, %24 ]
br label %19
19: ; preds = %17, %19
%20 = phi i32 [ 1, %17 ], [ %22, %19 ]
%21 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%22 = add nuw nsw i32 %20, 1
%23 = icmp eq i32 %22, %18
br i1 %23, label %24, label %19
24: ; preds = %19
%25 = call i32 @putchar(i32 10)
%26 = add nuw nsw i32 %18, 1
%27 = icmp eq i32 %18, %16
br i1 %27, label %28, label %17
28: ; preds = %24, %5
br label %29
29: ; preds = %2, %28
%30 = phi i32 [ 0, %28 ], [ 1, %2 ]
ret i32 %30
}