#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char niz[100];
  int i = 0, k = 0, j = 0, a = 0;
  printf("napishi '.' za da spresh vavejdaneto\n");
  for (; i < 100; i++) {
    gets(niz);
    if (niz[i] == '.')
      break;
  }
  j = i;
  do {
    if (niz[k] == niz[j]) {
      k++;
      j--;
      a = 1;
    } else {
      a = 0;
      break;
    }
  } while (k <= i / 2);
  printf("%d", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x74(%rbp)
movl   $0x0,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x64,-0x74(%rbp)
jge    1199 <main+0x79>
lea    -0x70(%rbp),%rdi
call   1040 <gets@plt>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x2e,%eax
jne    1186 <main+0x66>
jmp    1199 <main+0x79>
jmp    118b <main+0x6b>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    115c <main+0x3c>
mov    -0x74(%rbp),%eax
mov    %eax,-0x7c(%rbp)
movslq -0x78(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
movslq -0x7c(%rbp),%rcx
movsbl -0x70(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    11d7 <main+0xb7>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
mov    -0x7c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x7c(%rbp)
movl   $0x1,-0x80(%rbp)
jmp    11e3 <main+0xc3>
movl   $0x0,-0x80(%rbp)
jmp    120c <main+0xec>
jmp    11e8 <main+0xc8>
mov    -0x78(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x74(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x84(%rbp),%eax
cmp    %ecx,%eax
jle    119f <main+0x7f>
mov    -0x80(%rbp),%esi
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
mov    %rsp,%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1050 <gets@plt>
cmpb   $0x2e,(%rsp,%rbx,1)
je     116d <main+0x3d>
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1150 <main+0x20>
mov    $0x64,%ebx
mov    %ebx,%eax
shr    %ebx
add    $0x1,%ebx
add    %rsp,%rax
xor    %esi,%esi
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movzbl (%rsp,%rcx,1),%edx
cmp    (%rax),%dl
jne    119a <main+0x6a>
add    $0x1,%rcx
add    $0xffffffffffffffff,%rax
cmp    %rcx,%rbx
jne    1180 <main+0x50>
mov    $0x1,%esi
lea    0xe5f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [37 x i8] c"napishi '.' za da spresh vavejdaneto\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 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %0, %10
%5 = phi i64 [ 0, %0 ], [ %11, %10 ]
%6 = call i32 @gets(i8* %2)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %5
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 46
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = add nuw nsw i64 %5, 1
%12 = icmp eq i64 %11, 100
br i1 %12, label %15, label %4
13: ; preds = %4
%14 = trunc i64 %5 to i32
br label %15
15: ; preds = %10, %13
%16 = phi i32 [ %14, %13 ], [ 100, %10 ]
%17 = lshr i32 %16, 1
%18 = zext i32 %16 to i64
%19 = add nuw nsw i32 %17, 1
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %29, %15
%22 = phi i64 [ %31, %29 ], [ %18, %15 ]
%23 = phi i64 [ %30, %29 ], [ 0, %15 ]
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %22
%27 = load i8, i8* %26
%28 = icmp eq i8 %25, %27
br i1 %28, label %29, label %33
29: ; preds = %21
%30 = add nuw nsw i64 %23, 1
%31 = add nsw i64 %22, -1
%32 = icmp eq i64 %30, %20
br i1 %32, label %33, label %21
33: ; preds = %21, %29
%34 = phi i32 [ 1, %29 ], [ 0, %21 ]
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %34)
ret i32 0
}