// File: /workspace/github_c_makefile_star2_O0/smilingthax[P]libfontembed/sfnt_write.c
// Function: otf_write_woff_header
static int otf_write_woff_header(const struct _OTF_WRITE_INFO *otw,const OTF_WOFF_HEADER *woff,OUTPUT_FN output,void *context) // {{{
{
  char out[44];

  // header
  set_ULONG(out,OTF_TAG('w','O','F','F'));
  set_ULONG(out+4,otw->version);
  set_ULONG(out+8,woff->length);
  set_USHORT(out+12,otw->numTables);
  set_USHORT(out+14,0); // reserved, must be 0

  set_ULONG(out+16,woff->origLength);
  set_USHORT(out+20,woff->majorVersion);
  set_USHORT(out+22,woff->minorVersion);
  set_ULONG(out+24,woff->metaOffset);
  set_ULONG(out+28,woff->metaLength);
  set_ULONG(out+32,woff->metaOrigLength);
  set_ULONG(out+36,woff->privOffset);
  set_ULONG(out+40,woff->privLength);

  (*output)(out,44,context);

  // directory
  int ret=44,iA;
  for (iA=0;iA<otw->numTables;iA++) {
    const OTF_DIRENT *table=&otw->tables[iA].info.table;

    set_ULONG(out,table->tag);
    set_ULONG(out+4,table->offset);
    set_ULONG(out+8,table->compLength);
    set_ULONG(out+12,table->length);
    set_ULONG(out+16,table->checkSum);

    (*output)(out,20,context);
    ret+=20;
  }

  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
leaq -0x50(%rbp), %rdi
movl $0x774f4646, %esi       # imm = 0x774F4646
callq 0xca00
leaq -0x50(%rbp), %rdi
addq $0x4, %rdi
movq -0x8(%rbp), %rax
movl (%rax), %esi
callq 0xca00
leaq -0x50(%rbp), %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rax
movl (%rax), %esi
callq 0xca00
leaq -0x50(%rbp), %rdi
addq $0xc, %rdi
movq -0x8(%rbp), %rax
movzwl 0x4(%rax), %esi
callq 0xd000
leaq -0x50(%rbp), %rdi
addq $0xe, %rdi
xorl %esi, %esi
callq 0xd000
leaq -0x50(%rbp), %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %esi
callq 0xca00
leaq -0x50(%rbp), %rdi
addq $0x14, %rdi
movq -0x10(%rbp), %rax
movzwl 0x8(%rax), %esi
callq 0xd000
leaq -0x50(%rbp), %rdi
addq $0x16, %rdi
movq -0x10(%rbp), %rax
movzwl 0xa(%rax), %esi
callq 0xd000
leaq -0x50(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %esi
callq 0xca00
leaq -0x50(%rbp), %rdi
addq $0x1c, %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
callq 0xca00
leaq -0x50(%rbp), %rdi
addq $0x20, %rdi
movq -0x10(%rbp), %rax
movl 0x14(%rax), %esi
callq 0xca00
leaq -0x50(%rbp), %rdi
addq $0x24, %rdi
movq -0x10(%rbp), %rax
movl 0x18(%rax), %esi
callq 0xca00
leaq -0x50(%rbp), %rdi
addq $0x28, %rdi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %esi
callq 0xca00
movq -0x18(%rbp), %rax
leaq -0x50(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl $0x2c, %esi
callq *%rax
movl $0x2c, -0x54(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movq -0x8(%rbp), %rcx
movzwl 0x4(%rcx), %ecx
cmpl %ecx, %eax
jge 0xce9e
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x58(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
addq $0x20, %rax
addq $0x8, %rax
movq %rax, -0x60(%rbp)
leaq -0x50(%rbp), %rdi
movq -0x60(%rbp), %rax
movl (%rax), %esi
callq 0xca00
leaq -0x50(%rbp), %rdi
addq $0x4, %rdi
movq -0x60(%rbp), %rax
movl 0x8(%rax), %esi
callq 0xca00
leaq -0x50(%rbp), %rdi
addq $0x8, %rdi
movq -0x60(%rbp), %rax
movl 0x10(%rax), %esi
callq 0xca00
leaq -0x50(%rbp), %rdi
addq $0xc, %rdi
movq -0x60(%rbp), %rax
movl 0xc(%rax), %esi
callq 0xca00
leaq -0x50(%rbp), %rdi
addq $0x10, %rdi
movq -0x60(%rbp), %rax
movl 0x4(%rax), %esi
callq 0xca00
movq -0x18(%rbp), %rax
leaq -0x50(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl $0x14, %esi
callq *%rax
movl -0x54(%rbp), %eax
addl $0x14, %eax
movl %eax, -0x54(%rbp)
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0xcde3
movl -0x54(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)