// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/expat-2.0.1/lib/xmltok.c
// Function: XmlInitUnknownEncoding
ENCODING *
XmlInitUnknownEncoding(void *mem,
                       int *table,
                       CONVERTER convert, 
                       void *userData)
{
  int i;
  struct unknown_encoding *e = (struct unknown_encoding *)mem;
  for (i = 0; i < (int)sizeof(struct normal_encoding); i++)
    ((char *)mem)[i] = ((char *)&latin1_encoding)[i];
  for (i = 0; i < 128; i++)
    if (latin1_encoding.type[i] != BT_OTHER
        && latin1_encoding.type[i] != BT_NONXML
        && table[i] != i)
      return 0;
  for (i = 0; i < 256; i++) {
    int c = table[i];
    if (c == -1) {
      e->normal.type[i] = BT_MALFORM;
      /* This shouldn't really get used. */
      e->utf16[i] = 0xFFFF;
      e->utf8[i][0] = 1;
      e->utf8[i][1] = 0;
    }
    else if (c < 0) {
      if (c < -4)
        return 0;
      e->normal.type[i] = (unsigned char)(BT_LEAD2 - (c + 2));
      e->utf8[i][0] = 0;
      e->utf16[i] = 0;
    }
    else if (c < 0x80) {
      if (latin1_encoding.type[c] != BT_OTHER
          && latin1_encoding.type[c] != BT_NONXML
          && c != i)
        return 0;
      e->normal.type[i] = latin1_encoding.type[c];
      e->utf8[i][0] = 1;
      e->utf8[i][1] = (char)c;
      e->utf16[i] = (unsigned short)(c == 0 ? 0xFFFF : c);
    }
    else if (checkCharRefNumber(c) < 0) {
      e->normal.type[i] = BT_NONXML;
      /* This shouldn't really get used. */
      e->utf16[i] = 0xFFFF;
      e->utf8[i][0] = 1;
      e->utf8[i][1] = 0;
    }
    else {
      if (c > 0xFFFF)
        return 0;
      if (UCS2_GET_NAMING(nmstrtPages, c >> 8, c & 0xff))
        e->normal.type[i] = BT_NMSTRT;
      else if (UCS2_GET_NAMING(namePages, c >> 8, c & 0xff))
        e->normal.type[i] = BT_NAME;
      else
        e->normal.type[i] = BT_OTHER;
      e->utf8[i][0] = (char)XmlUtf8Encode(c, e->utf8[i] + 1);
      e->utf16[i] = (unsigned short)c;
    }
  }
  e->userData = userData;
  e->convert = convert;
  if (convert) {
    e->normal.isName2 = unknown_isName;
    e->normal.isName3 = unknown_isName;
    e->normal.isName4 = unknown_isName;
    e->normal.isNmstrt2 = unknown_isNmstrt;
    e->normal.isNmstrt3 = unknown_isNmstrt;
    e->normal.isNmstrt4 = unknown_isNmstrt;
    e->normal.isInvalid2 = unknown_isInvalid;
    e->normal.isInvalid3 = unknown_isInvalid;
    e->normal.isInvalid4 = unknown_isInvalid;
  }
  e->normal.enc.utf8Convert = unknown_toUtf8;
  e->normal.enc.utf16Convert = unknown_toUtf16;
  return &(e->normal.enc);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movl $0x0, 0x1c(%rsp)
cmpl $0x1d0, 0x1c(%rsp)      # imm = 0x1D0
jge 0x383dad
movslq 0x1c(%rsp), %rcx
leaq 0x2b4570(%rip), %rax    # 0x638300
movb (%rax,%rcx), %dl
movq 0x38(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x383d7a
movl $0x0, 0x1c(%rsp)
cmpl $0x80, 0x1c(%rsp)
jge 0x383e21
movslq 0x1c(%rsp), %rcx
leaq 0x2b4535(%rip), %rax    # 0x638300
movzbl 0x88(%rax,%rcx), %eax
cmpl $0x1c, %eax
je 0x383e12
movslq 0x1c(%rsp), %rcx
leaq 0x2b451c(%rip), %rax    # 0x638300
movzbl 0x88(%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x383e12
movq 0x30(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
cmpl 0x1c(%rsp), %eax
je 0x383e12
movq $0x0, 0x40(%rsp)
jmp 0x3842a2
jmp 0x383e14
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x383db5
movl $0x0, 0x1c(%rsp)
cmpl $0x100, 0x1c(%rsp)      # imm = 0x100
jge 0x38419f
movq 0x30(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0xc(%rsp)
cmpl $-0x1, 0xc(%rsp)
jne 0x383e9e
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb $0x1, 0x88(%rax,%rcx)
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movw $0xffff, 0x1e0(%rax,%rcx,2) # imm = 0xFFFF
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb $0x1, 0x3e0(%rax,%rcx,4)
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb $0x0, 0x3e1(%rax,%rcx,4)
jmp 0x38418d
cmpl $0x0, 0xc(%rsp)
jge 0x383f06
cmpl $-0x4, 0xc(%rsp)
jge 0x383eba
movq $0x0, 0x40(%rsp)
jmp 0x3842a2
movl 0xc(%rsp), %ecx
addl $0x2, %ecx
movl $0x5, %eax
subl %ecx, %eax
movb %al, %dl
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb %dl, 0x88(%rax,%rcx)
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb $0x0, 0x3e0(%rax,%rcx,4)
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movw $0x0, 0x1e0(%rax,%rcx,2)
jmp 0x38418b
cmpl $0x80, 0xc(%rsp)
jge 0x383fe3
movslq 0xc(%rsp), %rcx
leaq 0x2b43e0(%rip), %rax    # 0x638300
movzbl 0x88(%rax,%rcx), %eax
cmpl $0x1c, %eax
je 0x383f5e
movslq 0xc(%rsp), %rcx
leaq 0x2b43c7(%rip), %rax    # 0x638300
movzbl 0x88(%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x383f5e
movl 0xc(%rsp), %eax
cmpl 0x1c(%rsp), %eax
je 0x383f5e
movq $0x0, 0x40(%rsp)
jmp 0x3842a2
movslq 0xc(%rsp), %rcx
leaq 0x2b4396(%rip), %rax    # 0x638300
movb 0x88(%rax,%rcx), %dl
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb %dl, 0x88(%rax,%rcx)
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb $0x1, 0x3e0(%rax,%rcx,4)
movl 0xc(%rsp), %eax
movb %al, %dl
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb %dl, 0x3e1(%rax,%rcx,4)
cmpl $0x0, 0xc(%rsp)
jne 0x383fbd
movl $0xffff, %eax           # imm = 0xFFFF
movl %eax, 0x8(%rsp)
jmp 0x383fc5
movl 0xc(%rsp), %eax
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
movw %ax, %dx
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movw %dx, 0x1e0(%rax,%rcx,2)
jmp 0x384189
movl 0xc(%rsp), %edi
callq 0x3842b0
cmpl $0x0, %eax
jge 0x384040
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb $0x0, 0x88(%rax,%rcx)
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movw $0xffff, 0x1e0(%rax,%rcx,2) # imm = 0xFFFF
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb $0x1, 0x3e0(%rax,%rcx,4)
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb $0x0, 0x3e1(%rax,%rcx,4)
jmp 0x384187
cmpl $0xffff, 0xc(%rsp)      # imm = 0xFFFF
jle 0x384058
movq $0x0, 0x40(%rsp)
jmp 0x3842a2
movl 0xc(%rsp), %eax
sarl $0x8, %eax
movslq %eax, %rcx
leaq 0x21d807(%rip), %rax    # 0x5a1870
movzbl (%rax,%rcx), %eax
shll $0x3, %eax
movl 0xc(%rsp), %ecx
andl $0xff, %ecx
sarl $0x5, %ecx
addl %ecx, %eax
movslq %eax, %rcx
leaq 0x21d2d7(%rip), %rax    # 0x5a1360
movl (%rax,%rcx,4), %eax
movl 0xc(%rsp), %ecx
andl $0xff, %ecx
andl $0x1f, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x3840bd
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb $0x16, 0x88(%rax,%rcx)
jmp 0x384136
movl 0xc(%rsp), %eax
sarl $0x8, %eax
movslq %eax, %rcx
leaq 0x21d8a2(%rip), %rax    # 0x5a1970
movzbl (%rax,%rcx), %eax
shll $0x3, %eax
movl 0xc(%rsp), %ecx
andl $0xff, %ecx
sarl $0x5, %ecx
addl %ecx, %eax
movslq %eax, %rcx
leaq 0x21d272(%rip), %rax    # 0x5a1360
movl (%rax,%rcx,4), %eax
movl 0xc(%rsp), %ecx
andl $0xff, %ecx
andl $0x1f, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x384122
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb $0x1a, 0x88(%rax,%rcx)
jmp 0x384134
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb $0x1c, 0x88(%rax,%rcx)
jmp 0x384136
movl 0xc(%rsp), %edi
movq 0x10(%rsp), %rsi
addq $0x3e0, %rsi            # imm = 0x3E0
movslq 0x1c(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rsi
addq $0x1, %rsi
callq 0x383b40
movb %al, %dl
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movb %dl, 0x3e0(%rax,%rcx,4)
movl 0xc(%rsp), %eax
movw %ax, %dx
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movw %dx, 0x1e0(%rax,%rcx,2)
jmp 0x384189
jmp 0x38418b
jmp 0x38418d
jmp 0x38418f
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x383e29
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x1d8(%rax)
movq 0x28(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x1d0(%rax)
cmpq $0x0, 0x28(%rsp)
je 0x384278
movq 0x10(%rsp), %rax
leaq 0x167(%rip), %rcx       # 0x384340
movq %rcx, 0x188(%rax)
movq 0x10(%rsp), %rax
leaq 0x154(%rip), %rcx       # 0x384340
movq %rcx, 0x190(%rax)
movq 0x10(%rsp), %rax
leaq 0x141(%rip), %rcx       # 0x384340
movq %rcx, 0x198(%rax)
movq 0x10(%rsp), %rax
leaq 0x1de(%rip), %rcx       # 0x3843f0
movq %rcx, 0x1a0(%rax)
movq 0x10(%rsp), %rax
leaq 0x1cb(%rip), %rcx       # 0x3843f0
movq %rcx, 0x1a8(%rax)
movq 0x10(%rsp), %rax
leaq 0x1b8(%rip), %rcx       # 0x3843f0
movq %rcx, 0x1b0(%rax)
movq 0x10(%rsp), %rax
leaq 0x255(%rip), %rcx       # 0x3844a0
movq %rcx, 0x1b8(%rax)
movq 0x10(%rsp), %rax
leaq 0x242(%rip), %rcx       # 0x3844a0
movq %rcx, 0x1c0(%rax)
movq 0x10(%rsp), %rax
leaq 0x22f(%rip), %rcx       # 0x3844a0
movq %rcx, 0x1c8(%rax)
movq 0x10(%rsp), %rax
leaq 0x29c(%rip), %rcx       # 0x384520
movq %rcx, 0x70(%rax)
movq 0x10(%rsp), %rax
leaq 0x40c(%rip), %rcx       # 0x3846a0
movq %rcx, 0x78(%rax)
movq 0x10(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopl (%rax)