#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 *);
void draw(int row) {
  int row_temp = row;
  if (0 == row_temp % 2) {
    printf("row number error,you should input an odd row number!\n");
    return;
  }
  int i, j, k;
  for (i = 0; i <= row_temp / 2; i++) {
    for (j = 0; j <= row_temp / 2 - i - 1; j++) {
      printf(" ");
    }
    for (k = 0; k <= 2 * i; k++) {
      printf("*");
    }
    printf("\n");
  }
  for (i = 0; i <= row_temp / 2 - 1; i++) {
    for (j = 0; j <= i; j++) {
      printf(" ");
    }
    for (k = 0; k <= row_temp - 2 * (i + 1) - 1; k++) {
      printf("*");
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<draw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
jne    1147 <draw+0x37>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
jmp    12a9 <draw+0x199>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jg     11fd <draw+0xed>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
sub    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     11b1 <draw+0xa1>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1173 <draw+0x63>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jg     11e3 <draw+0xd3>
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b8 <draw+0xa8>
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114e <draw+0x3e>
movl   $0x0,-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
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     12a9 <draw+0x199>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1252 <draw+0x142>
lea    0xdf7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    122c <draw+0x11c>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
shl    $0x1,%edx
sub    %edx,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     128f <draw+0x17f>
lea    0xdbc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1259 <draw+0x149>
lea    0xd9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1204 <draw+0xf4>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw>:
test   $0x1,%dil
jne    1132 <draw+0x12>
lea    0xed3(%rip),%rdi
jmp    1040 <puts@plt>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0xffffffff,%edi
jl     1265 <draw+0x145>
mov    %edi,%r15d
shr    $0x1f,%r15d
mov    %edi,(%rsp)
add    %edi,%r15d
sar    %r15d
xor    %r12d,%r12d
mov    $0x1,%r14d
mov    %r15d,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12d,%eax
not    %eax
add    %r15d,%eax
mov    %ebx,%ebp
js     118f <draw+0x6f>
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1180 <draw+0x60>
mov    %r14d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11a0 <draw+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r12),%eax
add    $0xffffffff,%ebx
add    $0x2,%r14d
cmp    %r15d,%r12d
mov    %eax,%r12d
jne    1170 <draw+0x50>
mov    (%rsp),%eax
cmp    $0x2,%eax
jl     1265 <draw+0x145>
xor    %r13d,%r13d
mov    $0x1,%r12d
jmp    1207 <draw+0xe7>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
cmp    %r15d,%r13d
mov    0x4(%rsp),%eax
je     1265 <draw+0x145>
mov    %eax,%ebx
lea    -0x2(%rbx),%eax
mov    %eax,0x4(%rsp)
mov    %r12d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1220 <draw+0x100>
mov    %r13d,%eax
add    $0x1,%r13d
add    %eax,%eax
add    $0x2,%eax
mov    (%rsp),%ecx
sub    %eax,%ecx
test   %ecx,%ecx
jle    11f0 <draw+0xd0>
mov    $0x2,%r14d
nopw   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%r14d
cmp    %r14d,%ebx
jne    1250 <draw+0x130>
jmp    11f0 <draw+0xd0>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@str = [53 x i8] c"row number error,you should input an odd row number!\00"
define void @draw(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = sdiv i32 %0, 2
%6 = icmp slt i32 %0, -1
br i1 %6, label %59, label %9
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
br label %59
9: ; preds = %4, %29
%10 = phi i32 [ %33, %29 ], [ 1, %4 ]
%11 = phi i32 [ %32, %29 ], [ %5, %4 ]
%12 = phi i32 [ %31, %29 ], [ 0, %4 ]
%13 = xor i32 %12, -1
%14 = add nsw i32 %5, %13
%15 = icmp slt i32 %14, 0
br i1 %15, label %23, label %18
16: ; preds = %29
%17 = icmp sgt i32 %0, 1
br i1 %17, label %35, label %59
18: ; preds = %9, %18
%19 = phi i32 [ %21, %18 ], [ 0, %9 ]
%20 = tail call i32 @putchar(i32 32)
%21 = add nuw nsw i32 %19, 1
%22 = icmp eq i32 %21, %11
br i1 %22, label %23, label %18
23: ; preds = %18, %9
br label %24
24: ; preds = %23, %24
%25 = phi i32 [ %27, %24 ], [ 0, %23 ]
%26 = tail call i32 @putchar(i32 42)
%27 = add nuw nsw i32 %25, 1
%28 = icmp eq i32 %27, %10
br i1 %28, label %29, label %24
29: ; preds = %24
%30 = tail call i32 @putchar(i32 10)
%31 = add nuw nsw i32 %12, 1
%32 = add nsw i32 %11, -1
%33 = add nuw i32 %10, 2
%34 = icmp eq i32 %12, %5
br i1 %34, label %16, label %9
35: ; preds = %16, %55
%36 = phi i32 [ %39, %55 ], [ %0, %16 ]
%37 = phi i32 [ %57, %55 ], [ 1, %16 ]
%38 = phi i32 [ %41, %55 ], [ 0, %16 ]
%39 = add i32 %36, -2
br label %45
40: ; preds = %45
%41 = add nuw nsw i32 %38, 1
%42 = mul nsw i32 %41, -2
%43 = add i32 %42, %0
%44 = icmp sgt i32 %43, 0
br i1 %44, label %50, label %55
45: ; preds = %35, %45
%46 = phi i32 [ 0, %35 ], [ %48, %45 ]
%47 = tail call i32 @putchar(i32 32)
%48 = add nuw nsw i32 %46, 1
%49 = icmp eq i32 %48, %37
br i1 %49, label %40, label %45
50: ; preds = %40, %50
%51 = phi i32 [ %53, %50 ], [ 0, %40 ]
%52 = tail call i32 @putchar(i32 42)
%53 = add nuw nsw i32 %51, 1
%54 = icmp eq i32 %53, %39
br i1 %54, label %55, label %50
55: ; preds = %50, %40
%56 = tail call i32 @putchar(i32 10)
%57 = add nuw nsw i32 %37, 1
%58 = icmp eq i32 %41, %5
br i1 %58, label %59, label %35
59: ; preds = %55, %4, %16, %7
ret void
}