#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*/ next_generation(int *, int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int current[20];
  int next[20];
  int counter;
  int length;
  scanf("%d", &length);
  length = length - 1;
  for (counter = 0; counter <= length; counter++) {
    scanf("%d", (current + counter));
  }
  for (counter = 0; counter <= length; counter++) {
    if (*(current + counter) == 0)
      printf(".");
    if (*(current + counter) == 1)
      printf("*");
  }
  printf("\n");
  next_generation(current, next, length);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0xb8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xb8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xb8(%rbp)
movl   $0x0,-0xb4(%rbp)
mov    -0xb4(%rbp),%eax
cmp    -0xb8(%rbp),%eax
jg     11b2 <main+0x82>
lea    -0x60(%rbp),%rsi
movslq -0xb4(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe67(%rip),%rdi
call   1050 <scanf@plt>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    116e <main+0x3e>
movl   $0x0,-0xb4(%rbp)
mov    -0xb4(%rbp),%eax
cmp    -0xb8(%rbp),%eax
jg     1223 <main+0xf3>
movslq -0xb4(%rbp),%rax
cmpl   $0x0,-0x60(%rbp,%rax,4)
jne    11ec <main+0xbc>
lea    0xe1c(%rip),%rdi
call   1040 <printf@plt>
movslq -0xb4(%rbp),%rax
cmpl   $0x1,-0x60(%rbp,%rax,4)
jne    120a <main+0xda>
lea    0xe00(%rip),%rdi
call   1040 <printf@plt>
jmp    120f <main+0xdf>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    11bc <main+0x8c>
lea    0xddd(%rip),%rdi
call   1040 <printf@plt>
lea    -0x60(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
mov    -0xb8(%rbp),%edx
call   1030 <next_generation@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xb0,%rsp
lea    0xebd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
test   %eax,%eax
jle    11ef <main+0xbf>
mov    $0xffffffffffffffff,%r15
lea    0x10(%rsp),%rbx
lea    0xe8d(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rax
add    $0x1,%r15
add    $0x4,%rbx
cmp    %rax,%r15
jl     1180 <main+0x50>
test   %eax,%eax
js     11ef <main+0xbf>
mov    $0xffffffffffffffff,%rbx
jmp    11be <main+0x8e>
nopw   0x0(%rax,%rax,1)
movslq 0xc(%rsp),%rax
add    $0x1,%rbx
cmp    %rax,%rbx
jge    11ef <main+0xbf>
mov    0x14(%rsp,%rbx,4),%eax
test   %eax,%eax
je     11d0 <main+0xa0>
cmp    $0x1,%eax
jne    11b0 <main+0x80>
jmp    11e3 <main+0xb3>
nopl   (%rax)
mov    $0x2e,%edi
call   1040 <putchar@plt>
mov    0x14(%rsp,%rbx,4),%eax
cmp    $0x1,%eax
jne    11b0 <main+0x80>
mov    $0x2a,%edi
call   1040 <putchar@plt>
jmp    11b0 <main+0x80>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0xc(%rsp),%edx
lea    0x10(%rsp),%rdi
lea    0x60(%rsp),%rsi
call   1030 <next_generation@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [20 x i32]
%2 = alloca [20 x i32]
%3 = alloca i32
%4 = bitcast [20 x i32]* %1 to i8*
%5 = bitcast [20 x i32]* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = add nsw i32 %8, -1
store i32 %9, i32* %3
%10 = icmp slt i32 %8, 1
br i1 %10, label %39, label %13
11: ; preds = %13
%12 = icmp slt i32 %18, 0
br i1 %12, label %39, label %21
13: ; preds = %0, %13
%14 = phi i64 [ %17, %13 ], [ 0, %0 ]
%15 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 %14
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%17 = add nuw nsw i64 %14, 1
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = icmp slt i64 %14, %19
br i1 %20, label %13, label %11
21: ; preds = %11, %34
%22 = phi i64 [ %35, %34 ], [ 0, %11 ]
%23 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %21
%27 = call i32 @putchar(i32 46)
%28 = load i32, i32* %23
br label %29
29: ; preds = %26, %21
%30 = phi i32 [ %28, %26 ], [ %24, %21 ]
%31 = icmp eq i32 %30, 1
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 @putchar(i32 42)
br label %34
34: ; preds = %29, %32
%35 = add nuw nsw i64 %22, 1
%36 = load i32, i32* %3
%37 = sext i32 %36 to i64
%38 = icmp slt i64 %22, %37
br i1 %38, label %21, label %39
39: ; preds = %34, %0, %11
%40 = call i32 @putchar(i32 10)
%41 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%42 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%43 = load i32, i32* %3
%44 = call i32 @next_generation(i32* %41, i32* %42, i32 %43)
ret i32 0
}