	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ldns_tcp_read
_ldns_tcp_read:                         ## @ldns_tcp_read
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, (%rsi)
	jle	LBB0_5
## %bb.1:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	callq	_gettimeofday
	movq	(%rbx), %r15
	movq	%rbx, %rdi
	callq	_ldns_resolver_timeout
	leaq	-56(%rbp), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_ldns_tcp_read_wire_timeout
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	%rax, %r12
	movq	-56(%rbp), %rdx
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_ldns_wire2pkt
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_free
	movq	_LDNS_STATUS_OK@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jne	LBB0_4
## %bb.3:
	leaq	-40(%rbp), %rdi
	xorl	%esi, %esi
	callq	_gettimeofday
	movq	(%r14), %rdi
	movslq	-40(%rbp), %rax
	movslq	-48(%rbp), %rcx
	subq	%rcx, %rax
	movl	-36(%rbp), %ecx
	subl	-44(%rbp), %ecx
	imulq	$1000, %rax, %rax               ## imm = 0x3E8
	movslq	%ecx, %rcx
	imulq	$274877907, %rcx, %rcx          ## imm = 0x10624DD3
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$38, %rcx
	addl	%edx, %ecx
	movslq	%ecx, %rsi
	addq	%rax, %rsi
	callq	_ldns_pkt_set_querytime
	movq	(%r14), %rdi
	movq	-40(%rbp), %rsi
	callq	_ldns_pkt_set_timestamp
	jmp	LBB0_6
LBB0_4:
	movq	(%rbx), %rdi
	callq	_close
	movq	$0, (%rbx)
LBB0_5:
	movq	_LDNS_STATUS_ERR@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
LBB0_6:
	movq	%r15, %rax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LDNS_STATUS_ERR,8,3            ## @LDNS_STATUS_ERR
	.comm	_LDNS_STATUS_OK,8,3             ## @LDNS_STATUS_OK
	.no_dead_strip	_ldns_tcp_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ldns_tcp_read
_ldns_tcp_read:                         ; @ldns_tcp_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	ldr	x8, [x1]
	cmp	x8, #0
	b.le	LBB0_5
; %bb.1:
	mov	x21, x1
	mov	x19, x0
	add	x0, sp, #24
	mov	x1, #0
	bl	_gettimeofday
	ldr	x20, [x21]
	mov	x0, x21
	bl	_ldns_resolver_timeout
	mov	x2, x0
	add	x1, sp, #8
	mov	x0, x20
	bl	_ldns_tcp_read_wire_timeout
	cbz	x0, LBB0_4
; %bb.2:
	mov	x22, x0
	ldr	x2, [sp, #8]
	mov	x0, x19
	mov	x1, x22
	bl	_ldns_wire2pkt
	mov	x20, x0
	mov	x0, x22
	bl	_free
Lloh0:
	adrp	x8, _LDNS_STATUS_OK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LDNS_STATUS_OK@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x20, x8
	b.ne	LBB0_4
; %bb.3:
	add	x0, sp, #16
	mov	x1, #0
	bl	_gettimeofday
	ldp	w8, w9, [sp, #16]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	ldp	w10, w11, [sp, #24]
                                        ; kill: def $w10 killed $w10 def $x10
	sxtw	x10, w10
	sub	x8, x8, x10
	mov	w10, #1000
	mul	x8, x8, x10
	ldr	x0, [x19]
	sub	w9, w9, w11
	mov	w10, #19923
	movk	w10, #4194, lsl #16
	smull	x9, w9, w10
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w9, w9, w10
	add	x1, x8, w9, sxtw
	bl	_ldns_pkt_set_querytime
	ldr	x0, [x19]
	ldr	x1, [sp, #16]
	bl	_ldns_pkt_set_timestamp
	b	LBB0_6
LBB0_4:
	ldr	x0, [x21]
	bl	_close
	str	xzr, [x21]
LBB0_5:
Lloh3:
	adrp	x8, _LDNS_STATUS_ERR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LDNS_STATUS_ERR@GOTPAGEOFF]
Lloh5:
	ldr	x20, [x8]
LBB0_6:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_LDNS_STATUS_ERR,8,3            ; @LDNS_STATUS_ERR
	.comm	_LDNS_STATUS_OK,8,3             ; @LDNS_STATUS_OK
	.no_dead_strip	_ldns_tcp_read
.subsections_via_symbols
