	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lqr_Setup
_lqr_Setup:                             ## @lqr_Setup
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	24(%rdi), %edi
	callq	_link2physical
	movq	%rax, %r12
	leaq	52(%rax), %rdi
	xorps	%xmm0, %xmm0
	movups	%xmm0, 56(%rax)
	movq	$0, 72(%rax)
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	cmpq	$0, 16(%r14)
	movq	_LQM_ECHO@GOTPCREL(%rip), %r15
	je	LBB0_2
## %bb.1:
	movl	(%r15), %ebx
LBB0_2:
	movl	%ebx, 8(%r12)
	movl	12(%r14), %edi
	callq	_IsEnabled
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	_TY_QUALPROTO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_REJECTED
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	_LQM_LQR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%r12)
LBB0_5:
	movq	%r12, %rdi
	addq	$16, %rdi
	callq	_timer_Stop
	movl	(%r14), %r8d
	movl	%r8d, 48(%r12)
	testl	%r8d, %r8d
	je	LBB0_7
## %bb.6:
	movq	_LogLQM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r12), %edx
	movslq	%r8d, %rax
	imulq	$1374389535, %rax, %rcx         ## imm = 0x51EB851F
	movq	%rcx, %rax
	shrq	$63, %rax
	sarq	$37, %rcx
	addl	%eax, %ecx
	imull	$100, %ecx, %eax
	subl	%eax, %r8d
	leaq	L_.str(%rip), %rsi
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	_log_Printf
LBB0_7:
	movl	4(%r14), %eax
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movq	_SendLqrReport@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 40(%r12)
	leaq	L_.str.1(%rip), %rcx
	movq	%rcx, 16(%r12)
	movq	%r14, 32(%r12)
	leaq	L_.str.3(%rip), %rcx
	jmp	LBB0_11
LBB0_9:
	imull	$100, 8(%r14), %eax
	movq	_SendLqrReport@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 40(%r12)
	leaq	L_.str.1(%rip), %rcx
	movq	%rcx, 16(%r12)
	movq	%r14, 32(%r12)
	movl	(%r15), %ecx
	testl	%ecx, 8(%r12)
	je	LBB0_12
## %bb.10:
	leaq	L_.str.4(%rip), %rcx
LBB0_11:
	movq	_LogLQM@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	movl	(%r12), %edx
	movslq	%eax, %rbx
	imulq	$1374389535, %rbx, %r8          ## imm = 0x51EB851F
	movq	%r8, %rax
	shrq	$63, %rax
	sarq	$37, %r8
	addl	%eax, %r8d
	imull	$100, %r8d, %eax
	movl	%ebx, %r9d
	subl	%eax, %r9d
	leaq	L_.str.2(%rip), %rsi
                                        ## kill: def $r8d killed $r8d killed $r8
	xorl	%eax, %eax
	callq	_log_Printf
	movq	_SECTICKS@GOTPCREL(%rip), %rax
	imull	(%rax), %ebx
	movslq	%ebx, %rax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$37, %rax
	addl	%ecx, %eax
	movl	%eax, 24(%r12)
LBB0_13:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	$0, 24(%r12)
	cmpl	$0, (%r14)
	jne	LBB0_13
## %bb.14:
	movq	_LogLQM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r12), %edx
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_log_Printf                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_LQM_ECHO,4,2                   ## @LQM_ECHO
	.comm	_TY_QUALPROTO,4,2               ## @TY_QUALPROTO
	.comm	_LQM_LQR,4,2                    ## @LQM_LQR
	.comm	_LogLQM,4,2                     ## @LogLQM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: Expecting LQR every %d.%02d secs\n"

	.comm	_SendLqrReport,4,2              ## @SendLqrReport
L_.str.1:                               ## @.str.1
	.asciz	"lqm"

L_.str.2:                               ## @.str.2
	.asciz	"%s: Will send %s every %d.%02d secs\n"

L_.str.3:                               ## @.str.3
	.asciz	"LQR"

L_.str.4:                               ## @.str.4
	.asciz	"LCP ECHO"

	.comm	_SECTICKS,4,2                   ## @SECTICKS
L_.str.5:                               ## @.str.5
	.asciz	"%s: LQR/LCP ECHO not negotiated\n"

	.no_dead_strip	_lqr_Setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lqr_Setup
