#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*/ getstr(char *, char *);
int /*<<< orphan*/ lstrip(char *, char);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ rstrip(char *, char);
int split(char **, char *, char);
int /*<<< orphan*/ strip(char *, char);
int main() {
  char ret[100][100] = {0};
  char str[100];
  char del;
  getstr(str, &del);
  int word = split(ret, str, del);
  for (int i = 0; i < word; i++)
    printf("%s\n", ret[i]);
  getstr(str, &del);
  lstrip(str, del);
  printf("%s\n", str);
  rstrip(str, del);
  printf("%s\n", str);
  getstr(str, &del);
  strip(str, del);
  printf("%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x27a0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x2720(%rbp),%rdi
xor    %esi,%esi
mov    $0x2710,%edx
call   1050 <memset@plt>
lea    -0x2790(%rbp),%rdi
lea    -0x2791(%rbp),%rsi
call   1080 <getstr@plt>
lea    -0x2720(%rbp),%rdi
lea    -0x2790(%rbp),%rsi
movsbl -0x2791(%rbp),%edx
call   1070 <split@plt>
mov    %eax,-0x2798(%rbp)
movl   $0x0,-0x279c(%rbp)
mov    -0x279c(%rbp),%eax
cmp    -0x2798(%rbp),%eax
jge    1219 <main+0xa9>
movslq -0x279c(%rbp),%rax
lea    -0x2720(%rbp),%rsi
imul   $0x64,%rax,%rax
add    %rax,%rsi
lea    0xe00(%rip),%rdi
call   1040 <printf@plt>
mov    -0x279c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x279c(%rbp)
jmp    11d2 <main+0x62>
lea    -0x2790(%rbp),%rdi
lea    -0x2791(%rbp),%rsi
call   1080 <getstr@plt>
lea    -0x2790(%rbp),%rdi
movsbl -0x2791(%rbp),%esi
call   1090 <lstrip@plt>
lea    -0x2790(%rbp),%rsi
lea    0xdb3(%rip),%rdi
call   1040 <printf@plt>
lea    -0x2790(%rbp),%rdi
movsbl -0x2791(%rbp),%esi
call   1030 <rstrip@plt>
lea    -0x2790(%rbp),%rsi
lea    0xd8d(%rip),%rdi
call   1040 <printf@plt>
lea    -0x2790(%rbp),%rdi
lea    -0x2791(%rbp),%rsi
call   1080 <getstr@plt>
lea    -0x2790(%rbp),%rdi
movsbl -0x2791(%rbp),%esi
call   1060 <strip@plt>
lea    -0x2790(%rbp),%rsi
lea    0xd54(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x27a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x2790,%rsp
lea    0x80(%rsp),%r15
mov    $0x2710,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
lea    0x10(%rsp),%r14
lea    0xf(%rsp),%rsi
mov    %r14,%rdi
call   1080 <getstr@plt>
movsbl 0xf(%rsp),%edx
mov    %r15,%rdi
mov    %r14,%rsi
call   1070 <split@plt>
test   %eax,%eax
jle    11e5 <main+0x75>
mov    %eax,%ebx
lea    0xe3e(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <printf@plt>
add    $0x64,%r15
add    $0xffffffffffffffff,%rbx
jne    11d0 <main+0x60>
lea    0x10(%rsp),%rbx
lea    0xf(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <getstr@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1090 <lstrip@plt>
lea    0xdf2(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <rstrip@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <getstr@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1060 <strip@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x2790,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x [100 x i8]]
%2 = alloca [100 x i8]
%3 = alloca i8
%4 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %1, i64 0, i64 0, i64 0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i32 @getstr(i8* %5, i8* %3)
%7 = bitcast [100 x [100 x i8]]* %1 to i8**
%8 = load i8, i8* %3
%9 = call i32 @split(i8** %7, i8* %5, i8 signext %8)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = zext i32 %9 to i64
br label %25
13: ; preds = %25, %0
%14 = call i32 @getstr(i8* %5, i8* %3)
%15 = load i8, i8* %3
%16 = call i32 @lstrip(i8* %5, i8 signext %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%18 = load i8, i8* %3
%19 = call i32 @rstrip(i8* %5, i8 signext %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%21 = call i32 @getstr(i8* %5, i8* %3)
%22 = load i8, i8* %3
%23 = call i32 @strip(i8* %5, i8 signext %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
25: ; preds = %11, %25
%26 = phi i64 [ 0, %11 ], [ %29, %25 ]
%27 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %1, i64 0, i64 %26, i64 0
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %27)
%29 = add nuw nsw i64 %26, 1
%30 = icmp eq i64 %29, %12
br i1 %30, label %13, label %25
}