	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gem_ioctl
_gem_ioctl:                             ## @gem_ioctl
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %rbx
	callq	_netdev_priv
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_if_mii
	movq	%rax, %r12
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	4(%r13), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	leaq	8(%r13), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	%r13, %rdi
	callq	_gem_get_cell
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	cmpl	$128, %r14d
	je	LBB0_7
## %bb.1:
	cmpl	$129, %r14d
	je	LBB0_4
## %bb.2:
	cmpl	$130, %r14d
	jne	LBB0_10
## %bb.3:
	movl	(%r13), %eax
	movl	%eax, (%r12)
LBB0_4:
	cmpl	$0, 12(%r13)
	je	LBB0_5
## %bb.6:
	movl	(%r12), %esi
	movl	4(%r12), %edx
	andl	$31, %esi
	andl	$31, %edx
	movq	%r13, %rdi
	callq	___phy_read
	movl	%eax, 12(%r12)
	jmp	LBB0_9
LBB0_7:
	cmpl	$0, 12(%r13)
	je	LBB0_5
## %bb.8:
	movl	(%r12), %esi
	movl	4(%r12), %edx
	andl	$31, %esi
	andl	$31, %edx
	movl	8(%r12), %ecx
	movq	%r13, %rdi
	callq	___phy_write
LBB0_9:
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_5:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	%r13, %rdi
	callq	_gem_put_cell
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_gem_ioctl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gem_ioctl
_gem_ioctl:                             ; @gem_ioctl
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x23, x2
	mov	x20, x1
	bl	_netdev_priv
	mov	x19, x0
	mov	x0, x20
	bl	_if_mii
	mov	x22, x0
Lloh0:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
	add	x20, x19, #4
	mov	x0, x20
	bl	_mutex_lock
	add	x21, x19, #8
	mov	x0, x21
	bl	_spin_lock_irqsave
	mov	x0, x19
	bl	_gem_get_cell
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	cmp	w23, #128
	b.eq	LBB0_6
; %bb.1:
	cmp	w23, #129
	b.eq	LBB0_4
; %bb.2:
	cmp	w23, #130
	b.ne	LBB0_9
; %bb.3:
	ldr	w8, [x19]
	str	w8, [x22]
LBB0_4:
	ldr	w8, [x19, #12]
	cbz	w8, LBB0_8
; %bb.5:
	ldp	w8, w9, [x22]
	and	w1, w8, #0x1f
	and	w2, w9, #0x1f
	mov	x0, x19
	bl	___phy_read
	mov	w23, #0
	str	w0, [x22, #12]
	b	LBB0_10
LBB0_6:
	ldr	w8, [x19, #12]
	cbz	w8, LBB0_8
; %bb.7:
	ldp	w8, w9, [x22]
	and	w1, w8, #0x1f
	and	w2, w9, #0x1f
	ldr	w3, [x22, #8]
	mov	x0, x19
	bl	___phy_write
	mov	w23, #0
	b	LBB0_10
LBB0_8:
Lloh3:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_10
LBB0_9:
	neg	w23, w24
LBB0_10:
	mov	x0, x21
	bl	_spin_lock_irqsave
	mov	x0, x19
	bl	_gem_put_cell
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x23
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_gem_ioctl
.subsections_via_symbols
