	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i40iw_alloc_ucontext
_i40iw_alloc_ucontext:                  ## @i40iw_alloc_ucontext
	.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	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	callq	_to_iwdev
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_to_ucontext
	movq	%rax, %r14
	leaq	-40(%rbp), %rdi
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_ib_copy_from_udata
	testq	%rax, %rax
	jne	LBB0_1
## %bb.3:
	movl	-40(%rbp), %esi
	cmpl	$4, %esi
	jl	LBB0_5
## %bb.4:
	movq	_I40IW_ABI_VER@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jg	LBB0_5
## %bb.6:
	movl	8(%r15), %eax
	movl	%eax, -44(%rbp)
	movl	4(%r15), %eax
	movl	%eax, -48(%rbp)
	movl	(%r15), %eax
	addl	%eax, %eax
	movl	%eax, -56(%rbp)
	movl	%esi, -52(%rbp)
	movq	%r15, 24(%r14)
	movl	%esi, (%r14)
	leaq	-56(%rbp), %rsi
	movq	%r12, %rdi
	movl	$16, %edx
	callq	_ib_copy_to_udata
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_EFAULT@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_5:
	leaq	L_.str(%rip), %rdi
	callq	_i40iw_pr_err
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	leaq	16(%r14), %rdi
	callq	_INIT_LIST_HEAD
	leaq	12(%r14), %rdi
	callq	_spin_lock_init
	leaq	8(%r14), %rdi
	callq	_INIT_LIST_HEAD
	addq	$4, %r14
	movq	%r14, %rdi
	callq	_spin_lock_init
	xorl	%eax, %eax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_I40IW_ABI_VER,4,2              ## @I40IW_ABI_VER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupported provider library version %u.\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.no_dead_strip	_i40iw_alloc_ucontext
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i40iw_alloc_ucontext
_i40iw_alloc_ucontext:                  ; @i40iw_alloc_ucontext
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x1
	mov	x19, x0
	ldr	x0, [x0]
	bl	_to_iwdev
	mov	x21, x0
	mov	x0, x19
	bl	_to_ucontext
	mov	x19, x0
	add	x0, sp, #24
	mov	x1, x20
	mov	w2, #4
	bl	_ib_copy_from_udata
	cbnz	x0, LBB0_3
; %bb.1:
	ldr	w1, [sp, #24]
Lloh0:
	adrp	x8, _I40IW_ABI_VER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I40IW_ABI_VER@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w1, #4
	ccmp	w1, w8, #0, ge
	b.le	LBB0_6
; %bb.2:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_i40iw_pr_err
LBB0_3:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_6:
	ldur	d0, [x21, #4]
	str	d0, [sp, #16]
	ldr	w8, [x21]
	lsl	w8, w8, #1
	stp	w8, w1, [sp, #8]
	str	x21, [x19, #24]
	str	w1, [x19]
	add	x1, sp, #8
	mov	x0, x20
	mov	w2, #16
	bl	_ib_copy_to_udata
	cbz	x0, LBB0_8
; %bb.7:
Lloh7:
	adrp	x8, _EFAULT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_4
LBB0_8:
	add	x0, x19, #16
	bl	_INIT_LIST_HEAD
	add	x0, x19, #12
	bl	_spin_lock_init
	add	x0, x19, #8
	bl	_INIT_LIST_HEAD
	add	x0, x19, #4
	bl	_spin_lock_init
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_I40IW_ABI_VER,4,2              ; @I40IW_ABI_VER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupported provider library version %u.\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.no_dead_strip	_i40iw_alloc_ucontext
.subsections_via_symbols
