#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*/ printf(char *, ...);
int toupper(int);
int main(void) {
  int i;
  printf("static UCHAR UpTable[128] =\n{\n");
  for (i = 0; i < 128; ++i) {
    if (i < 32 || i > 127 || i == '\'' || i == '\\')
      printf("  %d,\n", i);
    else
      printf("  '%c',\n", toupper(i));
  }
  printf("};\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    11ba <main+0x9a>
cmpl   $0x20,-0x8(%rbp)
jl     1179 <main+0x59>
cmpl   $0x7f,-0x8(%rbp)
jg     1179 <main+0x59>
cmpl   $0x27,-0x8(%rbp)
je     1179 <main+0x59>
cmpl   $0x5c,-0x8(%rbp)
jne    118f <main+0x6f>
mov    -0x8(%rbp),%esi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11a7 <main+0x87>
mov    -0x8(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,%esi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11ac <main+0x8c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x24>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xed4(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb8(%rip),%r15
lea    0xeb8(%rip),%r14
xor    %ebx,%ebx
jmp    1176 <main+0x46>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x1(%rbx),%eax
cmp    $0x7f,%ebx
mov    %eax,%ebx
jae    1193 <main+0x63>
cmp    $0x20,%ebx
jb     1160 <main+0x30>
cmp    $0x5c,%ebx
je     1160 <main+0x30>
cmp    $0x27,%ebx
je     1160 <main+0x30>
mov    %ebx,%edi
call   1030 <toupper@plt>
mov    %r14,%rdi
mov    %eax,%esi
jmp    1165 <main+0x35>
lea    0xe94(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [31 x i8] c"static UCHAR UpTable[128] =\0A{\0A\00"
@.str.1 = [7 x i8] c" %d,\0A\00"
@.str.2 = [9 x i8] c" '%c',\0A\00"
@.str.3 = [4 x i8] c"};\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %4
4: ; preds = %27, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 128
br i1 %6, label %7, label %30
7: ; preds = %4
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 32
br i1 %9, label %19, label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 127
br i1 %12, label %19, label %13
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 39
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 92
br i1 %18, label %19, label %22
19: ; preds = %16, %13, %10, %7
%20 = load i32, i32* %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %20)
br label %26
22: ; preds = %16
%23 = load i32, i32* %2
%24 = call i32 @toupper(i32 %23)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %22, %19
br label %27
27: ; preds = %26
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
br label %4
30: ; preds = %4
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c" %d,\0A\00"
@.str.2 = [9 x i8] c" '%c',\0A\00"
@str = [30 x i8] c"static UCHAR UpTable[128] =\0A{\00"
@str.4 = [3 x i8] c"};\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %12
%3 = phi i32 [ 0, %0 ], [ %13, %12 ]
%4 = freeze i32 %3
%5 = icmp ult i32 %4, 32
br i1 %5, label %7, label %6
6: ; preds = %2
switch i32 %4, label %9 [
i32 92, label %7
i32 39, label %7
]
7: ; preds = %6, %6, %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %4)
br label %12
9: ; preds = %6
%10 = tail call i32 @toupper(i32 %4)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %7, %9
%13 = add nuw nsw i32 %4, 1
%14 = icmp ult i32 %4, 127
br i1 %14, label %2, label %15
15: ; preds = %12
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}