// File: /workspace/github_c_makefile_star2_O2/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, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
leaq 0x6b629(%rip), %rsi     # 0x74949
pushq $-0x1
popq %rdx
movq %rsp, %rcx
xorl %r8d, %r8d
callq 0x13571
movl %eax, %ebp
testl %eax, %eax
jne 0x9405
movq (%rsp), %rdi
pushq $0x1
popq %rsi
pushq $-0x1
popq %rcx
pushq $-0x1
popq %r8
movq %r13, %rdx
callq 0x1123b
testl %eax, %eax
jne 0x93fa
movq (%rsp), %rdi
pushq $0x2
popq %rsi
movq %r12, %rdx
callq 0x1111b
testl %eax, %eax
jne 0x93fa
movq (%rsp), %rdi
pushq $0x3
popq %rsi
movq %r15, %rdx
callq 0x1111b
testl %eax, %eax
jne 0x93fa
movq (%rsp), %rdi
pushq $0x4
popq %rsi
movq %r14, %rdx
callq 0x1111b
testl %eax, %eax
jne 0x93fa
movq (%rsp), %rdi
pushq $0x5
popq %rsi
movq %rbx, %rdx
callq 0x1111b
testl %eax, %eax
jne 0x93fa
movq 0x40(%rsp), %rdx
movq (%rsp), %rdi
pushq $0x6
popq %rsi
callq 0x1111b
testl %eax, %eax
jne 0x93fa
movq 0x48(%rsp), %rdx
movq (%rsp), %rdi
pushq $0x7
popq %rsi
callq 0x1111b
testl %eax, %eax
jne 0x93fa
movq 0x50(%rsp), %rdx
movq (%rsp), %rdi
pushq $0x8
popq %rsi
callq 0x1111b
testl %eax, %eax
jne 0x93fa
movq 0x58(%rsp), %rdx
movq (%rsp), %rdi
pushq $0x9
popq %rsi
callq 0x1111b
testl %eax, %eax
je 0x9416
movl %eax, %ebp
movq (%rsp), %rdi
callq 0xf24e
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rdi
callq 0xfe1e
xorl %ebp, %ebp
cmpl $0x65, %eax
cmovnel %eax, %ebp
jmp 0x93fc