#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
char small_to_capital(char c) {
  if (('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z') || c == '\0') {
    if ('a' <= c && c <= 'z') {
      c = c - 'a' + 'A';
    }
    return c;
  } else {
    printf("error : There exists illegal atom type \n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<small_to_capital>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     114c <small_to_capital+0x2c>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jle    1177 <small_to_capital+0x57>
movsbl -0x1(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     116a <small_to_capital+0x4a>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jle    1177 <small_to_capital+0x57>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jne    11ac <small_to_capital+0x8c>
movsbl -0x1(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     11a2 <small_to_capital+0x82>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     11a2 <small_to_capital+0x82>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<small_to_capital>:
lea    -0x41(%rdi),%ecx
lea    -0x61(%rdi),%eax
cmp    $0x1a,%cl
jb     1134 <small_to_capital+0x14>
test   %dil,%dil
je     1134 <small_to_capital+0x14>
cmp    $0x19,%al
ja     1144 <small_to_capital+0x24>
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %dil,%edx
movzbl %cl,%eax
cmovae %edx,%eax
ret
push   %rax
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"error : There exists illegal atom type \0A\00"
@EXIT_FAILURE = global i32 0
define signext i8 @small_to_capital(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 65, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %22, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 97, %12
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
br i1 %17, label %22, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %38
22: ; preds = %18, %14, %6
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 97, %24
br i1 %25, label %26, label %36
26: ; preds = %22
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp sle i32 %28, 122
br i1 %29, label %30, label %36
30: ; preds = %26
%31 = load i8, i8* %2
%32 = sext i8 %31 to i32
%33 = sub nsw i32 %32, 97
%34 = add nsw i32 %33, 65
%35 = trunc i32 %34 to i8
store i8 %35, i8* %2
br label %36
36: ; preds = %30, %26, %22
%37 = load i8, i8* %2
ret i8 %37
38: ; preds = %18
%39 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%40 = load i32, i32* @EXIT_FAILURE
%41 = call i32 @exit(i32 %40)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [40 x i8] c"error : There exists illegal atom type \00"
define signext i8 @small_to_capital(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -97
br i1 %3, label %9, label %5
5: ; preds = %1
%6 = icmp ult i8 %4, 26
%7 = icmp eq i8 %0, 0
%8 = or i1 %7, %6
br i1 %8, label %9, label %13
9: ; preds = %1, %5
%10 = icmp ult i8 %4, 26
%11 = add nsw i8 %0, -32
%12 = select i1 %10, i8 %11, i8 %0
ret i8 %12
13: ; preds = %5
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%15 = load i32, i32* @EXIT_FAILURE
%16 = tail call i32 @exit(i32 %15)
unreachable
}