	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_asix_set_eeprom                ## -- Begin function asix_set_eeprom
	.p2align	4, 0x90
_asix_set_eeprom:                       ## @asix_set_eeprom
	.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
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r12
	callq	_netdev_priv
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	16(%r14), %edx
	movl	(%r14), %ecx
	movq	8(%r14), %r8
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_netdev_dbg
	movl	16(%r14), %eax
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	8(%r14), %rcx
	movq	_AX_EEPROM_MAGIC@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_3
## %bb.5:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movl	(%r14), %ecx
	leal	(%rax,%rcx), %r15d
	decl	%r15d
	movl	%ecx, %ebx
	sarl	%ebx
	sarl	%r15d
	movl	%r15d, %r13d
	subl	%ebx, %r13d
	leal	1(%r13), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$4, %esi
	callq	_kmalloc_array
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movl	(%r14), %esi
	testb	$1, %sil
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_10
## %bb.8:
	movl	%r15d, -60(%rbp)                ## 4-byte Spill
	movq	_AX_CMD_READ_EEPROM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	$0, (%rsp)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	movl	$2, %r8d
	movq	%rax, %r9
	callq	_asix_read_cmd
	testl	%eax, %eax
	js	LBB0_15
## %bb.9:
	movl	(%r14), %esi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	-60(%rbp), %r15d                ## 4-byte Reload
LBB0_10:
	movl	16(%r14), %edx
	leal	(%rdx,%rsi), %ecx
	testb	$1, %cl
	je	LBB0_13
## %bb.11:
	movq	_AX_CMD_READ_EEPROM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movslq	%r13d, %rcx
	leaq	(%rax,%rcx,4), %r9
	movl	$0, (%rsp)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %edx
	xorl	%ecx, %ecx
	movl	$2, %r8d
	callq	_asix_read_cmd
	movl	%r15d, %ecx
	testl	%eax, %eax
	js	LBB0_18
## %bb.12:
	movl	(%r14), %esi
	movl	16(%r14), %edx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%ecx, %r15d
LBB0_13:
	movl	%r15d, %r13d
	andl	$1, %esi
	leaq	(%rax,%rsi,4), %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movq	_AX_CMD_WRITE_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$0, (%rsp)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_asix_write_cmd
	testl	%eax, %eax
	js	LBB0_14
## %bb.19:
	movl	$20, %edi
	callq	_msleep
	cmpl	%ebx, %r13d
	jl	LBB0_24
