#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 */
scalar_t__ isdigit(char);
int /*<<< orphan*/ printf(char *);
int soChars(char *nome, int tamanho) {
  for (int i = 0; i < tamanho; i++) {
    if (isdigit(nome[i]) != 0) {
      printf("\nNome invalido!\nDigite apenas letras!\n");
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<soChars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1188 <soChars+0x68>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1175 <soChars+0x55>
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    118f <soChars+0x6f>
jmp    117a <soChars+0x5a>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1136 <soChars+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soChars>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1180 <soChars+0x60>
mov    %esi,%r14d
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <isdigit@plt>
mov    $0x1,%bpl
test   %rax,%rax
jne    1172 <soChars+0x52>
mov    %r14d,%r14d
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
cmp    %rbp,%r14
je     1184 <soChars+0x64>
movsbl (%rbx,%rbp,1),%edi
call   1030 <isdigit@plt>
add    $0x1,%rbp
test   %rax,%rax
je     1150 <soChars+0x30>
add    $0xffffffffffffffff,%rbp
cmp    %r14,%rbp
setb   %bpl
lea    0xe87(%rip),%rdi
call   1040 <puts@plt>
jmp    1188 <soChars+0x68>
xor    %ebp,%ebp
jmp    1188 <soChars+0x68>
seta   %bpl
xor    $0x1,%bpl
movzbl %bpl,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"\0ANome invalido!\0ADigite apenas letras!\0A\00"
define i32 @soChars(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %22, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %25
11: ; preds = %7
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = call i64 @isdigit(i8 signext %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %11
%20 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %26
21: ; preds = %11
br label %22
22: ; preds = %21
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
br label %7
25: ; preds = %7
store i32 1, i32* %3
br label %26
26: ; preds = %25, %19
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@str = [38 x i8] c"\0ANome invalido!\0ADigite apenas letras!\00"
define i32 @soChars(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %26
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = zext i32 %1 to i64
%7 = load i8, i8* %0
%8 = tail call i64 @isdigit(i8 signext %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %4, %13
%11 = phi i64 [ %18, %13 ], [ 1, %4 ]
%12 = icmp eq i64 %11, %6
br i1 %12, label %24, label %13
13: ; preds = %10
%14 = getelementptr inbounds i8, i8* %0, i64 %11
%15 = load i8, i8* %14
%16 = tail call i64 @isdigit(i8 signext %15)
%17 = icmp eq i64 %16, 0
%18 = add nuw nsw i64 %11, 1
br i1 %17, label %10, label %19
19: ; preds = %13
%20 = icmp ult i64 %11, %5
br label %21
21: ; preds = %19, %4
%22 = phi i1 [ true, %4 ], [ %20, %19 ]
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
br label %26
24: ; preds = %10
%25 = icmp ult i64 %11, %5
br label %26
26: ; preds = %24, %2, %21
%27 = phi i1 [ %22, %21 ], [ false, %2 ], [ %25, %24 ]
%28 = xor i1 %27, true
%29 = zext i1 %28 to i32
ret i32 %29
}