#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*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void imprimirDecodificado(const char *str, int chave) {
  char caractere;
  while (caractere = *str, str++, caractere != '\n') {
    caractere -= chave;
    if (caractere < 'A') {
      caractere = 'Z' - ('A' - caractere) + 1;
    }
    putc(caractere, stdout);
  }
  putc('\n', stdout);
}


x86 assembly (clang, -O0):
<imprimirDecodificado>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
movsbl -0xd(%rbp),%eax
cmp    $0xa,%eax
je     118b <imprimirDecodificado+0x7b>
mov    -0xc(%rbp),%ecx
movsbl -0xd(%rbp),%eax
sub    %ecx,%eax
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
cmp    $0x41,%eax
jge    1172 <imprimirDecodificado+0x62>
movsbl -0xd(%rbp),%eax
mov    $0x41,%ecx
sub    %eax,%ecx
mov    $0x5a,%eax
sub    %ecx,%eax
add    $0x1,%eax
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
mov    0x2e64(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1030 <putc@plt>
jmp    111f <imprimirDecodificado+0xf>
mov    0x2e4e(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimirDecodificado>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%al
cmp    $0xa,%al
je     1157 <imprimirDecodificado+0x47>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%rbx
mov    0x2eb6(%rip),%r14
nopw   0x0(%rax,%rax,1)
sub    %bpl,%al
lea    0x1a(%rax),%ecx
cmp    $0x41,%al
movzbl %al,%eax
movzbl %cl,%ecx
cmovge %eax,%ecx
mov    (%r14),%esi
movsbl %cl,%edi
call   1030 <putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
cmp    $0xa,%al
jne    1130 <imprimirDecodificado+0x20>
mov    0x2e82(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @imprimirDecodificado(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %6
6: ; preds = %30, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
store i8 %8, i8* %5
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 10
br i1 %13, label %14, label %34
14: ; preds = %6
%15 = load i32, i32* %4
%16 = load i8, i8* %5
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, %15
%19 = trunc i32 %18 to i8
store i8 %19, i8* %5
%20 = load i8, i8* %5
%21 = sext i8 %20 to i32
%22 = icmp slt i32 %21, 65
br i1 %22, label %23, label %30
23: ; preds = %14
%24 = load i8, i8* %5
%25 = sext i8 %24 to i32
%26 = sub nsw i32 65, %25
%27 = sub nsw i32 90, %26
%28 = add nsw i32 %27, 1
%29 = trunc i32 %28 to i8
store i8 %29, i8* %5
br label %30
30: ; preds = %23, %14
%31 = load i8, i8* %5
%32 = load i32, i32* @stdout
%33 = call i32 @putc(i8 signext %31, i32 %32)
br label %6
34: ; preds = %6
%35 = load i32, i32* @stdout
%36 = call i32 @putc(i8 signext 10, i32 %35)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @imprimirDecodificado(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 10
br i1 %4, label %19, label %5
5: ; preds = %2
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %7
%8 = phi i8 [ %3, %5 ], [ %17, %7 ]
%9 = phi i8* [ %0, %5 ], [ %10, %7 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = sub i8 %8, %6
%12 = icmp slt i8 %11, 65
%13 = add i8 %11, 26
%14 = select i1 %12, i8 %13, i8 %11
%15 = load i32, i32* @stdout
%16 = tail call i32 @putc(i8 signext %14, i32 %15)
%17 = load i8, i8* %10
%18 = icmp eq i8 %17, 10
br i1 %18, label %19, label %7
19: ; preds = %7, %2
%20 = load i32, i32* @stdout
%21 = tail call i32 @putc(i8 signext 10, i32 %20)
ret void
}