#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(void) {
  char nome[30];
  scanf("%s", nome);
  int i;
  for (i = 0; nome[i] != '\0'; i++) {
    if (nome[i] < 'a' || nome[i] > 'z') {
      break;
    }
  }
  if (nome[i] != '\0')
    printf("Tem caracteres inválidos");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
movl   $0x0,-0x34(%rbp)
movslq -0x34(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1194 <main+0x74>
movslq -0x34(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%eax
cmp    $0x61,%eax
jl     117c <main+0x5c>
movslq -0x34(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%eax
cmp    $0x7a,%eax
jle    1181 <main+0x61>
jmp    1194 <main+0x74>
jmp    1186 <main+0x66>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1146 <main+0x26>
movslq -0x34(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     11b2 <main+0x92>
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%al
cmp    $0x61,%al
jl     114f <main+0x2f>
lea    0x1(%rsp),%rcx
nop
cmp    $0x7a,%al
jg     1153 <main+0x33>
movzbl (%rcx),%eax
add    $0x1,%rcx
cmp    $0x60,%al
jg     1140 <main+0x20>
test   %al,%al
je     115f <main+0x3f>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [26 x i8] c"Tem caracteres inv\C3\A1lidos\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = freeze i8 %4
%6 = icmp slt i8 %5, 97
br i1 %6, label %19, label %7
7: ; preds = %0, %11
%8 = phi i64 [ %12, %11 ], [ 0, %0 ]
%9 = phi i8 [ %15, %11 ], [ %5, %0 ]
%10 = icmp sgt i8 %9, 122
br i1 %10, label %22, label %11
11: ; preds = %7
%12 = add nuw i64 %8, 1
%13 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = freeze i8 %14
%16 = icmp slt i8 %15, 97
br i1 %16, label %17, label %7
17: ; preds = %11
%18 = freeze i8 %14
br label %19
19: ; preds = %17, %0
%20 = phi i8 [ %5, %0 ], [ %18, %17 ]
%21 = icmp eq i8 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %7, %19
%23 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %24
24: ; preds = %22, %19
ret i32 0
}