// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xacd2d(%rip), %rsi     # 0xb6927
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x50(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x18820
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x9c1b
jmp 0x9d93
movq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x1, %esi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq $-0x1, %r8
callq 0x154c0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x9c47
jmp 0x9d78
movq -0x50(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl $0x2, %esi
callq 0x15360
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x9c67
jmp 0x9d78
movq -0x50(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl $0x3, %esi
callq 0x15360
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x9c87
jmp 0x9d78
movq -0x50(%rbp), %rdi
movq -0x30(%rbp), %rdx
movl $0x4, %esi
callq 0x15360
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x9ca7
jmp 0x9d78
movq -0x50(%rbp), %rdi
movq -0x38(%rbp), %rdx
movl $0x5, %esi
callq 0x15360
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x9cc7
jmp 0x9d78
movq -0x50(%rbp), %rdi
movq 0x10(%rbp), %rdx
movl $0x6, %esi
callq 0x15360
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x9ce7
jmp 0x9d78
movq -0x50(%rbp), %rdi
movq 0x18(%rbp), %rdx
movl $0x7, %esi
callq 0x15360
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x9d04
jmp 0x9d78
movq -0x50(%rbp), %rdi
movq 0x20(%rbp), %rdx
movl $0x8, %esi
callq 0x15360
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x9d21
jmp 0x9d78
movq -0x50(%rbp), %rdi
movq 0x28(%rbp), %rdx
movl $0x9, %esi
callq 0x15360
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x9d3e
jmp 0x9d78
movq -0x50(%rbp), %rdi
callq 0x14020
movl %eax, -0x3c(%rbp)
cmpl $0x65, -0x3c(%rbp)
je 0x9d52
jmp 0x9d64
movq -0x50(%rbp), %rdi
callq 0x12580
movl $0x0, -0x4(%rbp)
jmp 0x9dce
cmpq $0x0, -0x48(%rbp)
jne 0x9d76
leaq 0xaccd9(%rip), %rax     # 0xb6a4b
movq %rax, -0x48(%rbp)
jmp 0x9d78
cmpq $0x0, -0x48(%rbp)
jne 0x9d8a
leaq 0xacaa9(%rip), %rax     # 0xb682f
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rdi
callq 0x12580
cmpq $0x0, -0x48(%rbp)
jne 0x9da5
leaq 0xaccb8(%rip), %rax     # 0xb6a59
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x9dc8
movq 0xd123d(%rip), %rax     # 0xdaff0
movq (%rax), %rdi
movq -0x48(%rbp), %rdx
leaq 0xacca9(%rip), %rsi     # 0xb6a6a
movb $0x0, %al
callq 0x81b0
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)