#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 *);
scalar_t__ strlen(char *);
int html_listitem(int list, char *text) {
  if ((text == NULL) || (strlen(text) == 0))
    return 0;
  switch (list) {
  case (1):
    return html_string("  <DD>%s\n", text);
    break;
  case (2):
    return html_string("  <DT>%s\n", text);
    break;
  case (3):
  case (4):
  case (5):
  case (6):
    return html_string("  <LI>%s\n", text);
    break;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<html_listitem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114d <html_listitem+0x2d>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jne    1159 <html_listitem+0x39>
movl   $0x0,-0x4(%rbp)
jmp    11e1 <html_listitem+0xc1>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x1,%eax
je     1192 <html_listitem+0x72>
jmp    116d <html_listitem+0x4d>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     11aa <html_listitem+0x8a>
jmp    117e <html_listitem+0x5e>
mov    -0x14(%rbp),%eax
add    $0xfffffffd,%eax
sub    $0x4,%eax
jb     11c2 <html_listitem+0xa2>
jmp    11da <html_listitem+0xba>
mov    -0x10(%rbp),%rsi
lea    0xe63(%rip),%rdi
call   1040 <html_string@plt>
mov    %eax,-0x4(%rbp)
jmp    11e1 <html_listitem+0xc1>
mov    -0x10(%rbp),%rsi
lea    0xe55(%rip),%rdi
call   1040 <html_string@plt>
mov    %eax,-0x4(%rbp)
jmp    11e1 <html_listitem+0xc1>
mov    -0x10(%rbp),%rsi
lea    0xe47(%rip),%rdi
call   1040 <html_string@plt>
mov    %eax,-0x4(%rbp)
jmp    11e1 <html_listitem+0xc1>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_listitem>:
test   %rsi,%rsi
je     1138 <html_listitem+0x28>
cmpb   $0x0,(%rsi)
je     1138 <html_listitem+0x28>
add    $0xffffffff,%edi
cmp    $0x5,%edi
ja     1138 <html_listitem+0x28>
movslq %edi,%rax
lea    0xef4(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1030 <html_string@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [10 x i8] c" <DD>%s\0A\00"
@.str.1 = [10 x i8] c" <DT>%s\0A\00"
@.str.2 = [10 x i8] c" <LI>%s\0A\00"
define i32 @html_listitem(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = call i64 @strlen(i8* %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8, %2
store i32 0, i32* %3
br label %25
13: ; preds = %8
%14 = load i32, i32* %4
switch i32 %14, label %24 [
i32 1, label %15
i32 2, label %18
i32 3, label %21
i32 4, label %21
i32 5, label %21
i32 6, label %21
]
15: ; preds = %13
%16 = load i8*, i8** %5
%17 = call i32 @html_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %16)
store i32 %17, i32* %3
br label %25
18: ; preds = %13
%19 = load i8*, i8** %5
%20 = call i32 @html_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %19)
store i32 %20, i32* %3
br label %25
21: ; preds = %13, %13, %13, %13
%22 = load i8*, i8** %5
%23 = call i32 @html_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %22)
store i32 %23, i32* %3
br label %25
24: ; preds = %13
store i32 0, i32* %3
br label %25
25: ; preds = %24, %21, %18, %15, %12
%26 = load i32, i32* %3
ret i32 %26
}

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