	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qed_ptp_hw_adjfreq
_qed_ptp_hw_adjfreq:                    ## @qed_ptp_hw_adjfreq
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	callq	_QED_LEADING_HWFN
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	%ebx, %r13d
	negl	%r13d
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	cmovsl	%ebx, %r13d
	cmpl	$2, %r13d
	jb	LBB0_7
## %bb.1:
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	movl	$8, %r14d
	movl	$1589934592, %r15d              ## imm = 0x5EC47A00
	movl	$-1589934592, %r12d             ## imm = 0xA13B8600
	movl	$1, -56(%rbp)                   ## 4-byte Folded Spill
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	addl	$1000000000, %r15d              ## imm = 0x3B9ACA00
	addl	$-1000000000, %r12d             ## imm = 0xC4653600
	cmpl	$1, %r14d
	jbe	LBB0_8
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	movl	%r13d, %esi
	callq	_div_s64
	addl	$-8, %eax
	sarl	$4, %eax
	cmpl	$2, %eax
	movl	$1, %ecx
	cmovll	%ecx, %eax
	movl	%eax, %ecx
	shll	$4, %ecx
	leal	8(%rcx), %r8d
	movl	%r8d, %edx
	imull	%r13d, %edx
	addl	%r15d, %edx
	addl	$24, %ecx
	movl	%r13d, %edi
	imull	%ecx, %edi
	addl	%r15d, %edi
	movl	%edx, %esi
	negl	%esi
	cmovsl	%edx, %esi
	movl	%edi, %ebx
	negl	%ebx
	cmovsl	%edi, %ebx
	movl	%esi, %r9d
	imull	%ecx, %r9d
	movl	%ebx, %edi
	imull	%r8d, %edi
	cmpl	%edi, %r9d
	jg	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r8d, %ecx
	movl	%esi, %ebx
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	decl	%r14d
	movl	%ecx, %esi
	imull	-44(%rbp), %esi                 ## 4-byte Folded Reload
	movl	%ebx, %edx
	imull	-56(%rbp), %edx                 ## 4-byte Folded Reload
	cmpl	%edx, %esi
	jle	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edx, %edx
	cmpl	%edi, %r9d
	setg	%dl
	addl	%edx, %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, %eax
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	jmp	LBB0_6
LBB0_7:
	xorl	%ecx, %ecx
	cmpl	$1, %r13d
	sete	%cl
	movl	$249999999, %eax                ## imm = 0xEE6B27F
	movl	$268435455, %edx                ## imm = 0xFFFFFFF
	cmovel	%eax, %edx
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	shll	$2, %ecx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
LBB0_8:
	movq	_QED_DRIFT_CNTR_TIME_QUANTA_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_QED_DRIFT_CNTR_ADJUSTMENT_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_QED_DRIFT_CNTR_DIRECTION_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_NIG_REG_TSGEN_RST_DRIFT_CNTR@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	_qed_wr
	movl	(%r14), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_qed_rd
	testb	$1, %al
	jne	LBB0_9
## %bb.10:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_DP_INFO
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_9:
	movl	%r13d, %ecx
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	shll	%cl, %edx
	movq	%rbx, %r13
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	notl	%ebx
	movl	%r12d, %ecx
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	shll	%cl, %eax
	shrl	$31, %ebx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %ebx
	orl	%edx, %eax
	orl	%eax, %ebx
	movq	_NIG_REG_TSGEN_DRIFT_CNTR_CONF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%r13, %rsi
	movl	%ebx, %ecx
	callq	_qed_wr
	movl	(%r14), %edx
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	movq	%r13, %rsi
	xorl	%ecx, %ecx
	callq	_qed_wr
LBB0_11:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_QED_DRIFT_CNTR_TIME_QUANTA_SHIFT,4,2 ## @QED_DRIFT_CNTR_TIME_QUANTA_SHIFT
	.comm	_QED_DRIFT_CNTR_ADJUSTMENT_SHIFT,4,2 ## @QED_DRIFT_CNTR_ADJUSTMENT_SHIFT
	.comm	_QED_DRIFT_CNTR_DIRECTION_SHIFT,4,2 ## @QED_DRIFT_CNTR_DIRECTION_SHIFT
	.comm	_NIG_REG_TSGEN_RST_DRIFT_CNTR,4,2 ## @NIG_REG_TSGEN_RST_DRIFT_CNTR
	.comm	_NIG_REG_TSGEN_DRIFT_CNTR_CONF,4,2 ## @NIG_REG_TSGEN_DRIFT_CNTR_CONF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Drift counter is not reset\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_qed_ptp_hw_adjfreq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qed_ptp_hw_adjfreq
