	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_search_merge                   ## -- Begin function search_merge
	.p2align	4, 0x90
_search_merge:                          ## @search_merge
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	_DATA_BUFF_LEN@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	%esi, (%rax)
	setge	%dil
	callq	_assert
	movq	_data_buff@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_read_in
	xorl	%edi, %edi
	cmpl	%r15d, %eax
	sete	%dil
	callq	_assert
	movq	_verbosity@GOTPCREL(%rip), %r13
	cmpl	$4, (%r13)
	movl	%r15d, %r12d
	jl	LBB0_5
## %bb.1:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	testl	%r15d, %r15d
	movq	%r14, %r15
	jle	LBB0_4
## %bb.2:
	movq	_stderr@GOTPCREL(%rip), %r14
	leaq	L_.str(%rip), %rbx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	movq	(%r15), %rax
	movl	(%rax,%r13,4), %ecx
	movq	%rbx, %rsi
	movl	%ecx, %edx
	xorl	%eax, %eax
	callq	_fprintf
	incq	%r13
	cmpq	%r13, %r12
	jne	LBB0_3
LBB0_4:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movq	_verbosity@GOTPCREL(%rip), %r13
	movq	%r15, %r14
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_5:
	movq	%rbx, %rdi
	callq	_free_unused_buffers
	movq	%rbx, %rdi
	testl	%r15d, %r15d
	jle	LBB0_6
## %bb.10:
	movq	(%r14), %rax
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	cmpl	$13, (%rax,%rbx,4)
	je	LBB0_7
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_11
## %bb.13:
	movl	%r12d, %ebx
	jmp	LBB0_14
LBB0_6:
	xorl	%ebx, %ebx
LBB0_7:
	leal	-1(%r15), %eax
	cmpl	%eax, %ebx
	jge	LBB0_14
## %bb.8:
	movq	(%r14), %rsi
	movl	%ebx, %eax
	movl	4(%rsi,%rax,4), %edx
	cmpl	$10, %edx
	jne	LBB0_9
## %bb.16:
	movl	%r15d, %edx
	callq	_get_conn_query
	testq	%rax, %rax
	je	LBB0_17
## %bb.18:
	movq	%rax, %r12
	movq	16(%rax), %rax
	testq	%rax, %rax
	je	LBB0_20
## %bb.19:
	movq	(%r12), %rcx
	cmpq	(%rax), %rcx
	jne	LBB0_20
## %bb.22:
	movslq	8(%r12), %r14
	testq	%r14, %r14
	je	LBB0_23
## %bb.24:
	addl	$2, %ebx
	xorl	%edi, %edi
	cmpq	16(%r14), %rax
	sete	%dil
	callq	_assert
	movl	8(%r14), %edi
	callq	_assert
	movq	16(%r14), %rax
	movq	8(%rax), %rax
	movq	(%rax), %rcx
	movq	_CC@GOTPCREL(%rip), %rdx
	movq	%rcx, (%rdx)
	testq	%rcx, %rcx
	setne	%dl
	cmpq	%rax, %rcx
	sete	%al
	andb	%dl, %al
	movzbl	%al, %edi
	callq	_assert
	movl	%ebx, %esi
	shlq	$2, %rsi
	movq	_data_buff@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	subl	%ebx, %r15d
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_client_read_special
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_query_complete_custom
	cmpl	$4, (%r13)
	jl	LBB0_26
## %bb.25:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.7(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
LBB0_26:
	movq	%r14, %rdi
	callq	_GATHER_QUERY
	movq	%rax, %r15
	cmpl	$2, (%r13)
	jl	LBB0_28
## %bb.27:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	(%r15), %r12d
	movl	4(%r15), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_CLOCK_MONOTONIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_get_utime
	subsd	8(%r15), %xmm0
	leaq	L_.str.8(%rip), %rsi
	movl	%ebx, %edi
	movl	%r12d, %edx
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movb	$1, %al
	callq	_fprintf
LBB0_28:
	movl	4(%r15), %eax
	movl	$1, %ebx
	cmpl	(%r15), %eax
	jne	LBB0_32
## %bb.29:
	movq	%r14, %rdi
	callq	_end_search_query
	cmpl	$4, (%r13)
	jl	LBB0_31
## %bb.30:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.9(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
LBB0_31:
	movq	%r14, %rdi
	callq	_delete_search_query
	jmp	LBB0_32
LBB0_14:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edx
	jmp	LBB0_15
LBB0_9:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
LBB0_15:
	xorl	%eax, %eax
	callq	_fprintf
	movl	$-1, %ebx
LBB0_32:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_cur_key@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	L_.str.5(%rip), %rsi
LBB0_21:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_fprintf
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_query_complete_custom
	jmp	LBB0_32
