// File: /workspace/github_c_makefile_star2_O2/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 $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r12
movq 0x8(%rdx), %rax
movq 0x50(%rax), %rdi
movq %r12, %rsi
callq 0xb9ac3
testq %rax, %rax
je 0xba3aa
movq %rax, %r15
movq 0x8(%r14), %rax
movq 0xa8(%rax), %rdi
movq %rbx, %rsi
callq 0x10d4e4
movq 0x8(%r14), %rax
movq 0xa8(%rax), %r13
movq %r12, %rdi
callq 0xda3de
testb %al, %al
je 0xba1cd
movq %r12, %rdi
callq 0xdaa3e
cvtss2sd %xmm0, %xmm0
jmp 0xba1d5
movsd 0x22db3b(%rip), %xmm0   # 0x2e7d10
movq %r13, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x10d634
movq 0x8(%r14), %rax
movq 0xa8(%rax), %r13
movq %r12, %rdi
callq 0xd9d99
pushq $0x1
popq %rsi
movq %r13, %rdi
movl %eax, %edx
movq %rbx, %rcx
callq 0x10d538
movq 0x8(%r14), %rax
movq 0xa8(%rax), %r13
movq %r12, %rdi
callq 0xdaba0
pushq $0x2
popq %rsi
movq %r13, %rdi
movl %eax, %edx
movq %rbx, %rcx
callq 0x10d538
movq 0x8(%r14), %rax
movq 0xa8(%rax), %rdi
movl (%r15), %edx
pushq $0x3
popq %rsi
movq %rbx, %rcx
callq 0x10d538
movq 0x8(%r14), %rax
movq 0xa8(%rax), %rdi
movq %rbx, %rsi
callq 0x10d688
pushq $-0x1
popq %r13
testl %eax, %eax
js 0xba398
movq 0x8(%r14), %rax
movq 0x150(%rax), %rdi
movq %rbx, %rsi
callq 0x10d4e4
movq 0x8(%r14), %rax
movq 0x150(%rax), %rdi
movl (%r15), %edx
xorl %esi, %esi
movq %rbx, %rcx
callq 0x10d538
movq 0x8(%r14), %rax
movq 0x150(%rax), %rdi
movq %rbx, %rsi
callq 0x10d688
testl %eax, %eax
js 0xba398
movq 0x8(%r14), %rax
movq %rsp, %rdx
movq %rax, (%rdx)
movq (%r15), %rax
movq %rax, 0x8(%rdx)
movq %rbx, 0x10(%rdx)
leaq 0x120(%rip), %rsi       # 0xba3e2
movq %r12, %rdi
callq 0xdb5d7
movq 0x8(%r14), %rax
movq 0x120(%rax), %rdi
movq %rbx, %rsi
callq 0x10d4e4
movq 0x8(%r14), %rax
movq 0x120(%rax), %rdi
movl (%r15), %edx
xorl %esi, %esi
movq %rbx, %rcx
callq 0x10d538
movq 0x8(%r14), %rax
movq 0x120(%rax), %rdi
movq %rbx, %rsi
callq 0x10d688
movq %r12, %rdi
callq 0xdc826
movq %rax, %r12
pushq $0x1
popq %rbp
movq %r12, %rdi
callq 0xdc92e
testq %rax, %rax
je 0xba395
movq 0x8(%r14), %rcx
movq 0x50(%rcx), %rdi
movq %rax, %rsi
callq 0xb9ac3
testq %rax, %rax
je 0xba316
movq %rax, %r13
movq 0x8(%r14), %rax
movq 0x80(%rax), %rdi
movq %rbx, %rsi
callq 0x10d4e4
movq 0x8(%r14), %rax
movq 0x80(%rax), %rdi
movl (%r13), %edx
xorl %esi, %esi
movq %rbx, %rcx
callq 0x10d538
movq 0x8(%r14), %rax
movq 0x80(%rax), %rdi
movl (%r15), %edx
movq %rbp, %rsi
movq %rbx, %rcx
callq 0x10d538
movq 0x8(%r14), %rax
movq 0x80(%rax), %rdi
movq %rbx, %rsi
callq 0x10d688
jmp 0xba316
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x37dbb7(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x22ac58(%rip), %rsi    # 0x2e5013
leaq 0x2c5243(%rip), %rdx    # 0x37f605
leaq 0x25c3d9(%rip), %rcx    # 0x3167a2
leaq 0x25b146(%rip), %r8     # 0x315516
movl $0x49e, %r9d            # imm = 0x49E
xorl %eax, %eax
callq 0x17a50
callq 0x17390