short get_actkey(actkey)
char *actkey;
{
  char Actkey[128];
  short ret;
  ret = 0;
  while (1) {
    printf("\nEntre com a chave de ativacao (12 digitos/letras):\n");
    printf("....5...9.12\n");
    gets(Actkey);
    eliminabr(Actkey);
    Strupr(Actkey);
    if ((strlen(Actkey) == 12) && validkey(Actkey)) {
      strcpy(actkey, Actkey);
      ret = 1;
      break;
    } else {
      printf("Chave Invalida.!");
      printf("\07");
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<get_actkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0x92(%rbp)
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x90(%rbp),%rdi
mov    $0x0,%al
call   1080 <gets@plt>
lea    -0x90(%rbp),%rdi
mov    $0x0,%al
call   1090 <eliminabr@plt>
lea    -0x90(%rbp),%rdi
mov    $0x0,%al
call   1070 <Strupr@plt>
lea    -0x90(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0xc,%rax
jne    1219 <get_actkey+0xa9>
lea    -0x90(%rbp),%rdi
mov    $0x0,%al
call   1050 <validkey@plt>
cmp    $0x0,%eax
je     1219 <get_actkey+0xa9>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <strcpy@plt>
movw   $0x1,-0x92(%rbp)
jmp    123a <get_actkey+0xca>
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1188 <get_actkey+0x18>
movswl -0x92(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_actkey>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%r14
lea    0xe67(%rip),%r15
lea    0xe94(%rip),%r12
mov    %rsp,%rbx
lea    0xe45(%rip),%r13
jmp    11d4 <get_actkey+0x44>
nopl   (%rax)
mov    %r13,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
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   10a0 <gets@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   10b0 <eliminabr@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <Strupr@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
cmp    $0xc,%rax
jne    11c0 <get_actkey+0x30>
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <validkey@plt>
test   %eax,%eax
je     11c0 <get_actkey+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 = [53 x i8] c"\0AEntre com a chave de ativacao (12 digitos/letras):\0A\00"
@.str.1 = [14 x i8] c"....5...9.12\0A\00"
@.str.2 = [17 x i8] c"Chave Invalida.!\00"
@.str.3 = [2 x i8] c"\07\00"
define signext i16 @get_actkey(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
%4 = alloca i16
store i8* %0, i8** %2
store i16 0, i16* %4
br label %5
5: ; preds = %1, %28
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 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 (...)* @eliminabr to i32 (i8*, ...)*)(i8* %10)
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @Strupr to i32 (i8*, ...)*)(i8* %12)
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%15 = call i64 @strlen(i8* %14)
%16 = icmp eq i64 %15, 12
br i1 %16, label %17, label %25
17: ; preds = %5
%18 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @validkey to i32 (i8*, ...)*)(i8* %18)
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = load i8*, i8** %2
%23 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%24 = call i8* @strcpy(i8* %22, i8* %23)
store i16 1, i16* %4
br label %29
25: ; preds = %17, %5
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %28
28: ; preds = %25
br label %5
29: ; preds = %21
%30 = load i16, i16* %4
ret i16 %30
}

LLVM IR (-O2):
@.str.2 = [17 x i8] c"Chave Invalida.!\00"
@str = [52 x i8] c"\0AEntre com a chave de ativacao (12 digitos/letras):\00"
@str.4 = [13 x i8] c"....5...9.12\00"
define signext i16 @get_actkey(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 = %17, %1
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 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 (...)* @eliminabr to i32 (i8*, ...)*)(i8* %3)
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @Strupr to i32 (i8*, ...)*)(i8* %3)
%10 = call i64 @strlen(i8* %3)
%11 = icmp eq i64 %10, 12
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @validkey to i32 (i8*, ...)*)(i8* %3)
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = call i8* @strcpy(i8* dereferenceable(1) %0, i8* %3)
ret i16 1
17: ; preds = %12, %4
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32 @putchar(i32 7)
br label %4
}