#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 */
char **mapper(char **, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
char **split(char *);
int strlen(char *);
main() {
  int no_of_words = 1;
  char s1[20], **s2, **id_row_column;
  int i = 0;
  int j = 0;
  scanf("%[^\n]s", s1);
  for (i = 0; i < strlen(s1); i++) {
    if (s1[i] == ' ') {
      no_of_words += 1;
    }
  }
  s2 = split(s1);
  id_row_column = mapper(s2, no_of_words);
  for (i = 0; i < no_of_words; i++) {
    printf("%s\n", id_row_column[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xe81(%rip),%rdi
call   1070 <scanf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x3c(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
cmp    %ecx,%eax
jge    11d5 <main+0x85>
movslq -0x34(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x20,%eax
jne    11c2 <main+0x72>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c7 <main+0x77>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    118b <main+0x3b>
lea    -0x20(%rbp),%rdi
call   1060 <split@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <mapper@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    122b <main+0xdb>
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xdef(%rip),%rdi
call   1040 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11f9 <main+0xa9>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xe9f(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    $0x1,%r15d
mov    $0x1,%ebp
test   %eax,%eax
jle    11ae <main+0x5e>
mov    $0x1,%ebp
xor    %ebx,%ebx
mov    %rsp,%r14
nopl   (%rax)
xor    %eax,%eax
cmpb   $0x20,(%rsp,%rbx,1)
sete   %al
add    %eax,%ebp
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1190 <main+0x40>
mov    %rsp,%rdi
call   1060 <split@plt>
mov    %rax,%rdi
mov    %ebp,%esi
call   1050 <mapper@plt>
mov    %rax,%r14
cmp    $0x2,%ebp
cmovae %ebp,%r15d
xor    %ebp,%ebp
lea    0xe34(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r14,%rbp,8),%rsi
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    11e0 <main+0x90>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 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 %18
6: ; preds = %0, %6
%7 = phi i64 [ %14, %6 ], [ 0, %0 ]
%8 = phi i32 [ %13, %6 ], [ 1, %0 ]
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 32
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %8, %12
%14 = add nuw nsw i64 %7, 1
%15 = call i32 @strlen(i8* %2)
%16 = sext i32 %15 to i64
%17 = icmp slt i64 %14, %16
br i1 %17, label %6, label %18
18: ; preds = %6, %0
%19 = phi i32 [ 1, %0 ], [ %13, %6 ]
%20 = call i8** @split(i8* %2)
%21 = call i8** @mapper(i8** %20, i32 %19)
%22 = call i32 @llvm.umax.i32(i32 %19, i32 1)
%23 = zext i32 %22 to i64
br label %24
24: ; preds = %18, %24
%25 = phi i64 [ 0, %18 ], [ %29, %24 ]
%26 = getelementptr inbounds i8*, i8** %21, i64 %25
%27 = load i8*, i8** %26
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %27)
%29 = add nuw nsw i64 %25, 1
%30 = icmp eq i64 %29, %23
br i1 %30, label %31, label %24
31: ; preds = %24
ret i32 0
}