#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 *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char ch;
  scanf("%c", &ch);
  if (ch >= 'a' && ch <= 'z')
    printf("%c", ch - 32);
  else if (ch >= 'A' && ch <= 'Z')
    printf("%c", ch + 32);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1174 <main+0x54>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1174 <main+0x54>
movsbl -0x5(%rbp),%eax
sub    $0x20,%eax
lea    0xe99(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
jmp    11a9 <main+0x89>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     11a4 <main+0x84>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     11a4 <main+0x84>
movsbl -0x5(%rbp),%eax
add    $0x20,%eax
lea    0xe64(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
jmp    11a9 <main+0x89>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x7(%rsp),%al
lea    -0x61(%rax),%edx
mov    $0xe0,%cl
cmp    $0x1a,%dl
jb     114a <main+0x2a>
lea    -0x41(%rax),%edx
mov    $0x20,%cl
cmp    $0x19,%dl
ja     115b <main+0x3b>
add    %cl,%al
movsbl %al,%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %17
7: ; preds = %0
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 32
%15 = trunc i32 %14 to i8
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %15)
br label %32
17: ; preds = %7, %0
%18 = load i8, i8* %2
%19 = sext i8 %18 to i32
%20 = icmp sge i32 %19, 65
br i1 %20, label %21, label %31
21: ; preds = %17
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
%24 = icmp sle i32 %23, 90
br i1 %24, label %25, label %31
25: ; preds = %21
%26 = load i8, i8* %2
%27 = sext i8 %26 to i32
%28 = add nsw i32 %27, 32
%29 = trunc i32 %28 to i8
%30 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %29)
br label %31
31: ; preds = %25, %21, %17
br label %32
32: ; preds = %31, %11
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = add i8 %3, -97
%5 = icmp ult i8 %4, 26
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = add i8 %3, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %13
9: ; preds = %6, %0
%10 = phi i8 [ -32, %0 ], [ 32, %6 ]
%11 = add nsw i8 %3, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %11)
br label %13
13: ; preds = %9, %6
ret i32 0
}