#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int strlen(char *);
char *strtok(char *, char *);
int main() {
  char girdi[2000];
  char *kelimeler[20];
  char *word;
  int dongu = 0, dongu2 = 0;
  int bosluk = 0;
  int uzunluk = 0;
  fgets(girdi, 2000, stdin);
  word = strtok(girdi, "\n ");
  while (word != NULL) {
    if (uzunluk < strlen(word)) {
      uzunluk = strlen(word);
    }
    kelimeler[dongu] = word;
    word = strtok(NULL, "\n ");
    dongu++;
  }
  for (int i = 0; i < uzunluk + 4; i++)
    printf("#");
  while (dongu2 < dongu) {
    bosluk = uzunluk - strlen(kelimeler[dongu2]);
    printf("\n# %s", kelimeler[dongu2]);
    for (int i = 0; i < bosluk; i++) {
      printf(" ");
    }
    printf(" #");
    dongu2++;
  }
  printf("\n");
  for (int i = 0; i < uzunluk + 4; i++)
    printf("#");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x8b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x88c(%rbp)
movl   $0x0,-0x890(%rbp)
movl   $0x0,-0x894(%rbp)
movl   $0x0,-0x898(%rbp)
lea    -0x7e0(%rbp),%rdi
mov    0x2e60(%rip),%rax
mov    (%rax),%edx
mov    $0x7d0,%esi
call   1050 <fgets@plt>
lea    -0x7e0(%rbp),%rdi
lea    0xe5e(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x888(%rbp)
cmpq   $0x0,-0x888(%rbp)
je     1237 <main+0xf7>
mov    -0x898(%rbp),%eax
mov    %eax,-0x8a8(%rbp)
mov    -0x888(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x8a8(%rbp),%eax
cmp    %ecx,%eax
jge    11f6 <main+0xb6>
mov    -0x888(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x898(%rbp)
mov    -0x888(%rbp),%rcx
movslq -0x88c(%rbp),%rax
mov    %rcx,-0x880(%rbp,%rax,8)
ff
xor    %eax,%eax
mov    %eax,%edi
lea    0xde9(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x888(%rbp)
mov    -0x88c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88c(%rbp)
jmp    11ae <main+0x6e>
movl   $0x0,-0x89c(%rbp)
mov    -0x89c(%rbp),%eax
mov    -0x898(%rbp),%ecx
add    $0x4,%ecx
cmp    %ecx,%eax
jge    127a <main+0x13a>
lea    0xdab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x89c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x89c(%rbp)
jmp    1241 <main+0x101>
jmp    127f <main+0x13f>
mov    -0x890(%rbp),%eax
cmp    -0x88c(%rbp),%eax
jge    133e <main+0x1fe>
mov    -0x898(%rbp),%eax
mov    %eax,-0x8ac(%rbp)
movslq -0x890(%rbp),%rax
mov    -0x880(%rbp,%rax,8),%rdi
ff
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x8ac(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x894(%rbp)
movslq -0x890(%rbp),%rax
mov    -0x880(%rbp,%rax,8),%rsi
ff
lea    0xd2c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8a0(%rbp)
mov    -0x8a0(%rbp),%eax
cmp    -0x894(%rbp),%eax
jge    131c <main+0x1dc>
lea    0xd00(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8a0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8a0(%rbp)
jmp    12e8 <main+0x1a8>
lea    0xce6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x890(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x890(%rbp)
jmp    127f <main+0x13f>
lea    0xcc7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8a4(%rbp)
mov    -0x8a4(%rbp),%eax
mov    -0x898(%rbp),%ecx
add    $0x4,%ecx
cmp    %ecx,%eax
jge    138f <main+0x24f>
lea    0xc96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8a4(%rbp)
jmp    1356 <main+0x216>
xor    %eax,%eax
add    $0x8b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x888,%rsp
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
lea    0xb0(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x7d0,%esi
call   1060 <fgets@plt>
lea    0xe7a(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strtok@plt>
test   %rax,%rax
je     1205 <main+0xb5>
mov    %rax,%rbx
xor    %ebp,%ebp
lea    0xe61(%rip),%r14
xor    %r12d,%r12d
jmp    11cb <main+0x7b>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,0x10(%rsp,%rbp,8)
xor    %edi,%edi
mov    %r14,%rsi
call   1070 <strtok@plt>
mov    %rax,%rbx
add    $0x1,%rbp
test   %rax,%rax
je     11e5 <main+0x95>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    %eax,%r12d
jge    11b0 <main+0x60>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%r12d
jmp    11b0 <main+0x60>
lea    0x4(%r12),%eax
cmp    $0xfffffffc,%r12d
jg     120f <main+0xbf>
mov    %eax,0x8(%rsp)
movl   $0x0,0xc(%rsp)
test   %ebp,%ebp
jne    1239 <main+0xe9>
jmp    12a2 <main+0x152>
xor    %r12d,%r12d
mov    $0x4,%eax
xor    %ebp,%ebp
cmp    $0x2,%eax
mov    $0x1,%ebx
mov    %eax,0x8(%rsp)
cmovge %eax,%ebx
xchg   %ax,%ax
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1220 <main+0xd0>
mov    $0x1,%al
mov    %eax,0xc(%rsp)
test   %ebp,%ebp
je     12a2 <main+0x152>
mov    %ebp,%ebp
lea    0xdc7(%rip),%r15
xor    %r13d,%r13d
jmp    1263 <main+0x113>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r13
cmp    %rbp,%r13
je     12a2 <main+0x152>
mov    0x10(%rsp,%r13,8),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r12d,%r14d
sub    %eax,%r14d
lea    0xd86(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r14d,%r14d
jle    1250 <main+0x100>
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%r14d
jne    1290 <main+0x140>
jmp    1250 <main+0x100>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpb   $0x0,0xc(%rsp)
je     12df <main+0x18f>
mov    0x8(%rsp),%eax
cmp    $0x2,%eax
mov    $0x1,%ebx
cmovge %eax,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    12d0 <main+0x180>
xor    %eax,%eax
add    $0x888,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"\0A \00"
@.str.1 = [2 x i8] c"#\00"
@.str.2 = [6 x i8] c"\0A# %s\00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [3 x i8] c" #\00"
@.str.5 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2000 x i8]
%3 = alloca [20 x i8*]
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
%12 = getelementptr inbounds [2000 x i8], [2000 x i8]* %2, i64 0, i64 0
%13 = load i32, i32* @stdin
%14 = call i32 @fgets(i8* %12, i32 2000, i32 %13)
%15 = getelementptr inbounds [2000 x i8], [2000 x i8]* %2, i64 0, i64 0
%16 = call i8* @strtok(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %16, i8** %4
br label %17
17: ; preds = %28, %0
%18 = load i8*, i8** %4
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %36
20: ; preds = %17
%21 = load i32, i32* %8
%22 = load i8*, i8** %4
%23 = call i32 @strlen(i8* %22)
%24 = icmp slt i32 %21, %23
br i1 %24, label %25, label %28
25: ; preds = %20
%26 = load i8*, i8** %4
%27 = call i32 @strlen(i8* %26)
store i32 %27, i32* %8
br label %28
28: ; preds = %25, %20
%29 = load i8*, i8** %4
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 %31
store i8* %29, i8** %32
%33 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %33, i8** %4
%34 = load i32, i32* %5
%35 = add nsw i32 %34, 1
store i32 %35, i32* %5
br label %17
36: ; preds = %17
store i32 0, i32* %9
br label %37
37: ; preds = %44, %36
%38 = load i32, i32* %9
%39 = load i32, i32* %8
%40 = add nsw i32 %39, 4
%41 = icmp slt i32 %38, %40
br i1 %41, label %42, label %47
42: ; preds = %37
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %44
44: ; preds = %42
%45 = load i32, i32* %9
%46 = add nsw i32 %45, 1
store i32 %46, i32* %9
br label %37
47: ; preds = %37
br label %48
48: ; preds = %74, %47
%49 = load i32, i32* %6
%50 = load i32, i32* %5
%51 = icmp slt i32 %49, %50
br i1 %51, label %52, label %78
52: ; preds = %48
%53 = load i32, i32* %8
%54 = load i32, i32* %6
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 %55
%57 = load i8*, i8** %56
%58 = call i32 @strlen(i8* %57)
%59 = sub nsw i32 %53, %58
store i32 %59, i32* %7
%60 = load i32, i32* %6
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 %61
%63 = load i8*, i8** %62
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %63)
store i32 0, i32* %10
br label %65
65: ; preds = %71, %52
%66 = load i32, i32* %10
%67 = load i32, i32* %7
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %74
69: ; preds = %65
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %71
71: ; preds = %69
%72 = load i32, i32* %10
%73 = add nsw i32 %72, 1
store i32 %73, i32* %10
br label %65
74: ; preds = %65
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%76 = load i32, i32* %6
%77 = add nsw i32 %76, 1
store i32 %77, i32* %6
br label %48
78: ; preds = %48
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %11
br label %80
80: ; preds = %87, %78
%81 = load i32, i32* %11
%82 = load i32, i32* %8
%83 = add nsw i32 %82, 4
%84 = icmp slt i32 %81, %83
br i1 %84, label %85, label %90
85: ; preds = %80
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %87
87: ; preds = %85
%88 = load i32, i32* %11
%89 = add nsw i32 %88, 1
store i32 %89, i32* %11
br label %80
90: ; preds = %80
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"\0A \00"
@.str.2 = [6 x i8] c"\0A# %s\00"
@.str.4 = [3 x i8] c" #\00"
define i32 @main() {
%1 = alloca [2000 x i8]
%2 = alloca [20 x i8*]
%3 = getelementptr inbounds [2000 x i8], [2000 x i8]* %1, i64 0, i64 0
%4 = bitcast [20 x i8*]* %2 to i8*
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %3, i32 2000, i32 %5)
%7 = call i8* @strtok(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i8* %7, null
br i1 %8, label %13, label %18
9: ; preds = %26
%10 = trunc i64 %30 to i32
%11 = add i32 %27, 4
%12 = icmp sgt i32 %27, -4
br i1 %12, label %13, label %32
13: ; preds = %0, %9
%14 = phi i32 [ %11, %9 ], [ 4, %0 ]
%15 = phi i32 [ %27, %9 ], [ 0, %0 ]
%16 = phi i32 [ %10, %9 ], [ 0, %0 ]
%17 = call i32 @llvm.smax.i32(i32 %14, i32 1)
br label %40
18: ; preds = %0, %26
%19 = phi i64 [ %30, %26 ], [ 0, %0 ]
%20 = phi i32 [ %27, %26 ], [ 0, %0 ]
%21 = phi i8* [ %29, %26 ], [ %7, %0 ]
%22 = call i32 @strlen(i8* %21)
%23 = icmp slt i32 %20, %22
br i1 %23, label %24, label %26
24: ; preds = %18
%25 = call i32 @strlen(i8* %21)
br label %26
26: ; preds = %24, %18
%27 = phi i32 [ %25, %24 ], [ %20, %18 ]
%28 = getelementptr inbounds [20 x i8*], [20 x i8*]* %2, i64 0, i64 %19
store i8* %21, i8** %28
%29 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%30 = add nuw i64 %19, 1
%31 = icmp eq i8* %29, null
br i1 %31, label %9, label %18
32: ; preds = %40, %9
%33 = phi i1 [ false, %9 ], [ true, %40 ]
%34 = phi i32 [ %11, %9 ], [ %14, %40 ]
%35 = phi i32 [ %27, %9 ], [ %15, %40 ]
%36 = phi i32 [ %10, %9 ], [ %16, %40 ]
%37 = icmp eq i32 %36, 0
br i1 %37, label %62, label %38
38: ; preds = %32
%39 = zext i32 %36 to i64
br label %45
40: ; preds = %13, %40
%41 = phi i32 [ %43, %40 ], [ 0, %13 ]
%42 = call i32 @putchar(i32 35)
%43 = add nuw nsw i32 %41, 1
%44 = icmp eq i32 %43, %17
br i1 %44, label %32, label %40
45: ; preds = %38, %53
%46 = phi i64 [ 0, %38 ], [ %55, %53 ]
%47 = getelementptr inbounds [20 x i8*], [20 x i8*]* %2, i64 0, i64 %46
%48 = load i8*, i8** %47
%49 = call i32 @strlen(i8* %48)
%50 = sub i32 %35, %49
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %48)
%52 = icmp sgt i32 %50, 0
br i1 %52, label %57, label %53
53: ; preds = %57, %45
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%55 = add nuw nsw i64 %46, 1
%56 = icmp eq i64 %55, %39
br i1 %56, label %62, label %45
57: ; preds = %45, %57
%58 = phi i32 [ %60, %57 ], [ 0, %45 ]
%59 = call i32 @putchar(i32 32)
%60 = add nuw nsw i32 %58, 1
%61 = icmp eq i32 %60, %50
br i1 %61, label %53, label %57
62: ; preds = %53, %32
%63 = call i32 @putchar(i32 10)
br i1 %33, label %64, label %66
64: ; preds = %62
%65 = call i32 @llvm.smax.i32(i32 %34, i32 1)
br label %67
66: ; preds = %67, %62
ret i32 0
67: ; preds = %64, %67
%68 = phi i32 [ %70, %67 ], [ 0, %64 ]
%69 = call i32 @putchar(i32 35)
%70 = add nuw nsw i32 %68, 1
%71 = icmp eq i32 %70, %65
br i1 %71, label %66, label %67
}