#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 */
typedef int /*<<< orphan*/ cumle;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
char *malloc(int);
scalar_t__ palindrome(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int main() {
  char *cumle = malloc(sizeof(char) * 256);
  printf("Bir cumle giriniz.\n");
  fgets(cumle, sizeof(cumle), stdin);
  printf(palindrome(cumle) ? "palindrom\n" : "palindrom degil\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    0x2e74(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%esi
call   1050 <fgets@plt>
mov    -0x10(%rbp),%rdi
call   1040 <palindrome@plt>
mov    %rax,%rcx
lea    0xe8c(%rip),%rdi
lea    0xe7a(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x100,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1060 <fgets@plt>
mov    %rbx,%rdi
call   1050 <palindrome@plt>
test   %rax,%rax
lea    0xe79(%rip),%rax
lea    0xe67(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Bir cumle giriniz.\0A\00"
@stdin = global i32 0
@.str.1 = [11 x i8] c"palindrom\0A\00"
@.str.2 = [17 x i8] c"palindrom degil\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 256)
store i8* %3, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %5, i32 8, i32 %6)
%8 = load i8*, i8** %2
%9 = call i64 @palindrome(i8* %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0)
%13 = call i32 @printf(i8* %12)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.1 = [11 x i8] c"palindrom\0A\00"
@.str.2 = [17 x i8] c"palindrom degil\0A\00"
@str = [19 x i8] c"Bir cumle giriniz.\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(256) i8* @malloc(i32 256)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @stdin
%4 = tail call i32 @fgets(i8* %1, i32 8, i32 %3)
%5 = tail call i64 @palindrome(i8* %1)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0)
%8 = tail call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}