#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*/ putchar(char);
void Rotate(char (*string)[102], int row, int column) {
  int i, j;
  for (i = 0; i < column; i++) {
    for (j = row - 1; j >= 0; j--) {
      if (string[j][i] == 0) {
        printf(" ");
        continue;
      }
      printf("%c", string[j][i]);
    }
    putchar('\n');
  }
}


x86 assembly (clang, -O0):
<Rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11d6 <Rotate+0xb6>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     11be <Rotate+0x9e>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
imul   $0x66,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    118b <Rotate+0x6b>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11b0 <Rotate+0x90>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
imul   $0x66,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    114e <Rotate+0x2e>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <Rotate+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rotate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    118a <Rotate+0x7a>
mov    %esi,%r15d
mov    %rdi,%rbx
mov    %esi,%eax
mov    %edx,%r12d
add    $0x1,%rax
mov    %rax,(%rsp)
xor    %ebp,%ebp
mov    $0x20,%r13d
jmp    1153 <Rotate+0x43>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    %r12,%rbp
je     118a <Rotate+0x7a>
test   %r15d,%r15d
jle    1140 <Rotate+0x30>
mov    (%rsp),%r14
nopl   0x0(%rax)
lea    -0x2(%r14),%eax
imul   $0x66,%rax,%rax
add    %rbx,%rax
movzbl 0x0(%rbp,%rax,1),%eax
test   %al,%al
cmove  %r13d,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%r14
cmp    $0x1,%r14
jg     1160 <Rotate+0x50>
jmp    1140 <Rotate+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Rotate([102 x i8]* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %26
5: ; preds = %3
%6 = icmp sgt i32 %1, 0
%7 = zext i32 %1 to i64
%8 = zext i32 %2 to i64
br label %9
9: ; preds = %5, %22
%10 = phi i64 [ 0, %5 ], [ %24, %22 ]
br i1 %6, label %11, label %22
11: ; preds = %9, %11
%12 = phi i64 [ %13, %11 ], [ %7, %9 ]
%13 = add nsw i64 %12, -1
%14 = and i64 %13, 4294967295
%15 = getelementptr inbounds [102 x i8], [102 x i8]* %0, i64 %14, i64 %10
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
%18 = select i1 %17, i8 32, i8 %16
%19 = sext i8 %18 to i32
%20 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 %19)
%21 = icmp sgt i64 %12, 1
br i1 %21, label %11, label %22
22: ; preds = %11, %9
%23 = tail call i32 @putchar(i8 signext 10)
%24 = add nuw nsw i64 %10, 1
%25 = icmp eq i64 %24, %8
br i1 %25, label %26, label %9
26: ; preds = %22, %3
ret void
}