#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 *, char *);
int strlen(char *);
int main() {
  char word[10];
  scanf("%s", word);
  int i = 0;
  int j = 0;
  int k = 0;
  int length = strlen(word);
  for (i = 0; i < length; i++) {
    int temp = i;
    for (j = i; j < length; j++) {
      int temps = j;
      while (temp <= temps) {
        printf("%c", word[temp]);
        temp++;
      }
      printf("\n");
      temp = i;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    -0xe(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1207 <main+0xd7>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    11f4 <main+0xc4>
mov    -0x18(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jg     11d2 <main+0xa2>
movslq -0x24(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%esi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11a1 <main+0x71>
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    118f <main+0x5f>
jmp    11f9 <main+0xc9>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1177 <main+0x47>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xebb(%rip),%rdi
lea    0x1e(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    11f5 <main+0xc5>
mov    %rax,%rcx
mov    %ecx,%eax
mov    %rax,(%rsp)
add    $0x1,%ecx
mov    %rcx,0x10(%rsp)
mov    $0x1,%r12d
xor    %r13d,%r13d
jmp    1197 <main+0x67>
xchg   %ax,%ax
add    $0x1,%r13
mov    0x8(%rsp),%r12
add    $0x1,%r12
add    $0x1,%rbx
cmp    (%rsp),%r13
je     11f5 <main+0xc5>
mov    $0x1,%ebp
mov    %r12,0x8(%rsp)
mov    %r13d,%r15d
jmp    11cd <main+0x9d>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
add    $0x1,%r12
add    $0x1,%rbp
cmp    0x10(%rsp),%r12
je     1180 <main+0x50>
cmp    %r13d,%r15d
jb     11b0 <main+0x80>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nop
movsbl (%rbx,%r14,1),%edi
call   1030 <putchar@plt>
add    $0x1,%r14
cmp    %r14,%rbp
jne    11e0 <main+0xb0>
jmp    11b0 <main+0x80>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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