// File: /workspace/github_c_makefile_star2_O0/winton[P]redis_parse/redis_parse.c
// Function: process_record
void process_record(char *record, int score) {
	bool exclude, match;
	char *field;
	char **fields;
	fields = to_fields(record);

	// For each query
	int q, x;
	for (q = 0; q < 100; q++) {
		// Skip unused query structs
		if (queries[q].used != true)
			continue;
		
		// Skip if score not within range
		if (score >= 0) {
			if (queries[q].finish >= 0 && score > queries[q].finish)
				continue;
			if (queries[q].start >= 0 && score < queries[q].start)
				continue;
		}

		match = true;
		if (!queries[q].exclude_empty)
			// For each column
			for (x = 0; x < columns_count; x++) {
				// Exclude matches
				if (!queries[q].exclude_empty_at[x] && strstr(fields[x], queries[q].exclude[x])) {
					match = false;
					break;
				}
			}

		if (match && !queries[q].query_empty)
			// For each column
			for (x = 0; x < columns_count; x++) {
				// Include matches
				if (!queries[q].query_empty_at[x] && !strstr(fields[x], queries[q].query[x])) {
					match = false;
					break;
				}
			}

		if (match) {
			if (queries[q].display_count)
				queries[q].count++;
			if (queries[q].display_group && queries[q].column > -1) {
				field = malloc(strlen(fields[queries[q].column]) + 1);
				strcpy(field, fields[queries[q].column]);
				if (queries[q].column == 2) { // tag
					hash_add_or_update(q, xstrtok(field, ","));
					while (hash_add_or_update(q, xstrtok(NULL, ",")));
				} else
					hash_add_or_update(q, field);
			}
		}
	}

	free(fields);
	free(record);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x30f0
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x64, -0x24(%rbp)
jge 0x4929
movslq -0x24(%rbp), %rcx
leaq 0x8c68(%rip), %rax      # 0xd280
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
je 0x4630
jmp 0x491b
cmpl $0x0, -0xc(%rbp)
jl 0x46a6
movslq -0x24(%rbp), %rcx
leaq 0x8c3f(%rip), %rax      # 0xd280
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x3c(%rax)
jl 0x466d
movl -0xc(%rbp), %eax
movslq -0x24(%rbp), %rdx
leaq 0x8c24(%rip), %rcx      # 0xd280
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x3c(%rcx), %eax
jle 0x466d
jmp 0x491b
movslq -0x24(%rbp), %rcx
leaq 0x8c08(%rip), %rax      # 0xd280
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x38(%rax)
jl 0x46a4
movl -0xc(%rbp), %eax
movslq -0x24(%rbp), %rdx
leaq 0x8bed(%rip), %rcx      # 0xd280
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x38(%rcx), %eax
jge 0x46a4
jmp 0x491b
jmp 0x46a6
movb $0x1, -0xe(%rbp)
movslq -0x24(%rbp), %rcx
leaq 0x8bcb(%rip), %rax      # 0xd280
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
testb $0x1, 0x4(%rax)
jne 0x473b
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl 0x8b2a(%rip), %eax      # 0xd1fc
jae 0x4739
movslq -0x24(%rbp), %rcx
leaq 0x8ba1(%rip), %rax      # 0xd280
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movslq -0x28(%rbp), %rcx
testb $0x1, 0xc(%rax,%rcx)
jne 0x472c
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0x24(%rbp), %rcx
leaq 0x8b78(%rip), %rax      # 0xd280
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x2270
cmpq $0x0, %rax
je 0x472c
movb $0x0, -0xe(%rbp)
jmp 0x4739
jmp 0x472e
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x46c9
jmp 0x473b
testb $0x1, -0xe(%rbp)
je 0x47d6
movslq -0x24(%rbp), %rcx
leaq 0x8b30(%rip), %rax      # 0xd280
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
testb $0x1, 0x3(%rax)
jne 0x47d6
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl 0x8a8f(%rip), %eax      # 0xd1fc
jae 0x47d4
movslq -0x24(%rbp), %rcx
leaq 0x8b06(%rip), %rax      # 0xd280
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movslq -0x28(%rbp), %rcx
testb $0x1, 0x5(%rax,%rcx)
jne 0x47c7
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0x24(%rbp), %rcx
leaq 0x8add(%rip), %rax      # 0xd280
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x2270
cmpq $0x0, %rax
jne 0x47c7
movb $0x0, -0xe(%rbp)
jmp 0x47d4
jmp 0x47c9
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x4764
jmp 0x47d6
testb $0x1, -0xe(%rbp)
je 0x4919
movslq -0x24(%rbp), %rcx
leaq 0x8a95(%rip), %rax      # 0xd280
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
testb $0x1, 0x1(%rax)
je 0x4813
movslq -0x24(%rbp), %rcx
leaq 0x8a7d(%rip), %rax      # 0xd280
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
movslq -0x24(%rbp), %rcx
leaq 0x8a62(%rip), %rax      # 0xd280
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
testb $0x1, 0x2(%rax)
je 0x4917
movslq -0x24(%rbp), %rcx
leaq 0x8a46(%rip), %rax      # 0xd280
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $-0x1, 0x28(%rax)
jle 0x4917
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rdx
leaq 0x8a26(%rip), %rcx      # 0xd280
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
movslq 0x28(%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x20d0
movq %rax, %rdi
addq $0x1, %rdi
callq 0x21e0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rdx
leaq 0x89ef(%rip), %rcx      # 0xd280
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
movslq 0x28(%rcx), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x2060
movslq -0x24(%rbp), %rcx
leaq 0x89d0(%rip), %rax      # 0xd280
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x2, 0x28(%rax)
jne 0x4909
movl -0x24(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x57c9(%rip), %rsi      # 0xa097
callq 0x4950
movl -0x2c(%rbp), %edi
movq %rax, %rsi
callq 0x31b0
movl -0x24(%rbp), %eax
movl %eax, -0x30(%rbp)
xorl %eax, %eax
movl %eax, %edi
leaq 0x57a8(%rip), %rsi      # 0xa097
callq 0x4950
movl -0x30(%rbp), %edi
movq %rax, %rsi
callq 0x31b0
testb $0x1, %al
jne 0x4905
jmp 0x4907
jmp 0x48de
jmp 0x4915
movl -0x24(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x31b0
jmp 0x4917
jmp 0x4919
jmp 0x491b
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x4603
movq -0x20(%rbp), %rdi
callq 0x2030
movq -0x8(%rbp), %rdi
callq 0x2030
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)