#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 */
typedef char a;
typedef char B;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char a = 'a';
  char b = 'b';
  char A = '0';
  char B = '0';
  do {
    if ((a) >= 'a' && (a) <= 'z')
      (A) = (a)-0x20;
    else if ((a) >= 'A' && (a) <= 'Z')
      ;
    else
      printf("ERROR: No es una letra, %s:%d\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/terrex/cursoc-guillermo/refs/heads/"
             "master/ejercicios/tema4/2.2.mayus.c",
             19);
  } while (0);
  printf("la letra %c en mayusculas es %c\n", a, A);
  do {
    if ((B) >= 'a' && (B) <= 'z')
      (B) = (B)-0x20;
    else if ((B) >= 'A' && (B) <= 'Z')
      ;
    else
      printf("ERROR: No es una letra, %s:%d\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/terrex/cursoc-guillermo/refs/heads/"
             "master/ejercicios/tema4/2.2.mayus.c",
             22);
  } while (0);
  printf("la letra %c en mayusculas es %c\n", B, B);
  do {
    if (('R') >= 'a' && ('R') <= 'z')
      (B) = ('R') - 0x20;
    else if (('R') >= 'A' && ('R') <= 'Z')
      ;
    else
      printf("ERROR: No es una letra, %s:%d\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/terrex/cursoc-guillermo/refs/heads/"
             "master/ejercicios/tema4/2.2.mayus.c",
             25);
  } while (0);
  printf("la letra %c en mayusculas es %c\n", 'R', B);
  do {
    if (('b') >= 'a' && ('b') <= 'z')
      (B) = ('b') - 0x20;
    else if (('b') >= 'A' && ('b') <= 'Z')
      ;
    else
      printf("ERROR: No es una letra, %s:%d\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/terrex/cursoc-guillermo/refs/heads/"
             "master/ejercicios/tema4/2.2.mayus.c",
             28);
  } while (0);
  printf("la letra %c en mayusculas es %c\n", 'b', B);
  do {
    if (('z') >= 'a' && ('z') <= 'z')
      (B) = ('z') - 0x20;
    else if (('z') >= 'A' && ('z') <= 'Z')
      ;
    else
      printf("ERROR: No es una letra, %s:%d\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/terrex/cursoc-guillermo/refs/heads/"
             "master/ejercicios/tema4/2.2.mayus.c",
             31);
  } while (0);
  printf("la letra %c en mayusculas es %c\n", 'z', B);
  do {
    if (('4') >= 'a' && ('4') <= 'z')
      (B) = ('4') - 0x20;
    else if (('4') >= 'A' && ('4') <= 'Z')
      ;
    else
      printf("ERROR: No es una letra, %s:%d\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/terrex/cursoc-guillermo/refs/heads/"
             "master/ejercicios/tema4/2.2.mayus.c",
             34);
  } while (0);
  printf("la letra %c en mayusculas es %c\n", '4', B);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movb   $0x62,-0x6(%rbp)
