	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sfp_sm_mod_hpower
_sfp_sm_mod_hpower:                     ## @sfp_sm_mod_hpower
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movl	8(%rdi), %ebx
	movq	_SFP_OPTIONS_POWER_DECL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_be16
	testl	%ebx, %eax
	movl	$1000, %eax                     ## imm = 0x3E8
	movl	$1500, %ebx                     ## imm = 0x5DC
	cmovel	%eax, %ebx
	movl	8(%r12), %r14d
	movq	_SFP_OPTIONS_HIGH_POWER_LEVEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_be16
	testl	%r14d, %eax
	movl	$2000, %r15d                    ## imm = 0x7D0
	cmovel	%ebx, %r15d
	movq	16(%r12), %rax
	movq	_SFP_SFF8472_COMPLIANCE_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.1:
	movq	_SFP_DIAGMON_DDM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_SFP_DIAGMON_ADDRMODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%eax, %ecx
	andl	24(%r12), %ecx
	cmpl	%eax, %ecx
	jne	LBB0_2
LBB0_4:
	cmpl	(%r12), %r15d
	jle	LBB0_6
## %bb.5:
	movl	4(%r12), %edi
	movl	%r15d, %eax
	shrl	$3, %eax
	imull	$8389, %eax, %edx               ## imm = 0x20C5
	shrl	$20, %edx
	shrl	$2, %r15d
	imull	$5243, %r15d, %eax              ## imm = 0x147B
	shrl	$17, %eax
	imull	$205, %eax, %ecx
	shrl	$10, %ecx
	andl	$-2, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subb	%cl, %al
	movzbl	%al, %ecx
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_warn
	xorl	%r14d, %r14d
	jmp	LBB0_13
LBB0_6:
	xorl	%r14d, %r14d
	cmpl	$1001, %r15d                    ## imm = 0x3E9
	jb	LBB0_13
## %bb.7:
	movq	_SFP_EXT_STATUS@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	leaq	-36(%rbp), %rcx
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$4, %r8d
	callq	_sfp_read
	cmpl	$4, %eax
	jne	LBB0_8
## %bb.9:
	xorl	%edi, %edi
	callq	_BIT
	orl	%eax, -36(%rbp)
	movl	(%r14), %edx
	leaq	-36(%rbp), %rcx
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$4, %r8d
	callq	_sfp_write
	movl	4(%r12), %edi
	cmpl	$4, %eax
	jne	LBB0_10
## %bb.14:
	movl	%r15d, %eax
	shrl	$3, %eax
	imull	$8389, %eax, %edx               ## imm = 0x20C5
	shrl	$20, %edx
	shrl	$2, %r15d
	imull	$5243, %r15d, %eax              ## imm = 0x147B
	shrl	$17, %eax
	imull	$205, %eax, %ecx
	shrl	$10, %ecx
	andl	$-2, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subb	%cl, %al
	movzbl	%al, %ecx
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_info
	movq	_T_HPOWER_LEVEL@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_13
LBB0_2:
	xorl	%r14d, %r14d
	cmpl	(%r12), %r15d
	jle	LBB0_13
