// File: /workspace/github_c_makefile_star2_O0/michaelnmmeyer[P]gourgandine/src/lib/utf8proc.c
// Function: utf8proc_decompose_char
UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, utf8proc_option_t options, int *last_boundclass) {
  const utf8proc_property_t *property;
  utf8proc_propval_t category;
  utf8proc_int32_t hangul_sindex;
  if (uc < 0 || uc >= 0x110000) return UTF8PROC_ERROR_NOTASSIGNED;
  property = unsafe_get_property(uc);
  category = property->category;
  hangul_sindex = uc - UTF8PROC_HANGUL_SBASE;
  if (options & (UTF8PROC_COMPOSE|UTF8PROC_DECOMPOSE)) {
    if (hangul_sindex >= 0 && hangul_sindex < UTF8PROC_HANGUL_SCOUNT) {
      utf8proc_int32_t hangul_tindex;
      if (bufsize >= 1) {
        dst[0] = UTF8PROC_HANGUL_LBASE +
          hangul_sindex / UTF8PROC_HANGUL_NCOUNT;
        if (bufsize >= 2) dst[1] = UTF8PROC_HANGUL_VBASE +
          (hangul_sindex % UTF8PROC_HANGUL_NCOUNT) / UTF8PROC_HANGUL_TCOUNT;
      }
      hangul_tindex = hangul_sindex % UTF8PROC_HANGUL_TCOUNT;
      if (!hangul_tindex) return 2;
      if (bufsize >= 3) dst[2] = UTF8PROC_HANGUL_TBASE + hangul_tindex;
      return 3;
    }
  }
  if (options & UTF8PROC_REJECTNA) {
    if (!category) return UTF8PROC_ERROR_NOTASSIGNED;
  }
  if (options & UTF8PROC_IGNORE) {
    if (property->ignorable) return 0;
  }
  if (options & UTF8PROC_LUMP) {
    if (category == UTF8PROC_CATEGORY_ZS) utf8proc_decompose_lump(0x0020);
    if (uc == 0x2018 || uc == 0x2019 || uc == 0x02BC || uc == 0x02C8)
      utf8proc_decompose_lump(0x0027);
    if (category == UTF8PROC_CATEGORY_PD || uc == 0x2212)
      utf8proc_decompose_lump(0x002D);
    if (uc == 0x2044 || uc == 0x2215) utf8proc_decompose_lump(0x002F);
    if (uc == 0x2236) utf8proc_decompose_lump(0x003A);
    if (uc == 0x2039 || uc == 0x2329 || uc == 0x3008)
      utf8proc_decompose_lump(0x003C);
    if (uc == 0x203A || uc == 0x232A || uc == 0x3009)
      utf8proc_decompose_lump(0x003E);
    if (uc == 0x2216) utf8proc_decompose_lump(0x005C);
    if (uc == 0x02C4 || uc == 0x02C6 || uc == 0x2038 || uc == 0x2303)
      utf8proc_decompose_lump(0x005E);
    if (category == UTF8PROC_CATEGORY_PC || uc == 0x02CD)
      utf8proc_decompose_lump(0x005F);
    if (uc == 0x02CB) utf8proc_decompose_lump(0x0060);
    if (uc == 0x2223) utf8proc_decompose_lump(0x007C);
    if (uc == 0x223C) utf8proc_decompose_lump(0x007E);
    if ((options & UTF8PROC_NLF2LS) && (options & UTF8PROC_NLF2PS)) {
      if (category == UTF8PROC_CATEGORY_ZL ||
          category == UTF8PROC_CATEGORY_ZP)
        utf8proc_decompose_lump(0x000A);
    }
  }
  if (options & UTF8PROC_STRIPMARK) {
    if (category == UTF8PROC_CATEGORY_MN ||
      category == UTF8PROC_CATEGORY_MC ||
      category == UTF8PROC_CATEGORY_ME) return 0;
  }
  if (options & UTF8PROC_CASEFOLD) {
    if (property->casefold_mapping != UINT16_MAX) {
      const utf8proc_int32_t *casefold_entry;
      utf8proc_ssize_t written = 0;
      for (casefold_entry = &utf8proc_sequences[property->casefold_mapping];
          *casefold_entry >= 0; casefold_entry++) {
        written += utf8proc_decompose_char(*casefold_entry, dst+written,
          (bufsize > written) ? (bufsize - written) : 0, options,
          last_boundclass);
        if (written < 0) return UTF8PROC_ERROR_OVERFLOW;
      }
      return written;
    }
  }
  if (options & (UTF8PROC_COMPOSE|UTF8PROC_DECOMPOSE)) {
    if (property->decomp_mapping != UINT16_MAX &&
        (!property->decomp_type || (options & UTF8PROC_COMPAT))) {
      const utf8proc_int32_t *decomp_entry;
      utf8proc_ssize_t written = 0;
      for (decomp_entry = &utf8proc_sequences[property->decomp_mapping];
          *decomp_entry >= 0; decomp_entry++) {
        written += utf8proc_decompose_char(*decomp_entry, dst+written,
          (bufsize > written) ? (bufsize - written) : 0, options,
        last_boundclass);
        if (written < 0) return UTF8PROC_ERROR_OVERFLOW;
      }
      return written;
    }
  }
  if (options & UTF8PROC_CHARBOUND) {
    utf8proc_bool boundary;
    int tbc = property->boundclass;
    boundary = grapheme_break(*last_boundclass, tbc);
    *last_boundclass = tbc;
    if (boundary) {
      if (bufsize >= 1) dst[0] = 0xFFFF;
      if (bufsize >= 2) dst[1] = uc;
      return 2;
    }
  }
  if (bufsize >= 1) *dst = uc;
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0xffcc
cmpl $0x110000, -0xc(%rbp)   # imm = 0x110000
jl 0xffd9
movq $-0x4, -0x8(%rbp)
jmp 0x10727
movl -0xc(%rbp), %edi
callq 0xfcc0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movw (%rax), %ax
movw %ax, -0x3a(%rbp)
movl -0xc(%rbp), %eax
subl $0xac00, %eax           # imm = 0xAC00
movl %eax, -0x40(%rbp)
movl -0x24(%rbp), %eax
andl $0x18, %eax
cmpl $0x0, %eax
je 0x100b5
cmpl $0x0, -0x40(%rbp)
jl 0x100b3
cmpl $0x2ba4, -0x40(%rbp)    # imm = 0x2BA4
jge 0x100b3
cmpq $0x1, -0x20(%rbp)
jl 0x1006e
movl -0x40(%rbp), %eax
movl $0x24c, %ecx            # imm = 0x24C
cltd
idivl %ecx
movl %eax, %ecx
addl $0x1100, %ecx           # imm = 0x1100
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x2, -0x20(%rbp)
jl 0x1006c
movl -0x40(%rbp), %eax
movl $0x24c, %ecx            # imm = 0x24C
cltd
idivl %ecx
movl %edx, %eax
movl $0x1c, %ecx
cltd
idivl %ecx
movl %eax, %ecx
addl $0x1161, %ecx           # imm = 0x1161
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x1006e
movl -0x40(%rbp), %eax
movl $0x1c, %ecx
cltd
idivl %ecx
movl %edx, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x1008f
movq $0x2, -0x8(%rbp)
jmp 0x10727
cmpq $0x3, -0x20(%rbp)
jl 0x100a6
movl -0x44(%rbp), %ecx
addl $0x11a7, %ecx           # imm = 0x11A7
movq -0x18(%rbp), %rax
movl %ecx, 0x8(%rax)
movq $0x3, -0x8(%rbp)
jmp 0x10727
jmp 0x100b5
movl -0x24(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x100d6
cmpw $0x0, -0x3a(%rbp)
jne 0x100d4
movq $-0x4, -0x8(%rbp)
jmp 0x10727
jmp 0x100d6
movl -0x24(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x10108
movq -0x38(%rbp), %rax
movw 0x20(%rax), %ax
shrw $0x2, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x10106
movq $0x0, -0x8(%rbp)
jmp 0x10727
jmp 0x10108
movl -0x24(%rbp), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0x10463
movswl -0x3a(%rbp), %eax
cmpl $0x17, %eax
jne 0x1014a
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movq -0x30(%rbp), %r8
movl $0x20, %edi
callq 0xffa0
movq %rax, -0x8(%rbp)
jmp 0x10727
cmpl $0x2018, -0xc(%rbp)     # imm = 0x2018
je 0x1016e
cmpl $0x2019, -0xc(%rbp)     # imm = 0x2019
je 0x1016e
cmpl $0x2bc, -0xc(%rbp)      # imm = 0x2BC
je 0x1016e
cmpl $0x2c8, -0xc(%rbp)      # imm = 0x2C8
jne 0x10196
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movq -0x30(%rbp), %r8
movl $0x27, %edi
callq 0xffa0
movq %rax, -0x8(%rbp)
jmp 0x10727
movswl -0x3a(%rbp), %eax
cmpl $0xd, %eax
je 0x101a8
cmpl $0x2212, -0xc(%rbp)     # imm = 0x2212
jne 0x101d0
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movq -0x30(%rbp), %r8
movl $0x2d, %edi
callq 0xffa0
movq %rax, -0x8(%rbp)
jmp 0x10727
cmpl $0x2044, -0xc(%rbp)     # imm = 0x2044
je 0x101e2
cmpl $0x2215, -0xc(%rbp)     # imm = 0x2215
jne 0x1020a
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movq -0x30(%rbp), %r8
movl $0x2f, %edi
callq 0xffa0
movq %rax, -0x8(%rbp)
jmp 0x10727
cmpl $0x2236, -0xc(%rbp)     # imm = 0x2236
jne 0x1023b
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movq -0x30(%rbp), %r8
movl $0x3a, %edi
callq 0xffa0
movq %rax, -0x8(%rbp)
jmp 0x10727
cmpl $0x2039, -0xc(%rbp)     # imm = 0x2039
je 0x10256
cmpl $0x2329, -0xc(%rbp)     # imm = 0x2329
je 0x10256
cmpl $0x3008, -0xc(%rbp)     # imm = 0x3008
jne 0x1027e
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movq -0x30(%rbp), %r8
movl $0x3c, %edi
callq 0xffa0
movq %rax, -0x8(%rbp)
jmp 0x10727
cmpl $0x203a, -0xc(%rbp)     # imm = 0x203A
je 0x10299
cmpl $0x232a, -0xc(%rbp)     # imm = 0x232A
je 0x10299
cmpl $0x3009, -0xc(%rbp)     # imm = 0x3009
jne 0x102c1
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movq -0x30(%rbp), %r8
movl $0x3e, %edi
callq 0xffa0
movq %rax, -0x8(%rbp)
jmp 0x10727
cmpl $0x2216, -0xc(%rbp)     # imm = 0x2216
jne 0x102f2
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movq -0x30(%rbp), %r8
movl $0x5c, %edi
callq 0xffa0
movq %rax, -0x8(%rbp)
jmp 0x10727
cmpl $0x2c4, -0xc(%rbp)      # imm = 0x2C4
je 0x10316
cmpl $0x2c6, -0xc(%rbp)      # imm = 0x2C6
je 0x10316
cmpl $0x2038, -0xc(%rbp)     # imm = 0x2038
je 0x10316
cmpl $0x2303, -0xc(%rbp)     # imm = 0x2303
jne 0x1033e
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movq -0x30(%rbp), %r8
movl $0x5e, %edi
callq 0xffa0
movq %rax, -0x8(%rbp)
jmp 0x10727
movswl -0x3a(%rbp), %eax
cmpl $0xc, %eax
je 0x10350
cmpl $0x2cd, -0xc(%rbp)      # imm = 0x2CD
jne 0x10378
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movq -0x30(%rbp), %r8
movl $0x5f, %edi
callq 0xffa0
movq %rax, -0x8(%rbp)
jmp 0x10727
cmpl $0x2cb, -0xc(%rbp)      # imm = 0x2CB
jne 0x103a9
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movq -0x30(%rbp), %r8
movl $0x60, %edi
callq 0xffa0
movq %rax, -0x8(%rbp)
jmp 0x10727
cmpl $0x2223, -0xc(%rbp)     # imm = 0x2223
jne 0x103da
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movq -0x30(%rbp), %r8
movl $0x7c, %edi
callq 0xffa0
movq %rax, -0x8(%rbp)
jmp 0x10727
cmpl $0x223c, -0xc(%rbp)     # imm = 0x223C
jne 0x1040b
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movq -0x30(%rbp), %r8
movl $0x7e, %edi
callq 0xffa0
movq %rax, -0x8(%rbp)
jmp 0x10727
movl -0x24(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x10461
movl -0x24(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x10461
movswl -0x3a(%rbp), %eax
cmpl $0x18, %eax
je 0x10437
movswl -0x3a(%rbp), %eax
cmpl $0x19, %eax
jne 0x1045f
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movq -0x30(%rbp), %r8
movl $0xa, %edi
callq 0xffa0
movq %rax, -0x8(%rbp)
jmp 0x10727
jmp 0x10461
jmp 0x10463
movl -0x24(%rbp), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x1049a
movswl -0x3a(%rbp), %eax
cmpl $0x6, %eax
je 0x1048b
movswl -0x3a(%rbp), %eax
cmpl $0x7, %eax
je 0x1048b
movswl -0x3a(%rbp), %eax
cmpl $0x8, %eax
jne 0x10498
movq $0x0, -0x8(%rbp)
jmp 0x10727
jmp 0x1049a
movl -0x24(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x10589
movq -0x38(%rbp), %rax
movzwl 0xa(%rax), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x10587
movq $0x0, -0x58(%rbp)
movq -0x38(%rbp), %rax
movzwl 0xa(%rax), %eax
movl %eax, %ecx
leaq 0x90af9(%rip), %rax     # 0xa0fd0
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpl $0x0, (%rax)
jl 0x1057a
movq -0x50(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x7c(%rbp)
movq -0x18(%rbp), %rax
movq -0x58(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x58(%rbp), %rax
jle 0x10526
movq -0x20(%rbp), %rax
subq -0x58(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x10531
xorl %eax, %eax
movq %rax, -0x88(%rbp)
jmp 0x10531
movq -0x78(%rbp), %rsi
movl -0x7c(%rbp), %edi
movq -0x88(%rbp), %rdx
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
callq 0xffa0
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jge 0x10567
movq $-0x2, -0x8(%rbp)
jmp 0x10727
jmp 0x10569
movq -0x50(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x50(%rbp)
jmp 0x104e2
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x10727
jmp 0x10589
movl -0x24(%rbp), %eax
andl $0x18, %eax
cmpl $0x0, %eax
je 0x1069c
movq -0x38(%rbp), %rax
movzwl 0x8(%rax), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x1069a
movq -0x38(%rbp), %rax
cmpw $0x0, 0x6(%rax)
je 0x105c5
movl -0x24(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1069a
movq $0x0, -0x68(%rbp)
movq -0x38(%rbp), %rax
movzwl 0x8(%rax), %eax
movl %eax, %ecx
leaq 0x909f2(%rip), %rax     # 0xa0fd0
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpl $0x0, (%rax)
jl 0x1068d
movq -0x60(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x94(%rbp)
movq -0x18(%rbp), %rax
movq -0x68(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x68(%rbp), %rax
jle 0x10633
movq -0x20(%rbp), %rax
subq -0x68(%rbp), %rax
movq %rax, -0xa0(%rbp)
jmp 0x1063e
xorl %eax, %eax
movq %rax, -0xa0(%rbp)
jmp 0x1063e
movq -0x90(%rbp), %rsi
movl -0x94(%rbp), %edi
movq -0xa0(%rbp), %rdx
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
callq 0xffa0
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
jge 0x1067a
movq $-0x2, -0x8(%rbp)
jmp 0x10727
jmp 0x1067c
movq -0x60(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x60(%rbp)
jmp 0x105e9
movq -0x68(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x10727
jmp 0x1069c
movl -0x24(%rbp), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x1070f
movq -0x38(%rbp), %rax
movw 0x20(%rax), %ax
shrw $0x4, %ax
andw $0xf, %ax
movzwl %ax, %eax
movl %eax, -0x70(%rbp)
movq -0x30(%rbp), %rax
movl (%rax), %edi
movl -0x70(%rbp), %esi
callq 0xfd60
andb $0x1, %al
movb %al, -0x69(%rbp)
movl -0x70(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
testb $0x1, -0x69(%rbp)
je 0x1070d
cmpq $0x1, -0x20(%rbp)
jl 0x106f2
movq -0x18(%rbp), %rax
movl $0xffff, (%rax)         # imm = 0xFFFF
cmpq $0x2, -0x20(%rbp)
jl 0x10703
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movq $0x2, -0x8(%rbp)
jmp 0x10727
jmp 0x1070f
cmpq $0x1, -0x20(%rbp)
jl 0x1071f
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq $0x1, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)