#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*/ LC_ALL;
int /*<<< orphan*/ printf(char *, char, char);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main() {
  setlocale(LC_ALL, "");
  char letraMaiuscula = 'A';
  char letraMinuscula = letraMaiuscula + 32;
  printf("Letra Maiúscula: %c == %d\n", letraMaiuscula, letraMaiuscula);
  printf("Letra Maiúscula + 32 == %c == %d\n", letraMinuscula, letraMinuscula);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1040 <setlocale@plt>
movb   $0x41,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x6(%rbp)
mov    -0x5(%rbp),%al
lea    0xea4(%rip),%rdi
movsbl %al,%esi
movsbl -0x5(%rbp),%edx
call   1030 <printf@plt>
mov    -0x6(%rbp),%al
lea    0xeaa(%rip),%rdi
movsbl %al,%esi
movsbl -0x6(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xeea(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xec3(%rip),%rdi
mov    $0x41,%esi
mov    $0x41,%edx
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x61,%esi
mov    $0x61,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [28 x i8] c"Letra Mai\C3\BAscula: %c == %d\0A\00"
@.str.2 = [35 x i8] c"Letra Mai\C3\BAscula + 32 == %c == %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
%4 = load i32, i32* @LC_ALL
%5 = call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i8 65, i8* %2
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, 32
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
%10 = load i8, i8* %2
%11 = load i8, i8* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8 signext %10, i8 signext %11)
%13 = load i8, i8* %3
%14 = load i8, i8* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8 signext %13, i8 signext %14)
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [28 x i8] c"Letra Mai\C3\BAscula: %c == %d\0A\00"
@.str.2 = [35 x i8] c"Letra Mai\C3\BAscula + 32 == %c == %d\0A\00"
define i32 @main() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8 signext 65, i8 signext 65)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8 signext 97, i8 signext 97)
ret i32 0
}