#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, j, k;
  do {
    printf("Please input a number for cengshu: ");
    scanf("%d", &n);
  } while (n % 2 == 0);
  for (i = 1; i <= (n + 1) / 2; i++) {
    for (j = 1; j <= (n + 1) / 2 - i; j++) {
      printf(" ");
    }
    for (k = 1; k <= i * 2 - 1; k++) {
      printf("*");
    }
    printf("\n");
  }
  for (i = 1; i <= n / 2; i++) {
    for (j = 1; j <= i; j++) {
      printf(" ");
    }
    for (k = 1; k <= (n / 2 - i) * 2 + 1; k++) {
      printf("*");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     112f <main+0xf>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jg     121b <main+0xfb>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jg     11cc <main+0xac>
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    118e <main+0x6e>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1201 <main+0xe1>
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d3 <main+0xb3>
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1166 <main+0x46>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
jg     12cf <main+0x1af>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     126d <main+0x14d>
lea    0xdc8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1247 <main+0x127>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
sub    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     12b5 <main+0x195>
lea    0xd85(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1274 <main+0x154>
lea    0xd6d(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1222 <main+0x102>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xec2(%rip),%r14
lea    0xedf(%rip),%r15
lea    0x4(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
test   $0x1,%al
je     1150 <main+0x20>
test   %eax,%eax
jle    1210 <main+0xe0>
mov    $0x1,%r14d
mov    $0x1,%ebx
xchg   %ax,%ax
mov    %eax,%ecx
add    $0x1,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0x1,%eax
sar    %eax
cmp    %ebx,%eax
jle    11c6 <main+0x96>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0x1,%eax
sar    %eax
sub    %ebx,%eax
add    $0x1,%ebp
cmp    %eax,%ebp
jl     11a0 <main+0x70>
mov    %r14d,%ebp
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11d0 <main+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%ecx
mov    0x4(%rsp),%eax
lea    0x1(%rax),%edx
shr    $0x1f,%edx
add    %eax,%edx
add    $0x1,%edx
sar    %edx
add    $0x2,%r14d
cmp    %edx,%ebx
mov    %ecx,%ebx
jl     1180 <main+0x50>
cmp    $0x2,%eax
jge    121d <main+0xed>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%ebx
jmp    1250 <main+0x120>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%eax
mov    0x4(%rsp),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
cmp    %edx,%ebx
mov    %eax,%ebx
jge    1210 <main+0xe0>
mov    %ebx,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1260 <main+0x130>
mov    0x4(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
shr    %ecx
sub    %ebx,%ecx
lea    (%rcx,%rcx,1),%eax
add    $0x1,%eax
test   %eax,%eax
jle    1230 <main+0x100>
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
shr    %ecx
sub    %ebx,%ecx
lea    (%rcx,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ebp
cmp    %eax,%ebp
jl     1290 <main+0x160>
jmp    1230 <main+0x100>

LLVM IR (-O0):
@.str = [36 x i8] c"Please input a number for cengshu: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [2 x i8] c"*\00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
br label %6
6: ; preds = %9, %0
%7 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 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)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = srem i32 %10, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %9
store i32 1, i32* %3
br label %14
14: ; preds = %48, %13
%15 = load i32, i32* %3
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
%18 = sdiv i32 %17, 2
%19 = icmp sle i32 %15, %18
br i1 %19, label %20, label %51
20: ; preds = %14
store i32 1, i32* %4
br label %21
21: ; preds = %31, %20
%22 = load i32, i32* %4
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
%25 = sdiv i32 %24, 2
%26 = load i32, i32* %3
%27 = sub nsw i32 %25, %26
%28 = icmp sle i32 %22, %27
br i1 %28, label %29, label %34
29: ; preds = %21
%30 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %29
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %21
34: ; preds = %21
store i32 1, i32* %5
br label %35
35: ; preds = %43, %34
%36 = load i32, i32* %5
%37 = load i32, i32* %3
%38 = mul nsw i32 %37, 2
%39 = sub nsw i32 %38, 1
%40 = icmp sle i32 %36, %39
br i1 %40, label %41, label %46
41: ; preds = %35
%42 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %43
43: ; preds = %41
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 1
store i32 %45, i32* %5
br label %35
46: ; preds = %35
%47 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %48
48: ; preds = %46
%49 = load i32, i32* %3
%50 = add nsw i32 %49, 1
store i32 %50, i32* %3
br label %14
51: ; preds = %14
store i32 1, i32* %3
br label %52
52: ; preds = %84, %51
%53 = load i32, i32* %3
%54 = load i32, i32* %2
%55 = sdiv i32 %54, 2
%56 = icmp sle i32 %53, %55
br i1 %56, label %57, label %87
57: ; preds = %52
store i32 1, i32* %4
br label %58
58: ; preds = %64, %57
%59 = load i32, i32* %4
%60 = load i32, i32* %3
%61 = icmp sle i32 %59, %60
br i1 %61, label %62, label %67
62: ; preds = %58
%63 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %64
64: ; preds = %62
%65 = load i32, i32* %4
%66 = add nsw i32 %65, 1
store i32 %66, i32* %4
br label %58
67: ; preds = %58
store i32 1, i32* %5
br label %68
68: ; preds = %79, %67
%69 = load i32, i32* %5
%70 = load i32, i32* %2
%71 = sdiv i32 %70, 2
%72 = load i32, i32* %3
%73 = sub nsw i32 %71, %72
%74 = mul nsw i32 %73, 2
%75 = add nsw i32 %74, 1
%76 = icmp sle i32 %69, %75
br i1 %76, label %77, label %82
77: ; preds = %68
%78 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %79
79: ; preds = %77
%80 = load i32, i32* %5
%81 = add nsw i32 %80, 1
store i32 %81, i32* %5
br label %68
82: ; preds = %68
%83 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %84
84: ; preds = %82
%85 = load i32, i32* %3
%86 = add nsw i32 %85, 1
store i32 %86, i32* %3
br label %52
87: ; preds = %52
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"Please input a number for cengshu: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %3, label %9
9: ; preds = %3
%10 = icmp slt i32 %6, 1
br i1 %10, label %75, label %11
11: ; preds = %9, %35
%12 = phi i32 [ %38, %35 ], [ %6, %9 ]
%13 = phi i32 [ %42, %35 ], [ 2, %9 ]
%14 = phi i32 [ %37, %35 ], [ 1, %9 ]
%15 = add nsw i32 %12, 1
%16 = sdiv i32 %15, 2
%17 = icmp sgt i32 %16, %14
br i1 %17, label %20, label %29
18: ; preds = %35
%19 = icmp slt i32 %38, 2
br i1 %19, label %75, label %43
20: ; preds = %11, %20
%21 = phi i32 [ %23, %20 ], [ 1, %11 ]
%22 = call i32 @putchar(i32 32)
%23 = add nuw nsw i32 %21, 1
%24 = load i32, i32* %1
%25 = add nsw i32 %24, 1
%26 = sdiv i32 %25, 2
%27 = sub nsw i32 %26, %14
%28 = icmp slt i32 %21, %27
br i1 %28, label %20, label %29
29: ; preds = %20, %11
br label %30
30: ; preds = %29, %30
%31 = phi i32 [ %33, %30 ], [ 1, %29 ]
%32 = call i32 @putchar(i32 42)
%33 = add nuw nsw i32 %31, 1
%34 = icmp eq i32 %33, %13
br i1 %34, label %35, label %30
35: ; preds = %30
%36 = call i32 @putchar(i32 10)
%37 = add nuw nsw i32 %14, 1
%38 = load i32, i32* %1
%39 = add nsw i32 %38, 1
%40 = sdiv i32 %39, 2
%41 = icmp slt i32 %14, %40
%42 = add nuw i32 %13, 2
br i1 %41, label %11, label %18
43: ; preds = %18, %68
%44 = phi i32 [ %74, %68 ], [ 2, %18 ]
%45 = phi i32 [ %70, %68 ], [ 1, %18 ]
br label %53
46: ; preds = %53
%47 = load i32, i32* %1
%48 = sdiv i32 %47, 2
%49 = sub nsw i32 %48, %45
%50 = shl nsw i32 %49, 1
%51 = or i32 %50, 1
%52 = icmp slt i32 %51, 1
br i1 %52, label %68, label %58
53: ; preds = %43, %53
%54 = phi i32 [ 1, %43 ], [ %56, %53 ]
%55 = call i32 @putchar(i32 32)
%56 = add nuw nsw i32 %54, 1
%57 = icmp eq i32 %56, %44
br i1 %57, label %46, label %53
58: ; preds = %46, %58
%59 = phi i32 [ %61, %58 ], [ 1, %46 ]
%60 = call i32 @putchar(i32 42)
%61 = add nuw nsw i32 %59, 1
%62 = load i32, i32* %1
%63 = sdiv i32 %62, 2
%64 = sub nsw i32 %63, %45
%65 = shl nsw i32 %64, 1
%66 = or i32 %65, 1
%67 = icmp slt i32 %59, %66
br i1 %67, label %58, label %68
68: ; preds = %58, %46
%69 = call i32 @putchar(i32 10)
%70 = add nuw nsw i32 %45, 1
%71 = load i32, i32* %1
%72 = sdiv i32 %71, 2
%73 = icmp slt i32 %45, %72
%74 = add nuw nsw i32 %44, 1
br i1 %73, label %43, label %75
75: ; preds = %68, %9, %18
ret i32 0
}