	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_c4iw_id_alloc                  ## -- Begin function c4iw_id_alloc
	.p2align	4, 0x90
_c4iw_id_alloc:                         ## @c4iw_id_alloc
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	12(%rdi), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movl	24(%rbx), %edi
	movl	(%rbx), %esi
	movl	4(%rbx), %edx
	callq	_find_next_zero_bit
	movl	(%rbx), %esi
	cmpl	%esi, %eax
	jge	LBB0_2
## %bb.1:
	movl	%eax, %r15d
	jmp	LBB0_3
LBB0_2:
	movl	24(%rbx), %edi
	callq	_find_first_zero_bit
	movl	%eax, %r15d
	movl	(%rbx), %esi
LBB0_3:
	movl	$-1, %r12d
	cmpl	%esi, %r15d
	jge	LBB0_8
## %bb.4:
	movq	_C4IW_ID_TABLE_F_RANDOM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_6
## %bb.5:
	xorl	%eax, %eax
	callq	_prandom_u32
	movq	_RANDOM_SKIP@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	addl	4(%rbx), %edx
	movl	(%rbx), %esi
	jmp	LBB0_7
LBB0_6:
	leal	1(%r15), %edx
LBB0_7:
	xorl	%eax, %eax
	cmpl	%esi, %edx
	cmovll	%edx, %eax
	movl	%eax, 4(%rbx)
	movl	24(%rbx), %esi
	movl	%r15d, %edi
	callq	_set_bit
	addl	16(%rbx), %r15d
	movl	%r15d, %r12d
LBB0_8:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_C4IW_ID_TABLE_F_RANDOM,4,2     ## @C4IW_ID_TABLE_F_RANDOM
	.comm	_RANDOM_SKIP,4,2                ## @RANDOM_SKIP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_c4iw_id_alloc                  ; -- Begin function c4iw_id_alloc
	.p2align	2
_c4iw_id_alloc:                         ; @c4iw_id_alloc
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x0
	add	x19, x0, #12
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	w0, [x20, #24]
	ldp	w1, w2, [x20]
	bl	_find_next_zero_bit
	ldr	w1, [x20]
	cmp	w0, w1
	b.ge	LBB0_3
; %bb.1:
	mov	x21, x0
	cmp	w21, w1
	b.lt	LBB0_4
LBB0_2:
	mov	w20, #-1
	b	LBB0_8
LBB0_3:
	ldr	w0, [x20, #24]
	bl	_find_first_zero_bit
	mov	x21, x0
	ldr	w1, [x20]
	cmp	w21, w1
	b.ge	LBB0_2
LBB0_4:
	ldr	w8, [x20, #8]
Lloh0:
	adrp	x9, _C4IW_ID_TABLE_F_RANDOM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _C4IW_ID_TABLE_F_RANDOM@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	bl	_prandom_u32
Lloh3:
	adrp	x8, _RANDOM_SKIP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RANDOM_SKIP@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	sdiv	w9, w0, w8
	msub	w8, w9, w8, w0
	ldp	w1, w9, [x20]
	add	w8, w9, w8
	b	LBB0_7
LBB0_6:
	add	w8, w21, #1
LBB0_7:
	cmp	w8, w1
	csel	w8, w8, wzr, lt
	str	w8, [x20, #4]
	ldr	w1, [x20, #24]
	mov	x0, x21
	bl	_set_bit
	ldr	w8, [x20, #16]
	add	w20, w21, w8
LBB0_8:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_C4IW_ID_TABLE_F_RANDOM,4,2     ; @C4IW_ID_TABLE_F_RANDOM
	.comm	_RANDOM_SKIP,4,2                ; @RANDOM_SKIP
.subsections_via_symbols
