#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 *, ...);
void printChar(int c) {
  switch (c) {
  case '<':
    printf("&lt;");
    break;
  case '>':
    printf("&gt");
    break;
  case '&':
    printf("&amp;");
    break;
  default:
    printf("%c", c);
    break;
  }
}


x86 assembly (clang, -O0):
<printChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x26,%eax
je     1177 <printChar+0x67>
jmp    112f <printChar+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x3c,%eax
je     1151 <printChar+0x41>
jmp    1140 <printChar+0x30>
mov    -0x8(%rbp),%eax
sub    $0x3e,%eax
je     1164 <printChar+0x54>
jmp    118a <printChar+0x7a>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119b <printChar+0x8b>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119b <printChar+0x8b>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119b <printChar+0x8b>
mov    -0x4(%rbp),%esi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printChar>:
cmp    $0x26,%edi
je     113d <printChar+0x1d>
cmp    $0x3e,%edi
je     114b <printChar+0x2b>
cmp    $0x3c,%edi
jne    1159 <printChar+0x39>
lea    0xeca(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"&lt;\00"
@.str.1 = [4 x i8] c"&gt\00"
@.str.2 = [6 x i8] c"&amp;\00"
@.str.3 = [3 x i8] c"%c\00"
define void @printChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %10 [
i32 60, label %4
i32 62, label %6
i32 38, label %8
]
4: ; preds = %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %13
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %13
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"&lt;\00"
@.str.1 = [4 x i8] c"&gt\00"
@.str.2 = [6 x i8] c"&amp;\00"
define void @printChar(i32 %0) {
switch i32 %0, label %8 [
i32 60, label %2
i32 62, label %4
i32 38, label %6
]
2: ; preds = %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %10
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %10
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = tail call i32 @putchar(i32 %0)
br label %10
10: ; preds = %8, %6, %4, %2
ret void
}