	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fw_core_add_descriptor         ## -- Begin function fw_core_add_descriptor
	.p2align	4, 0x90
_fw_core_add_descriptor:                ## @fw_core_add_descriptor
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	8(%rbx), %rdx
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movswq	2(%rdx,%rcx,4), %rsi
	addq	%rsi, %rcx
	incq	%rcx
	cmpq	%rax, %rcx
	jb	LBB0_3
## %bb.4:
	cmpq	%rax, %rcx
	jne	LBB0_5
LBB0_6:
	movq	_card_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_config_rom_length@GOTPCREL(%rip), %r14
	movl	(%r14), %r15d
	movq	%rbx, %rdi
	callq	_required_space
	addl	%r15d, %eax
	cmpl	$257, %eax                      ## imm = 0x101
	jl	LBB0_8
## %bb.7:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_1:
	xorl	%ecx, %ecx
	cmpq	%rax, %rcx
	je	LBB0_6
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_8:
	leaq	24(%rbx), %rdi
	movq	_descriptor_list@GOTPCREL(%rip), %rsi
	callq	_list_add_tail
	movq	%rbx, %rdi
	callq	_required_space
	addl	%eax, (%r14)
	movq	_descriptor_count@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leal	1(%rcx), %edx
	movl	%edx, (%rax)
	cmpq	$0, 16(%rbx)
	jle	LBB0_10
## %bb.9:
	addl	$2, %ecx
	movl	%ecx, (%rax)
LBB0_10:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_update_config_roms
LBB0_11:
	movq	_card_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_card_mutex,4,2                 ## @card_mutex
	.comm	_config_rom_length,4,2          ## @config_rom_length
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_descriptor_list,4,2            ## @descriptor_list
	.comm	_descriptor_count,4,2           ## @descriptor_count
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fw_core_add_descriptor         ; -- Begin function fw_core_add_descriptor
	.p2align	2
_fw_core_add_descriptor:                ; @fw_core_add_descriptor
	.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	x19, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_6
; %bb.1:
	mov	x9, #0
	ldr	x10, [x19, #8]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x11, x10, x9, lsl #2
	ldrsh	w11, [x11, #2]
	add	w11, w11, #1
	add	x9, x9, w11, sxtw
	cmp	x9, x8
	b.lo	LBB0_2
; %bb.3:
	cmp	x9, x8
	b.ne	LBB0_7
LBB0_4:
Lloh0:
	adrp	x0, _card_mutex@GOTPAGE
Lloh1:
	ldr	x0, [x0, _card_mutex@GOTPAGEOFF]
	bl	_mutex_lock
Lloh2:
	adrp	x20, _config_rom_length@GOTPAGE
Lloh3:
	ldr	x20, [x20, _config_rom_length@GOTPAGEOFF]
	ldr	w21, [x20]
	mov	x0, x19
	bl	_required_space
	add	w8, w0, w21
	cmp	w8, #257
	b.lt	LBB0_8
; %bb.5:
Lloh4:
	adrp	x8, _EBUSY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_11
LBB0_6:
	mov	x9, #0
	cmp	x9, x8
	b.eq	LBB0_4
LBB0_7:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_12
LBB0_8:
	add	x0, x19, #24
Lloh10:
	adrp	x1, _descriptor_list@GOTPAGE
Lloh11:
	ldr	x1, [x1, _descriptor_list@GOTPAGEOFF]
	bl	_list_add_tail
	mov	x0, x19
	bl	_required_space
	ldr	w8, [x20]
	add	w9, w8, w0
Lloh12:
	adrp	x8, _descriptor_count@GOTPAGE
Lloh13:
	ldr	x8, [x8, _descriptor_count@GOTPAGEOFF]
	str	w9, [x20]
	ldr	w9, [x8]
	add	w10, w9, #1
	str	w10, [x8]
	ldr	x10, [x19, #16]
	cmp	x10, #1
	b.lt	LBB0_10
; %bb.9:
	add	w9, w9, #2
	str	w9, [x8]
LBB0_10:
	bl	_update_config_roms
	mov	w19, #0
LBB0_11:
Lloh14:
	adrp	x0, _card_mutex@GOTPAGE
Lloh15:
	ldr	x0, [x0, _card_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
LBB0_12:
	mov	x0, x19
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_card_mutex,4,2                 ; @card_mutex
	.comm	_config_rom_length,4,2          ; @config_rom_length
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_descriptor_list,4,2            ; @descriptor_list
	.comm	_descriptor_count,4,2           ; @descriptor_count
.subsections_via_symbols
