#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*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *, char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main(void) {
  char expr1[100];
  char expr2[100];
  int m;
  int x;
  int charcount = 0;
  scanf("%[^\n]s", expr1);
  x = strlen(expr1);
  for (m = 0; m <= x; m++) {
    if ((expr1[m] == ' ') || (m == x)) {
      printf("Numero de letras de la palabra %s %d \n", expr2, charcount);
      memset(expr2, '\0', 100);
      charcount = 0;
    } else {
      expr2[charcount] = expr1[m];
      charcount++;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xec(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xe8(%rbp)
movl   $0x0,-0xe4(%rbp)
mov    -0xe4(%rbp),%eax
cmp    -0xe8(%rbp),%eax
jg     123a <main+0xfa>
movslq -0xe4(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x20,%eax
je     11be <main+0x7e>
mov    -0xe4(%rbp),%eax
cmp    -0xe8(%rbp),%eax
jne    11f9 <main+0xb9>
lea    -0xe0(%rbp),%rsi
mov    -0xec(%rbp),%edx
lea    0xe35(%rip),%rdi
call   1040 <printf@plt>
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
movl   $0x0,-0xec(%rbp)
jmp    1221 <main+0xe1>
movslq -0xe4(%rbp),%rax
mov    -0x70(%rbp,%rax,1),%cl
movslq -0xec(%rbp),%rax
mov    %cl,-0xe0(%rbp,%rax,1)
mov    -0xec(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xec(%rbp)
jmp    1226 <main+0xe6>
mov    -0xe4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe4(%rbp)
jmp    1185 <main+0x45>
mov    -0x4(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
lea    0xea8(%rip),%rdi
lea    0x70(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
js     11d0 <main+0x90>
mov    %eax,%r12d
mov    %eax,%r13d
add    $0x1,%r12d
xor    %ebp,%ebp
lea    0xe83(%rip),%r14
mov    %rsp,%r15
xor    %ebx,%ebx
jmp    11b7 <main+0x77>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1040 <printf@plt>
xor    %ebx,%ebx
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
je     11d0 <main+0x90>
movzbl 0x70(%rsp,%rbp,1),%eax
cmp    $0x20,%al
je     1190 <main+0x50>
cmp    %rbp,%r13
je     1190 <main+0x50>
movslq %ebx,%rbx
mov    %al,(%rsp,%rbx,1)
add    $0x1,%ebx
jmp    11ae <main+0x6e>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [39 x i8] c"Numero de letras de la palabra %s %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %5
store i32 0, i32* %4
br label %11
11: ; preds = %43, %0
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %46
15: ; preds = %11
%16 = load i32, i32* %4
%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 eq i32 %20, 32
br i1 %21, label %26, label %22
22: ; preds = %15
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %32
26: ; preds = %22, %15
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%28 = load i32, i32* %6
%29 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %27, i32 %28)
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%31 = call i32 @memset(i8* %30, i8 signext 0, i32 100)
store i32 0, i32* %6
br label %42
32: ; preds = %22
%33 = load i32, i32* %4
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = load i32, i32* %6
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %38
store i8 %36, i8* %39
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %42
42: ; preds = %32, %26
br label %43
43: ; preds = %42
%44 = load i32, i32* %4
%45 = add nsw i32 %44, 1
store i32 %45, i32* %4
br label %11
46: ; preds = %11
%47 = load i32, i32* %1
ret i32 %47
}

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [39 x i8] c"Numero de letras de la palabra %s %d \0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @strlen(i8* %3)
%7 = icmp slt i32 %6, 0
br i1 %7, label %31, label %8
8: ; preds = %0
%9 = zext i32 %6 to i64
%10 = add nuw i32 %6, 1
%11 = zext i32 %10 to i64
br label %12
12: ; preds = %8, %27
%13 = phi i64 [ 0, %8 ], [ %29, %27 ]
%14 = phi i32 [ 0, %8 ], [ %28, %27 ]
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %13
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 32
%18 = icmp eq i64 %13, %9
%19 = select i1 %17, i1 true, i1 %18
br i1 %19, label %20, label %23
20: ; preds = %12
%21 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 %14)
%22 = call i32 @memset(i8* %4, i8 signext 0, i32 100)
br label %27
23: ; preds = %12
%24 = sext i32 %14 to i64
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %24
store i8 %16, i8* %25
%26 = add nsw i32 %14, 1
br label %27
27: ; preds = %20, %23
%28 = phi i32 [ 0, %20 ], [ %26, %23 ]
%29 = add nuw nsw i64 %13, 1
%30 = icmp eq i64 %29, %11
br i1 %30, label %31, label %12
31: ; preds = %27, %0
ret i32 0
}