	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fjes_free_resources
_fjes_free_resources:                   ## @fjes_free_resources
	.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
	subq	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	leaq	8(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movl	8(%rdi), %eax
	testl	%eax, %eax
	jle	LBB0_6
## %bb.1:
	movq	%r15, %rdx
	movq	72(%r15), %rcx
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	leaq	48(%r15), %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	leaq	60(%r15), %rcx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	leaq	56(%r15), %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	xorl	%r14d, %r14d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	movslq	%eax, %rcx
	addq	$8, %r12
	cmpq	%rcx, %r14
	jge	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	12(%r15), %ecx
	cmpq	%rcx, %r14
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %r13
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %esi
	callq	_fjes_hw_unregister_buff_addr
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	64(%r15), %r15
	incl	4(%r15,%r14,8)
	cmpl	$0, -60(%rbp)                   ## 4-byte Folded Reload
	movl	$1, %eax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmovnel	%eax, %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	addq	%r12, %r15
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movl	4(%rax), %esi
	movq	%r15, %rdi
	callq	_fjes_hw_setup_epbuf
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movl	%r14d, %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_clear_bit
	movq	%r13, %r15
	movl	8(%r13), %eax
	jmp	LBB0_4
LBB0_5:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_7
LBB0_6:
	cmpl	$0, (%r15)
	je	LBB0_10
LBB0_7:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_fjes_hw_reset
	movl	$0, (%r15)
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	$1, 4(%r15)
LBB0_9:
	movq	$0, 40(%r15)
	leaq	-136(%rbp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	movl	36(%r15), %eax
	movl	%eax, -104(%rbp)
	movl	32(%r15), %edi
	callq	___pa
	movq	%rax, -112(%rbp)
	movl	28(%r15), %eax
	movl	%eax, -120(%rbp)
	movl	24(%r15), %edi
	callq	___pa
	movq	%rax, -128(%rbp)
	movq	16(%r15), %rax
	movl	(%rax), %edi
	callq	___pa
	movq	%rax, -136(%rbp)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_fjes_hw_init_command_registers
LBB0_10:
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_fjes_free_resources
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fjes_free_resources
_fjes_free_resources:                   ; @fjes_free_resources
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	mov	x9, x0
	ldr	w8, [x9, #8]!
	str	x9, [sp]                        ; 8-byte Folded Spill
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x21, #0
	mov	w27, #0
	ldr	x28, [x20, #72]
	add	x22, x20, #48
	add	x23, x20, #60
	add	x24, x20, #56
	mov	w19, #4
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x21, x21, #1
	add	x19, x19, #8
	cmp	x21, w8, sxtw
	b.ge	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x20, #12]
	cmp	x21, x9
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x22
	bl	_mutex_lock
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	mov	x1, x21
	bl	_fjes_hw_unregister_buff_addr
	mov	x25, x0
	mov	x0, x22
	bl	_mutex_unlock
	ldr	x8, [x20, #64]
	add	x26, x8, x19
	ldr	w8, [x26]
	add	w8, w8, #1
	str	w8, [x26], #-4
	cmp	w25, #0
	csinc	w27, w27, wzr, eq
	mov	x0, x23
	bl	_spin_lock_irqsave
	ldp	w2, w1, [x28]
	mov	x0, x26
	bl	_fjes_hw_setup_epbuf
	mov	x0, x23
	bl	_spin_unlock_irqrestore
	mov	x0, x21
	mov	x1, x24
	bl	_clear_bit
	ldr	w8, [x20, #8]
	b	LBB0_2
LBB0_5:
	cbnz	w27, LBB0_7
LBB0_6:
	ldr	w8, [x20]
	cbz	w8, LBB0_10
LBB0_7:
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	bl	_fjes_hw_reset
	str	wzr, [x20]
	cbz	w0, LBB0_9
; %bb.8:
	mov	w8, #1
	str	w8, [x20, #4]
LBB0_9:
	str	xzr, [x20, #40]
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	ldp	w0, w8, [x20, #32]
	str	w8, [sp, #40]
	bl	___pa
	str	x0, [sp, #32]
	ldp	w0, w8, [x20, #24]
	str	w8, [sp, #24]
	bl	___pa
	str	x0, [sp, #16]
	ldr	x8, [x20, #16]
	ldr	w0, [x8]
	bl	___pa
	str	x0, [sp, #8]
	add	x1, sp, #8
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	bl	_fjes_hw_init_command_registers
LBB0_10:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_fjes_free_resources
.subsections_via_symbols