LBB0_17:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_32
LBB0_23:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_cur_key@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_DATA_BUFF_LEN,4,2              ## @DATA_BUFF_LEN
	.comm	_data_buff,8,3                  ## @data_buff
	.comm	_verbosity,4,2                  ## @verbosity
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%c[%d]"

L_.str.1:                               ## @.str.1
	.asciz	"\n"

L_.str.2:                               ## @.str.2
	.asciz	"data_shift = %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"data_buff[] = %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"Error in search_merge: cannot find query for answer. Dropping answer.\n"

L_.str.5:                               ## @.str.5
	.asciz	"Error in search_merge: generations do not match. Dropping answer. (key = %s).\n"

	.comm	_cur_key,8,3                    ## @cur_key
L_.str.6:                               ## @.str.6
	.asciz	"Error in search_merge: no parent query. Dropping answer. (key = %s).\n"

	.comm	_CC,8,3                         ## @CC
L_.str.7:                               ## @.str.7
	.asciz	"end of search_merge\n"

L_.str.8:                               ## @.str.8
	.asciz	"got answer %d of %d in %.08f seconds\n"

	.comm	_CLOCK_MONOTONIC,4,2            ## @CLOCK_MONOTONIC
L_.str.9:                               ## @.str.9
	.asciz	"All answers gathered. Deleting master query.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_search_merge                   ; -- Begin function search_merge
	.p2align	2
_search_merge:                          ; @search_merge
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _DATA_BUFF_LEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DATA_BUFF_LEN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	cset	w0, ge
	bl	_assert
Lloh3:
	adrp	x24, _data_buff@GOTPAGE
Lloh4:
	ldr	x24, [x24, _data_buff@GOTPAGEOFF]
	ldr	x1, [x24]
	mov	x0, x20
	mov	x2, x19
	bl	_read_in
	cmp	w0, w19
	cset	w0, eq
	bl	_assert
Lloh5:
	adrp	x23, _verbosity@GOTPAGE
Lloh6:
	ldr	x23, [x23, _verbosity@GOTPAGEOFF]
	ldr	w8, [x23]
	mov	w25, w19
Lloh7:
	adrp	x22, _stderr@GOTPAGE
Lloh8:
	ldr	x22, [x22, _stderr@GOTPAGEOFF]
	cmp	w8, #4
	b.lt	LBB0_5
; %bb.1:
	cmp	w19, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x26, #0
	lsl	x27, x25, #2
Lloh9:
	adrp	x21, l_.str@PAGE
Lloh10:
	add	x21, x21, l_.str@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22]
	ldr	x8, [x24]
	ldr	w8, [x8, x26]
	stp	x8, x8, [sp]
	mov	x1, x21
	bl	_fprintf
	add	x26, x26, #4
	cmp	x27, x26
	b.ne	LBB0_3
LBB0_4:
	ldr	w0, [x22]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fprintf
LBB0_5:
	mov	x0, x20
	bl	_free_unused_buffers
	subs	w8, w19, #1
	b.lt	LBB0_10
; %bb.6:
	mov	x9, #0
	ldr	x10, [x24]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x10, x9, lsl #2]
	cmp	w11, #13
	b.eq	LBB0_25
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x9, x9, #1
	cmp	x25, x9
	b.ne	LBB0_7
; %bb.9:
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	b	LBB0_26
LBB0_10:
	mov	w25, #0
	cmp	w25, w8
	b.ge	LBB0_26
