#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, j, k, n;
  printf("enter no. of rows");
  scanf("%d", &n);
  for (i = n; i >= 1; i--) {
    for (j = 1; j <= 2 * n - 1; j++)
      printf("s");
    printf("\n");
    for (k = 1; k <= (n + 1) - i; k++)
      printf(" ");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     11e4 <main+0xc4>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1190 <main+0x70>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <main+0x42>
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jg     11d1 <main+0xb1>
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a3 <main+0x83>
jmp    11d6 <main+0xb6>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1151 <main+0x31>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11ea <main+0xba>
mov    %eax,%r14d
jmp    117d <main+0x4d>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%r14),%ecx
cmp    $0x1,%r14d
mov    %ecx,%r14d
jle    11ea <main+0xba>
test   %eax,%eax
jle    11a7 <main+0x77>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x73,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%eax
add    %eax,%eax
cmp    %eax,%ebx
jl     1190 <main+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%ebx
sub    %r14d,%ebx
mov    0xc(%rsp),%eax
lea    (%rbx,%rax,1),%ecx
test   %ecx,%ecx
jle    1170 <main+0x40>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%eax
lea    (%rbx,%rax,1),%ecx
add    $0x1,%ebp
cmp    %ecx,%ebp
jl     11d0 <main+0xa0>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"enter no. of rows\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %35
7: ; preds = %0, %31
%8 = phi i32 [ %32, %31 ], [ %5, %0 ]
%9 = phi i32 [ %33, %31 ], [ %5, %0 ]
%10 = icmp sgt i32 %8, 0
br i1 %10, label %11, label %18
11: ; preds = %7, %11
%12 = phi i32 [ %14, %11 ], [ 1, %7 ]
%13 = call i32 @putchar(i32 115)
%14 = add nuw nsw i32 %12, 1
%15 = load i32, i32* %1
%16 = shl nsw i32 %15, 1
%17 = icmp slt i32 %14, %16
br i1 %17, label %11, label %18
18: ; preds = %11, %7
%19 = call i32 @putchar(i32 10)
%20 = sub i32 1, %9
%21 = load i32, i32* %1
%22 = add i32 %20, %21
%23 = icmp slt i32 %22, 1
br i1 %23, label %31, label %24
24: ; preds = %18, %24
%25 = phi i32 [ %27, %24 ], [ 1, %18 ]
%26 = call i32 @putchar(i32 32)
%27 = add nuw nsw i32 %25, 1
%28 = load i32, i32* %1
%29 = add i32 %20, %28
%30 = icmp slt i32 %25, %29
br i1 %30, label %24, label %31
31: ; preds = %24, %18
%32 = phi i32 [ %21, %18 ], [ %28, %24 ]
%33 = add nsw i32 %9, -1
%34 = icmp sgt i32 %9, 1
br i1 %34, label %7, label %35
35: ; preds = %31, %0
ret i32 0
}