movb   $0x30,-0x7(%rbp)
movb   $0x30,-0x8(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1158 <main+0x48>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1158 <main+0x48>
movsbl -0x5(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x7(%rbp)
jmp    1196 <main+0x86>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1177 <main+0x67>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1177 <main+0x67>
jmp    1191 <main+0x81>
lea    0xe82(%rip),%rdi
lea    0xe9a(%rip),%rsi
mov    $0x13,%edx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1196 <main+0x86>
jmp    119b <main+0x8b>
movsbl -0x5(%rbp),%esi
movsbl -0x7(%rbp),%edx
lea    0xf16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x8(%rbp),%eax
cmp    $0x61,%eax
jl     11da <main+0xca>
movsbl -0x8(%rbp),%eax
cmp    $0x7a,%eax
jg     11da <main+0xca>
movsbl -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x8(%rbp)
jmp    1218 <main+0x108>
movsbl -0x8(%rbp),%eax
cmp    $0x41,%eax
jl     11f9 <main+0xe9>
movsbl -0x8(%rbp),%eax
cmp    $0x5a,%eax
jg     11f9 <main+0xe9>
jmp    1213 <main+0x103>
lea    0xe00(%rip),%rdi
lea    0xe18(%rip),%rsi
mov    $0x16,%edx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1218 <main+0x108>
jmp    121d <main+0x10d>
movsbl -0x8(%rbp),%esi
movsbl -0x8(%rbp),%edx
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1238 <main+0x128>
movsbl -0x8(%rbp),%edx
lea    0xe7d(%rip),%rdi
mov    $0x52,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x42,-0x8(%rbp)
movsbl -0x8(%rbp),%edx
lea    0xe62(%rip),%rdi
mov    $0x62,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x5a,-0x8(%rbp)
movsbl -0x8(%rbp),%edx
lea    0xe47(%rip),%rdi
mov    $0x7a,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd74(%rip),%rdi
lea    0xd8c(%rip),%rsi
mov    $0x22,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x8(%rbp),%edx
lea    0xe16(%rip),%rdi
mov    $0x34,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xfa4(%rip),%rbx
mov    %rbx,%rdi
mov    $0x61,%esi
mov    $0x41,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec9(%rip),%r14
lea    0xee1(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x16,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x30,%esi
mov    $0x30,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x52,%esi
mov    $0x30,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x62,%esi
mov    $0x42,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7a,%esi
mov    $0x5a,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x22,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
mov    $0x5a,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [31 x i8] c"ERROR: No es una letra, %s:%d\0A\00"
@.str.1 = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/terrex/cursoc-guillermo/refs/heads/master/ejercicios/tema4/2.2.mayus.c\00"
@.str.2 = [33 x i8] c"la letra %c en mayusculas es %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i32 0, i32* %1
store i8 97, i8* %2
store i8 98, i8* %3
store i8 48, i8* %4
store i8 48, i8* %5
br label %6
6: ; preds = %0
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 97
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 122
br i1 %13, label %14, label %19
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = sub nsw i32 %16, 32
%18 = trunc i32 %17 to i8
store i8 %18, i8* %4
br label %31
19: ; preds = %10, %6
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 65
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 90
br i1 %26, label %27, label %28
27: ; preds = %23
br label %30
28: ; preds = %23, %19
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.1, i64 0, i64 0), i32 19)
br label %30
30: ; preds = %28, %27
br label %31
31: ; preds = %30, %14
br label %32
32: ; preds = %31
%33 = load i8, i8* %2
%34 = sext i8 %33 to i32
%35 = load i8, i8* %4
%36 = sext i8 %35 to i32
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %34, i32 %36)
br label %38
38: ; preds = %32
%39 = load i8, i8* %5
%40 = sext i8 %39 to i32
%41 = icmp sge i32 %40, 97
br i1 %41, label %42, label %51
42: ; preds = %38
%43 = load i8, i8* %5
%44 = sext i8 %43 to i32
%45 = icmp sle i32 %44, 122
br i1 %45, label %46, label %51
46: ; preds = %42
%47 = load i8, i8* %5
%48 = sext i8 %47 to i32
%49 = sub nsw i32 %48, 32
%50 = trunc i32 %49 to i8
store i8 %50, i8* %5
br label %63
51: ; preds = %42, %38
%52 = load i8, i8* %5
%53 = sext i8 %52 to i32
%54 = icmp sge i32 %53, 65
br i1 %54, label %55, label %60
55: ; preds = %51
%56 = load i8, i8* %5
%57 = sext i8 %56 to i32
%58 = icmp sle i32 %57, 90
br i1 %58, label %59, label %60
59: ; preds = %55
br label %62
60: ; preds = %55, %51
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.1, i64 0, i64 0), i32 22)
br label %62
62: ; preds = %60, %59
br label %63
63: ; preds = %62, %46
br label %64
64: ; preds = %63
%65 = load i8, i8* %5
%66 = sext i8 %65 to i32
%67 = load i8, i8* %5
%68 = sext i8 %67 to i32
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %66, i32 %68)
br label %70
70: ; preds = %64
br label %71
71: ; preds = %70
%72 = load i8, i8* %5
%73 = sext i8 %72 to i32
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 82, i32 %73)
br label %75
75: ; preds = %71
store i8 66, i8* %5
br label %76
76: ; preds = %75
%77 = load i8, i8* %5
%78 = sext i8 %77 to i32
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 98, i32 %78)
br label %80
80: ; preds = %76
store i8 90, i8* %5
br label %81
81: ; preds = %80
%82 = load i8, i8* %5
%83 = sext i8 %82 to i32
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 122, i32 %83)
br label %85
85: ; preds = %81
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.1, i64 0, i64 0), i32 34)
br label %87
87: ; preds = %85
%88 = load i8, i8* %5
%89 = sext i8 %88 to i32
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 52, i32 %89)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"ERROR: No es una letra, %s:%d\0A\00"
@.str.1 = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/terrex/cursoc-guillermo/refs/heads/master/ejercicios/tema4/2.2.mayus.c\00"
@.str.2 = [33 x i8] c"la letra %c en mayusculas es %c\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 97, i32 65)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.1, i64 0, i64 0), i32 22)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 48, i32 48)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 82, i32 48)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 98, i32 66)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 122, i32 90)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.1, i64 0, i64 0), i32 34)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 52, i32 90)
ret i32 0
}