LBB0_11:
	ldr	x1, [x24]
	add	w8, w25, #1
	ldr	w8, [x1, w8, uxtw #2]
	cmp	w8, #10
	b.ne	LBB0_27
; %bb.12:
	mov	x0, x20
	mov	x2, x19
	bl	_get_conn_query
	cbz	x0, LBB0_32
; %bb.13:
	mov	x21, x0
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_30
; %bb.14:
	ldr	x9, [x21]
	ldr	x10, [x8]
	cmp	x9, x10
	b.ne	LBB0_30
; %bb.15:
	ldrsw	x20, [x21, #8]
	cbz	w20, LBB0_33
; %bb.16:
	add	w25, w25, #2
	ldr	x9, [x20, #16]
	cmp	x8, x9
	cset	w0, eq
	bl	_assert
	ldr	w0, [x20, #8]
	bl	_assert
	ldr	x8, [x20, #16]
	ldr	x8, [x8, #8]
	ldr	x9, [x8]
Lloh13:
	adrp	x10, _CC@GOTPAGE
Lloh14:
	ldr	x10, [x10, _CC@GOTPAGEOFF]
Lloh15:
	str	x9, [x10]
	cmp	x9, #0
	ccmp	x9, x8, #0, ne
	cset	w0, eq
	bl	_assert
	ldr	x8, [x24]
	add	x1, x8, w25, uxtw #2
	sub	w2, w19, w25
	mov	x0, x21
	bl	_client_read_special
	mov	x0, x21
	mov	w1, #1
	bl	_query_complete_custom
	ldr	w8, [x23]
	cmp	w8, #4
	b.lt	LBB0_18
; %bb.17:
	ldr	w0, [x22]
Lloh16:
	adrp	x1, l_.str.7@PAGE
Lloh17:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_fprintf
LBB0_18:
	mov	x0, x20
	bl	_GATHER_QUERY
	mov	x19, x0
	ldr	w8, [x23]
	cmp	w8, #2
	b.lt	LBB0_20
; %bb.19:
	ldr	w21, [x22]
Lloh18:
	adrp	x8, _CLOCK_MONOTONIC@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CLOCK_MONOTONIC@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	ldp	w24, w25, [x19]
	bl	_get_utime
	ldr	d1, [x19, #8]
	fsub	d0, d0, d1
	str	d0, [sp, #16]
	stp	x24, x25, [sp]
Lloh21:
	adrp	x1, l_.str.8@PAGE
Lloh22:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	x0, x21
	bl	_fprintf
LBB0_20:
	ldp	w9, w8, [x19]
	cmp	w8, w9
	b.ne	LBB0_24
; %bb.21:
	mov	x0, x20
	bl	_end_search_query
	ldr	w8, [x23]
	cmp	w8, #4
	b.lt	LBB0_23
; %bb.22:
	ldr	w0, [x22]
Lloh23:
	adrp	x1, l_.str.9@PAGE
Lloh24:
	add	x1, x1, l_.str.9@PAGEOFF
	bl	_fprintf
LBB0_23:
	mov	x0, x20
	bl	_delete_search_query
LBB0_24:
	mov	w0, #1
	b	LBB0_29
LBB0_25:
	mov	x25, x9
	cmp	w25, w8
	b.lt	LBB0_11
LBB0_26:
	ldr	w0, [x22]
	str	x25, [sp]
Lloh25:
	adrp	x1, l_.str.2@PAGE
Lloh26:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_28
LBB0_27:
	ldr	w0, [x22]
	str	x8, [sp]
Lloh27:
	adrp	x1, l_.str.3@PAGE
Lloh28:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_28:
	bl	_fprintf
	mov	w0, #-1
LBB0_29:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_30:
	ldr	w0, [x22]
Lloh29:
	adrp	x8, _cur_key@GOTPAGE
Lloh30:
	ldr	x8, [x8, _cur_key@GOTPAGEOFF]
Lloh31:
	ldr	x8, [x8]
	str	x8, [sp]
Lloh32:
	adrp	x1, l_.str.5@PAGE
Lloh33:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_31:
	bl	_fprintf
	mov	x0, x21
	mov	w1, #0
	bl	_query_complete_custom
	mov	w0, #0
	b	LBB0_29
LBB0_32:
	ldr	w0, [x22]
Lloh34:
	adrp	x1, l_.str.4@PAGE
Lloh35:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_fprintf
	mov	w0, #0
	b	LBB0_29
LBB0_33:
	ldr	w0, [x22]
Lloh36:
	adrp	x8, _cur_key@GOTPAGE
Lloh37:
	ldr	x8, [x8, _cur_key@GOTPAGEOFF]
Lloh38:
	ldr	x8, [x8]
	str	x8, [sp]
Lloh39:
	adrp	x1, l_.str.6@PAGE
Lloh40:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_31
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotStr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_DATA_BUFF_LEN,4,2              ; @DATA_BUFF_LEN
	.comm	_data_buff,8,3                  ; @data_buff
	.comm	_verbosity,4,2                  ; @verbosity
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%c[%d]"

l_.str.1:                               ; @.str.1
	.asciz	"\n"

l_.str.2:                               ; @.str.2
	.asciz	"data_shift = %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"data_buff[] = %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"Error in search_merge: cannot find query for answer. Dropping answer.\n"

l_.str.5:                               ; @.str.5
	.asciz	"Error in search_merge: generations do not match. Dropping answer. (key = %s).\n"

	.comm	_cur_key,8,3                    ; @cur_key
l_.str.6:                               ; @.str.6
	.asciz	"Error in search_merge: no parent query. Dropping answer. (key = %s).\n"

	.comm	_CC,8,3                         ; @CC
l_.str.7:                               ; @.str.7
	.asciz	"end of search_merge\n"

l_.str.8:                               ; @.str.8
	.asciz	"got answer %d of %d in %.08f seconds\n"

	.comm	_CLOCK_MONOTONIC,4,2            ; @CLOCK_MONOTONIC
l_.str.9:                               ; @.str.9
	.asciz	"All answers gathered. Deleting master query.\n"

.subsections_via_symbols