## %bb.3:
	movl	4(%r12), %edi
	movl	%r15d, %eax
	shrl	$3, %eax
	imull	$8389, %eax, %edx               ## imm = 0x20C5
	shrl	$20, %edx
	shrl	$2, %r15d
	imull	$5243, %r15d, %eax              ## imm = 0x147B
	shrl	$17, %eax
	imull	$205, %eax, %ecx
	shrl	$10, %ecx
	andl	$-2, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subb	%cl, %al
	movzbl	%al, %ecx
	leaq	L_.str(%rip), %rsi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_8:
	movl	4(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_11
LBB0_10:
	leaq	L_.str.3(%rip), %rsi
LBB0_11:
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
LBB0_12:
	subl	(%rax), %r14d
LBB0_13:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SFP_OPTIONS_POWER_DECL,4,2     ## @SFP_OPTIONS_POWER_DECL
	.comm	_SFP_OPTIONS_HIGH_POWER_LEVEL,4,2 ## @SFP_OPTIONS_HIGH_POWER_LEVEL
	.comm	_SFP_SFF8472_COMPLIANCE_NONE,8,3 ## @SFP_SFF8472_COMPLIANCE_NONE
	.comm	_SFP_DIAGMON_DDM,4,2            ## @SFP_DIAGMON_DDM
	.comm	_SFP_DIAGMON_ADDRMODE,4,2       ## @SFP_DIAGMON_ADDRMODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Host does not support %u.%uW modules\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Host does not support %u.%uW modules, module left in power mode 1\n"

	.comm	_SFP_EXT_STATUS,4,2             ## @SFP_EXT_STATUS
L_.str.2:                               ## @.str.2
	.asciz	"Failed to read EEPROM: %d\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
L_.str.3:                               ## @.str.3
	.asciz	"Failed to write EEPROM: %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"Module switched to %u.%uW power level\n"

	.comm	_T_HPOWER_LEVEL,4,2             ## @T_HPOWER_LEVEL
	.no_dead_strip	_sfp_sm_mod_hpower
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sfp_sm_mod_hpower
_sfp_sm_mod_hpower:                     ; @sfp_sm_mod_hpower
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	w20, [x0, #8]
Lloh0:
	adrp	x8, _SFP_OPTIONS_POWER_DECL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SFP_OPTIONS_POWER_DECL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_cpu_to_be16
	tst	w0, w20
	mov	w8, #1500
	mov	w9, #1000
	csel	w20, w9, w8, eq
	ldr	w21, [x19, #8]
Lloh3:
	adrp	x8, _SFP_OPTIONS_HIGH_POWER_LEVEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SFP_OPTIONS_HIGH_POWER_LEVEL@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_cpu_to_be16
	tst	w0, w21
	mov	w8, #2000
	csel	w20, w20, w8, eq
	ldr	x8, [x19, #16]
Lloh6:
	adrp	x9, _SFP_SFF8472_COMPLIANCE_NONE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SFP_SFF8472_COMPLIANCE_NONE@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x19, #24]
Lloh9:
	adrp	x9, _SFP_DIAGMON_DDM@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SFP_DIAGMON_DDM@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x10, _SFP_DIAGMON_ADDRMODE@GOTPAGE
Lloh13:
	ldr	x10, [x10, _SFP_DIAGMON_ADDRMODE@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	orr	w10, w10, w9
	and	w8, w10, w8
	cmp	w8, w9
	b.ne	LBB0_8
LBB0_2:
	ldr	w8, [x19]
	cmp	w20, w8
	b.le	LBB0_4
; %bb.3:
	ldr	w0, [x19, #4]
	lsr	w8, w20, #3
	mov	w9, #8389
	mul	w8, w8, w9
	lsr	w2, w8, #20
	lsr	w8, w20, #2
	mov	w9, #5243
	mul	w8, w8, w9
	lsr	w8, w8, #17
	mov	w9, #205
	mul	w9, w8, w9
	lsr	w9, w9, #11
	mov	w10, #10
	msub	w8, w9, w10, w8
	and	w3, w8, #0xff
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
	mov	w0, #0
	b	LBB0_15
LBB0_4:
	cmp	w20, #1001
	b.lo	LBB0_10
; %bb.5:
Lloh17:
	adrp	x21, _SFP_EXT_STATUS@GOTPAGE
Lloh18:
	ldr	x21, [x21, _SFP_EXT_STATUS@GOTPAGEOFF]
	ldr	w2, [x21]
	add	x3, sp, #12
	mov	x0, x19
	mov	w1, #1
	mov	w4, #4
	bl	_sfp_read
	cmp	w0, #4
	b.ne	LBB0_11
; %bb.6:
	mov	w0, #0
	bl	_BIT
	ldr	w8, [sp, #12]
	orr	w8, w8, w0
	str	w8, [sp, #12]
	ldr	w2, [x21]
	add	x3, sp, #12
	mov	x0, x19
	mov	w1, #1
	mov	w4, #4
	bl	_sfp_write
	mov	x2, x0
	ldr	w0, [x19, #4]
	cmp	w2, #4
	b.ne	LBB0_12
; %bb.7:
	lsr	w8, w20, #3
	mov	w9, #8389
	mul	w8, w8, w9
	lsr	w2, w8, #20
	lsr	w8, w20, #2
	mov	w9, #5243
	mul	w8, w8, w9
	lsr	w8, w8, #17
	mov	w9, #205
	mul	w9, w8, w9
	lsr	w9, w9, #11
	mov	w10, #10
	msub	w8, w9, w10, w8
	and	w3, w8, #0xff
Lloh19:
	adrp	x1, l_.str.4@PAGE
Lloh20:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_info
Lloh21:
	adrp	x8, _T_HPOWER_LEVEL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _T_HPOWER_LEVEL@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	b	LBB0_15
LBB0_8:
	ldr	w8, [x19]
	cmp	w20, w8
	b.le	LBB0_10
; %bb.9:
	ldr	w0, [x19, #4]
	lsr	w8, w20, #3
	mov	w9, #8389
	mul	w8, w8, w9
	lsr	w2, w8, #20
	lsr	w8, w20, #2
	mov	w9, #5243
	mul	w8, w8, w9
	lsr	w8, w8, #17
	mov	w9, #205
	mul	w9, w8, w9
	lsr	w9, w9, #11
	mov	w10, #10
	msub	w8, w9, w10, w8
	and	x8, x8, #0xff
	str	x8, [sp]
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_14
LBB0_10:
	mov	w0, #0
	b	LBB0_15
LBB0_11:
	mov	x2, x0
	ldr	w0, [x19, #4]
Lloh28:
	adrp	x1, l_.str.2@PAGE
Lloh29:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_13
LBB0_12:
Lloh30:
	adrp	x1, l_.str.3@PAGE
Lloh31:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_13:
	bl	_dev_err
Lloh32:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_SFP_OPTIONS_POWER_DECL,4,2     ; @SFP_OPTIONS_POWER_DECL
	.comm	_SFP_OPTIONS_HIGH_POWER_LEVEL,4,2 ; @SFP_OPTIONS_HIGH_POWER_LEVEL
	.comm	_SFP_SFF8472_COMPLIANCE_NONE,8,3 ; @SFP_SFF8472_COMPLIANCE_NONE
	.comm	_SFP_DIAGMON_DDM,4,2            ; @SFP_DIAGMON_DDM
	.comm	_SFP_DIAGMON_ADDRMODE,4,2       ; @SFP_DIAGMON_ADDRMODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Host does not support %u.%uW modules\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Host does not support %u.%uW modules, module left in power mode 1\n"

	.comm	_SFP_EXT_STATUS,4,2             ; @SFP_EXT_STATUS
l_.str.2:                               ; @.str.2
	.asciz	"Failed to read EEPROM: %d\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
l_.str.3:                               ; @.str.3
	.asciz	"Failed to write EEPROM: %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"Module switched to %u.%uW power level\n"

	.comm	_T_HPOWER_LEVEL,4,2             ; @T_HPOWER_LEVEL
	.no_dead_strip	_sfp_sm_mod_hpower
.subsections_via_symbols
