#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*/ assert(int);
int isRotation(char *, char *);
int main() {
  char str1[] = "This is a test string ";
  char str2[] = "a test string This is ";
  int actual = isRotation(str1, str2);
  assert(actual == 1);
  char str3[] = "Test";
  char str4[] = "estT";
  actual = isRotation(str3, str4);
  assert(actual == 1);
  char str5[] = "Test";
  char str6[] = "esz";
  actual = isRotation(str5, str6);
  assert(actual == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xebf(%rip),%ax
mov    %ax,-0xc(%rbp)
mov    0xeb7(%rip),%al
mov    %al,-0xa(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeb2(%rip),%eax
mov    %eax,-0x30(%rbp)
mov    0xeac(%rip),%ax
mov    %ax,-0x2c(%rbp)
mov    0xea4(%rip),%al
mov    %al,-0x2a(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <isRotation@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x1,-0x44(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0xe7b(%rip),%eax
mov    %eax,-0x49(%rbp)
mov    0xe76(%rip),%al
mov    %al,-0x45(%rbp)
mov    0xe6e(%rip),%eax
mov    %eax,-0x4e(%rbp)
mov    0xe69(%rip),%al
mov    %al,-0x4a(%rbp)
lea    -0x49(%rbp),%rdi
lea    -0x4e(%rbp),%rsi
call   1030 <isRotation@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x1,-0x44(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0xe36(%rip),%eax
mov    %eax,-0x53(%rbp)
mov    0xe31(%rip),%al
mov    %al,-0x4f(%rbp)
mov    0xe2e(%rip),%eax
mov    %eax,-0x57(%rbp)
lea    -0x53(%rbp),%rdi
lea    -0x57(%rbp),%rsi
call   1030 <isRotation@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movabs $0x20676e69727473,%rax
mov    %rax,0x4f(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movabs $0x20736920736968,%rax
mov    %rax,0x2f(%rsp)
lea    0x40(%rsp),%rdi
lea    0x20(%rsp),%rsi
call   1030 <isRotation@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
movb   $0x0,0x18(%rsp)
movl   $0x74736554,0x14(%rsp)
74
movb   $0x0,0x10(%rsp)
movl   $0x54747365,0xc(%rsp)
54
lea    0x14(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1030 <isRotation@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
movb   $0x0,0x8(%rsp)
movl   $0x74736554,0x4(%rsp)
74
movl   $0x7a7365,0x1c(%rsp)
lea    0x4(%rsp),%rdi
lea    0x1c(%rsp),%rsi
call   1030 <isRotation@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.str1 = [23 x i8] c"This is a test string \00"
@__const.main.str2 = [23 x i8] c"a test string This is \00"
@__const.main.str3 = [5 x i8] c"Test\00"
@__const.main.str4 = [5 x i8] c"estT\00"
@__const.main.str5 = [5 x i8] c"Test\00"
@__const.main.str6 = [4 x i8] c"esz\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [23 x i8]
%3 = alloca [23 x i8]
%4 = alloca i32
%5 = alloca [5 x i8]
%6 = alloca [5 x i8]
%7 = alloca [5 x i8]
%8 = alloca [4 x i8]
store i32 0, i32* %1
%9 = bitcast [23 x i8]* %2 to i8*
%10 = bitcast [23 x i8]* %3 to i8*
%11 = getelementptr inbounds [23 x i8], [23 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [23 x i8], [23 x i8]* %3, i64 0, i64 0
%13 = call i32 @isRotation(i8* %11, i8* %12)
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 1
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = bitcast [5 x i8]* %5 to i8*
%19 = bitcast [5 x i8]* %6 to i8*
%20 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%21 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%22 = call i32 @isRotation(i8* %20, i8* %21)
store i32 %22, i32* %4
%23 = load i32, i32* %4
%24 = icmp eq i32 %23, 1
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = bitcast [5 x i8]* %7 to i8*
%28 = bitcast [4 x i8]* %8 to i8*
%29 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%30 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%31 = call i32 @isRotation(i8* %29, i8* %30)
store i32 %31, i32* %4
%32 = load i32, i32* %4
%33 = icmp eq i32 %32, 0
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [23 x i8] c"This is a test string \00"
@__const.main.str2 = [23 x i8] c"a test string This is \00"
@__const.main.str4 = [5 x i8] c"estT\00"
@__const.main.str5 = [5 x i8] c"Test\00"
define i32 @main() {
%1 = alloca [23 x i8]
%2 = alloca [23 x i8]
%3 = alloca [5 x i8]
%4 = alloca [5 x i8]
%5 = alloca [5 x i8]
%6 = alloca i32
%7 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [23 x i8], [23 x i8]* %2, i64 0, i64 0
%9 = call i32 @isRotation(i8* %7, i8* %8)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%14 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%15 = call i32 @isRotation(i8* %13, i8* %14)
%16 = icmp eq i32 %15, 1
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%20 = bitcast i32* %6 to i8*
store i32 8024933, i32* %6
%21 = call i32 @isRotation(i8* %19, i8* %20)
%22 = icmp eq i32 %21, 0
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
ret i32 0
}