#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*/ Rotate(char **, int, int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ *gets(char *);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main(int argc, char *argv[]) {
  int max_row, max_length;
  char string[102][102] = {'\0'};
  fflush(stdin);
  max_row = max_length = 0;
  while (gets(string[max_row]) != NULL) {
    max_length =
        ((max_length) > (strlen(string[max_row])) ? (max_length)
                                                  : (strlen(string[max_row])));
    max_row++;
  }
  Rotate(string, max_row, max_length);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x28d0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x28c0(%rbp),%rdi
xor    %esi,%esi
mov    $0x28a4,%edx
call   1040 <memset@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
lea    -0x28c0(%rbp),%rdi
imul   $0x66,%rax,%rax
add    %rax,%rdi
call   1060 <gets@plt>
cmp    $0x0,%rax
je     122b <main+0xdb>
mov    -0x18(%rbp),%eax
mov    %eax,-0x28c4(%rbp)
movslq -0x14(%rbp),%rax
lea    -0x28c0(%rbp),%rdi
imul   $0x66,%rax,%rax
add    %rax,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28c4(%rbp),%eax
cmp    %ecx,%eax
jle    11f7 <main+0xa7>
mov    -0x18(%rbp),%eax
mov    %eax,-0x28c8(%rbp)
jmp    1214 <main+0xc4>
movslq -0x14(%rbp),%rax
lea    -0x28c0(%rbp),%rdi
imul   $0x66,%rax,%rax
add    %rax,%rdi
call   1030 <strlen@plt>
mov    %eax,-0x28c8(%rbp)
mov    -0x28c8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1198 <main+0x48>
lea    -0x28c0(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1050 <Rotate@plt>
xor    %eax,%eax
add    $0x28d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x28b0,%rsp
mov    %rsp,%rbx
xor    %ebp,%ebp
mov    $0x28a4,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    $0x0,%r14d
test   %rax,%rax
je     11ce <main+0x7e>
xor    %ebp,%ebp
xor    %r14d,%r14d
jmp    11b4 <main+0x64>
nopw   0x0(%rax,%rax,1)
add    $0x66,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
add    $0x1,%ebp
test   %rax,%rax
je     11ce <main+0x7e>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    %eax,%r14d
jg     11a0 <main+0x50>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%r14d
jmp    11a0 <main+0x50>
mov    %rsp,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1050 <Rotate@plt>
xor    %eax,%eax
add    $0x28b0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [102 x [102 x i8]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [102 x [102 x i8]]* %8 to i8*
%10 = load i32, i32* @stdin
%11 = call i32 @fflush(i32 %10)
store i32 0, i32* %7
store i32 0, i32* %6
br label %12
12: ; preds = %35, %2
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [102 x [102 x i8]], [102 x [102 x i8]]* %8, i64 0, i64 %14
%16 = getelementptr inbounds [102 x i8], [102 x i8]* %15, i64 0, i64 0
%17 = call i32* @gets(i8* %16)
%18 = icmp ne i32* %17, null
br i1 %18, label %19, label %39
19: ; preds = %12
%20 = load i32, i32* %7
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [102 x [102 x i8]], [102 x [102 x i8]]* %8, i64 0, i64 %22
%24 = getelementptr inbounds [102 x i8], [102 x i8]* %23, i64 0, i64 0
%25 = call i32 @strlen(i8* %24)
%26 = icmp sgt i32 %20, %25
br i1 %26, label %27, label %29
27: ; preds = %19
%28 = load i32, i32* %7
br label %35
29: ; preds = %19
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [102 x [102 x i8]], [102 x [102 x i8]]* %8, i64 0, i64 %31
%33 = getelementptr inbounds [102 x i8], [102 x i8]* %32, i64 0, i64 0
%34 = call i32 @strlen(i8* %33)
br label %35
35: ; preds = %29, %27
%36 = phi i32 [ %28, %27 ], [ %34, %29 ]
store i32 %36, i32* %7
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %6
br label %12
39: ; preds = %12
%40 = getelementptr inbounds [102 x [102 x i8]], [102 x [102 x i8]]* %8, i64 0, i64 0
%41 = bitcast [102 x i8]* %40 to i8**
%42 = load i32, i32* %6
%43 = load i32, i32* %7
%44 = call i32 @Rotate(i8** %41, i32 %42, i32 %43)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [102 x [102 x i8]]
%4 = getelementptr inbounds [102 x [102 x i8]], [102 x [102 x i8]]* %3, i64 0, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = tail call i32 @fflush(i32 %5)
%7 = call i32* @gets(i8* %4)
%8 = icmp eq i32* %7, null
br i1 %8, label %25, label %9
9: ; preds = %2, %17
%10 = phi i64 [ %19, %17 ], [ 0, %2 ]
%11 = phi i8* [ %20, %17 ], [ %4, %2 ]
%12 = phi i32 [ %18, %17 ], [ 0, %2 ]
%13 = call i32 @strlen(i8* %11)
%14 = icmp sgt i32 %12, %13
br i1 %14, label %17, label %15
15: ; preds = %9
%16 = call i32 @strlen(i8* %11)
br label %17
17: ; preds = %9, %15
%18 = phi i32 [ %16, %15 ], [ %12, %9 ]
%19 = add nuw i64 %10, 1
%20 = getelementptr inbounds [102 x [102 x i8]], [102 x [102 x i8]]* %3, i64 0, i64 %19, i64 0
%21 = call i32* @gets(i8* %20)
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %9
23: ; preds = %17
%24 = trunc i64 %19 to i32
br label %25
25: ; preds = %23, %2
%26 = phi i32 [ 0, %2 ], [ %24, %23 ]
%27 = phi i32 [ 0, %2 ], [ %18, %23 ]
%28 = bitcast [102 x [102 x i8]]* %3 to i8**
%29 = call i32 @Rotate(i8** %28, i32 %26, i32 %27)
ret i32 0
}