#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 /*<<< orphan*/ strlwr(char *);
int main() {
  char input[10];
  scanf("%s", input);
  printf("%s", input);
  int len = strlen(input);
  int i, j;
  int status = 1;
  strlwr(input);
  char *p;
  p = input;
  p = &input[len - 1];
  for (j = 0; j < len / 2; j++) {
    if (input[j] != *p) {
      status = 0;
      break;
    }
    p--;
  }
  if (status == 1)
    printf("Palindrom\n");
  else
    printf("bukan Palindrom\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1060 <scanf@plt>
lea    -0xe(%rbp),%rsi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xe(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x20(%rbp)
lea    -0xe(%rbp),%rdi
call   1030 <strlwr@plt>
lea    -0xe(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0xe(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cmp    %ecx,%eax
jge    120c <main+0xcc>
movslq -0x1c(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
mov    -0x28(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11f2 <main+0xb2>
movl   $0x0,-0x20(%rbp)
jmp    120c <main+0xcc>
mov    -0x28(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11b0 <main+0x70>
cmpl   $0x1,-0x20(%rbp)
jne    1229 <main+0xe9>
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1237 <main+0xf7>
lea    0xdd3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xea2(%rip),%r14
lea    0xe(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1030 <strlwr@plt>
lea    0xe74(%rip),%rdi
cmp    $0x2,%r14d
jl     11da <main+0x8a>
mov    %r14d,%eax
shr    %eax
add    $0xffffffff,%r14d
neg    %rax
lea    (%rsp,%r14,1),%rsi
add    $0xe,%rsi
xor    %edx,%edx
lea    0xe4b(%rip),%r8
nopl   0x0(%rax,%rax,1)
movzbl (%rbx),%ecx
cmp    (%rsi,%rdx,1),%cl
jne    11d7 <main+0x87>
add    $0x1,%rbx
add    $0xffffffffffffffff,%rdx
cmp    %rdx,%rax
jne    11c0 <main+0x70>
jmp    11da <main+0x8a>
mov    %r8,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

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