// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/core/colorspace.c
// Function: gt_colorspace_decode_string
int gt_colorspace_decode_string(GtStr *color_string, GtStr *result,
                                GtError *err)
{
  int had_err = 0;
  GtUword str_len, idx;
  char *input;
  GtColorSpaceDecoder *cd;

  cd = gt_colorspace_decoder_new();

  gt_assert(cd);
  gt_assert(color_string && result);
  gt_assert(gt_str_length(result) == 0);

  input = gt_str_get(color_string);
  str_len = gt_str_length(color_string);

  had_err = set_first_state(cd, input[0], err);
  if (!had_err)
  {
    gt_str_append_char(result, cd->current->self);

    for (idx = 1UL; !had_err && idx < str_len; idx++)
    {
      had_err = set_next_state(cd, input[idx], err);
      gt_str_append_char(result, cd->current->self);
    }
    gt_assert(gt_str_length(result) == str_len);
  }
  gt_colorspace_decoder_delete(cd);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, 0x20(%rsp)
movq %rsi, %r14
movq %rdi, %r12
leaq 0x4346d(%rip), %rsi     # 0x10217d
movl $0xf8, %edi
movl $0x2a, %edx
callq 0x35862
movq %rax, %rbx
movq $0x0, (%rax)
leaq 0x8(%rax), %rbp
movb $0x61, 0x8(%rax)
leaq 0x38(%rax), %rcx
movb $0x63, 0x38(%rax)
leaq 0x68(%rax), %r15
movb $0x67, 0x68(%rax)
leaq 0x98(%rax), %rdx
movb $0x74, 0x98(%rax)
leaq 0xc8(%rax), %rax
movb $0x6e, 0xc8(%rbx)
movq %rbp, 0x10(%rbx)
movq %rcx, 0x18(%rbx)
movq %r15, 0x20(%rbx)
movq %rdx, 0x28(%rbx)
movq %rax, 0x30(%rbx)
movq %rcx, 0x40(%rbx)
movq %rbp, 0x48(%rbx)
movq %rdx, 0x50(%rbx)
movq %r15, 0x58(%rbx)
movq %rax, 0x60(%rbx)
movq %r15, 0x70(%rbx)
movq %rdx, 0x78(%rbx)
movq %rbp, 0x80(%rbx)
movq %rcx, 0x88(%rbx)
movq %rax, 0x90(%rbx)
movq %rdx, 0xa0(%rbx)
movq %r15, 0xa8(%rbx)
movq %rcx, 0xb0(%rbx)
movq %rbp, 0xb8(%rbx)
movq %rax, 0xc0(%rbx)
movq %rax, 0xf0(%rbx)
movq %rax, 0xe8(%rbx)
movq %rax, 0xe0(%rbx)
movq %rax, 0xd8(%rbx)
movq %rax, 0xd0(%rbx)
testq %r12, %r12
je 0xbefad
testq %r14, %r14
je 0xbefad
movq %rdx, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
movq %r14, 0x8(%rsp)
movq %r14, %rdi
callq 0x3bb86
testq %rax, %rax
jne 0xbefb2
movq %r12, %rdi
callq 0x3bb5d
movq %rax, %r13
movq %r12, %rdi
callq 0x3bb86
cmpq $0x0, (%rbx)
jne 0xbefb7
movq %rax, %r12
movsbl (%r13), %edx
movzbl %dl, %eax
cmpl $0x60, %eax
jg 0xbee60
cmpl $0x46, %eax
jg 0xbee79
cmpl $0x41, %eax
je 0xbeea6
movq 0x18(%rsp), %rbp
cmpl $0x43, %eax
je 0xbeea6
jmp 0xbef8e
cmpl $0x66, %eax
jg 0xbee90
cmpl $0x61, %eax
je 0xbeea6
movq 0x18(%rsp), %rbp
cmpl $0x63, %eax
je 0xbeea6
jmp 0xbef8e
movq %r15, %rbp
cmpl $0x47, %eax
je 0xbeea6
movq 0x10(%rsp), %rbp
cmpl $0x54, %eax
je 0xbeea6
jmp 0xbef8e
movq %r15, %rbp
cmpl $0x67, %eax
je 0xbeea6
movq 0x10(%rsp), %rbp
cmpl $0x74, %eax
jne 0xbef8e
movq %rbp, (%rbx)
movsbl (%rbp), %esi
movq 0x8(%rsp), %rdi
callq 0x3b9df
xorl %ebp, %ebp
cmpq $0x2, %r12
jb 0xbef5a
movl $0x2, %r15d
movq (%rbx), %rax
testq %rax, %rax
je 0xbefa8
movzbl -0x1(%r13,%r15), %ecx
movsbl %cl, %edx
cmpq $0x35, %rcx
ja 0xbef3a
movabsq $0xf000000000000, %rsi  # imm = 0xF000000000000
btq %rcx, %rsi
jae 0xbeefe
addl $-0x30, %edx
movq 0x8(%rax,%rdx,8), %rax
jmp 0xbef12
movabsq $0x30400000000000, %rsi # imm = 0x30400000000000
btq %rcx, %rsi
jae 0xbef3a
movq 0x28(%rax), %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
movb $0x1, %r14b
movsbl (%rax), %esi
movq 0x8(%rsp), %rdi
callq 0x3b9df
testb %r14b, %r14b
je 0xbef5a
leaq 0x1(%r15), %rax
cmpq %r12, %r15
movq %rax, %r15
jb 0xbeec9
jmp 0xbef5a
xorl %r14d, %r14d
movq 0x20(%rsp), %rdi
leaq 0x433c5(%rip), %rsi     # 0x10230e
xorl %eax, %eax
callq 0x34f1f
movq (%rbx), %rax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xbef1a
movq 0x8(%rsp), %rdi
callq 0x3bb86
cmpq %r12, %rax
jne 0xbefbc
leaq 0x4320d(%rip), %rsi     # 0x10217d
movq %rbx, %rdi
movl $0x50, %edx
callq 0x35c27
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4330c(%rip), %rsi     # 0x1022a1
movq 0x20(%rsp), %rdi
xorl %eax, %eax
callq 0x34f1f
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xbef69
callq 0x298f0
callq 0x2980e
callq 0x29847
callq 0x29880
callq 0x298b7