// File: /workspace/github_c_makefile_star2_O3/jkbenaim[P]psfrag/db.c
// Function: DB_AddFrag
int DB_AddFrag(
	sqlite3 *db,
	char *pcode,
	int64_t addr,
	int64_t num,
	int64_t entrypoint,
	int64_t offset_code,
	int64_t offset_relocs,
	int64_t romsize,
	int64_t ramsize,
	int64_t vma
) {
	__label__ err_prepare, err_bind, err_step;
	int rc = SQLITE_OK;
	char *zErr = NULL;
	sqlite3_stmt *stmt;

	rc = sqlite3_prepare_v2(
		db,
		R"STATEMENT(
			insert
			into frags(
				pcode,
				addr,
				num,
				entrypoint,
				offset_code,
				offset_relocs,
				romsize,
				ramsize,
				vma
			)
			values(
				:pcode,
				:addr,
				:num,
				:entrypoint,
				:offset_code,
				:offset_relocs,
				:romsize,
				:ramsize,
				:vma
			);
		)STATEMENT",
		-1,
		&stmt,
		NULL
	);
	if (rc != SQLITE_OK) goto err_prepare;

	rc = sqlite3_bind_text(stmt, 1, pcode, -1, SQLITE_TRANSIENT);
	if (rc != SQLITE_OK) goto err_bind;

	rc = sqlite3_bind_int64(stmt, 2, addr);
	if (rc != SQLITE_OK) goto err_bind;

	rc = sqlite3_bind_int64(stmt, 3, num);
	if (rc != SQLITE_OK) goto err_bind;

	rc = sqlite3_bind_int64(stmt, 4, entrypoint);
	if (rc != SQLITE_OK) goto err_bind;

	rc = sqlite3_bind_int64(stmt, 5, offset_code);
	if (rc != SQLITE_OK) goto err_bind;

	rc = sqlite3_bind_int64(stmt, 6, offset_relocs);
	if (rc != SQLITE_OK) goto err_bind;

	rc = sqlite3_bind_int64(stmt, 7, romsize);
	if (rc != SQLITE_OK) goto err_bind;

	rc = sqlite3_bind_int64(stmt, 8, ramsize);
	if (rc != SQLITE_OK) goto err_bind;

	rc = sqlite3_bind_int64(stmt, 9, vma);
	if (rc != SQLITE_OK) goto err_bind;

	rc = sqlite3_step(stmt);
	if (rc != SQLITE_DONE) goto err_step;

	sqlite3_finalize(stmt);
	return SQLITE_OK;

err_step:
	if (!zErr) zErr = "error in step";
err_bind:
	if (!zErr) zErr = "error in bind";
	sqlite3_finalize(stmt);
err_prepare:
	if (!zErr) zErr = "error in prepare";

	if (!zErr) fprintf(stderr, "DB_AddFrag: %s\n", zErr);
	return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r14
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbp
leaq 0x7d4ed(%rip), %rsi     # 0x86949
movq %rsp, %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
callq 0x14dad
movl %eax, %ebx
testl %eax, %eax
jne 0x955e
movq (%rsp), %rdi
movl $0x1, %esi
movq %rbp, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq $-0x1, %r8
callq 0x1257a
testl %eax, %eax
jne 0x9553
movq (%rsp), %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x12444
testl %eax, %eax
jne 0x9553
movq (%rsp), %rdi
movl $0x3, %esi
movq %r12, %rdx
callq 0x12444
testl %eax, %eax
jne 0x9553
movq (%rsp), %rdi
movl $0x4, %esi
movq %r15, %rdx
callq 0x12444
testl %eax, %eax
jne 0x9553
movq (%rsp), %rdi
movl $0x5, %esi
movq %r14, %rdx
callq 0x12444
testl %eax, %eax
jne 0x9553
movq 0x40(%rsp), %rdx
movq (%rsp), %rdi
movl $0x6, %esi
callq 0x12444
testl %eax, %eax
jne 0x9553
movq 0x48(%rsp), %rdx
movq (%rsp), %rdi
movl $0x7, %esi
callq 0x12444
testl %eax, %eax
jne 0x9553
movq 0x50(%rsp), %rdx
movq (%rsp), %rdi
movl $0x8, %esi
callq 0x12444
testl %eax, %eax
jne 0x9553
movq 0x58(%rsp), %rdx
movq (%rsp), %rdi
movl $0x9, %esi
callq 0x12444
testl %eax, %eax
je 0x956f
movl %eax, %ebx
movq (%rsp), %rdi
callq 0x100a7
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rdi
callq 0x10dca
xorl %ebx, %ebx
cmpl $0x65, %eax
cmovnel %eax, %ebx
jmp 0x9555