#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 html_string(char *, char *);
int html_closelist(int list) {
  switch (list) {
  case (1):
    return html_string("</%s>\n", "DL");
    break;
  case (3):
    return html_string("</%s>\n", "DIR");
    break;
  case (4):
    return html_string("</%s>\n", "MENU");
    break;
  case (5):
    return html_string("</%s>\n", "OL");
    break;
  case (6):
    return html_string("</%s>\n", "UL");
    break;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<html_closelist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     11cb <html_closelist+0xbb>
mov    -0x10(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xecd(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1030 <html_string@plt>
mov    %eax,-0x4(%rbp)
jmp    11d2 <html_closelist+0xc2>
lea    0xeb2(%rip),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <html_string@plt>
mov    %eax,-0x4(%rbp)
jmp    11d2 <html_closelist+0xc2>
lea    0xe97(%rip),%rdi
lea    0xe9e(%rip),%rsi
call   1030 <html_string@plt>
mov    %eax,-0x4(%rbp)
jmp    11d2 <html_closelist+0xc2>
lea    0xe7c(%rip),%rdi
lea    0xe88(%rip),%rsi
call   1030 <html_string@plt>
mov    %eax,-0x4(%rbp)
jmp    11d2 <html_closelist+0xc2>
lea    0xe61(%rip),%rdi
lea    0xe70(%rip),%rsi
call   1030 <html_string@plt>
mov    %eax,-0x4(%rbp)
jmp    11d2 <html_closelist+0xc2>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_closelist>:
add    $0xffffffff,%edi
cmp    $0x5,%edi
ja     1122 <html_closelist+0x12>
mov    $0x3d,%eax
bt     %edi,%eax
jb     1125 <html_closelist+0x15>
xor    %eax,%eax
ret
movslq %edi,%rax
lea    0xeed(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
lea    0xec3(%rip),%rdi
jmp    1030 <html_string@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"</%s>\0A\00"
@.str.1 = [3 x i8] c"DL\00"
@.str.2 = [4 x i8] c"DIR\00"
@.str.3 = [5 x i8] c"MENU\00"
@.str.4 = [3 x i8] c"OL\00"
@.str.5 = [3 x i8] c"UL\00"
define i32 @html_closelist(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %15 [
i32 1, label %5
i32 3, label %7
i32 4, label %9
i32 5, label %11
i32 6, label %13
]
5: ; preds = %1
%6 = call i32 @html_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 %6, i32* %2
br label %16
7: ; preds = %1
%8 = call i32 @html_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
store i32 %8, i32* %2
br label %16
9: ; preds = %1
%10 = call i32 @html_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
store i32 %10, i32* %2
br label %16
11: ; preds = %1
%12 = call i32 @html_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32 %12, i32* %2
br label %16
13: ; preds = %1
%14 = call i32 @html_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32 %14, i32* %2
br label %16
15: ; preds = %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %13, %11, %9, %7, %5
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [7 x i8] c"</%s>\0A\00"
@.str.1 = [3 x i8] c"DL\00"
@.str.2 = [4 x i8] c"DIR\00"
@.str.3 = [5 x i8] c"MENU\00"
@.str.4 = [3 x i8] c"OL\00"
@.str.5 = [3 x i8] c"UL\00"
@reltable.html_closelist = [6 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([6 x i32]* @reltable.html_closelist to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([6 x i32]* @reltable.html_closelist to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([6 x i32]* @reltable.html_closelist to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.3 to i64), i64 ptrtoint ([6 x i32]* @reltable.html_closelist to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.4 to i64), i64 ptrtoint ([6 x i32]* @reltable.html_closelist to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.5 to i64), i64 ptrtoint ([6 x i32]* @reltable.html_closelist to i64)) to i32)]
define i32 @html_closelist(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = trunc i32 %2 to i8
%6 = lshr i8 61, %5
%7 = and i8 %6, 1
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %4
%10 = sext i32 %2 to i64
%11 = shl i64 %10, 2
%12 = call i8* @llvm.load.relative.i64(i8* bitcast ([6 x i32]* @reltable.html_closelist to i8*), i64 %11)
%13 = tail call i32 @html_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %4, %1, %9
%15 = phi i32 [ 0, %1 ], [ %13, %9 ], [ 0, %4 ]
ret i32 %15
}