#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 */
char toupper(char);
char IRCUppercase(char c) {
  char upper;
  if (c == '{') {
    upper = '[';
  } else if (c == '}') {
    upper = ']';
  } else if (c == '|') {
    upper = '\\';
  } else if (c == '^') {
    upper = '~';
  } else {
    upper = toupper(c);
  }
  return upper;
}


x86 assembly (clang, -O0):
<IRCUppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x7b,%eax
jne    1134 <IRCUppercase+0x24>
movb   $0x5b,-0x2(%rbp)
jmp    1191 <IRCUppercase+0x81>
movsbl -0x1(%rbp),%eax
cmp    $0x7d,%eax
jne    114a <IRCUppercase+0x3a>
movb   $0x5d,-0x2(%rbp)
jmp    118c <IRCUppercase+0x7c>
movsbl -0x1(%rbp),%eax
cmp    $0x7c,%eax
jne    1160 <IRCUppercase+0x50>
movb   $0x5c,-0x2(%rbp)
jmp    1187 <IRCUppercase+0x77>
movsbl -0x1(%rbp),%eax
cmp    $0x5e,%eax
jne    1176 <IRCUppercase+0x66>
movb   $0x7e,-0x2(%rbp)
jmp    1182 <IRCUppercase+0x72>
movsbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x2(%rbp)
jmp    1187 <IRCUppercase+0x77>
jmp    118c <IRCUppercase+0x7c>
jmp    1191 <IRCUppercase+0x81>
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IRCUppercase>:
lea    -0x5e(%rdi),%ecx
cmp    $0x1f,%cl
ja     1130 <IRCUppercase+0x20>
mov    $0x5b,%al
movzbl %cl,%ecx
lea    0xedc(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x7e,%al
ret
movsbl %dil,%edi
jmp    1030 <toupper@plt>
mov    $0x5c,%al
ret
mov    $0x5d,%al
ret

LLVM IR (-O0):
define signext i8 @IRCUppercase(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 123
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 91, i8* %3
br label %29
8: ; preds = %1
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 125
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 93, i8* %3
br label %28
13: ; preds = %8
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 124
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 92, i8* %3
br label %27
18: ; preds = %13
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 94
br i1 %21, label %22, label %23
22: ; preds = %18
store i8 126, i8* %3
br label %26
23: ; preds = %18
%24 = load i8, i8* %2
%25 = call signext i8 @toupper(i8 signext %24)
store i8 %25, i8* %3
br label %26
26: ; preds = %23, %22
br label %27
27: ; preds = %26, %17
br label %28
28: ; preds = %27, %12
br label %29
29: ; preds = %28, %7
%30 = load i8, i8* %3
ret i8 %30
}

LLVM IR (-O2):
define signext i8 @IRCUppercase(i8 signext %0) {
switch i8 %0, label %5 [
i8 123, label %7
i8 125, label %2
i8 124, label %3
i8 94, label %4
]
2: ; preds = %1
br label %7
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
%6 = tail call signext i8 @toupper(i8 signext %0)
br label %7
7: ; preds = %1, %2, %4, %5, %3
%8 = phi i8 [ 93, %2 ], [ 92, %3 ], [ 126, %4 ], [ %6, %5 ], [ 91, %1 ]
ret i8 %8
}