#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 int i;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ islower(int);
int toupper(int);
int main() {
  int i;
  for (i = 0; i < 256; i++)
    if ((((islower(i)) && !(('a' <= (i) && (i) <= 'z'))) ||
         (!(islower(i)) && (('a' <= (i) && (i) <= 'z')))) ||
        toupper(i) != (('a' <= (i) && (i) <= 'z') ? 'A' + ((i) - 'a') : (i)))
      exit(1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    120c <main+0xdc>
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     117d <main+0x4d>
mov    $0x61,%eax
cmp    -0x8(%rbp),%eax
jg     11ef <main+0xbf>
cmpl   $0x7a,-0x8(%rbp)
jg     11ef <main+0xbf>
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
jne    11a7 <main+0x77>
mov    $0x61,%eax
cmp    -0x8(%rbp),%eax
jg     11a7 <main+0x77>
cmpl   $0x7a,-0x8(%rbp)
jle    11ef <main+0xbf>
mov    -0x8(%rbp),%edi
call   1040 <toupper@plt>
mov    %eax,-0xc(%rbp)
mov    $0x61,%eax
cmp    -0x8(%rbp),%eax
jg     11db <main+0xab>
cmpl   $0x7a,-0x8(%rbp)
jg     11db <main+0xab>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x10(%rbp)
jmp    11e1 <main+0xb1>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
cmp    %ecx,%eax
je     11f9 <main+0xc9>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    11fe <main+0xce>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
mov    %r14d,%edi
call   1030 <islower@plt>
add    $0xffffff9f,%r14d
test   %rax,%rax
je     1157 <main+0x27>
cmp    $0x19,%r14d
ja     1197 <main+0x67>
lea    0x61(%r14),%ebx
mov    %ebx,%edi
call   1030 <islower@plt>
cmp    $0x19,%r14d
ja     116d <main+0x3d>
test   %rax,%rax
je     1197 <main+0x67>
mov    %ebx,%edi
call   1040 <toupper@plt>
lea    -0x20(%rbx),%ecx
cmp    $0x1a,%r14d
cmovae %ebx,%ecx
cmp    %ecx,%eax
jne    1197 <main+0x67>
add    $0x1,%ebx
mov    %ebx,%r14d
cmp    $0x100,%ebx
jne    1140 <main+0x10>
xor    %edi,%edi
call   1050 <exit@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %46, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %49
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i64 @islower(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp sle i32 97, %11
br i1 %12, label %13, label %43
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp sle i32 %14, 122
br i1 %15, label %16, label %43
16: ; preds = %13, %6
%17 = load i32, i32* %2
%18 = call i64 @islower(i32 %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %26, label %20
20: ; preds = %16
%21 = load i32, i32* %2
%22 = icmp sle i32 97, %21
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp sle i32 %24, 122
br i1 %25, label %43, label %26
26: ; preds = %23, %20, %16
%27 = load i32, i32* %2
%28 = call i32 @toupper(i32 %27)
%29 = load i32, i32* %2
%30 = icmp sle i32 97, %29
br i1 %30, label %31, label %38
31: ; preds = %26
%32 = load i32, i32* %2
%33 = icmp sle i32 %32, 122
br i1 %33, label %34, label %38
34: ; preds = %31
%35 = load i32, i32* %2
%36 = sub nsw i32 %35, 97
%37 = add nsw i32 65, %36
br label %40
38: ; preds = %31, %26
%39 = load i32, i32* %2
br label %40
40: ; preds = %38, %34
%41 = phi i32 [ %37, %34 ], [ %39, %38 ]
%42 = icmp ne i32 %28, %41
br i1 %42, label %43, label %45
43: ; preds = %40, %23, %13, %10
%44 = call i32 @exit(i32 1)
unreachable
45: ; preds = %40
br label %46
46: ; preds = %45
%47 = load i32, i32* %2
%48 = add nsw i32 %47, 1
store i32 %48, i32* %2
br label %3
49: ; preds = %3
%50 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
br label %4
1: ; preds = %15
%2 = add nuw nsw i32 %5, 1
%3 = icmp eq i32 %2, 256
br i1 %3, label %22, label %4
4: ; preds = %0, %1
%5 = phi i32 [ 0, %0 ], [ %2, %1 ]
%6 = tail call i64 @islower(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = add nsw i32 %5, -97
%9 = icmp ult i32 %8, 26
%10 = select i1 %7, i1 true, i1 %9
br i1 %10, label %11, label %20
11: ; preds = %4
%12 = tail call i64 @islower(i32 %5)
%13 = icmp eq i64 %12, 0
%14 = and i1 %9, %13
br i1 %14, label %20, label %15
15: ; preds = %11
%16 = tail call i32 @toupper(i32 %5)
%17 = add nsw i32 %5, -32
%18 = select i1 %9, i32 %17, i32 %5
%19 = icmp eq i32 %16, %18
br i1 %19, label %1, label %20
20: ; preds = %4, %11, %15
%21 = tail call i32 @exit(i32 1)
unreachable
22: ; preds = %1
%23 = tail call i32 @exit(i32 0)
unreachable
}