#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 n, i, k, h, d;
  printf("Wuwedi n: ");
  scanf("%d", &n);
  h = 2 * n - 1;
  printf("\n");
  for (i = 0; i < n; i++) {
    for (d = 0; d < i; d++)
      printf(" ");
    for (k = 0; k < h - 2 * i; k++) {
      printf(".");
    }
    printf("\n");
  }
  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    0xec9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11f4 <main+0xd4>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a3 <main+0x83>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    117d <main+0x5d>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0xc(%rbp),%edx
shl    $0x1,%edx
sub    %edx,%ecx
cmp    %ecx,%eax
jge    11da <main+0xba>
lea    0xe49(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11aa <main+0x8a>
lea    0xe2d(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116a <main+0x4a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%r14d
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x4(%rsp)
jle    11d3 <main+0xa3>
xor    %r15d,%r15d
jmp    1185 <main+0x55>
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
cmp    0x4(%rsp),%r15d
jge    11d3 <main+0xa3>
mov    %r15d,%ebx
test   %r15d,%r15d
je     119f <main+0x6f>
nopl   (%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1190 <main+0x60>
mov    %r14d,%eax
sub    %r15d,%eax
lea    (%rax,%rax,1),%ebx
add    $0xffffffff,%ebx
test   %ebx,%ebx
jle    1170 <main+0x40>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2e,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %ebx,%ebp
jl     11c0 <main+0x90>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"Wuwedi n: \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 ([11 x i8], [11 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 = call i32 @putchar(i32 10)
%7 = load i32, i32* %1
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %32
9: ; preds = %0, %27
%10 = phi i32 [ %29, %27 ], [ 0, %0 ]
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %17, %9
%13 = sub i32 %5, %10
%14 = shl i32 %13, 1
%15 = add i32 %14, -1
%16 = icmp sgt i32 %15, 0
br i1 %16, label %22, label %27
17: ; preds = %9, %17
%18 = phi i32 [ %20, %17 ], [ 0, %9 ]
%19 = call i32 @putchar(i32 32)
%20 = add nuw nsw i32 %18, 1
%21 = icmp eq i32 %20, %10
br i1 %21, label %12, label %17
22: ; preds = %12, %22
%23 = phi i32 [ %25, %22 ], [ 0, %12 ]
%24 = call i32 @putchar(i32 46)
%25 = add nuw nsw i32 %23, 1
%26 = icmp slt i32 %25, %15
br i1 %26, label %22, label %27
27: ; preds = %22, %12
%28 = call i32 @putchar(i32 10)
%29 = add nuw nsw i32 %10, 1
%30 = load i32, i32* %1
%31 = icmp slt i32 %29, %30
br i1 %31, label %9, label %32
32: ; preds = %27, %0
ret i32 0
}