#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*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
void h_th_start(const char *class, int colspan) {
  fputs("<th", stdout);
  if (class)
    printf(" class=\"%s\"", class);
  if (colspan > 1)
    printf(" colspan=\"%d\"", colspan);
  fputs(">", stdout);
}


x86 assembly (clang, -O0):
<h_th_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1040 <fputs@plt>
cmpq   $0x0,-0x8(%rbp)
je     1161 <h_th_start+0x41>
mov    -0x8(%rbp),%rsi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0xc(%rbp)
jle    117c <h_th_start+0x5c>
mov    -0xc(%rbp),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%esi
lea    0xe92(%rip),%rdi
call   1040 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_th_start>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb0(%rip),%r14
mov    (%r14),%esi
lea    0xec6(%rip),%rdi
call   1040 <fputs@plt>
test   %rbx,%rbx
je     1155 <h_th_start+0x35>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x2,%ebp
jl     116a <h_th_start+0x4a>
lea    0xeaf(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%r14),%esi
lea    0xeaa(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fputs@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"<th\00"
@stdout = global i32 0
@.str.1 = [12 x i8] c" class=\22%s\22\00"
@.str.2 = [14 x i8] c" colspan=\22%d\22\00"
@.str.3 = [2 x i8] c">\00"
define void @h_th_start(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %2
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 1
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %15, %12
%19 = load i32, i32* @stdout
%20 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"<th\00"
@stdout = global i32 0
@.str.1 = [12 x i8] c" class=\22%s\22\00"
@.str.2 = [14 x i8] c" colspan=\22%d\22\00"
@.str.3 = [2 x i8] c">\00"
define void @h_th_start(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp eq i8* %0, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %2
%9 = icmp sgt i32 %1, 1
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %1)
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* @stdout
%14 = tail call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %13)
ret void
}