#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char sentence[50];
  int transporter[100];
  int i = -1;
  int j = 0;
  printf("sentenceyi yazin(sonuna nokta koyunuz):\n");
  gets(sentence);
  do {
    i++;
    printf("%c", sentence[i]);
    j++;
    if (sentence[i] == ' ' || sentence[i] == '.') {
      printf("%d\n", j - 1);
      j = 0;
    }
  } while (sentence[i] != '.');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x1d4(%rbp)
ff ff ff
movl   $0x0,-0x1d8(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1040 <gets@plt>
mov    -0x1d4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1d4(%rbp)
movslq -0x1d4(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%esi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1d8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1d8(%rbp)
movslq -0x1d4(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
cmp    $0x20,%eax
je     11bf <main+0x9f>
movslq -0x1d4(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
cmp    $0x2e,%eax
jne    11e0 <main+0xc0>
mov    -0x1d8(%rbp),%esi
sub    $0x1,%esi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1d8(%rbp)
jmp    11e5 <main+0xc5>
movslq -0x1d4(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
cmp    $0x2e,%eax
jne    115d <main+0x3d>
xor    %eax,%eax
add    $0x1e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
lea    0xeb5(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
xor    %ebp,%ebp
lea    0xe98(%rip),%r14
jmp    1189 <main+0x49>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl (%rbx),%eax
xor    %ebp,%ebp
add    $0x1,%rbx
cmp    $0x2e,%al
je     11a1 <main+0x61>
movsbl (%rbx),%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
cmp    $0x2e,%al
je     1170 <main+0x30>
cmp    $0x20,%al
je     1170 <main+0x30>
add    $0x1,%ebp
jmp    1181 <main+0x41>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.2 = [4 x i8] c"%d\0A\00"
@str = [40 x i8] c"sentenceyi yazin(sonuna nokta koyunuz):\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
br label %5
5: ; preds = %18, %0
%6 = phi i64 [ %8, %18 ], [ -1, %0 ]
%7 = phi i32 [ %20, %18 ], [ 0, %0 ]
%8 = add nsw i64 %6, 1
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i32 @putchar(i32 %11)
%13 = load i8, i8* %9
%14 = add nsw i32 %7, 1
switch i8 %13, label %18 [
i8 46, label %15
i8 32, label %15
]
15: ; preds = %5, %5
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%17 = load i8, i8* %9
br label %18
18: ; preds = %5, %15
%19 = phi i8 [ %13, %5 ], [ %17, %15 ]
%20 = phi i32 [ %14, %5 ], [ 0, %15 ]
%21 = icmp eq i8 %19, 46
br i1 %21, label %22, label %5
22: ; preds = %18
ret i32 0
}