// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movl $0x0, 0x2c(%rsp)
callq 0x111d80
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x111ba5
movq 0xa2464(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x4c4e8(%rip), %rsi     # 0x15e066
leaq 0x7332b(%rip), %rdx     # 0x184eb0
leaq 0x73327(%rip), %rcx     # 0x184eb3
leaq 0x7333c(%rip), %r8      # 0x184ecf
movl $0x98, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x111ba7
jmp 0x111ba9
cmpq $0x0, 0x40(%rsp)
je 0x111bb9
cmpq $0x0, 0x38(%rsp)
jne 0x111bf1
movq 0xa2418(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x4c49c(%rip), %rsi     # 0x15e066
leaq 0x73314(%rip), %rdx     # 0x184ee5
leaq 0x732db(%rip), %rcx     # 0x184eb3
leaq 0x732f0(%rip), %r8      # 0x184ecf
movl $0x99, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x111bf3
jmp 0x111bf5
movq 0x38(%rsp), %rdi
callq 0x19a00
cmpq $0x0, %rax
je 0x111c3d
movq 0xa23cc(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x4c450(%rip), %rsi     # 0x15e066
leaq 0x732df(%rip), %rdx     # 0x184efc
leaq 0x7328f(%rip), %rcx     # 0x184eb3
leaq 0x732a4(%rip), %r8      # 0x184ecf
movl $0x9a, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x111c3f
movq 0x40(%rsp), %rdi
callq 0x19940
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rdi
callq 0x19a00
movq %rax, 0x20(%rsp)
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rax
movb (%rax), %al
movq 0x30(%rsp), %rdx
movsbl %al, %esi
callq 0x111f90
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x2c(%rsp)
jne 0x111d62
movq 0x38(%rsp), %rdi
movq 0x8(%rsp), %rax
movq (%rax), %rax
movsbl (%rax), %esi
callq 0x194d0
movq $0x1, 0x18(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x2c(%rsp)
movb %al, 0x7(%rsp)
jne 0x111cc1
movq 0x18(%rsp), %rax
cmpq 0x20(%rsp), %rax
setb %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x111ccb
jmp 0x111d13
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movb (%rax,%rcx), %al
movq 0x30(%rsp), %rdx
movsbl %al, %esi
callq 0x1120a0
movl %eax, 0x2c(%rsp)
movq 0x38(%rsp), %rdi
movq 0x8(%rsp), %rax
movq (%rax), %rax
movsbl (%rax), %esi
callq 0x194d0
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x111ca3
jmp 0x111d15
movq 0x38(%rsp), %rdi
callq 0x19a00
cmpq 0x20(%rsp), %rax
je 0x111d5e
movq 0xa22ab(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x4c32f(%rip), %rsi     # 0x15e066
leaq 0x731d9(%rip), %rdx     # 0x184f17
leaq 0x7316e(%rip), %rcx     # 0x184eb3
leaq 0x73183(%rip), %r8      # 0x184ecf
movl $0xa9, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x111d60
jmp 0x111d62
movq 0x8(%rsp), %rdi
callq 0x112190
movl 0x2c(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)