#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 *);
scalar_t__ soChars(char *, int);
int strlen(char *);
void leValidaNome(char *nome) {
  while (1) {
    printf("Informe seu nome:");
    scanf(" %[^\n]s", nome);
    int tamanho = strlen(nome);
    if (tamanho == 0)
      printf("\nNome invalido!\nDigite algo!\n");
    else if (soChars(nome, tamanho))
      return;
  }
}


x86 assembly (clang, -O0):
<leValidaNome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    118f <leValidaNome+0x4f>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
jmp    11b0 <leValidaNome+0x70>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1060 <soChars@plt>
cmp    $0x0,%rax
je     11ab <leValidaNome+0x6b>
add    $0x10,%rsp
pop    %rbp
ret
jmp    11b0 <leValidaNome+0x70>
jmp    114c <leValidaNome+0xc>

x86 assembly (clang, -O2):
<leValidaNome>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xe9e(%rip),%r14
lea    0xea9(%rip),%r15
lea    0xeaa(%rip),%r12
jmp    1188 <leValidaNome+0x38>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
je     1180 <leValidaNome+0x30>
mov    %rbx,%rdi
mov    %eax,%esi
call   1070 <soChars@plt>
test   %rax,%rax
je     1188 <leValidaNome+0x38>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Informe seu nome:\00"
@.str.1 = [8 x i8] c" %[^\0A]s\00"
@.str.2 = [30 x i8] c"\0ANome invalido!\0ADigite algo!\0A\00"
define void @leValidaNome(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
br label %4
4: ; preds = %1, %21
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
br label %21
14: ; preds = %4
%15 = load i8*, i8** %2
%16 = load i32, i32* %3
%17 = call i64 @soChars(i8* %15, i32 %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
ret void
20: ; preds = %14
br label %21
21: ; preds = %20, %12
br label %4
}

LLVM IR (-O2):
@.str = [18 x i8] c"Informe seu nome:\00"
@.str.1 = [8 x i8] c" %[^\0A]s\00"
@str = [29 x i8] c"\0ANome invalido!\0ADigite algo!\00"
define void @leValidaNome(i8* %0) {
br label %2
2: ; preds = %9, %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 @strlen(i8* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %10
br label %2
10: ; preds = %2
%11 = tail call i64 @soChars(i8* %0, i32 %5)
%12 = icmp eq i64 %11, 0
br i1 %12, label %9, label %13
13: ; preds = %10
ret void
}