	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx4_release_resource
_mlx4_release_resource:                 ## @mlx4_release_resource
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %ebx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	%rdi, %r13
	callq	_mlx4_priv
	movq	(%r13), %rcx
	cmpl	%r12d, (%rcx)
	jge	LBB0_1
## %bb.8:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	(%rax), %r14
	movl	%r15d, %eax
	leaq	(%rax,%rax,2), %r15
	shlq	$4, %r15
	leaq	(%r14,%r15), %rdi
	addq	$40, %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_spin_lock
	movq	(%r14,%r15), %r8
	testl	%ebx, %ebx
	jle	LBB0_3
## %bb.2:
	leal	-1(%rbx), %ecx
	movq	(%r13), %rdx
	movl	(%rdx), %edx
	incl	%edx
	imull	%ecx, %edx
	addl	%r12d, %edx
	movslq	%edx, %rcx
	movslq	%r12d, %r10
	jmp	LBB0_4
LBB0_3:
	movslq	%r12d, %r10
	movq	%r10, %rcx
LBB0_4:
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	(%r8,%rcx,4), %esi
	movq	8(%r14,%r15), %rcx
	movl	(%rcx,%r10,4), %edi
	movl	%esi, %eax
	subl	%edx, %eax
	subl	%edi, %esi
	xorl	%r9d, %r9d
	testl	%esi, %esi
	cmovlel	%r9d, %esi
	movl	%edx, %ecx
	subl	%esi, %ecx
	cmpl	%edi, %eax
	cmovgel	%r9d, %ecx
	testl	%ebx, %ebx
	jle	LBB0_6
## %bb.5:
	decl	%ebx
	movq	(%r13), %rax
	movl	(%rax), %eax
	incl	%eax
	imull	%ebx, %eax
	addl	%r12d, %eax
	cltq
	subl	%edx, (%r8,%rax,4)
	movq	16(%r14,%r15), %rax
	addl	%edx, (%rax,%rbx,4)
	shlq	$2, %rbx
	addq	24(%r14,%r15), %rbx
	jmp	LBB0_7
LBB0_6:
	subl	%edx, (%r8,%r10,4)
	addl	%edx, 32(%r14,%r15)
	leaq	(%r14,%r15), %rbx
	addq	$36, %rbx
LBB0_7:
	addl	%ecx, (%rbx)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_mlx4_release_resource
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx4_release_resource
_mlx4_release_resource:                 ; @mlx4_release_resource
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x23, x4
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	bl	_mlx4_priv
	ldr	x8, [x22]
	ldr	w8, [x8]
	cmp	w8, w21
	b.ge	LBB0_2
; %bb.1:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_2:
	ldr	x24, [x0]
	mov	w25, w20
	mov	w8, #48
	madd	x26, x25, x8, x24
	add	x20, x26, #40
	mov	x0, x20
	bl	_spin_lock
	ldr	x8, [x26]
	subs	w9, w23, #1
	b.lt	LBB0_4
; %bb.3:
	ldr	x10, [x22]
	ldr	w10, [x10]
	madd	w9, w9, w10, w9
	add	w9, w9, w21
	sxtw	x9, w9
	sxtw	x10, w21
	b	LBB0_5
LBB0_4:
	mov	x9, x21
	sxtw	x10, w9
	mov	x9, x10
LBB0_5:
	ldr	w9, [x8, x9, lsl #2]
	mov	w11, #48
	madd	x11, x25, x11, x24
	ldr	x11, [x11, #8]
	ldr	w11, [x11, x10, lsl #2]
	sub	w12, w9, w11
	cmp	w12, #0
	csel	w12, w12, wzr, gt
	sub	w12, w19, w12
	sub	w9, w9, w19
	cmp	w9, w11
	csel	w9, w12, wzr, lt
	subs	w11, w23, #1
	b.lt	LBB0_7
; %bb.6:
	ldr	x10, [x22]
	ldr	w10, [x10]
	madd	w10, w11, w10, w11
	add	w10, w10, w21
	sbfiz	x10, x10, #2, #32
	ldr	w12, [x8, x10]
	sub	w12, w12, w19
	str	w12, [x8, x10]
	mov	w8, #48
	madd	x8, x25, x8, x24
	lsl	x10, x11, #2
	ldp	x11, x8, [x8, #16]
	ldr	w12, [x11, x10]
	add	w12, w12, w19
	str	w12, [x11, x10]
	add	x8, x8, x10
	b	LBB0_8
LBB0_7:
	lsl	x10, x10, #2
	ldr	w11, [x8, x10]
	sub	w11, w11, w19
	str	w11, [x8, x10]
	mov	w8, #48
	madd	x8, x25, x8, x24
	ldr	w10, [x8, #32]
	add	w10, w10, w19
	str	w10, [x8, #32]
	add	x8, x8, #36
LBB0_8:
	ldr	w10, [x8]
	add	w9, w10, w9
	str	w9, [x8]
	mov	x0, x20
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_spin_unlock
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_mlx4_release_resource
.subsections_via_symbols
