#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_tablecloserow();
scalar_t__ html_tabledata(int, int, int, int /*<<< orphan*/, char *);
int html_tableopenrow(int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, double);
int html_writetablevalue(char *descrip, char *units, char *format,
                         double value) {
  char buf[64];
  int l = html_tableopenrow((0));
  l += html_tabledata((0), 1, 1, 0, descrip);
  sprintf(buf, format, value);
  l += html_tabledata((3), 1, 1, 0, buf);
  l += html_tabledata((2), 1, 1, 0, units);
  l += html_tablecloserow();
  return l;
}


x86 assembly (clang, -O0):
<html_writetablevalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
xor    %edi,%edi
call   1030 <html_tableopenrow@plt>
mov    %eax,-0x64(%rbp)
mov    -0x8(%rbp),%r8
xor    %ecx,%ecx
mov    $0x1,%edx
mov    %ecx,%edi
mov    %edx,%esi
call   1050 <html_tabledata@plt>
mov    %rax,%rcx
movslq -0x64(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x64(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movsd  -0x20(%rbp),%xmm0
call   1060 <sprintf@plt>
lea    -0x60(%rbp),%r8
mov    $0x3,%edi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %edx,%esi
call   1050 <html_tabledata@plt>
mov    %rax,%rcx
movslq -0x64(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x64(%rbp)
mov    -0x10(%rbp),%r8
mov    $0x2,%edi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %edx,%esi
call   1050 <html_tabledata@plt>
mov    %rax,%rcx
movslq -0x64(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x64(%rbp)
mov    $0x0,%al
call   1040 <html_tablecloserow@plt>
mov    %rax,%rcx
movslq -0x64(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_writetablevalue>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x58,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <html_tableopenrow@plt>
mov    %eax,%ebp
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
call   1050 <html_tabledata@plt>
mov    %rax,%rbx
add    %ebp,%ebx
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %r15,%rsi
movsd  0x8(%rsp),%xmm0
call   1060 <sprintf@plt>
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbp,%r8
call   1050 <html_tabledata@plt>
mov    %rax,%rbp
add    %ebx,%ebp
mov    $0x2,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %r14,%r8
call   1050 <html_tabledata@plt>
mov    %rax,%rbx
add    %ebp,%ebx
xor    %eax,%eax
call   1040 <html_tablecloserow@plt>
add    %ebx,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @html_writetablevalue(i8* %0, i8* %1, i8* %2, double %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca double
%9 = alloca [64 x i8]
%10 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store double %3, double* %8
%11 = call i32 @html_tableopenrow(i32 0)
store i32 %11, i32* %10
%12 = load i8*, i8** %5
%13 = call i64 @html_tabledata(i32 0, i32 1, i32 1, i32 0, i8* %12)
%14 = load i32, i32* %10
%15 = sext i32 %14 to i64
%16 = add nsw i64 %15, %13
%17 = trunc i64 %16 to i32
store i32 %17, i32* %10
%18 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%19 = load i8*, i8** %7
%20 = load double, double* %8
%21 = call i32 @sprintf(i8* %18, i8* %19, double %20)
%22 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%23 = call i64 @html_tabledata(i32 3, i32 1, i32 1, i32 0, i8* %22)
%24 = load i32, i32* %10
%25 = sext i32 %24 to i64
%26 = add nsw i64 %25, %23
%27 = trunc i64 %26 to i32
store i32 %27, i32* %10
%28 = load i8*, i8** %6
%29 = call i64 @html_tabledata(i32 2, i32 1, i32 1, i32 0, i8* %28)
%30 = load i32, i32* %10
%31 = sext i32 %30 to i64
%32 = add nsw i64 %31, %29
%33 = trunc i64 %32 to i32
store i32 %33, i32* %10
%34 = call i64 (...) @html_tablecloserow()
%35 = load i32, i32* %10
%36 = sext i32 %35 to i64
%37 = add nsw i64 %36, %34
%38 = trunc i64 %37 to i32
store i32 %38, i32* %10
%39 = load i32, i32* %10
ret i32 %39
}

LLVM IR (-O2):
define i32 @html_writetablevalue(i8* %0, i8* %1, i8* nocapture %2, double %3) {
%5 = alloca [64 x i8]
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = tail call i32 @html_tableopenrow(i32 0)
%8 = tail call i64 @html_tabledata(i32 0, i32 1, i32 1, i32 0, i8* %0)
%9 = trunc i64 %8 to i32
%10 = add i32 %7, %9
%11 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) %2, double %3)
%12 = call i64 @html_tabledata(i32 3, i32 1, i32 1, i32 0, i8* %6)
%13 = trunc i64 %12 to i32
%14 = add i32 %10, %13
%15 = call i64 @html_tabledata(i32 2, i32 1, i32 1, i32 0, i8* %1)
%16 = trunc i64 %15 to i32
%17 = add i32 %14, %16
%18 = call i64 (...) @html_tablecloserow()
%19 = trunc i64 %18 to i32
%20 = add i32 %17, %19
ret i32 %20
}