	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function add_bg_result
_add_bg_result:                         ## @add_bg_result
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movl	$0, -44(%rbp)
	cmpq	$0, 16(%rdi)
	je	LBB0_1
## %bb.18:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_context_query_delete           ## TAILCALL
LBB0_1:
	movl	%r9d, %r13d
	movq	%r8, %r15
	movl	%ecx, %eax
	movq	%rdx, %r12
	movq	%rdi, %r14
	cmpq	$0, 8(%rdi)
	je	LBB0_10
## %bb.2:
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	(%r14), %rdi
	addq	$12, %rdi
	callq	_lock_basic_lock
	testq	%r15, %r15
	je	LBB0_3
## %bb.4:
	movq	%r15, %rdi
	callq	_strdup
	movq	8(%rbx), %rcx
	movq	%rax, 8(%rcx)
	jmp	LBB0_5
LBB0_10:
	testq	%r15, %r15
	je	LBB0_11
## %bb.12:
	movq	%r15, %rdi
	movl	%eax, %r15d
	callq	_strdup
	movq	8(%rbx), %rcx
	movq	%rax, 8(%rcx)
	movl	%r15d, %eax
	jmp	LBB0_13
LBB0_3:
	movq	8(%rbx), %rcx
LBB0_5:
	movl	%r13d, (%rcx)
	testq	%r12, %r12
	je	LBB0_6
## %bb.7:
	movq	%r12, %rdi
	callq	_sldns_buffer_remaining
	movl	%eax, 20(%rbx)
	movq	%r12, %rdi
	callq	_sldns_buffer_begin
	movl	20(%rbx), %esi
	movl	%eax, %edi
	callq	_memdup
	movl	%eax, 16(%rbx)
	testl	%eax, %eax
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	jne	LBB0_9
## %bb.8:
	movq	_UB_NOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	jmp	LBB0_9
LBB0_6:
	movl	-48(%rbp), %esi                 ## 4-byte Reload
LBB0_9:
	leaq	-44(%rbp), %rcx
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_context_serialize_answer
	movq	%rax, %r15
	movq	(%r14), %rdi
	addq	$12, %rdi
	callq	_lock_basic_unlock
	testq	%r15, %r15
	jne	LBB0_15
	jmp	LBB0_16
LBB0_11:
	movq	8(%rbx), %rcx
LBB0_13:
	movl	%r13d, (%rcx)
	leaq	-44(%rbp), %rcx
	movq	%rbx, %rdi
	movl	%eax, %esi
	movq	%r12, %rdx
	callq	_context_serialize_answer
	movq	%rax, %r15
	movq	(%r14), %rdi
	addq	$8, %rdi
	movl	(%rbx), %esi
	callq	_rbtree_delete
	movq	(%r14), %rax
	decl	4(%rax)
	movq	%rbx, %rdi
	callq	_context_query_delete
	testq	%r15, %r15
	je	LBB0_16
LBB0_15:
	movq	(%r14), %rax
	movl	(%rax), %edi
	movl	-44(%rbp), %edx
	movq	%r15, %rsi
	callq	_tube_queue_item
	testl	%eax, %eax
	jne	LBB0_17
LBB0_16:
	leaq	L_.str(%rip), %rdi
	callq	_log_err
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UB_NOMEM,4,2                   ## @UB_NOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"out of memory for async answer"

	.no_dead_strip	_add_bg_result
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function add_bg_result
_add_bg_result:                         ; @add_bg_result
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	str	wzr, [sp, #12]
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_context_query_delete
LBB0_2:
	mov	x23, x5
	mov	x24, x4
	mov	x21, x3
	mov	x22, x2
	mov	x19, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_7
; %bb.3:
	ldr	x8, [x19]
	add	x0, x8, #12
	bl	_lock_basic_lock
	cbz	x24, LBB0_9
; %bb.4:
	mov	x0, x24
	bl	_strdup
	ldr	x8, [x20, #8]
	str	x0, [x8, #8]
	str	w23, [x8]
	cbz	x22, LBB0_6
LBB0_5:
	mov	x0, x22
	bl	_sldns_buffer_remaining
	str	w0, [x20, #20]
	mov	x0, x22
	bl	_sldns_buffer_begin
	ldr	w1, [x20, #20]
	bl	_memdup
	str	w0, [x20, #16]
Lloh0:
	adrp	x8, _UB_NOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _UB_NOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, #0
	csel	w21, w8, w21, eq
LBB0_6:
	add	x3, sp, #12
	mov	x0, x20
	mov	x1, x21
	mov	x2, #0
	bl	_context_serialize_answer
	mov	x21, x0
	ldr	x8, [x19]
	add	x0, x8, #12
	bl	_lock_basic_unlock
	cbnz	x21, LBB0_12
	b	LBB0_13
LBB0_7:
	cbz	x24, LBB0_10
; %bb.8:
	mov	x0, x24
	bl	_strdup
	ldr	x8, [x20, #8]
	str	x0, [x8, #8]
	b	LBB0_11
LBB0_9:
	ldr	x8, [x20, #8]
	str	w23, [x8]
	cbnz	x22, LBB0_5
	b	LBB0_6
LBB0_10:
	ldr	x8, [x20, #8]
LBB0_11:
	str	w23, [x8]
	add	x3, sp, #12
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_context_serialize_answer
	mov	x21, x0
	ldr	x8, [x19]
	add	x0, x8, #8
	ldr	w1, [x20]
	bl	_rbtree_delete
	ldr	x8, [x19]
	ldr	w9, [x8, #4]
	sub	w9, w9, #1
	str	w9, [x8, #4]
	mov	x0, x20
	bl	_context_query_delete
	cbz	x21, LBB0_13
LBB0_12:
	ldr	x8, [x19]
	ldr	w0, [x8]
	ldr	w2, [sp, #12]
	mov	x1, x21
	bl	_tube_queue_item
	cbnz	w0, LBB0_14
LBB0_13:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_log_err
LBB0_14:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_UB_NOMEM,4,2                   ; @UB_NOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"out of memory for async answer"

	.no_dead_strip	_add_bg_result
.subsections_via_symbols
