#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 *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int str_len(char *);
int /*<<< orphan*/ swap(char, char);
int main() {
  int i, slength;
  char str[100];
  scanf("%s", str);
  slength = str_len(str);
  if (slength % 2 == 0) {
    for (i = 0; i < (slength) / 2; ++i) {
      swap(str[i], str[((slength) / 2) + i]);
    }
  } else {
    for (i = 0; i < (slength / 2); ++i) {
      swap(str[i], str[((slength + 1) / 2) + i]);
    }
  }
  printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1060 <str_len@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11df <main+0x9f>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x74(%rbp),%eax
cmp    %ecx,%eax
jge    11da <main+0x9a>
movslq -0x8(%rbp),%rax
mov    -0x70(%rbp,%rax,1),%cl
mov    -0xc(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
add    -0x8(%rbp),%eax
cltq
movsbl %cl,%edi
movsbl -0x70(%rbp,%rax,1),%esi
call   1050 <swap@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1189 <main+0x49>
jmp    123f <main+0xff>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x78(%rbp),%eax
cmp    %ecx,%eax
jge    123a <main+0xfa>
movslq -0x8(%rbp),%rax
mov    -0x70(%rbp,%rax,1),%cl
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%esi
cltd
idiv   %esi
add    -0x8(%rbp),%eax
cltq
movsbl %cl,%edi
movsbl -0x70(%rbp,%rax,1),%esi
call   1050 <swap@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11e6 <main+0xa6>
jmp    123f <main+0xff>
lea    -0x70(%rbp),%rsi
lea    0xdb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
lea    0xeb0(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1060 <str_len@plt>
test   $0x1,%al
jne    11a9 <main+0x69>
cmp    $0x2,%eax
jl     11d7 <main+0x97>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rax
mov    %eax,%r14d
lea    (%rsp,%rax,1),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%rsp,%rbx,1),%edi
movsbl (%r15,%rbx,1),%esi
call   1050 <swap@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1190 <main+0x50>
jmp    11d7 <main+0x97>
cmp    $0x2,%eax
jl     11d7 <main+0x97>
mov    %eax,%r14d
shr    %r14d
add    $0x1,%eax
shr    %rax
lea    (%rsp,%rax,1),%r15
xor    %ebx,%ebx
movsbl (%rsp,%rbx,1),%edi
movsbl (%r15,%rbx,1),%esi
call   1050 <swap@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    11c0 <main+0x80>
lea    0xe22(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @str_len(i8* %2)
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %0
%8 = icmp sgt i32 %4, 1
br i1 %8, label %9, label %41
9: ; preds = %7
%10 = lshr i32 %4, 1
%11 = add nuw nsw i32 %4, 1
%12 = lshr i32 %11, 1
%13 = zext i32 %12 to i64
%14 = zext i32 %10 to i64
br label %31
15: ; preds = %0
%16 = sdiv i32 %4, 2
%17 = icmp sgt i32 %4, 1
br i1 %17, label %18, label %41
18: ; preds = %15
%19 = sext i32 %16 to i64
%20 = zext i32 %16 to i64
br label %21
21: ; preds = %18, %21
%22 = phi i64 [ 0, %18 ], [ %29, %21 ]
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = add nsw i64 %22, %19
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = call i32 @swap(i8 signext %24, i8 signext %27)
%29 = add nuw nsw i64 %22, 1
%30 = icmp eq i64 %29, %20
br i1 %30, label %41, label %21
31: ; preds = %9, %31
%32 = phi i64 [ 0, %9 ], [ %39, %31 ]
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = add nuw nsw i64 %32, %13
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = call i32 @swap(i8 signext %34, i8 signext %37)
%39 = add nuw nsw i64 %32, 1
%40 = icmp eq i64 %39, %14
br i1 %40, label %41, label %31
41: ; preds = %31, %21, %7, %15
%42 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}