#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() {
  char word[20];
  int i, l;
  i = 0;
  printf("Vuvedi duma: ");
  scanf("%s", word);
  l = strlen(word) - 1;
  while (i == !l) {
    if (word[i] == word[l]) {
      i++;
      l--;
      printf("1\n");
    } else {
      printf("0\n");
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
cmpl   $0x0,-0x28(%rbp)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    11df <main+0xaf>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
movslq -0x28(%rbp),%rcx
movsbl -0x20(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    11c9 <main+0x99>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x28(%rbp)
lea    0xe52(%rip),%rdi
call   1040 <printf@plt>
jmp    11da <main+0xaa>
lea    0xe44(%rip),%rdi
call   1040 <printf@plt>
jmp    11df <main+0xaf>
jmp    1171 <main+0x41>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
lea    0xeac(%rip),%rdi
call   1050 <printf@plt>
lea    0xeae(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%r15d
add    $0xffffffff,%eax
je     11c8 <main+0x88>
movslq %eax,%r12
add    $0xfffffffe,%r15d
xor    %ebx,%ebx
lea    0xe88(%rip),%r14
nopl   0x0(%rax,%rax,1)
movzbl (%rsp,%rbx,1),%eax
cmp    (%rsp,%r12,1),%al
jne    11bc <main+0x7c>
lea    0x1(%rbx),%r13
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0xffffffffffffffff,%r12
xor    %eax,%eax
cmp    %ebx,%r15d
sete   %al
mov    %r13,%rbx
cmp    %rax,%r13
je     1190 <main+0x50>
jmp    11c8 <main+0x88>
lea    0xe4e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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