#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 */
scalar_t__ html_int(char *, int);
int html_string(char *, char *);
scalar_t__ html_tablealign(int);
int html_opentable(int align, int border, int width) {
  int l = html_string("%s", "<TABLE");
  l += html_tablealign(align);
  if (border)
    l += html_string(" %s", "BORDER");
  if (width)
    l += html_int(" WIDTH=\"%d%%\"", width);
  l += html_string("%s\n", ">");
  return l;
}


x86 assembly (clang, -O0):
<html_opentable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    0xec0(%rip),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <html_string@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <html_tablealign@plt>
mov    %rax,%rcx
movslq -0x10(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     118f <html_opentable+0x5f>
lea    0xe8a(%rip),%rdi
lea    0xe87(%rip),%rsi
call   1030 <html_string@plt>
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     11b5 <html_opentable+0x85>
mov    -0xc(%rbp),%esi
lea    0xe6f(%rip),%rdi
call   1040 <html_int@plt>
mov    %rax,%rcx
movslq -0x10(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
lea    0xe64(%rip),%rdi
lea    0xe61(%rip),%rsi
call   1030 <html_string@plt>
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_opentable>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebx
lea    0xec2(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1030 <html_string@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1050 <html_tablealign@plt>
mov    %rax,%rbx
add    %ebp,%ebx
test   %r15d,%r15d
je     117c <html_opentable+0x4c>
lea    0xe9b(%rip),%rdi
lea    0xe98(%rip),%rsi
call   1030 <html_string@plt>
add    %ebx,%eax
mov    %eax,%ebx
test   %r14d,%r14d
je     1192 <html_opentable+0x62>
lea    0xe8a(%rip),%rdi
mov    %r14d,%esi
call   1040 <html_int@plt>
add    %eax,%ebx
lea    0xe87(%rip),%rdi
lea    0xe84(%rip),%rsi
call   1030 <html_string@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"<TABLE\00"
@.str.2 = [4 x i8] c" %s\00"
@.str.3 = [7 x i8] c"BORDER\00"
@.str.4 = [14 x i8] c" WIDTH=\22%d%%\22\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [2 x i8] c">\00"
define i32 @html_opentable(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i32 @html_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i32 %8, i32* %7
%9 = load i32, i32* %4
%10 = call i64 @html_tablealign(i32 %9)
%11 = load i32, i32* %7
%12 = sext i32 %11 to i64
%13 = add nsw i64 %12, %10
%14 = trunc i64 %13 to i32
store i32 %14, i32* %7
%15 = load i32, i32* %5
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %3
%18 = call i32 @html_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%19 = load i32, i32* %7
%20 = add nsw i32 %19, %18
store i32 %20, i32* %7
br label %21
21: ; preds = %17, %3
%22 = load i32, i32* %6
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %31
24: ; preds = %21
%25 = load i32, i32* %6
%26 = call i64 @html_int(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = add nsw i64 %28, %26
%30 = trunc i64 %29 to i32
store i32 %30, i32* %7
br label %31
31: ; preds = %24, %21
%32 = call i32 @html_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%33 = load i32, i32* %7
%34 = add nsw i32 %33, %32
store i32 %34, i32* %7
%35 = load i32, i32* %7
ret i32 %35
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"<TABLE\00"
@.str.2 = [4 x i8] c" %s\00"
@.str.3 = [7 x i8] c"BORDER\00"
@.str.4 = [14 x i8] c" WIDTH=\22%d%%\22\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [2 x i8] c">\00"
define i32 @html_opentable(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @html_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i64 @html_tablealign(i32 %0)
%6 = trunc i64 %5 to i32
%7 = add i32 %4, %6
%8 = icmp eq i32 %1, 0
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = tail call i32 @html_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%11 = add nsw i32 %10, %7
br label %12
12: ; preds = %9, %3
%13 = phi i32 [ %11, %9 ], [ %7, %3 ]
%14 = icmp eq i32 %2, 0
br i1 %14, label %19, label %15
15: ; preds = %12
%16 = tail call i64 @html_int(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %2)
%17 = trunc i64 %16 to i32
%18 = add i32 %13, %17
br label %19
19: ; preds = %15, %12
%20 = phi i32 [ %18, %15 ], [ %13, %12 ]
%21 = tail call i32 @html_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%22 = add nsw i32 %21, %20
ret i32 %22
}