#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 main(void) {
  int side, side2, i, k;
  char c;
  printf("enter the side of square:");
  scanf("%d", &side);
  printf("enter the character: ");
  scanf(" %c", &c);
  for (i = side; i >= 1; i--) {
    for (k = 1; k <= side; k++) {
      printf("%c ", c);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x15(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     11ce <main+0xae>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11b2 <main+0x92>
movsbl -0x15(%rbp),%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1186 <main+0x66>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1175 <main+0x55>
mov    -0x4(%rbp),%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
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
lea    0xb(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11d6 <main+0xa6>
lea    0xeae(%rip),%rbx
mov    %eax,%r14d
test   %eax,%eax
jle    11b8 <main+0x88>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl 0xb(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     11a0 <main+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x2,%r14d
jl     11d6 <main+0xa6>
add    $0xffffffff,%r14d
mov    0xc(%rsp),%eax
test   %eax,%eax
jg     1190 <main+0x60>
jmp    11b8 <main+0x88>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"enter the side of square:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"enter the character: \00"
@.str.3 = [4 x i8] c" %c\00"
@.str.4 = [4 x i8] c"%c \00"
@.str.5 = [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
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%11 = load i32, i32* %2
store i32 %11, i32* %4
br label %12
12: ; preds = %29, %0
%13 = load i32, i32* %4
%14 = icmp sge i32 %13, 1
br i1 %14, label %15, label %32
15: ; preds = %12
store i32 1, i32* %5
br label %16
16: ; preds = %24, %15
%17 = load i32, i32* %5
%18 = load i32, i32* %2
%19 = icmp sle i32 %17, %18
br i1 %19, label %20, label %27
20: ; preds = %16
%21 = load i8, i8* %6
%22 = sext i8 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %20
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %16
27: ; preds = %16
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %29
29: ; preds = %27
%30 = load i32, i32* %4
%31 = add nsw i32 %30, -1
store i32 %31, i32* %4
br label %12
32: ; preds = %12
%33 = load i32, i32* %1
ret i32 %33
}

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