	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _get_res
__get_res:                              ## @_get_res
	.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
	movq	%r9, -48(%rbp)                  ## 8-byte Spill
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movl	%ecx, %ebx
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	%rdi, %r13
	callq	_mlx4_tlock
	movl	%eax, %edi
	callq	_spin_lock_irq
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	callq	_find_res
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r14
	movq	(%rax), %rax
	movq	_RES_ANY_BUSY@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_5
## %bb.4:
	movl	%ebx, %edi
	callq	_mlx4_resource_type_to_str
	movq	8(%r14), %rcx
	movq	%rcx, (%rsp)
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	%r12d, %ecx
	movl	%r15d, %r8d
	movl	%eax, %r9d
	callq	_mlx4_warn
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_ENONET@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_5:
	cmpl	%r12d, 16(%r14)
	jne	LBB0_6
## %bb.7:
	movq	%rax, 24(%r14)
	movq	%rcx, (%r14)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%r14)
	xorl	%ebx, %ebx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%r14, (%rax)
	jmp	LBB0_9
LBB0_6:
	movq	_EPERM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movq	%r13, %rdi
	callq	_mlx4_tlock
	movl	%eax, %edi
	callq	_spin_unlock_irq
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENONET,4,2                     ## @ENONET
	.comm	_RES_ANY_BUSY,8,3               ## @RES_ANY_BUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s(%d) trying to get resource %llx of type %s, but it's already taken by %s\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EPERM,4,2                      ## @EPERM
	.no_dead_strip	__get_res
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _get_res
__get_res:                              ; @_get_res
	.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	x20, x5
	mov	x21, x4
	mov	x24, x3
	mov	x23, x2
	mov	x22, x1
	mov	x19, x0
	bl	_mlx4_tlock
	bl	_spin_lock_irq
	mov	x0, x19
	mov	x1, x23
	mov	x2, x24
	bl	_find_res
	cbz	x0, LBB0_3
; %bb.1:
	mov	x25, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _RES_ANY_BUSY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RES_ANY_BUSY@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	mov	x0, x24
	bl	_mlx4_resource_type_to_str
	mov	x5, x0
	ldr	x6, [x25, #8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	mov	x3, x22
	mov	x4, x23
	bl	_mlx4_warn
Lloh5:
	adrp	x8, _EBUSY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_8
LBB0_3:
Lloh7:
	adrp	x8, _ENONET@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENONET@GOTPAGEOFF]
	b	LBB0_8
LBB0_4:
	ldr	w10, [x25, #16]
	cmp	w10, w22
	b.ne	LBB0_7
; %bb.5:
	str	x8, [x25, #24]
	stp	x9, x20, [x25]
	mov	w20, #0
	cbz	x21, LBB0_9
; %bb.6:
	str	x25, [x21]
	b	LBB0_9
LBB0_7:
Lloh9:
	adrp	x8, _EPERM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	mov	x0, x19
	bl	_mlx4_tlock
	bl	_spin_unlock_irq
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_ENONET,4,2                     ; @ENONET
	.comm	_RES_ANY_BUSY,8,3               ; @RES_ANY_BUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s(%d) trying to get resource %llx of type %s, but it's already taken by %s\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EPERM,4,2                      ; @EPERM
	.no_dead_strip	__get_res
.subsections_via_symbols