## %bb.20:
	incl	%r13d
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %ecx
	movq	%r12, %rdi
	leaq	L_.str.3(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_netdev_dbg
	movq	_AX_CMD_WRITE_EEPROM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %ecx
	movl	$0, (%rsp)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_asix_write_cmd
	testl	%eax, %eax
	js	LBB0_22
## %bb.23:                              ##   in Loop: Header=BB0_21 Depth=1
	movl	$20, %edi
	callq	_msleep
	incl	%ebx
	addq	$4, %r14
	cmpl	%ebx, %r13d
	jne	LBB0_21
LBB0_24:
	movq	_AX_CMD_WRITE_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$0, (%rsp)
	xorl	%r15d, %r15d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_asix_write_cmd
	testl	%eax, %eax
	jns	LBB0_26
## %bb.25:
	movl	%eax, %ebx
	leaq	L_.str.5(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_netdev_err
	movl	%ebx, %r15d
	jmp	LBB0_26
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_27
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_27
LBB0_14:
	movl	%eax, %r15d
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_netdev_err
	jmp	LBB0_26
LBB0_15:
	movl	%eax, %r15d
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_16
LBB0_18:
	movl	%eax, %r15d
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movl	%ecx, %edx
	jmp	LBB0_17
LBB0_22:
	movl	%eax, %r15d
	leaq	L_.str.4(%rip), %rsi
LBB0_16:
	movq	%r12, %rdi
	movl	%ebx, %edx
LBB0_17:
	xorl	%eax, %eax
	callq	_netdev_err
LBB0_26:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
LBB0_27:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write EEPROM len %d, offset %d, magic 0x%x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AX_EEPROM_MAGIC,8,3            ## @AX_EEPROM_MAGIC
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AX_CMD_READ_EEPROM,4,2         ## @AX_CMD_READ_EEPROM
L_.str.1:                               ## @.str.1
	.asciz	"Failed to read EEPROM at offset 0x%02x.\n"

	.comm	_AX_CMD_WRITE_ENABLE,4,2        ## @AX_CMD_WRITE_ENABLE
L_.str.2:                               ## @.str.2
	.asciz	"Failed to enable EEPROM write\n"

L_.str.3:                               ## @.str.3
	.asciz	"write to EEPROM at offset 0x%02x, data 0x%04x\n"

	.comm	_AX_CMD_WRITE_EEPROM,4,2        ## @AX_CMD_WRITE_EEPROM
L_.str.4:                               ## @.str.4
	.asciz	"Failed to write EEPROM at offset 0x%02x.\n"

	.comm	_AX_CMD_WRITE_DISABLE,4,2       ## @AX_CMD_WRITE_DISABLE
L_.str.5:                               ## @.str.5
	.asciz	"Failed to disable EEPROM write\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_asix_set_eeprom                ; -- Begin function asix_set_eeprom
	.p2align	2
_asix_set_eeprom:                       ; @asix_set_eeprom
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x24, x2
	mov	x25, x1
	mov	x19, x0
	bl	_netdev_priv
	mov	x21, x0
	ldr	w2, [x25, #16]
	ldr	w3, [x25]
	ldr	x8, [x25, #8]
	str	x8, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_netdev_dbg
	ldr	w8, [x25, #16]
	cbz	w8, LBB0_16
; %bb.1:
	ldr	x9, [x25, #8]
Lloh2:
	adrp	x10, _AX_EEPROM_MAGIC@GOTPAGE
Lloh3:
	ldr	x10, [x10, _AX_EEPROM_MAGIC@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_16
; %bb.2:
	ldr	w9, [x25]
	asr	w22, w9, #1
	add	w8, w8, w9
	sub	w8, w8, #1
	asr	w23, w8, #1
	sub	w27, w23, w22
	add	w0, w27, #1
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	w1, #4
	bl	_kmalloc_array
	cbz	x0, LBB0_19
; %bb.3:
	mov	x20, x0
	ldr	w8, [x25]
	tbz	w8, #0, LBB0_6
; %bb.4:
Lloh8:
	adrp	x8, _AX_CMD_READ_EEPROM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AX_CMD_READ_EEPROM@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x22
	mov	w3, #0
	mov	w4, #2
	mov	x5, x20
	mov	w6, #0
	bl	_asix_read_cmd
	tbnz	w0, #31, LBB0_21
; %bb.5:
	ldr	w8, [x25]
LBB0_6:
	ldr	w2, [x25, #16]
	add	w9, w2, w8
	tbz	w9, #0, LBB0_9
; %bb.7:
Lloh11:
	adrp	x8, _AX_CMD_READ_EEPROM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AX_CMD_READ_EEPROM@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	add	x5, x20, w27, sxtw #2
	mov	x0, x21
	mov	x2, x23
	mov	w3, #0
	mov	w4, #2
	mov	w6, #0
	bl	_asix_read_cmd
	tbnz	w0, #31, LBB0_22
; %bb.8:
	ldr	w8, [x25]
	ldr	w2, [x25, #16]
LBB0_9:
	and	w8, w8, #0x1
	add	x0, x20, w8, uxtw #2
	mov	x1, x24
	bl	_memcpy
Lloh14:
	adrp	x8, _AX_CMD_WRITE_ENABLE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AX_CMD_WRITE_ENABLE@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x21
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	mov	x5, #0
	mov	w6, #0
	bl	_asix_write_cmd
	tbnz	w0, #31, LBB0_20
; %bb.10:
	mov	w0, #20
	bl	_msleep
	cmp	w23, w22
	b.lt	LBB0_14
; %bb.11:
	add	w24, w23, #1
Lloh17:
	adrp	x25, _AX_CMD_WRITE_EEPROM@GOTPAGE
Lloh18:
	ldr	x25, [x25, _AX_CMD_WRITE_EEPROM@GOTPAGEOFF]
	mov	x27, x20
Lloh19:
	adrp	x23, l_.str.3@PAGE
Lloh20:
	add	x23, x23, l_.str.3@PAGEOFF
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	w3, [x27]
	mov	x0, x19
	mov	x1, x23
	mov	x2, x22
	bl	_netdev_dbg
	ldr	w1, [x25]
	ldr	w3, [x27]
	mov	x0, x21
	mov	x2, x22
	mov	w4, #0
	mov	x5, #0
	mov	w6, #0
	bl	_asix_write_cmd
	tbnz	w0, #31, LBB0_24
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	w0, #20
	bl	_msleep
	add	w22, w22, #1
	add	x27, x27, #4
	cmp	w24, w22
	b.ne	LBB0_12
LBB0_14:
Lloh21:
	adrp	x8, _AX_CMD_WRITE_DISABLE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AX_CMD_WRITE_DISABLE@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x21
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	mov	x5, #0
	mov	w6, #0
	bl	_asix_write_cmd
	mov	w26, #0
	tbz	w0, #31, LBB0_26
; %bb.15:
	mov	x21, x0
Lloh24:
	adrp	x1, l_.str.5@PAGE
Lloh25:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_netdev_err
	mov	x26, x21
	b	LBB0_26
LBB0_16:
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_17:
	ldr	w8, [x8]
	neg	w26, w8
LBB0_18:
	mov	x0, x26
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_19:
Lloh28:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_17
LBB0_20:
	mov	x26, x0
Lloh30:
	adrp	x1, l_.str.2@PAGE
Lloh31:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_25
LBB0_21:
	mov	x26, x0
	str	x22, [sp]
	b	LBB0_23
LBB0_22:
	mov	x26, x0
	str	x23, [sp]
LBB0_23:
Lloh32:
	adrp	x1, l_.str.1@PAGE
Lloh33:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_25
LBB0_24:
	mov	x26, x0
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	str	x22, [sp]
Lloh34:
	adrp	x1, l_.str.4@PAGE
Lloh35:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_25:
	mov	x0, x19
	bl	_netdev_err
LBB0_26:
	mov	x0, x20
	bl	_kfree
	b	LBB0_18
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write EEPROM len %d, offset %d, magic 0x%x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AX_EEPROM_MAGIC,8,3            ; @AX_EEPROM_MAGIC
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AX_CMD_READ_EEPROM,4,2         ; @AX_CMD_READ_EEPROM
l_.str.1:                               ; @.str.1
	.asciz	"Failed to read EEPROM at offset 0x%02x.\n"

	.comm	_AX_CMD_WRITE_ENABLE,4,2        ; @AX_CMD_WRITE_ENABLE
l_.str.2:                               ; @.str.2
	.asciz	"Failed to enable EEPROM write\n"

l_.str.3:                               ; @.str.3
	.asciz	"write to EEPROM at offset 0x%02x, data 0x%04x\n"

	.comm	_AX_CMD_WRITE_EEPROM,4,2        ; @AX_CMD_WRITE_EEPROM
l_.str.4:                               ; @.str.4
	.asciz	"Failed to write EEPROM at offset 0x%02x.\n"

	.comm	_AX_CMD_WRITE_DISABLE,4,2       ; @AX_CMD_WRITE_DISABLE
l_.str.5:                               ; @.str.5
	.asciz	"Failed to disable EEPROM write\n"

.subsections_via_symbols
