#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void print_char_html(char c) {
  switch (c) {
  case '<':
    fprintf(stdout, "&lt;");
    break;
  case '>':
    fprintf(stdout, "&gt;");
    break;
  case '"':
    fprintf(stdout, "&quot;");
    break;
  case '&':
    fprintf(stdout, "&amp;");
    break;
  case '|':
    fprintf(stdout, "&brvbar;");
    break;
  default:
    fprintf(stdout, "%c", c);
  }
}


x86 assembly (clang, -O0):
<print_char_html>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x22,%eax
je     11af <print_char_html+0x9f>
jmp    1133 <print_char_html+0x23>
mov    -0x8(%rbp),%eax
sub    $0x26,%eax
je     11cb <print_char_html+0xbb>
jmp    1144 <print_char_html+0x34>
mov    -0x8(%rbp),%eax
sub    $0x3c,%eax
je     1177 <print_char_html+0x67>
jmp    1155 <print_char_html+0x45>
mov    -0x8(%rbp),%eax
sub    $0x3e,%eax
je     1193 <print_char_html+0x83>
jmp    1166 <print_char_html+0x56>
mov    -0x8(%rbp),%eax
sub    $0x7c,%eax
je     11e7 <print_char_html+0xd7>
jmp    1203 <print_char_html+0xf3>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
lea    0xe79(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    121e <print_char_html+0x10e>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
lea    0xe62(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    121e <print_char_html+0x10e>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
lea    0xe4b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    121e <print_char_html+0x10e>
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
lea    0xe36(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    121e <print_char_html+0x10e>
mov    0x2df2(%rip),%rax
mov    (%rax),%edi
lea    0xe20(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    121e <print_char_html+0x10e>
mov    0x2dd6(%rip),%rax
mov    (%rax),%edi
movsbl -0x1(%rbp),%edx
lea    0xe09(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char_html>:
mov    %edi,%edx
lea    -0x22(%rdx),%eax
cmp    $0x1c,%eax
ja     1141 <print_char_html+0x31>
lea    0xedf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xf44(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
cmp    $0x7c,%edx
jne    115d <print_char_html+0x4d>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xf35(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    0xf27(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
lea    0xf01(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"&lt;\00"
@.str.1 = [5 x i8] c"&gt;\00"
@.str.2 = [7 x i8] c"&quot;\00"
@.str.3 = [6 x i8] c"&amp;\00"
@.str.4 = [9 x i8] c"&brvbar;\00"
@.str.5 = [3 x i8] c"%c\00"
define void @print_char_html(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %20 [
i32 60, label %5
i32 62, label %8
i32 34, label %11
i32 38, label %14
i32 124, label %17
]
5: ; preds = %1
%6 = load i32, i32* @stdout
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %25
8: ; preds = %1
%9 = load i32, i32* @stdout
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %25
11: ; preds = %1
%12 = load i32, i32* @stdout
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %25
14: ; preds = %1
%15 = load i32, i32* @stdout
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %25
17: ; preds = %1
%18 = load i32, i32* @stdout
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %25
20: ; preds = %1
%21 = load i32, i32* @stdout
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %20, %17, %14, %11, %8, %5
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"&lt;\00"
@.str.1 = [5 x i8] c"&gt;\00"
@.str.2 = [7 x i8] c"&quot;\00"
@.str.3 = [6 x i8] c"&amp;\00"
@.str.4 = [9 x i8] c"&brvbar;\00"
@.str.5 = [3 x i8] c"%c\00"
define void @print_char_html(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %18 [
i32 60, label %3
i32 62, label %6
i32 34, label %9
i32 38, label %12
i32 124, label %15
]
3: ; preds = %1
%4 = load i32, i32* @stdout
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %21
6: ; preds = %1
%7 = load i32, i32* @stdout
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %21
9: ; preds = %1
%10 = load i32, i32* @stdout
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %21
12: ; preds = %1
%13 = load i32, i32* @stdout
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %21
15: ; preds = %1
%16 = load i32, i32* @stdout
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %21
18: ; preds = %1
%19 = load i32, i32* @stdout
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %2)
br label %21
21: ; preds = %18, %15, %12, %9, %6, %3
ret void
}