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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   1050 <str_len@plt>
mov    %eax,-0x74(%rbp)
movl   $0x0,-0x78(%rbp)
mov    -0x78(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x74(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x80(%rbp),%eax
cmp    %ecx,%eax
jge    123f <main+0x10f>
mov    -0x74(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11e2 <main+0xb2>
movslq -0x78(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x74(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    -0x78(%rbp),%eax
cltq
mov    -0x70(%rbp,%rax,1),%cl
movslq -0x78(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
mov    -0x7c(%rbp),%eax
mov    %al,%cl
mov    -0x74(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
add    -0x78(%rbp),%eax
cltq
mov    %cl,-0x70(%rbp,%rax,1)
jmp    122c <main+0xfc>
movslq -0x78(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x74(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
add    -0x78(%rbp),%eax
cltq
mov    -0x70(%rbp,%rax,1),%cl
movslq -0x78(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
movslq -0x78(%rbp),%rax
mov    -0x70(%rbp,%rax,1),%cl
mov    -0x74(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
add    $0x1,%eax
add    -0x78(%rbp),%eax
cltq
mov    %cl,-0x70(%rbp,%rax,1)
jmp    1231 <main+0x101>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    116a <main+0x3a>
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   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <str_len@plt>
cmp    $0x2,%eax
jl     11a9 <main+0x79>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rdx
mov    %edx,%edi
add    %rbx,%rdx
add    $0x1,%rdx
xor    %esi,%esi
jmp    1193 <main+0x63>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdx,%rsi,1),%ecx
mov    %cl,(%rsp,%rsi,1)
mov    %cl,(%rdx,%rsi,1)
add    $0x1,%rsi
cmp    %rsi,%rdi
je     11a9 <main+0x79>
test   $0x1,%al
jne    1180 <main+0x50>
movzbl (%rsp,%rsi,1),%ebx
movzbl -0x1(%rdx,%rsi,1),%ecx
mov    %cl,(%rsp,%rsi,1)
mov    %bl,-0x1(%rdx,%rsi,1)
jmp    118a <main+0x5a>
lea    0xe50(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @str_len(i8* %8, i32 100)
store i32 %9, i32* %3
store i32 0, i32* %4
br label %10
10: ; preds = %72, %0
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = sdiv i32 %12, 2
%14 = icmp slt i32 %11, %13
br i1 %14, label %15, label %75
15: ; preds = %10
%16 = load i32, i32* %3
%17 = srem i32 %16, 2
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %43
19: ; preds = %15
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
store i32 %24, i32* %5
%25 = load i32, i32* %3
%26 = sdiv i32 %25, 2
%27 = load i32, i32* %4
%28 = add nsw i32 %26, %27
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = load i32, i32* %4
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %33
store i8 %31, i8* %34
%35 = load i32, i32* %5
%36 = trunc i32 %35 to i8
%37 = load i32, i32* %3
%38 = sdiv i32 %37, 2
%39 = load i32, i32* %4
%40 = add nsw i32 %38, %39
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %41
store i8 %36, i8* %42
br label %71
43: ; preds = %15
%44 = load i32, i32* %4
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
store i32 %48, i32* %5
%49 = load i32, i32* %3
%50 = sdiv i32 %49, 2
%51 = add nsw i32 %50, 1
%52 = load i32, i32* %4
%53 = add nsw i32 %51, %52
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %54
%56 = load i8, i8* %55
%57 = load i32, i32* %4
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %58
store i8 %56, i8* %59
%60 = load i32, i32* %4
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %61
%63 = load i8, i8* %62
%64 = load i32, i32* %3
%65 = sdiv i32 %64, 2
%66 = add nsw i32 %65, 1
%67 = load i32, i32* %4
%68 = add nsw i32 %66, %67
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %69
store i8 %63, i8* %70
br label %71
71: ; preds = %43, %19
br label %72
72: ; preds = %71
%73 = load i32, i32* %4
%74 = add nsw i32 %73, 1
store i32 %74, i32* %4
br label %10
75: ; preds = %10
%76 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%77 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %76)
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, i32 100)
%5 = sdiv i32 %4, 2
%6 = icmp sgt i32 %4, 1
br i1 %6, label %7, label %28
7: ; preds = %0
%8 = and i32 %4, 1
%9 = icmp eq i32 %8, 0
%10 = sext i32 %5 to i64
%11 = zext i32 %5 to i64
br label %12
12: ; preds = %7, %25
%13 = phi i64 [ 0, %7 ], [ %26, %25 ]
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %13
br i1 %9, label %15, label %20
15: ; preds = %12
%16 = load i8, i8* %14
%17 = add nsw i64 %13, %10
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %17
%19 = load i8, i8* %18
store i8 %19, i8* %14
store i8 %16, i8* %18
br label %25
20: ; preds = %12
%21 = add nsw i64 %13, %10
%22 = add nsw i64 %21, 1
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %22
%24 = load i8, i8* %23
store i8 %24, i8* %14
store i8 %24, i8* %23
br label %25
25: ; preds = %15, %20
%26 = add nuw nsw i64 %13, 1
%27 = icmp eq i64 %26, %11
br i1 %27, label %28, label %12
28: ; preds = %25, %0
%29 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}