#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 main(int argc, char **argv) {
  char kelime[50];
  char tkelime[50];
  int i = -1, j = 0;
  printf("Kelime >> : ");
  scanf("%s", kelime);
  while (kelime[++i] != '\0')
    ;
  while (i >= 0)
    tkelime[j++] = kelime[--i];
  tkelime[j] = '\0';
  printf("Tersi >> : %s", tkelime);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x94(%rbp)
ff ff ff
movl   $0x0,-0x98(%rbp)
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
cltq
movsbl -0x50(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     118f <main+0x6f>
jmp    116b <main+0x4b>
jmp    1194 <main+0x74>
cmpl   $0x0,-0x94(%rbp)
jl     11d5 <main+0xb5>
mov    -0x94(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x94(%rbp)
cltq
mov    -0x50(%rbp,%rax,1),%cl
mov    -0x98(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x98(%rbp)
cltq
mov    %cl,-0x90(%rbp,%rax,1)
jmp    1194 <main+0x74>
movslq -0x98(%rbp),%rax
movb   $0x0,-0x90(%rbp,%rax,1)
lea    -0x90(%rbp),%rsi
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
lea    0xecd(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0x40(%rsp),%r14
mov    %r14,%rsi
call   1040 <scanf@plt>
mov    $0xffffffff,%eax
movabs $0xffffffff00000000,%rcx
ff ff ff
movabs $0x100000000,%rdx
nopl   0x0(%rax)
add    %rdx,%rcx
add    $0x1,%eax
cmpb   $0x0,0x40(%rsp,%rbx,1)
lea    0x1(%rbx),%rbx
jne    1170 <main+0x50>
lea    -0x2(%rbx),%edx
xor    %esi,%esi
cmp    $0xffffffff,%edx
jl     1336 <main+0x216>
sar    $0x20,%rcx
test   %eax,%eax
mov    $0x0,%r11d
cmovs  %eax,%r11d
neg    %r11d
add    %rbx,%r11
cmp    $0x8,%r11d
jb     1307 <main+0x1e7>
lea    -0x1(%rbx),%r9
mov    %r11d,%r8d
xor    %r10d,%r10d
cmp    $0x20,%r11d
jae    11c6 <main+0xa6>
xor    %esi,%esi
jmp    128c <main+0x16c>
mov    %r8d,%esi
and    $0xffffffe0,%esi
movslq %r9d,%rdx
lea    (%rsp,%rdx,1),%rdi
add    $0x30,%rdi
test   %eax,%eax
mov    $0x0,%edx
cmovs  %eax,%edx
mov    %ebx,%r15d
sub    %edx,%r15d
and    $0xffffffe0,%r15d
pxor   %xmm0,%xmm0
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movdqu -0x10(%rdi),%xmm1
movdqu (%rdi),%xmm2
movdqa %xmm2,%xmm3
punpcklbw %xmm0,%xmm3
pshufd $0x4e,%xmm3,%xmm3
pshuflw $0x1b,%xmm3,%xmm3
pshufhw $0x1b,%xmm3,%xmm3
punpckhbw %xmm0,%xmm2
pshufd $0x4e,%xmm2,%xmm2
pshuflw $0x1b,%xmm2,%xmm2
pshufhw $0x1b,%xmm2,%xmm2
packuswb %xmm3,%xmm2
movdqa %xmm1,%xmm3
punpcklbw %xmm0,%xmm3
pshufd $0x4e,%xmm3,%xmm3
pshuflw $0x1b,%xmm3,%xmm3
pshufhw $0x1b,%xmm3,%xmm3
punpckhbw %xmm0,%xmm1
pshufd $0x4e,%xmm1,%xmm1
pshuflw $0x1b,%xmm1,%xmm1
pshufhw $0x1b,%xmm1,%xmm1
packuswb %xmm3,%xmm1
movdqa %xmm2,(%rsp,%rdx,1)
movdqa %xmm1,0x10(%rsp,%rdx,1)
add    $0x20,%rdx
add    $0xffffffffffffffe0,%rdi
cmp    %rdx,%r15
jne    1200 <main+0xe0>
cmp    %r8,%rsi
je     1333 <main+0x213>
test   $0x18,%r8b
je     1304 <main+0x1e4>
mov    %rsi,%rdx
mov    %r8d,%esi
and    $0xfffffff8,%esi
sub    %rsi,%rcx
mov    %rdx,%rdi
neg    %rdi
lea    (%rsp,%rdi,1),%r15
add    $0x40,%r15
movslq %r9d,%rdi
test   %eax,%eax
cmovs  %eax,%r10d
add    %r15,%rdi
add    $0xfffffffffffffff8,%rdi
mov    %ebx,%r9d
sub    %r10d,%r9d
and    $0xfffffff8,%r9d
pxor   %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movq   (%rdi),%xmm1
punpcklbw %xmm0,%xmm1
pshufd $0x4e,%xmm1,%xmm1
pshuflw $0x1b,%xmm1,%xmm1
pshufhw $0x1b,%xmm1,%xmm1
packuswb %xmm1,%xmm1
movq   %xmm1,(%rsp,%rdx,1)
add    $0x8,%rdx
add    $0xfffffffffffffff8,%rdi
cmp    %rdx,%r9
jne    12d0 <main+0x1b0>
cmp    %r8,%rsi
jne    1307 <main+0x1e7>
jmp    1333 <main+0x213>
sub    %rsi,%rcx
add    %r14,%rcx
add    $0xffffffffffffffff,%rcx
xor    %edx,%edx
test   %eax,%eax
cmovs  %eax,%edx
sub    %edx,%ebx
nopw   0x0(%rax,%rax,1)
movzbl (%rcx),%eax
mov    %al,(%rsp,%rsi,1)
add    $0x1,%rsi
add    $0xffffffffffffffff,%rcx
cmp    %rsi,%rbx
jne    1320 <main+0x200>
mov    %r11d,%esi
movb   $0x0,(%rsp,%rsi,1)
lea    0xccc(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"Kelime >> : \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [14 x i8] c"Tersi >> : %s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [50 x i8]
%4 = alloca [50 x i8]
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
br label %9
9: ; preds = %9, %2
%10 = phi i64 [ %11, %9 ], [ -1, %2 ]
%11 = add nsw i64 %10, 1
%12 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %9
15: ; preds = %9
%16 = trunc i64 %10 to i32
%17 = trunc i64 %11 to i32
%18 = icmp sgt i32 %16, -2
br i1 %18, label %19, label %89
19: ; preds = %15
%20 = shl i64 %11, 32
%21 = ashr exact i64 %20, 32
%22 = add i32 %17, 1
%23 = call i32 @llvm.smin.i32(i32 %17, i32 0)
%24 = sub i32 %22, %23
%25 = zext i32 %24 to i64
%26 = icmp ult i32 %24, 8
br i1 %26, label %75, label %27
27: ; preds = %19
%28 = icmp ult i32 %24, 32
br i1 %28, label %56, label %29
29: ; preds = %27
%30 = and i64 %25, 4294967264
br label %31
31: ; preds = %31, %29
%32 = phi i64 [ 0, %29 ], [ %48, %31 ]
%33 = xor i64 %32, -1
%34 = add i64 %21, %33
%35 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 %34
%36 = getelementptr inbounds i8, i8* %35, i64 -15
%37 = bitcast i8* %36 to <16 x i8>*
%38 = load <16 x i8>, <16 x i8>* %37
%39 = shufflevector <16 x i8> %38, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%40 = getelementptr inbounds i8, i8* %35, i64 -31
%41 = bitcast i8* %40 to <16 x i8>*
%42 = load <16 x i8>, <16 x i8>* %41
%43 = shufflevector <16 x i8> %42, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%44 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 %32
%45 = bitcast i8* %44 to <16 x i8>*
store <16 x i8> %39, <16 x i8>* %45
%46 = getelementptr inbounds i8, i8* %44, i64 16
%47 = bitcast i8* %46 to <16 x i8>*
store <16 x i8> %43, <16 x i8>* %47
%48 = add nuw i64 %32, 32
%49 = icmp eq i64 %48, %30
br i1 %49, label %50, label %31
50: ; preds = %31
%51 = icmp eq i64 %30, %25
br i1 %51, label %87, label %52
52: ; preds = %50
%53 = sub nsw i64 %21, %30
%54 = and i64 %25, 24
%55 = icmp eq i64 %54, 0
br i1 %55, label %75, label %56
56: ; preds = %27, %52
%57 = phi i64 [ %30, %52 ], [ 0, %27 ]
%58 = and i64 %25, 4294967288
%59 = sub nsw i64 %21, %58
br label %60
60: ; preds = %60, %56
%61 = phi i64 [ %57, %56 ], [ %71, %60 ]
%62 = xor i64 %61, -1
%63 = add i64 %21, %62
%64 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 %63
%65 = getelementptr inbounds i8, i8* %64, i64 -7
%66 = bitcast i8* %65 to <8 x i8>*
%67 = load <8 x i8>, <8 x i8>* %66
%68 = shufflevector <8 x i8> %67, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%69 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 %61
%70 = bitcast i8* %69 to <8 x i8>*
store <8 x i8> %68, <8 x i8>* %70
%71 = add nuw i64 %61, 8
%72 = icmp eq i64 %71, %58
br i1 %72, label %73, label %60
73: ; preds = %60
%74 = icmp eq i64 %58, %25
br i1 %74, label %87, label %75
75: ; preds = %19, %52, %73
%76 = phi i64 [ %21, %19 ], [ %53, %52 ], [ %59, %73 ]
%77 = phi i64 [ 0, %19 ], [ %30, %52 ], [ %58, %73 ]
br label %78
78: ; preds = %75, %78
%79 = phi i64 [ %81, %78 ], [ %76, %75 ]
%80 = phi i64 [ %84, %78 ], [ %77, %75 ]
%81 = add nsw i64 %79, -1
%82 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 %81
%83 = load i8, i8* %82
%84 = add nuw nsw i64 %80, 1
%85 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 %80
store i8 %83, i8* %85
%86 = icmp eq i64 %84, %25
br i1 %86, label %87, label %78
87: ; preds = %78, %73, %50
%88 = zext i32 %24 to i64
br label %89
89: ; preds = %15, %87
%90 = phi i64 [ %88, %87 ], [ 0, %15 ]
%91 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 %90
store i8 0, i8* %91
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}