// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/semind.c
// Function: search_query_callback
static int search_query_callback(void *data, int argc, char **argv, char **colname)
{
	char *fmt = (char *) semind_search_format;
	char buf[32];
	int quote = 0;
	int n = 0;

	while (*fmt != '\0') {
		char c = *fmt;

		if (quote) {
			quote = 0;
			switch (c) {
				case 't': c = '\t'; break;
				case 'r': c = '\r'; break;
				case 'n': c = '\n'; break;
			}
		} else if (c == '%') {
			int colnum = 0;
			char *pos = ++fmt;

			c = *fmt;

			if (c == '\0')
				semind_error(1, 0, "unexpected end of format string");

			switch (c) {
				case 'f': colnum = 0; goto print_string;
				case 'l': colnum = 1; goto print_string;
				case 'c': colnum = 2; goto print_string;
				case 'C': colnum = 3; goto print_string;
				case 'n': colnum = 4; goto print_string;
				case 'm':
					if (n) {
						printf("%.*s", n, buf);
						n = 0;
					}
					print_mode(argv[5]);
					fmt++;
					break;
				case 'k':
					if (n) {
						printf("%.*s", n, buf);
						n = 0;
					}
					printf("%c", atoi(argv[6]));
					fmt++;
					break;
				case 's':
					if (n) {
						printf("%.*s", n, buf);
						n = 0;
					}
					print_file_line(argv[0], atoi(argv[1]));
					fmt++;
					break;

				print_string:
					if (n) {
						printf("%.*s", n, buf);
						n = 0;
					}
					printf("%s", argv[colnum]);
					fmt++;
					break;
				default:
					break;

			}

			if (pos == fmt)
				semind_error(1, 0, "invalid format specification: %%%c", c);

			continue;
		} else if (c == '\\') {
			quote = 1;
			fmt++;
			continue;
		}

		if (n == sizeof(buf)) {
			printf("%.*s", n, buf);
			n = 0;
		}

		buf[n++] = c;
		fmt++;
	}

	if (n)
		printf("%.*s", n, buf);
	printf("\n");

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq 0x77d97(%rip), %rax     # 0x8c2f8
movq %rax, -0x28(%rbp)
movl $0x0, -0x54(%rbp)
movl $0x0, -0x58(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x14848
movq -0x28(%rbp), %rax
movb (%rax), %al
movb %al, -0x59(%rbp)
cmpl $0x0, -0x54(%rbp)
je 0x145d0
movl $0x0, -0x54(%rbp)
movsbl -0x59(%rbp), %eax
movl %eax, -0x6c(%rbp)
subl $0x6e, %eax
je 0x145c7
jmp 0x145a7
movl -0x6c(%rbp), %eax
subl $0x72, %eax
je 0x145c1
jmp 0x145b1
movl -0x6c(%rbp), %eax
subl $0x74, %eax
jne 0x145cb
jmp 0x145bb
movb $0x9, -0x59(%rbp)
jmp 0x145cb
movb $0xd, -0x59(%rbp)
jmp 0x145cb
movb $0xa, -0x59(%rbp)
jmp 0x147fd
movsbl -0x59(%rbp), %eax
cmpl $0x25, %eax
jne 0x147d8
movl $0x0, -0x60(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq %rax, -0x68(%rbp)
movq -0x28(%rbp), %rax
movb (%rax), %al
movb %al, -0x59(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x0, %eax
jne 0x1461b
movl $0x1, %edi
xorl %esi, %esi
leaq 0x537fa(%rip), %rdx     # 0x67e0e
movb $0x0, %al
callq 0x131c0
movsbl -0x59(%rbp), %eax
addl $-0x43, %eax
movl %eax, %ecx
movq %rcx, -0x78(%rbp)
subl $0x30, %eax
ja 0x147ae
movq -0x78(%rbp), %rax
leaq 0x52a1c(%rip), %rcx     # 0x67058
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, -0x60(%rbp)
jmp 0x14764
movl $0x1, -0x60(%rbp)
jmp 0x14764
movl $0x2, -0x60(%rbp)
jmp 0x14764
movl $0x3, -0x60(%rbp)
jmp 0x14764
movl $0x4, -0x60(%rbp)
jmp 0x14764
cmpl $0x0, -0x58(%rbp)
je 0x146a3
movl -0x58(%rbp), %esi
leaq -0x50(%rbp), %rdx
leaq 0x5b8f5(%rip), %rdi     # 0x6ff8a
movb $0x0, %al
callq 0x12050
movl $0x0, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x14880
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x147b0
cmpl $0x0, -0x58(%rbp)
je 0x146e3
movl -0x58(%rbp), %esi
leaq -0x50(%rbp), %rdx
leaq 0x5b8b5(%rip), %rdi     # 0x6ff8a
movb $0x0, %al
callq 0x12050
movl $0x0, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x122c0
movl %eax, %esi
leaq 0x53195(%rip), %rdi     # 0x6788e
movb $0x0, %al
callq 0x12050
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x147b0
cmpl $0x0, -0x58(%rbp)
je 0x14733
movl -0x58(%rbp), %esi
leaq -0x50(%rbp), %rdx
leaq 0x5b865(%rip), %rdi     # 0x6ff8a
movb $0x0, %al
callq 0x12050
movl $0x0, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x122c0
movq -0x80(%rbp), %rdi
movl %eax, %esi
callq 0x14930
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x147b0
cmpl $0x0, -0x58(%rbp)
je 0x14786
movl -0x58(%rbp), %esi
leaq -0x50(%rbp), %rdx
leaq 0x5b812(%rip), %rdi     # 0x6ff8a
movb $0x0, %al
callq 0x12050
movl $0x0, -0x58(%rbp)
movq -0x18(%rbp), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x5f230(%rip), %rdi     # 0x739c9
movb $0x0, %al
callq 0x12050
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x147b0
jmp 0x147b0
movq -0x68(%rbp), %rax
cmpq -0x28(%rbp), %rax
jne 0x147d3
movsbl -0x59(%rbp), %ecx
movl $0x1, %edi
xorl %esi, %esi
leaq 0x53662(%rip), %rdx     # 0x67e2e
movb $0x0, %al
callq 0x131c0
jmp 0x14573
movsbl -0x59(%rbp), %eax
cmpl $0x5c, %eax
jne 0x147f9
movl $0x1, -0x54(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x14573
jmp 0x147fb
jmp 0x147fd
movslq -0x58(%rbp), %rax
cmpq $0x20, %rax
jne 0x14823
movl -0x58(%rbp), %esi
leaq -0x50(%rbp), %rdx
leaq 0x5b775(%rip), %rdi     # 0x6ff8a
movb $0x0, %al
callq 0x12050
movl $0x0, -0x58(%rbp)
movb -0x59(%rbp), %cl
movl -0x58(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x58(%rbp)
cltq
movb %cl, -0x50(%rbp,%rax)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x14573
cmpl $0x0, -0x58(%rbp)
je 0x14863
movl -0x58(%rbp), %esi
leaq -0x50(%rbp), %rdx
leaq 0x5b72e(%rip), %rdi     # 0x6ff8a
movb $0x0, %al
callq 0x12050
leaq 0x5334d(%rip), %rdi     # 0x67bb7
movb $0x0, %al
callq 0x12050
xorl %eax, %eax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)