#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 *);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  int l, i, ok, k;
  char n[100];
  printf("Vuvedete tekst");
  scanf("%s", n);
  l = strlen(n) / 2;
  k = strlen(n);
  for (i = 0; i < l; i++) {
    if (n[i] != n[k - i - 1]) {
      ok = 2;
      break;
    } else
      ok = 1;
  }
  if (ok == 2)
    printf("\n0\n");
  if (ok == 1)
    printf("\n1\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d9 <main+0xa9>
movslq -0xc(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
mov    -0x14(%rbp),%ecx
sub    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl -0x80(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
je     11bf <main+0x8f>
movl   $0x2,-0x10(%rbp)
jmp    11d9 <main+0xa9>
movl   $0x1,-0x10(%rbp)
jmp    11cb <main+0x9b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1185 <main+0x55>
cmpl   $0x2,-0x10(%rbp)
jne    11ef <main+0xbf>
lea    0xe28(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x1,-0x10(%rbp)
jne    1205 <main+0xd5>
lea    0xe16(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    0xeb2(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
call   1060 <scanf@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    0xe94(%rip),%rdi
cmp    $0x2,%ebx
jl     11bd <main+0x7d>
shr    %ebx
add    $0xffffffff,%eax
xor    %ecx,%ecx
lea    0xe84(%rip),%r8
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rsp,%rcx,1),%edx
movslq %eax,%rsi
cmp    (%rsp,%rsi,1),%dl
jne    11ba <main+0x7a>
add    $0x1,%rcx
add    $0xffffffff,%eax
cmp    %rcx,%rbx
jne    11a0 <main+0x60>
jmp    11bd <main+0x7d>
mov    %r8,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Vuvedete tekst\00"
@.str.1 = [3 x i8] c"%s\00"
@str = [3 x i8] c"\0A1\00"
@str.4 = [3 x i8] c"\0A0\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @strlen(i8* %2)
%6 = call i32 @strlen(i8* %2)
%7 = icmp sgt i32 %5, 1
br i1 %7, label %8, label %25
8: ; preds = %0
%9 = lshr i32 %5, 1
%10 = zext i32 %9 to i64
br label %13
11: ; preds = %13
%12 = icmp eq i64 %24, %10
br i1 %12, label %25, label %13
13: ; preds = %8, %11
%14 = phi i64 [ 0, %8 ], [ %24, %11 ]
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = trunc i64 %14 to i32
%18 = xor i32 %17, -1
%19 = add i32 %6, %18
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = icmp eq i8 %16, %22
%24 = add nuw nsw i64 %14, 1
br i1 %23, label %11, label %25
25: ; preds = %11, %13, %0
%26 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), %0 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @str.4, i64 0, i64 0), %13 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), %11 ]
%27 = call i32 @puts(i8* dereferenceable(1) %26)
ret i32 0
}