#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 *, ...);
int main() {
  char metin[100];
  int i, counter = 0, j = 0;
  char sonlanan[100];
  int nokta;
  printf("metni girin: ");
  scanf("%s", metin);
  printf("kacıncı karakterden sonrası gozuksun: ");
  scanf("%d", &nokta);
  printf("girdiginiz metin: ");
  for (i = 0; metin[i] != '\0'; i++) {
    printf("%c", metin[i]);
    counter++;
  }
  int gecici = nokta;
  printf("\n");
  printf("%d. karakterden sonrası: ", nokta);
  for (nokta = gecici; nokta <= counter; nokta++) {
    printf("%c", metin[nokta]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0xe4(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x74(%rbp)
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     11d8 <main+0xb8>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1198 <main+0x78>
mov    -0xe4(%rbp),%eax
mov    %eax,-0xe8(%rbp)
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xe4(%rbp),%esi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xe8(%rbp),%eax
mov    %eax,-0xe4(%rbp)
mov    -0xe4(%rbp),%eax
cmp    -0x78(%rbp),%eax
jg     124f <main+0x12f>
movslq -0xe4(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%esi
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xe4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe4(%rbp)
jmp    1212 <main+0xf2>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x78,%rsp
lea    0xec3(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%al
test   %al,%al
je     11b5 <main+0x85>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x11(%rsp,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    11a0 <main+0x70>
mov    0xc(%rsp),%ebp
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%esi
lea    0xe83(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,0xc(%rsp)
cmp    %ebx,%ebp
jg     11fc <main+0xcc>
nopl   (%rax)
movslq %ebp,%rax
movsbl 0x10(%rsp,%rax,1),%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%ebp
mov    %ebp,0xc(%rsp)
cmp    %ebx,%eax
jl     11e0 <main+0xb0>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"metni girin: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [42 x i8] c"kac\C4\B1nc\C4\B1 karakterden sonras\C4\B1 gozuksun: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [19 x i8] c"girdiginiz metin: \00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [27 x i8] c"%d. karakterden sonras\C4\B1: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [100 x i8]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %3
br label %15
15: ; preds = %31, %0
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %34
22: ; preds = %15
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
store i32 %30, i32* %4
br label %31
31: ; preds = %22
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %15
34: ; preds = %15
%35 = load i32, i32* %7
store i32 %35, i32* %8
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%37 = load i32, i32* %7
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %8
store i32 %39, i32* %7
br label %40
40: ; preds = %51, %34
%41 = load i32, i32* %7
%42 = load i32, i32* %4
%43 = icmp sle i32 %41, %42
br i1 %43, label %44, label %54
44: ; preds = %40
%45 = load i32, i32* %7
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %46
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %49)
br label %51
51: ; preds = %44
%52 = load i32, i32* %7
%53 = add nsw i32 %52, 1
store i32 %53, i32* %7
br label %40
54: ; preds = %40
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"metni girin: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [42 x i8] c"kac\C4\B1nc\C4\B1 karakterden sonras\C4\B1 gozuksun: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [19 x i8] c"girdiginiz metin: \00"
@.str.7 = [27 x i8] c"%d. karakterden sonras\C4\B1: \00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%10 = load i8, i8* %3
%11 = icmp eq i8 %10, 0
br i1 %11, label %23, label %12
12: ; preds = %0, %12
%13 = phi i64 [ %19, %12 ], [ 0, %0 ]
%14 = phi i8 [ %21, %12 ], [ %10, %0 ]
%15 = phi i32 [ %18, %12 ], [ 0, %0 ]
%16 = sext i8 %14 to i32
%17 = call i32 @putchar(i32 %16)
%18 = add nuw nsw i32 %15, 1
%19 = add nuw i64 %13, 1
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 0
br i1 %22, label %23, label %12
23: ; preds = %12, %0
%24 = phi i32 [ 0, %0 ], [ %18, %12 ]
%25 = load i32, i32* %2
%26 = call i32 @putchar(i32 10)
%27 = load i32, i32* %2
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i32 %27)
store i32 %25, i32* %2
%29 = icmp sgt i32 %25, %24
br i1 %29, label %40, label %30
30: ; preds = %23, %30
%31 = phi i32 [ %38, %30 ], [ %25, %23 ]
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = call i32 @putchar(i32 %35)
%37 = load i32, i32* %2
%38 = add nsw i32 %37, 1
store i32 %38, i32* %2
%39 = icmp slt i32 %37, %24
br i1 %39, label %30, label %40
40: ; preds = %30, %23
%41 = call i32 @putchar(i32 10)
ret i32 0
}