#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 */
char getchar();
int /*<<< orphan*/ input(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ output(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ reverse(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  char str[101];
  int l;
  scanf("%d", &l);
  char ch = getchar();
  input(str, 0, l);
  reverse(str, 0, l - 2);
  output(str, 0, l);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe97(%rip),%rdi
lea    -0x74(%rbp),%rsi
call   1070 <scanf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %al,-0x75(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%edx
xor    %esi,%esi
call   1040 <input@plt>
lea    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%edx
sub    $0x2,%edx
xor    %esi,%esi
call   1030 <reverse@plt>
lea    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%edx
xor    %esi,%esi
call   1050 <output@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
lea    0xea1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0xc(%rsp),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <input@plt>
mov    0xc(%rsp),%edx
add    $0xfffffffe,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <reverse@plt>
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <output@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [101 x i8]
%3 = alloca i32
%4 = alloca i8
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = call signext i8 (...) @getchar()
store i8 %6, i8* %4
%7 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @input(i8* %7, i32 0, i32 %8)
%10 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 2
%13 = call i32 @reverse(i8* %10, i32 0, i32 %12)
%14 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%15 = load i32, i32* %3
%16 = call i32 @output(i8* %14, i32 0, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [101 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = call signext i8 (...) @getchar()
%7 = load i32, i32* %2
%8 = call i32 @input(i8* %3, i32 0, i32 %7)
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -2
%11 = call i32 @reverse(i8* %3, i32 0, i32 %10)
%12 = load i32, i32* %2
%13 = call i32 @output(i8* %3, i32 0, i32 %12)
ret i32 0
}