#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 palindrom(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strlwr(char *);
char *strtok(char *, char *);
int main() {
  char unos[1000 + 1] = "", recenica[1000 + 1] = "", delimit[] = " ,.:!?";
  char *token;
  scanf(" %[^\n]", unos);
  printf("%s", unos);
  token = strtok(unos, delimit);
  while (token != NULL) {
    strcat(recenica, token);
    token = strtok(NULL, delimit);
  }
  strlwr(recenica);
  if (palindrom(recenica) == 1)
    printf(" je palindrom.");
  else
    printf(" nije palindrom.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e9,%edx
call   1050 <memset@plt>
lea    -0x7e0(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e9,%edx
call   1050 <memset@plt>
mov    0xe52(%rip),%eax
mov    %eax,-0x7e7(%rbp)
mov    0xe49(%rip),%ax
mov    %ax,-0x7e3(%rbp)
mov    0xe3e(%rip),%al
mov    %al,-0x7e1(%rbp)
lea    -0x3f0(%rbp),%rsi
lea    0xe2b(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x3f0(%rbp),%rdi
lea    -0x7e7(%rbp),%rsi
call   1070 <strtok@plt>
mov    %rax,-0x7f0(%rbp)
cmpq   $0x0,-0x7f0(%rbp)
je     124d <main+0xdd>
lea    -0x7e0(%rbp),%rdi
mov    -0x7f0(%rbp),%rsi
call   1090 <strcat@plt>
lea    -0x7e7(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1070 <strtok@plt>
mov    %rax,-0x7f0(%rbp)
jmp    1210 <main+0xa0>
lea    -0x7e0(%rbp),%rdi
call   1030 <strlwr@plt>
lea    -0x7e0(%rbp),%rdi
call   1080 <palindrom@plt>
cmp    $0x1,%eax
jne    1281 <main+0x111>
lea    0xd9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    128f <main+0x11f>
lea    0xd98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x7f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x7f8,%rsp
lea    0x400(%rsp),%rbx
mov    $0x3e9,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
lea    0x10(%rsp),%rdi
mov    $0x3e9,%edx
xor    %esi,%esi
call   1050 <memset@plt>
movl   $0x3f213a,0xb(%rsp)
movl   $0x3a2e2c20,0x8(%rsp)
3a
lea    0xe4e(%rip),%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
lea    0xe46(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <strtok@plt>
test   %rax,%rax
je     120a <main+0x9a>
lea    0x10(%rsp),%r14
lea    0x8(%rsp),%rbx
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rax,%rsi
call   1090 <strcat@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1070 <strtok@plt>
test   %rax,%rax
jne    11f0 <main+0x80>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlwr@plt>
mov    %rbx,%rdi
call   1080 <palindrom@plt>
cmp    $0x1,%eax
lea    0xde8(%rip),%rax
lea    0xdf0(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x7f8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.delimit = [7 x i8] c" ,.:!?\00"
@.str = [7 x i8] c" %[^\0A]\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c" je palindrom.\00"
@.str.3 = [17 x i8] c" nije palindrom.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1001 x i8]
%3 = alloca [1001 x i8]
%4 = alloca [7 x i8]
%5 = alloca i8*
store i32 0, i32* %1
%6 = bitcast [1001 x i8]* %2 to i8*
%7 = bitcast [1001 x i8]* %3 to i8*
%8 = bitcast [7 x i8]* %4 to i8*
%9 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 0
%14 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%15 = call i8* @strtok(i8* %13, i8* %14)
store i8* %15, i8** %5
br label %16
16: ; preds = %19, %0
%17 = load i8*, i8** %5
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %25
19: ; preds = %16
%20 = getelementptr inbounds [1001 x i8], [1001 x i8]* %3, i64 0, i64 0
%21 = load i8*, i8** %5
%22 = call i32 @strcat(i8* %20, i8* %21)
%23 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%24 = call i8* @strtok(i8* null, i8* %23)
store i8* %24, i8** %5
br label %16
25: ; preds = %16
%26 = getelementptr inbounds [1001 x i8], [1001 x i8]* %3, i64 0, i64 0
%27 = call i32 @strlwr(i8* %26)
%28 = getelementptr inbounds [1001 x i8], [1001 x i8]* %3, i64 0, i64 0
%29 = call i32 @palindrom(i8* %28)
%30 = icmp eq i32 %29, 1
br i1 %30, label %31, label %33
31: ; preds = %25
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %35
33: ; preds = %25
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %35
35: ; preds = %33, %31
ret i32 0
}

LLVM IR (-O2):
@__const.main.delimit = [7 x i8] c" ,.:!?\00"
@.str = [7 x i8] c" %[^\0A]\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c" je palindrom.\00"
@.str.3 = [17 x i8] c" nije palindrom.\00"
define i32 @main() {
%1 = alloca [1001 x i8]
%2 = alloca [1001 x i8]
%3 = alloca [7 x i8]
%4 = getelementptr inbounds [1001 x i8], [1001 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%9 = call i8* @strtok(i8* %4, i8* %6)
%10 = icmp eq i8* %9, null
br i1 %10, label %16, label %11
11: ; preds = %0, %11
%12 = phi i8* [ %14, %11 ], [ %9, %0 ]
%13 = call i32 @strcat(i8* %5, i8* %12)
%14 = call i8* @strtok(i8* null, i8* %6)
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %11
16: ; preds = %11, %0
%17 = call i32 @strlwr(i8* %5)
%18 = call i32 @palindrom(i8* %5)
%19 = icmp eq i32 %18, 1
%20 = select i1 %19, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %20)
ret i32 0
}