	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_siw_alloc_ucontext             ## -- Begin function siw_alloc_ucontext
	.p2align	4, 0x90
_siw_alloc_ucontext:                    ## @siw_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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	movl	(%rdi), %edi
	callq	_to_siw_dev
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_to_siw_ctx
	movq	%rax, %rbx
	movl	$0, -40(%rbp)
	movq	%r15, %rdi
	callq	_atomic_inc_return
	movq	_SIW_MAX_CONTEXT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_4
## %bb.1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movq	%rbx, %rdi
	addq	$16, %rdi
	movq	_XA_FLAGS_ALLOC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_xa_init_flags
	movq	$0, 8(%rbx)
	movq	%r15, (%rbx)
	movl	4(%r15), %eax
	movl	%eax, -40(%rbp)
	cmpl	$3, (%r12)
	ja	LBB0_6
## %bb.5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_3:
	movq	%r15, %rdi
	callq	_atomic_dec
	movl	(%r14), %r14d
	movq	%r15, %rdi
	callq	_atomic_read
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edi
	movl	%ebx, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_siw_dbg
LBB0_8:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	leaq	-40(%rbp), %rsi
	movq	%r12, %rdi
	movl	$4, %edx
	callq	_ib_copy_to_udata
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_3
## %bb.7:
	movl	(%r14), %r14d
	movq	%r15, %rdi
	callq	_atomic_read
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%r14d, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_siw_dbg
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_SIW_MAX_CONTEXT,8,3            ## @SIW_MAX_CONTEXT
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_XA_FLAGS_ALLOC,4,2             ## @XA_FLAGS_ALLOC
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"success. now %d context(s)\n"

L_.str.1:                               ## @.str.1
	.asciz	"failure %d. now %d context(s)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_siw_alloc_ucontext             ; -- Begin function siw_alloc_ucontext
	.p2align	2
_siw_alloc_ucontext:                    ; @siw_alloc_ucontext
	.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	x21, x1
	mov	x19, x0
	ldr	w0, [x0]
	bl	_to_siw_dev
	mov	x20, x0
	mov	x0, x19
	bl	_to_siw_ctx
	mov	x22, x0
	str	wzr, [sp, #8]
	mov	x0, x20
	bl	_atomic_inc_return
Lloh0:
	adrp	x8, _SIW_MAX_CONTEXT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SIW_MAX_CONTEXT@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.le	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
	add	x0, x22, #16
Lloh5:
	adrp	x8, _XA_FLAGS_ALLOC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _XA_FLAGS_ALLOC@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_xa_init_flags
	stp	x20, xzr, [x22]
	ldr	w8, [x20, #4]
	str	w8, [sp, #8]
	ldr	w8, [x21]
	cmp	w8, #3
	b.hi	LBB0_7
; %bb.3:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_5:
	mov	x0, x20
	bl	_atomic_dec
	ldr	w19, [x19]
	mov	x0, x20
	bl	_atomic_read
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
LBB0_6:
	bl	_siw_dbg
	mov	x0, x21
	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
LBB0_7:
	add	x1, sp, #8
	mov	x0, x21
	mov	w2, #4
	bl	_ib_copy_to_udata
	mov	x21, x0
	cbnz	w0, LBB0_5
; %bb.8:
	ldr	w19, [x19]
	mov	x0, x20
	bl	_atomic_read
	mov	x2, x0
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_SIW_MAX_CONTEXT,8,3            ; @SIW_MAX_CONTEXT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_XA_FLAGS_ALLOC,4,2             ; @XA_FLAGS_ALLOC
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"success. now %d context(s)\n"

l_.str.1:                               ; @.str.1
	.asciz	"failure %d. now %d context(s)\n"

.subsections_via_symbols