_qed_ptp_hw_adjfreq:                    ; @qed_ptp_hw_adjfreq
	.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
	bl	_QED_LEADING_HWFN
	ldr	x8, [x0]
	stp	x8, x0, [sp, #16]               ; 16-byte Folded Spill
	cmp	w19, #0
	str	w19, [sp, #12]                  ; 4-byte Folded Spill
	cneg	w22, w19, mi
	cmp	w22, #2
	b.lo	LBB0_5
; %bb.1:
	mov	w25, #0
	mov	w24, #0
	mov	w20, #1
	mov	w26, #8
	mov	w27, #31232
	movk	w27, #24260, lsl #16
	mov	w23, #34304
	movk	w23, #41275, lsl #16
	mov	w28, #51712
	movk	w28, #15258, lsl #16
	mov	w21, #13824
	movk	w21, #50277, lsl #16
	mov	x19, x22
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w27, w27, w28
	add	w23, w23, w21
	cmp	w26, #1
	b.ls	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	sub	w26, w26, #1
	mov	x0, x23
	mov	x1, x22
	bl	_div_s64
	sub	w8, w0, #8
	asr	w8, w8, #4
	cmp	w8, #1
	csinc	w8, w8, wzr, gt
	lsl	w9, w8, #4
	mov	w10, #8
	bfi	w10, w8, #4, #28
	madd	w11, w10, w22, w27
	add	w9, w9, #24
	madd	w12, w22, w9, w27
	cmp	w11, #0
	cneg	w13, w11, mi
	cmp	w12, #0
	cneg	w14, w12, mi
	mul	w11, w13, w9
	mul	w12, w14, w10
	cmp	w11, w12
	csel	w9, w9, w10, gt
	csel	w10, w14, w13, gt
	mul	w13, w9, w19
	mul	w14, w10, w20
	cmp	w13, w14
	b.le	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w11, w12
	cinc	w24, w8, gt
	mov	x25, x26
	mov	x19, x10
	mov	x20, x9
	b	LBB0_2
LBB0_5:
	mov	w8, #268435455
	mov	w9, #45695
	movk	w9, #3814, lsl #16
	cmp	w22, #1
	csel	w24, w9, w8, eq
	cset	w8, eq
	lsl	w25, w8, #2
LBB0_6:
Lloh0:
	adrp	x8, _QED_DRIFT_CNTR_TIME_QUANTA_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _QED_DRIFT_CNTR_TIME_QUANTA_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
Lloh3:
	adrp	x8, _QED_DRIFT_CNTR_ADJUSTMENT_SHIFT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _QED_DRIFT_CNTR_ADJUSTMENT_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
Lloh6:
	adrp	x8, _QED_DRIFT_CNTR_DIRECTION_SHIFT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _QED_DRIFT_CNTR_DIRECTION_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w22, [x8]
Lloh9:
	adrp	x19, _NIG_REG_TSGEN_RST_DRIFT_CNTR@GOTPAGE
Lloh10:
	ldr	x19, [x19, _NIG_REG_TSGEN_RST_DRIFT_CNTR@GOTPAGEOFF]
	ldr	w2, [x19]
	ldp	x26, x23, [sp, #16]             ; 16-byte Folded Reload
	mov	x0, x23
	mov	x1, x26
	mov	w3, #1
	bl	_qed_wr
	ldr	w2, [x19]
	mov	x0, x23
	mov	x1, x26
	bl	_qed_rd
	tbnz	w0, #0, LBB0_8
; %bb.7:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	bl	_DP_INFO
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_8:
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	mvn	w8, w8
	lsr	w8, w8, #31
	lsl	w9, w24, w20
	lsl	w10, w25, w21
	orr	w9, w10, w9
	lsl	w8, w8, w22
	orr	w3, w9, w8
Lloh16:
	adrp	x8, _NIG_REG_TSGEN_DRIFT_CNTR_CONF@GOTPAGE
Lloh17:
	ldr	x8, [x8, _NIG_REG_TSGEN_DRIFT_CNTR_CONF@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x23
	mov	x1, x26
	bl	_qed_wr
	ldr	w2, [x19]
	mov	x0, x23
	mov	x1, x26
	mov	w3, #0
	bl	_qed_wr
	mov	w0, #0
LBB0_9:
	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
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_QED_DRIFT_CNTR_TIME_QUANTA_SHIFT,4,2 ; @QED_DRIFT_CNTR_TIME_QUANTA_SHIFT
	.comm	_QED_DRIFT_CNTR_ADJUSTMENT_SHIFT,4,2 ; @QED_DRIFT_CNTR_ADJUSTMENT_SHIFT
	.comm	_QED_DRIFT_CNTR_DIRECTION_SHIFT,4,2 ; @QED_DRIFT_CNTR_DIRECTION_SHIFT
	.comm	_NIG_REG_TSGEN_RST_DRIFT_CNTR,4,2 ; @NIG_REG_TSGEN_RST_DRIFT_CNTR
	.comm	_NIG_REG_TSGEN_DRIFT_CNTR_CONF,4,2 ; @NIG_REG_TSGEN_DRIFT_CNTR_CONF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Drift counter is not reset\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_qed_ptp_hw_adjfreq
.subsections_via_symbols