_lqr_Setup:                             ; @lqr_Setup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x0
	ldr	w0, [x0, #24]
	bl	_link2physical
	mov	x19, x0
	str	xzr, [x0, #72]
	add	x0, x0, #52
	stp	xzr, xzr, [x19, #56]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
Lloh0:
	adrp	x21, _LQM_ECHO@GOTPAGE
Lloh1:
	ldr	x21, [x21, _LQM_ECHO@GOTPAGEOFF]
	ldr	x8, [x20, #16]
	ldr	w9, [x21]
	cmp	x8, #0
	csel	w8, wzr, w9, eq
	str	w8, [x19, #8]
	ldr	w0, [x20, #12]
	bl	_IsEnabled
	cbz	x0, LBB0_3
; %bb.1:
Lloh2:
	adrp	x8, _TY_QUALPROTO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TY_QUALPROTO@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_REJECTED
	cbnz	w0, LBB0_3
; %bb.2:
Lloh5:
	adrp	x8, _LQM_LQR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LQM_LQR@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	orr	w8, w9, w8
	str	w8, [x19, #8]
LBB0_3:
	add	x0, x19, #16
	bl	_timer_Stop
	ldr	w8, [x20]
	str	w8, [x19, #48]
Lloh8:
	adrp	x22, _LogLQM@GOTPAGE
Lloh9:
	ldr	x22, [x22, _LogLQM@GOTPAGEOFF]
	cbz	w8, LBB0_5
; %bb.4:
	ldr	w0, [x22]
	ldr	w2, [x19]
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	smull	x9, w8, w9
	lsr	x10, x9, #63
	asr	x9, x9, #37
	add	w9, w9, w10
	mov	w10, #100
	msub	w8, w9, w10, w8
	stp	x9, x8, [sp]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_log_Printf
LBB0_5:
	ldr	w23, [x20, #4]
	cbz	w23, LBB0_7
; %bb.6:
Lloh12:
	adrp	x8, _SendLqrReport@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SendLqrReport@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x19, #40]
Lloh15:
	adrp	x8, l_.str.1@PAGE
Lloh16:
	add	x8, x8, l_.str.1@PAGEOFF
	str	x8, [x19, #16]
	str	x20, [x19, #32]
Lloh17:
	adrp	x8, l_.str.3@PAGE
Lloh18:
	add	x8, x8, l_.str.3@PAGEOFF
	b	LBB0_9
LBB0_7:
	ldr	w8, [x20, #8]
Lloh19:
	adrp	x9, _SendLqrReport@GOTPAGE
Lloh20:
	ldr	x9, [x9, _SendLqrReport@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
Lloh22:
	adrp	x10, l_.str.1@PAGE
Lloh23:
	add	x10, x10, l_.str.1@PAGEOFF
	str	w9, [x19, #40]
	str	x10, [x19, #16]
	str	x20, [x19, #32]
	ldr	w9, [x19, #8]
	ldr	w10, [x21]
	tst	w10, w9
	b.eq	LBB0_11
; %bb.8:
	mov	w9, #100
	mul	w23, w8, w9
Lloh24:
	adrp	x8, l_.str.4@PAGE
Lloh25:
	add	x8, x8, l_.str.4@PAGEOFF
LBB0_9:
	ldr	w0, [x22]
	ldr	w2, [x19]
	mov	w20, #34079
	movk	w20, #20971, lsl #16
	smull	x9, w23, w20
	lsr	x10, x9, #63
	asr	x9, x9, #37
	add	w9, w9, w10
	mov	w10, #100
	msub	w10, w9, w10, w23
	stp	x8, x9, [sp]
	str	x10, [sp, #16]
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_log_Printf
Lloh28:
	adrp	x8, _SECTICKS@GOTPAGE
Lloh29:
	ldr	x8, [x8, _SECTICKS@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	mul	w8, w8, w23
	smull	x8, w8, w20
	lsr	x9, x8, #63
	asr	x8, x8, #37
	add	w8, w8, w9
	str	w8, [x19, #24]
LBB0_10:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_11:
	str	wzr, [x19, #24]
	ldr	w8, [x20]
	cbnz	w8, LBB0_10
; %bb.12:
	ldr	w0, [x22]
	ldr	w2, [x19]
Lloh31:
	adrp	x1, l_.str.5@PAGE
Lloh32:
	add	x1, x1, l_.str.5@PAGEOFF
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_log_Printf
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_LQM_ECHO,4,2                   ; @LQM_ECHO
	.comm	_TY_QUALPROTO,4,2               ; @TY_QUALPROTO
	.comm	_LQM_LQR,4,2                    ; @LQM_LQR
	.comm	_LogLQM,4,2                     ; @LogLQM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: Expecting LQR every %d.%02d secs\n"

	.comm	_SendLqrReport,4,2              ; @SendLqrReport
l_.str.1:                               ; @.str.1
	.asciz	"lqm"

l_.str.2:                               ; @.str.2
	.asciz	"%s: Will send %s every %d.%02d secs\n"

l_.str.3:                               ; @.str.3
	.asciz	"LQR"

l_.str.4:                               ; @.str.4
	.asciz	"LCP ECHO"

	.comm	_SECTICKS,4,2                   ; @SECTICKS
l_.str.5:                               ; @.str.5
	.asciz	"%s: LQR/LCP ECHO not negotiated\n"

	.no_dead_strip	_lqr_Setup
.subsections_via_symbols
