#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*/ rev(char *, int);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  char s[100], ch;
  int n, i, c;
  scanf("%d\n", &n);
  scanf("%c", &ch);
  for (i = 0; i < n - 1; i++) {
    s[i] = ch;
    scanf("%c", &ch);
  }
  s[n - 1] = '\0';
  rev(s, n - 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x78(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x71(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
mov    -0x78(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1199 <main+0x79>
mov    -0x71(%rbp),%cl
movslq -0x7c(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
lea    0xe84(%rip),%rdi
lea    -0x71(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    115d <main+0x3d>
mov    -0x78(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x0,-0x70(%rbp,%rax,1)
lea    -0x70(%rbp),%rdi
mov    -0x78(%rbp),%esi
sub    $0x2,%esi
call   1030 <rev@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
lea    0xecd(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xebe(%rip),%rdi
lea    0xb(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rsi
cmp    $0x2,%rsi
jl     119a <main+0x7a>
lea    0xea0(%rip),%r14
lea    0xb(%rsp),%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl 0xb(%rsp),%eax
mov    %al,0x10(%rsp,%rbx,1)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rsi
lea    -0x1(%rsi),%rax
cmp    %rax,%rbx
jl     1170 <main+0x50>
jmp    11a1 <main+0x81>
mov    %rsi,%rax
add    $0xffffffffffffffff,%rax
movb   $0x0,0x10(%rsp,%rax,1)
add    $0xfffffffe,%esi
lea    0x10(%rsp),%rdi
call   1030 <rev@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %4)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
store i32 0, i32* %5
br label %9
9: ; preds = %20, %0
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %23
14: ; preds = %9
%15 = load i8, i8* %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %17
store i8 %15, i8* %18
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %20
20: ; preds = %14
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %9
23: ; preds = %9
%24 = load i32, i32* %4
%25 = sub nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %26
store i8 0, i8* %27
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%29 = load i32, i32* %4
%30 = sub nsw i32 %29, 2
%31 = call i32 @rev(i8* %28, i32 %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i8
%3 = alloca i32
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = bitcast i32* %3 to i8*
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 1
br i1 %9, label %13, label %10
10: ; preds = %0
%11 = add nsw i32 %8, -1
%12 = sext i32 %11 to i64
br label %23
13: ; preds = %0, %13
%14 = phi i64 [ %18, %13 ], [ 0, %0 ]
%15 = load i8, i8* %2
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %14
store i8 %15, i8* %16
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%18 = add nuw nsw i64 %14, 1
%19 = load i32, i32* %3
%20 = add nsw i32 %19, -1
%21 = sext i32 %20 to i64
%22 = icmp slt i64 %18, %21
br i1 %22, label %13, label %23
23: ; preds = %13, %10
%24 = phi i64 [ %12, %10 ], [ %21, %13 ]
%25 = phi i32 [ %8, %10 ], [ %19, %13 ]
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %24
store i8 0, i8* %26
%27 = add nsw i32 %25, -2
%28 = call i32 @rev(i8* %4, i32 %27)
ret i32 0
}