#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 */
scalar_t__ calloc(int, int);
int checkstr(char *, char *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  char *S, *R;
  int n, i, ans;
  scanf("%d", &n);
  S = (char *)calloc(n, sizeof(char));
  R = (char *)calloc(n, sizeof(char));
  scanf("%s", S);
  for (i = 0; i < n; i++) {
    *(R + i) = *(S + (n - 1 - i));
  }
  ans = checkstr(S, R, n);
  if (ans == 1)
    printf("Good String");
  if (ans == 0)
    printf("Not Good String");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11d4 <main+0x94>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
sub    -0x20(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    119c <main+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <checkstr@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x1,-0x24(%rbp)
jne    11fd <main+0xbd>
lea    0xe12(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x24(%rbp)
jne    1213 <main+0xd3>
lea    0xdf8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%r14
mov    0x4(%rsp),%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
lea    0xe83(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x4(%rsp),%edx
test   %edx,%edx
jle    11be <main+0x7e>
mov    $0xffffffff,%eax
xor    %ecx,%ecx
nopl   0x0(%rax)
add    %eax,%edx
movslq %edx,%rdx
movzbl (%r14,%rdx,1),%edx
mov    %dl,(%rbx,%rcx,1)
add    $0x1,%rcx
movslq 0x4(%rsp),%rdx
add    $0xffffffff,%eax
cmp    %rdx,%rcx
jl     11a0 <main+0x60>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <checkstr@plt>
cmp    $0x1,%eax
je     11db <main+0x9b>
test   %eax,%eax
jne    11e7 <main+0xa7>
lea    0xe2d(%rip),%rdi
jmp    11e2 <main+0xa2>
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [12 x i8] c"Good String\00"
@.str.3 = [16 x i8] c"Not Good String\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca 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 ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%8 = load i32, i32* %4
%9 = call i64 @calloc(i32 %8, i32 1)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %2
%11 = load i32, i32* %4
%12 = call i64 @calloc(i32 %11, i32 1)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %3
%14 = load i8*, i8** %2
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %14)
store i32 0, i32* %5
br label %16
16: ; preds = %33, %0
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %36
20: ; preds = %16
%21 = load i8*, i8** %2
%22 = load i32, i32* %4
%23 = sub nsw i32 %22, 1
%24 = load i32, i32* %5
%25 = sub nsw i32 %23, %24
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %21, i64 %26
%28 = load i8, i8* %27
%29 = load i8*, i8** %3
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %29, i64 %31
store i8 %28, i8* %32
br label %33
33: ; preds = %20
%34 = load i32, i32* %5
%35 = add nsw i32 %34, 1
store i32 %35, i32* %5
br label %16
36: ; preds = %16
%37 = load i8*, i8** %2
%38 = load i8*, i8** %3
%39 = load i32, i32* %4
%40 = call i32 @checkstr(i8* %37, i8* %38, i32 %39)
store i32 %40, i32* %6
%41 = load i32, i32* %6
%42 = icmp eq i32 %41, 1
br i1 %42, label %43, label %45
43: ; preds = %36
%44 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %45
45: ; preds = %43, %36
%46 = load i32, i32* %6
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
br label %50
50: ; preds = %48, %45
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [12 x i8] c"Good String\00"
@.str.3 = [16 x i8] c"Not Good String\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i64 @calloc(i32 %4, i32 1)
%6 = inttoptr i64 %5 to i8*
%7 = load i32, i32* %1
%8 = call i64 @calloc(i32 %7, i32 1)
%9 = inttoptr i64 %8 to i8*
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%11 = load i32, i32* %1
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %27
13: ; preds = %0, %13
%14 = phi i64 [ %23, %13 ], [ 0, %0 ]
%15 = phi i32 [ %24, %13 ], [ %11, %0 ]
%16 = trunc i64 %14 to i32
%17 = xor i32 %16, -1
%18 = add i32 %15, %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %6, i64 %19
%21 = load i8, i8* %20
%22 = getelementptr inbounds i8, i8* %9, i64 %14
store i8 %21, i8* %22
%23 = add nuw nsw i64 %14, 1
%24 = load i32, i32* %1
%25 = sext i32 %24 to i64
%26 = icmp slt i64 %23, %25
br i1 %26, label %13, label %27
27: ; preds = %13, %0
%28 = phi i32 [ %11, %0 ], [ %24, %13 ]
%29 = call i32 @checkstr(i8* %6, i8* %9, i32 %28)
switch i32 %29, label %34 [
i32 1, label %31
i32 0, label %30
]
30: ; preds = %27
br label %31
31: ; preds = %27, %30
%32 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), %30 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), %27 ]
%33 = call i32 @printf(i8* dereferenceable(1) %32)
br label %34
34: ; preds = %31, %27
ret i32 0
}