// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/anno_db_gfflike.c
// Function: gt_feature_index_gfflike_save_chg
static int gt_feature_index_gfflike_save_chg(void *key, GT_UNUSED void *val,
                                             void *data, GtError *err)
{
  GtFeatureNode *fn = (GtFeatureNode*) key, *child;
  GtUword *id;
  ObserverCallbackInfo *oci = (ObserverCallbackInfo*) data;
  GFFlikeAttributeInfo ai;
  GtFeatureNodeIterator *fni;
  int had_err = 0, rval;

  id = node_ul_gt_hashmap_get(oci->fis->cache_node2id, fn);
  gt_assert(id);

  /* update main feature table */
  gt_rdb_stmt_reset(oci->fis->stmts[GT_PSTMT_FEATURE_UPDATE], err);
  gt_rdb_stmt_bind_double(oci->fis->stmts[GT_PSTMT_FEATURE_UPDATE], 0,
                          gt_feature_node_score_is_defined(fn) ?
                         gt_feature_node_get_score(fn) :
                         GT_UNDEF_DOUBLE, err);
  gt_rdb_stmt_bind_int(oci->fis->stmts[GT_PSTMT_FEATURE_UPDATE], 1,
                       gt_feature_node_get_strand(fn), err);
  gt_rdb_stmt_bind_int(oci->fis->stmts[GT_PSTMT_FEATURE_UPDATE], 2,
                       gt_feature_node_get_phase(fn), err);
  gt_rdb_stmt_bind_int(oci->fis->stmts[GT_PSTMT_FEATURE_UPDATE], 3, *id,
                       err);
  rval = gt_rdb_stmt_exec(oci->fis->stmts[GT_PSTMT_FEATURE_UPDATE], err);
  if (rval < 0)
    had_err = -1;

  if (!had_err) {
    /* resave attributes: remove first... */
    gt_rdb_stmt_reset(oci->fis->stmts[GT_PSTMT_NODE_DELETE_ATTRIB_FOR_NODE],
                      err);
    gt_rdb_stmt_bind_int(oci->fis->stmts[GT_PSTMT_NODE_DELETE_ATTRIB_FOR_NODE],
                         0, *id, err);
    rval = gt_rdb_stmt_exec(
                          oci->fis->stmts[GT_PSTMT_NODE_DELETE_ATTRIB_FOR_NODE],
                          err);
    if (rval < 0)
      had_err = -1;
  }

  if (!had_err) {
    /* then insert all attributes again */
    ai.fis = oci->fis;
    ai.id = *id;
    ai.err = err;
    gt_feature_node_foreach_attribute(fn, resave_each_attribute, &ai);
  }

  if (!had_err) {
    gt_rdb_stmt_reset(oci->fis->stmts[GT_PSTMT_NODE_DELETE_AS_PARENT], err);
    gt_rdb_stmt_bind_int(oci->fis->stmts[GT_PSTMT_NODE_DELETE_AS_PARENT],
                         0, *id, err);
    (void) gt_rdb_stmt_exec(oci->fis->stmts[GT_PSTMT_NODE_DELETE_AS_PARENT],
                            err);
    fni = gt_feature_node_iterator_new_direct(fn);
    while ((child = gt_feature_node_iterator_next(fni))) {
      GtUword *child_id;
      if ((child_id = node_ul_gt_hashmap_get(oci->fis->cache_node2id, child))) {
        gt_rdb_stmt_reset(oci->fis->stmts[GT_PSTMT_PARENT_INSERT], err);
        gt_rdb_stmt_bind_int(oci->fis->stmts[GT_PSTMT_PARENT_INSERT],
                             0, *child_id, err);
        gt_rdb_stmt_bind_int(oci->fis->stmts[GT_PSTMT_PARENT_INSERT],
                             1, *id, err);
        (void) gt_rdb_stmt_exec(oci->fis->stmts[GT_PSTMT_PARENT_INSERT],
                                err);
      }
    }
  }

  return (had_err >= 0) ? 0  : -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r12
movq 0x8(%rdx), %rax
movq 0x50(%rax), %rdi
leaq 0x10(%rsp), %rsi
movq %r12, (%rsi)
callq 0x1012ee
testq %rax, %rax
je 0x125635
movq %rax, %r15
movq 0x8(%r14), %rax
movq 0xa8(%rax), %rdi
movq %rbx, %rsi
callq 0x16bf19
movq 0x8(%r14), %rax
movq 0xa8(%rax), %r13
movq %r12, %rdi
callq 0x1429c8
testb %al, %al
je 0x12542c
movq %r12, %rdi
callq 0x142cc3
cvtss2sd %xmm0, %xmm0
jmp 0x125434
movsd 0x2228dc(%rip), %xmm0   # 0x347d10
movq %r13, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x16bf9d
movq 0x8(%r14), %rax
movq 0xa8(%rax), %r13
movq %r12, %rdi
callq 0x1424d6
movl $0x1, %esi
movq %r13, %rdi
movl %eax, %edx
movq %rbx, %rcx
callq 0x16bf3a
movq 0x8(%r14), %rax
movq 0xa8(%rax), %r13
movq %r12, %rdi
callq 0x142d3a
movl $0x2, %esi
movq %r13, %rdi
movl %eax, %edx
movq %rbx, %rcx
callq 0x16bf3a
movq 0x8(%r14), %rax
movq 0xa8(%rax), %rdi
movl 0x8(%r15), %edx
movl $0x3, %esi
movq %rbx, %rcx
callq 0x16bf3a
movq 0x8(%r14), %rax
movq 0xa8(%rax), %rdi
movq %rbx, %rsi
callq 0x16bfbe
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x125624
movq 0x8(%r14), %rax
movq 0x150(%rax), %rdi
movq %rbx, %rsi
callq 0x16bf19
movq 0x8(%r14), %rax
movq 0x150(%rax), %rdi
movl 0x8(%r15), %edx
xorl %esi, %esi
movq %rbx, %rcx
callq 0x16bf3a
movq 0x8(%r14), %rax
movq 0x150(%rax), %rdi
movq %rbx, %rsi
callq 0x16bfbe
testl %eax, %eax
js 0x125624
movq 0x8(%r14), %rax
leaq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq 0x8(%r15), %rax
movq %rax, 0x8(%rdx)
movq %rbx, 0x10(%rdx)
leaq 0x10d(%rip), %rsi       # 0x12563a
movq %r12, %rdi
callq 0x1433d2
movq 0x8(%r14), %rax
movq 0x120(%rax), %rdi
movq %rbx, %rsi
callq 0x16bf19
movq 0x8(%r14), %rax
movq 0x120(%rax), %rdi
movl 0x8(%r15), %edx
xorl %esi, %esi
movq %rbx, %rcx
callq 0x16bf3a
movq 0x8(%r14), %rax
movq 0x120(%rax), %rdi
movq %rbx, %rsi
callq 0x16bfbe
movq %r12, %rdi
callq 0x144041
movq %rax, %r12
movq %rax, %rdi
callq 0x1440ea
movl $0x0, %ebp
testq %rax, %rax
je 0x125624
leaq 0x8(%rsp), %r13
movq 0x8(%r14), %rcx
movq 0x50(%rcx), %rdi
movq %rax, 0x8(%rsp)
movq %r13, %rsi
callq 0x1012ee
testq %rax, %rax
je 0x125611
movq %rax, %rbp
movq 0x8(%r14), %rax
movq 0x80(%rax), %rdi
movq %rbx, %rsi
callq 0x16bf19
movq 0x8(%r14), %rax
movq 0x80(%rax), %rdi
movl 0x8(%rbp), %edx
xorl %esi, %esi
movq %rbx, %rcx
callq 0x16bf3a
movq 0x8(%r14), %rax
movq 0x80(%rax), %rdi
movl 0x8(%r15), %edx
movl $0x1, %esi
movq %rbx, %rcx
callq 0x16bf3a
movq 0x8(%r14), %rax
movq 0x80(%rax), %rdi
movq %rbx, %rsi
callq 0x16bfbe
movq %r12, %rdi
callq 0x1440ea
testq %rax, %rax
jne 0x12559a
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3ae19