// File: /workspace/github_c_makefile_star2_O2/jkbenaim[P]psfrag/psfrag.c
// Function: dump_frags
int dump_frags()
{
	__label__ out_return, out_finalize;
	int rc = SQLITE_OK;
	char *zErr = NULL;

	sqlite3_stmt *stmt;
	rc = sqlite3_prepare_v2(
		db,
		"select pcode,addr,num,entrypoint,offset_code,offset_relocs,romsize,ramsize,vma from frags order by num;",
		-1,
		&stmt,
		NULL
	);
	if (rc != SQLITE_OK) {
		zErr = "prepare";
		goto out_return;
	}

	printf("pcode,addr,num,entrypoint,offset_code,offset_relocs,romsize,ramsize,vma\n");

	while (SQLITE_DONE != (rc=sqlite3_step(stmt))) switch (rc) {
	case SQLITE_BUSY:
		break;
	case SQLITE_ERROR:
		zErr = "sqlite3_step returned SQLITE_ERROR";
		goto out_finalize;
		break;
	case SQLITE_MISUSE:
		zErr = "sqlite3_step returned SQLITE_MISUSE";
		goto out_finalize;
		break;
	default:
		zErr = "sqlite3_step returned some other error";
		goto out_finalize;
		break;
	case SQLITE_ROW:
		printf("%s,%" PRIuLEAST32 ",%" PRIuLEAST32 ",%" PRIuLEAST32 ",%" PRIuLEAST32 ",%" PRIuLEAST32 ",%" PRIuLEAST32 ",%" PRIuLEAST32 ",%" PRIuLEAST32 "\n",
			sqlite3_column_text(stmt, 0),
			(uint_least32_t)sqlite3_column_int64(stmt, 1),
			(uint_least32_t)sqlite3_column_int64(stmt, 2),
			(uint_least32_t)sqlite3_column_int64(stmt, 3),
			(uint_least32_t)sqlite3_column_int64(stmt, 4),
			(uint_least32_t)sqlite3_column_int64(stmt, 5),
			(uint_least32_t)sqlite3_column_int64(stmt, 6),
			(uint_least32_t)sqlite3_column_int64(stmt, 7),
			(uint_least32_t)sqlite3_column_int64(stmt, 8)
		);
		break;
	}

out_finalize:
	sqlite3_finalize(stmt);
out_return:
	if (zErr) {
		fprintf(stderr, "dump_frags: error: %s\n", zErr);
		return -1;
	} else
		return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x9642a(%rip), %rdi     # 0x9f208
leaq 0x6b48e(%rip), %rsi     # 0x74273
pushq $-0x1
popq %rdx
movq %rsp, %rcx
xorl %r8d, %r8d
callq 0x13571
testl %eax, %eax
jne 0x8f29
leaq 0x6ba5b(%rip), %rdi     # 0x7485d
callq 0x8090
movq (%rsp), %rdi
callq 0xfe1e
cmpl $0x5, %eax
je 0x8e07
cmpl $0x64, %eax
jne 0x8ed9
movq (%rsp), %rdi
xorl %esi, %esi
callq 0x10d19
movq %rax, 0x10(%rsp)
movq (%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x10cef
movq %rax, 0x8(%rsp)
movq (%rsp), %rdi
pushq $0x2
popq %rsi
callq 0x10cef
movq %rax, %rbx
movq (%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x10cef
movq %rax, %rbp
movq (%rsp), %rdi
pushq $0x4
popq %rsi
callq 0x10cef
movq %rax, %r15
movq (%rsp), %rdi
pushq $0x5
popq %rsi
callq 0x10cef
movq %rax, %r14
movq (%rsp), %rdi
pushq $0x6
popq %rsi
callq 0x10cef
movq %rax, %r12
movq (%rsp), %rdi
pushq $0x7
popq %rsi
callq 0x10cef
movq %rax, %r13
movq (%rsp), %rdi
pushq $0x8
popq %rsi
callq 0x10cef
movq %rax, %r10
leaq 0x6b49a(%rip), %rdi     # 0x74349
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
movl %ebx, %ecx
movl %ebp, %r8d
movl %r15d, %r9d
xorl %eax, %eax
pushq %r10
pushq %r13
pushq %r12
pushq %r14
callq 0x80e0
addq $0x20, %rsp
jmp 0x8e07
cmpl $0x1, %eax
je 0x8ef8
cmpl $0x15, %eax
je 0x8eef
cmpl $0x65, %eax
jne 0x8f01
movb $0x1, %bpl
xorl %ebx, %ebx
jmp 0x8f0a
leaq 0x6b408(%rip), %rbx     # 0x742fe
jmp 0x8f08
leaq 0x6b3dc(%rip), %rbx     # 0x742db
jmp 0x8f08
leaq 0x6b41a(%rip), %rbx     # 0x74322
xorl %ebp, %ebp
movq (%rsp), %rdi
callq 0xf24e
xorl %eax, %eax
testb %bpl, %bpl
je 0x8f30
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6bb54(%rip), %rbx     # 0x74a84
movq 0x940b9(%rip), %rax     # 0x9cff0
movq (%rax), %rdi
leaq 0x6b424(%rip), %rsi     # 0x74365
movq %rbx, %rdx
xorl %eax, %eax
callq 0x81b0
pushq $-0x1
popq %rax
jmp 0x8f1a