// File: /workspace/github_c_makefile_star2_O2/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 $0x18, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, %r15
movq %rdi, %r12
leaq 0x4a821(%rip), %rsi     # 0xeb3f9
pushq $0x2a
popq %rdx
movl $0xf8, %edi
callq 0xccb0
movq %rax, %rbx
andq $0x0, (%rax)
leaq 0x8(%rax), %r14
movb $0x61, 0x8(%rax)
leaq 0x38(%rax), %rcx
movb $0x63, 0x38(%rax)
leaq 0x68(%rax), %rdx
movb $0x67, 0x68(%rax)
leaq 0x98(%rax), %rbp
movb $0x74, 0x98(%rax)
addq $0xc8, %rax
movb $0x6e, 0xc8(%rbx)
movq %r14, 0x10(%rbx)
movq %rcx, 0x18(%rbx)
movq %rdx, 0x20(%rbx)
movq %rbp, 0x28(%rbx)
movq %rax, 0x30(%rbx)
movq %rcx, 0x40(%rbx)
movq %r14, 0x48(%rbx)
movq %rbp, 0x50(%rbx)
movq %rdx, 0x58(%rbx)
movq %rax, 0x60(%rbx)
movq %rdx, 0x70(%rbx)
movq %rbp, 0x78(%rbx)
movq %r14, 0x80(%rbx)
movq %rcx, 0x88(%rbx)
movq %rax, 0x90(%rbx)
movq %rbp, 0xa0(%rbx)
movq %rdx, 0xa8(%rbx)
movq %rcx, 0xb0(%rbx)
movq %r14, 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 0xa0e67
testq %r15, %r15
je 0xa0e67
movq %rdx, 0x8(%rsp)
movq %rcx, (%rsp)
movq %r15, %rdi
callq 0x14461
testq %rax, %rax
jne 0xa0e95
movq %r12, %rdi
callq 0x143d2
movq %rax, %r13
movq %r12, %rdi
callq 0x14461
cmpq $0x0, (%rbx)
jne 0xa0ec3
movq %rax, %r12
movsbl (%r13), %edx
cmpb $0x41, %dl
je 0xa0d5e
movzbl %dl, %eax
cmpl $0x43, %eax
je 0xa0d4e
cmpl $0x47, %eax
je 0xa0d59
cmpl $0x54, %eax
je 0xa0d54
cmpl $0x61, %eax
je 0xa0d5e
movq %rbp, %r14
cmpl $0x74, %eax
je 0xa0d5e
movq 0x8(%rsp), %r14
cmpl $0x67, %eax
je 0xa0d5e
movq (%rsp), %r14
cmpl $0x63, %eax
je 0xa0d5e
leaq 0x4a7e4(%rip), %rsi     # 0xeb51d
movq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0xc007
pushq $-0x1
popq %r14
jmp 0xa0e0d
movq (%rsp), %r14
jmp 0xa0d5e
movq %rbp, %r14
jmp 0xa0d5e
movq 0x8(%rsp), %r14
movq %r14, (%rbx)
movsbl (%r14), %esi
movq %r15, %rdi
callq 0x140b1
pushq $0x1
popq %rbp
xorl %r14d, %r14d
testl %r14d, %r14d
jne 0xa0dfc
cmpq %r12, %rbp
jae 0xa0dfc
movq (%rbx), %rax
testq %rax, %rax
je 0xa0e31
movzbl (%r13,%rbp), %ecx
movsbl %cl, %edx
cmpq $0x35, %rcx
ja 0xa0de0
movabsq $0xf000000000000, %rsi  # imm = 0xF000000000000
btq %rcx, %rsi
jae 0xa0db6
addl $-0x30, %edx
movq 0x8(%rax,%rdx,8), %rax
jmp 0xa0dca
movabsq $0x30400000000000, %rsi # imm = 0x30400000000000
btq %rcx, %rsi
jae 0xa0de0
movq 0x28(%rax), %rax
movq %rax, (%rbx)
xorl %r14d, %r14d
movsbl (%rax), %esi
movq %r15, %rdi
callq 0x140b1
incq %rbp
jmp 0xa0d73
movq 0x10(%rsp), %rdi
leaq 0x4a79e(%rip), %rsi     # 0xeb58a
xorl %eax, %eax
callq 0xc007
movq (%rbx), %rax
pushq $-0x1
popq %r14
jmp 0xa0dd0
movq %r15, %rdi
callq 0x14461
cmpq %r12, %rax
jne 0xa0ef0
leaq 0x4a5e5(%rip), %rsi     # 0xeb3f9
pushq $0x50
popq %rdx
movq %rbx, %rdi
callq 0xd249
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8d180(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x29224(%rip), %rsi     # 0xca066
leaq 0x4a71e(%rip), %rdx     # 0xeb567
leaq 0x4a72b(%rip), %rcx     # 0xeb57b
leaq 0x4a5a2(%rip), %r8      # 0xeb3f9
pushq $0x77
popq %r9
xorl %eax, %eax
callq 0xb8c0
callq 0xb300
movq 0x8d14a(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x291ee(%rip), %rsi     # 0xca066
leaq 0x4a590(%rip), %rdx     # 0xeb40f
leaq 0x4a557(%rip), %rcx     # 0xeb3dd
leaq 0x4a56c(%rip), %r8      # 0xeb3f9
movl $0x99, %r9d
jmp 0xa0e5b
movq 0x8d11c(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x291c0(%rip), %rsi     # 0xca066
leaq 0x4a579(%rip), %rdx     # 0xeb426
leaq 0x4a529(%rip), %rcx     # 0xeb3dd
leaq 0x4a53e(%rip), %r8      # 0xeb3f9
movl $0x9a, %r9d
jmp 0xa0e5b
movq 0x8d0ee(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x29192(%rip), %rsi     # 0xca066
leaq 0x4a61e(%rip), %rdx     # 0xeb4f9
leaq 0x4a62b(%rip), %rcx     # 0xeb50d
leaq 0x4a510(%rip), %r8      # 0xeb3f9
pushq $0x57
jmp 0xa0e59
movq 0x8d0c1(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x29165(%rip), %rsi     # 0xca066
leaq 0x4a539(%rip), %rdx     # 0xeb441
leaq 0x4a4ce(%rip), %rcx     # 0xeb3dd
leaq 0x4a4e3(%rip), %r8      # 0xeb3f9
movl $0xa9, %r9d
jmp 0xa0e5b