// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/sfnt.c
// Function: otf_read_table
char *otf_read_table(OTF_FILE *otf,char *buf,const OTF_DIRENT *table) // {{{
{
  char *ours=NULL;

  if (table->length==0) {
    return buf;
  } else if ( (table->compLength<0)||(table->length<table->compLength) ) {
    assert(0);
    return NULL;
  }

  const int pad_len=otf_padded(table->length); // for checksum...
  if (!buf) {
    ours=buf=malloc(sizeof(char)*pad_len);
    if (!buf) {
      fprintf(stderr,"Bad alloc: %s\n", strerror(errno));
      return NULL;
    }
  }

  int res;
  if (table->compLength<table->length) {
    res=otf_read_compressed_raw(otf->f,buf,table->offset,pad_len,table->compLength);
  } else {
    res=otf_read_raw(otf->f,buf,table->offset,pad_len);
  }
  if (res==pad_len) {
    return buf;
  } else if (res==table->length) {
    // (file/uncompressed) length is not a multiple of 4, fill missing padding with zero
    memset(buf+res,0,pad_len-res);
    return buf;
  } else if (res!=-1) {
    fprintf(stderr,"Short read\n");
  }
  free(ours);
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movslq 0xc(%rdx), %r14
testq %r14, %r14
je 0x2c4a
movq %rdx, %r12
movslq 0x10(%rdx), %r13
cmpl %r13d, %r14d
jb 0x2d32
movq %rdi, %rbp
leaq 0x3(%r14), %r15
andq $-0x4, %r15
testq %rbx, %rbx
je 0x2b72
xorl %eax, %eax
jmp 0x2b86
movq %r15, %rdi
callq 0x21d0
movq %rax, %rbx
testq %rax, %rax
je 0x2ce0
movq %rax, 0x10(%rsp)
movq (%rbp), %rbp
movq %r12, (%rsp)
movl 0x8(%r12), %r12d
cmpl %r14d, %r13d
jae 0x2c03
movslq %r15d, %rax
movq %rax, 0x8(%rsp)
movq %r13, %rdi
callq 0x21d0
testq %rax, %rax
je 0x2c5c
movq %rax, %r14
movq %rbp, %rdi
movq %rax, %rsi
movq %r12, %rdx
movl %r13d, %ecx
callq 0x2d51
cmpl %r13d, %eax
jne 0x2c88
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %r12
movq %r14, %rdx
movq %r13, %rcx
callq 0x2080
testl %eax, %eax
movq (%rsp), %r14
jne 0x2cb4
movq %r12, %rdi
callq 0x21b0
movl 0x8(%rsp), %eax
jmp 0x2c18
movq %rbp, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movl %r15d, %ecx
callq 0x2d51
movq (%rsp), %r14
subl %eax, %r15d
je 0x2c4a
cmpl 0xc(%r14), %eax
jne 0x2c35
movslq %eax, %rdi
addq %rbx, %rdi
movslq %r15d, %rdx
xorl %esi, %esi
callq 0x20d0
jmp 0x2c4a
cmpl $-0x1, %eax
jne 0x2d11
movq 0x10(%rsp), %rdi
callq 0x21b0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xc37d(%rip), %rax      # 0xefe0
movq (%rax), %r12
callq 0x2040
movl (%rax), %edi
callq 0x2070
leaq 0x76e0(%rip), %rsi      # 0xa359
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21e0
jmp 0x2cac
movq 0xc351(%rip), %rax      # 0xefe0
movq (%rax), %rcx
leaq 0x76cf(%rip), %rdi      # 0xa368
pushq $0xb
popq %rsi
pushq $0x1
popq %rdx
callq 0x2280
movq %r14, %rdi
callq 0x21b0
pushq $-0x1
popq %rax
jmp 0x2c14
movq 0xc325(%rip), %rax      # 0xefe0
movq (%rax), %rcx
leaq 0x7a67(%rip), %rdi      # 0xa72c
pushq $0x15
popq %rsi
pushq $0x1
popq %rdx
callq 0x2280
movq %r12, %rdi
callq 0x21b0
pushq $-0x1
popq %rax
jmp 0x2c18
movq 0xc2f9(%rip), %rax      # 0xefe0
movq (%rax), %r14
callq 0x2040
movl (%rax), %edi
callq 0x2070
leaq 0x765c(%rip), %rsi      # 0xa359
xorl %ebx, %ebx
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21e0
jmp 0x2c4a
movq 0xc2c8(%rip), %rax      # 0xefe0
movq (%rax), %rcx
leaq 0x7646(%rip), %rdi      # 0xa368
pushq $0xb
popq %rsi
pushq $0x1
popq %rdx
callq 0x2280
jmp 0x2c3e
leaq 0x7f87(%rip), %rdi      # 0xacc0
leaq 0x7d0f(%rip), %rsi      # 0xaa4f
leaq 0x75d5(%rip), %rcx      # 0xa31c
movl $0x81, %edx
callq 0x20f0