short pede_cliente(cliente)
char *cliente;
{
  char Cliente[128];
  short ret;
  while (1) {
    printf("\nNome do Cliente (40 Posicoes no maximo):\n");
    printf("....5...10...15...20...25...30...35...40\n");
    gets(Cliente);
    tirabr(Cliente);
    if (!strlen(Cliente)) {
      printf("\07");
      continue;
    }
    if (strlen(Cliente) > 40) {
      printf("Maximo 40 posicoes!!");
      printf("\07");
      continue;
    }
    ret = 1;
    strcpy(cliente, Cliente);
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<pede_cliente>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x90(%rbp),%rdi
mov    $0x0,%al
call   1060 <gets@plt>
lea    -0x90(%rbp),%rdi
mov    $0x0,%al
call   1070 <tirabr@plt>
lea    -0x90(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jne    11c0 <pede_cliente+0x70>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    115f <pede_cliente+0xf>
lea    -0x90(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x28,%rax
jbe    11f7 <pede_cliente+0xa7>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    115f <pede_cliente+0xf>
movw   $0x1,-0x92(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <strcpy@plt>
movswl -0x92(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pede_cliente>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%r14
lea    0xe8b(%rip),%r15
lea    0xeae(%rip),%r12
mov    %rsp,%rbx
lea    0xe65(%rip),%r13
jmp    11aa <pede_cliente+0x3a>
nopl   (%rax)
mov    $0x7,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
call   1050 <puts@plt>
mov    %r12,%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <gets@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <tirabr@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
test   %rax,%rax
je     11a0 <pede_cliente+0x30>
cmp    $0x29,%rax
jb     11ed <pede_cliente+0x7d>
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    11a0 <pede_cliente+0x30>
mov    %rsp,%rsi
mov    %r14,%rdi
call   1040 <strcpy@plt>
mov    $0x1,%ax
add    $0x80,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [43 x i8] c"\0ANome do Cliente (40 Posicoes no maximo):\0A\00"
@.str.1 = [42 x i8] c"....5...10...15...20...25...30...35...40\0A\00"
@.str.2 = [2 x i8] c"\07\00"
@.str.3 = [21 x i8] c"Maximo 40 posicoes!!\00"
define signext i16 @pede_cliente(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
%4 = alloca i16
store i8* %0, i8** %2
br label %5
5: ; preds = %1, %15, %21
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %8)
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @tirabr to i32 (i8*, ...)*)(i8* %10)
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%13 = call i64 @strlen(i8* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %5
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %5
17: ; preds = %5
%18 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%19 = call i64 @strlen(i8* %18)
%20 = icmp ugt i64 %19, 40
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %5
24: ; preds = %17
store i16 1, i16* %4
%25 = load i8*, i8** %2
%26 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%27 = call i8* @strcpy(i8* %25, i8* %26)
br label %28
28: ; preds = %24
%29 = load i16, i16* %4
ret i16 %29
}

LLVM IR (-O2):
@.str.3 = [21 x i8] c"Maximo 40 posicoes!!\00"
@str = [42 x i8] c"\0ANome do Cliente (40 Posicoes no maximo):\00"
@str.4 = [41 x i8] c"....5...10...15...20...25...30...35...40\00"
define signext i16 @pede_cliente(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %11, %1
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.4, i64 0, i64 0))
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %3)
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @tirabr to i32 (i8*, ...)*)(i8* %3)
%9 = call i64 @strlen(i8* %3)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %4, %15
%12 = call i32 @putchar(i32 7)
br label %4
13: ; preds = %4
%14 = icmp ugt i64 %9, 40
br i1 %14, label %15, label %17
15: ; preds = %13
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %11
17: ; preds = %13
%18 = call i8* @strcpy(i8* dereferenceable(1) %0, i8* %3)
ret i16 1
}