#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 ct(int t) {
  int n;
  int x = 1;
  while (t > 0) {
    for (n = 0; n < t; n++)
      printf(" ");
    for (n = 0; n < x; n++)
      printf("*");
    x = x + 2;
    t = t - 1;
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<ct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    11a9 <ct+0x99>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1159 <ct+0x49>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <ct+0x23>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1186 <ct+0x76>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1160 <ct+0x50>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
jmp    1122 <ct+0x12>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ct>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1179 <ct+0x69>
mov    %edi,%r14d
mov    $0x1,%ebp
mov    %r14d,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1130 <ct+0x20>
mov    %ebp,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1150 <ct+0x40>
add    $0x2,%ebp
lea    -0x1(%r14),%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x1,%r14d
mov    %ebx,%r14d
jg     1120 <ct+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ct(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %21
3: ; preds = %1, %16
%4 = phi i32 [ %17, %16 ], [ 1, %1 ]
%5 = phi i32 [ %18, %16 ], [ %0, %1 ]
br label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 0, %3 ]
%8 = tail call i32 @putchar(i32 32)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %5
br i1 %10, label %11, label %6
11: ; preds = %6, %11
%12 = phi i32 [ %14, %11 ], [ 0, %6 ]
%13 = tail call i32 @putchar(i32 42)
%14 = add nuw nsw i32 %12, 1
%15 = icmp eq i32 %14, %4
br i1 %15, label %16, label %11
16: ; preds = %11
%17 = add nuw nsw i32 %4, 2
%18 = add nsw i32 %5, -1
%19 = tail call i32 @putchar(i32 10)
%20 = icmp sgt i32 %5, 1
br i1 %20, label %3, label %21
21: ; preds = %16, %1
ret i32 undef
}