	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function igt_guc_doorbells
_igt_guc_doorbells:                     ## @igt_guc_doorbells
	.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	%rdi, %rbx
	callq	_HAS_GT_UC
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_GEM_BUG_ON
	movq	%rbx, %rdi
	callq	_mutex_lock
	leaq	4(%rbx), %r14
	movq	%r14, %rdi
	callq	_intel_runtime_pm_get
	movl	%eax, %r12d
	leaq	8(%rbx), %r15
	movq	%r15, %rdi
	callq	_check_all_doorbells
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_31
## %bb.1:
	movq	_ATTEMPTS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_14
## %bb.2:
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	_GUC_CLIENT_PRIORITY_NUM@GOTPCREL(%rip), %r13
	movq	_clients@GOTPCREL(%rip), %r12
	movq	_ATTEMPTS@GOTPCREL(%rip), %r14
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	movslq	(%r14), %rax
	cmpq	%rax, %rbx
	movq	_GUC_CLIENT_PRIORITY_NUM@GOTPCREL(%rip), %r13
	jge	LBB0_16
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %eax
	cltd
	idivl	(%r13)
	movq	%r15, %rdi
	movl	%edx, %esi
	callq	_guc_client_alloc
	movq	(%r12), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	callq	_IS_ERR
	movq	(%r12), %rcx
	movq	(%rcx,%rbx,8), %rdi
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	callq	_PTR_ERR
	movq	_ENOSPC@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	jne	LBB0_17
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %eax
	cltd
	idivl	(%r13)
	movq	%r15, %rdi
	movl	%edx, %esi
	callq	_available_dbs
	testq	%rax, %rax
	je	LBB0_3
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	(%rdi), %rdx
	movq	_GUC_NUM_DOORBELLS@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	cmpq	%rcx, %rdx
	jge	LBB0_20
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %eax
	cltd
	idivl	(%r13)
	movl	%edx, %esi
	callq	_validate_client
	testl	%eax, %eax
	jne	LBB0_21
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	movq	8(%rdi), %r14
	callq	___guc_client_enable
	testl	%eax, %eax
	jne	LBB0_32
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rax
	movq	8(%rax), %rcx
	cmpq	%rcx, %r14
	jne	LBB0_33
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	callq	_check_all_doorbells
	testl	%eax, %eax
	jne	LBB0_34
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_ring_doorbell_nop
	testl	%eax, %eax
	movq	_ATTEMPTS@GOTPCREL(%rip), %r14
	je	LBB0_3
	jmp	LBB0_18
LBB0_14:
	xorl	%r13d, %r13d
	jmp	LBB0_31
LBB0_15:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_22
LBB0_16:
	xorl	%r13d, %r13d
	jmp	LBB0_25
LBB0_17:
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_err
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_PTR_ERR
LBB0_18:
	movl	%eax, %r13d
	jmp	LBB0_24
LBB0_19:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_22
LBB0_20:
	leaq	L_.str.4(%rip), %rdi
	xorl	%r13d, %r13d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_23
LBB0_21:
	leaq	L_.str.5(%rip), %rdi
LBB0_22:
	xorl	%r13d, %r13d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_err
LBB0_23:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_24
LBB0_32:
	movl	%eax, %r13d
	leaq	L_.str.6(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_35
LBB0_33:
	leaq	L_.str.7(%rip), %rdi
	xorl	%r13d, %r13d
	movl	%ebx, %esi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_35
LBB0_34:
	movl	%eax, %r13d
LBB0_35:
	movq	_ATTEMPTS@GOTPCREL(%rip), %r14
LBB0_24:
	movl	(%r14), %eax
LBB0_25:
	testl	%eax, %eax
	jle	LBB0_30
## %bb.26:
	xorl	%ebx, %ebx
	jmp	LBB0_28
	.p2align	4, 0x90
LBB0_27:                                ##   in Loop: Header=BB0_28 Depth=1
	incq	%rbx
	movslq	(%r14), %rax
	cmpq	%rax, %rbx
	jge	LBB0_30
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_IS_ERR_OR_NULL
	testl	%eax, %eax
	jne	LBB0_27
## %bb.29:                              ##   in Loop: Header=BB0_28 Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	___guc_client_disable
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_guc_client_free
	jmp	LBB0_27
LBB0_30:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	-44(%rbp), %r12d                ## 4-byte Reload
LBB0_31:
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_intel_runtime_pm_put
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ATTEMPTS,4,2                   ## @ATTEMPTS
	.comm	_GUC_CLIENT_PRIORITY_NUM,4,2    ## @GUC_CLIENT_PRIORITY_NUM
	.comm	_clients,8,3                    ## @clients
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"[%d] No guc client\n"

	.comm	_ENOSPC,4,2                     ## @ENOSPC
L_.str.2:                               ## @.str.2
	.asciz	"[%d] unexpected error\n"

L_.str.3:                               ## @.str.3
	.asciz	"[%d] non-db related alloc fail\n"

	.comm	_GUC_NUM_DOORBELLS,8,3          ## @GUC_NUM_DOORBELLS
L_.str.4:                               ## @.str.4
	.asciz	"[%d] more clients than doorbells (%d >= %d)\n"

L_.str.5:                               ## @.str.5
	.asciz	"[%d] client_alloc sanity check failed!\n"

L_.str.6:                               ## @.str.6
	.asciz	"[%d] Failed to create a doorbell\n"

L_.str.7:                               ## @.str.7
	.asciz	"[%d] doorbell id changed (%d != %d)\n"

	.no_dead_strip	_igt_guc_doorbells
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function igt_guc_doorbells
_igt_guc_doorbells:                     ; @igt_guc_doorbells
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x19, x0
	bl	_HAS_GT_UC
	cmp	w0, #0
	cset	w0, eq
	bl	_GEM_BUG_ON
	mov	x0, x19
	bl	_mutex_lock
	add	x20, x19, #4
	mov	x0, x20
	bl	_intel_runtime_pm_get
	mov	x21, x0
	add	x22, x19, #8
	mov	x0, x22
	bl	_check_all_doorbells
	mov	x23, x0
	cbz	w0, LBB0_2
LBB0_1:
	mov	x0, x20
	mov	x1, x21
	bl	_intel_runtime_pm_put
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x23
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_2:
Lloh0:
	adrp	x24, _ATTEMPTS@GOTPAGE
Lloh1:
	ldr	x24, [x24, _ATTEMPTS@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.3:
	str	w21, [sp, #28]                  ; 4-byte Folded Spill
	mov	x26, #0
Lloh2:
	adrp	x27, _GUC_CLIENT_PRIORITY_NUM@GOTPAGE
Lloh3:
	ldr	x27, [x27, _GUC_CLIENT_PRIORITY_NUM@GOTPAGEOFF]
Lloh4:
	adrp	x25, _clients@GOTPAGE
Lloh5:
	ldr	x25, [x25, _clients@GOTPAGEOFF]
Lloh6:
	adrp	x21, _ENOSPC@GOTPAGE
Lloh7:
	ldr	x21, [x21, _ENOSPC@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x26, x26, #1
	ldrsw	x8, [x24]
	cmp	x26, x8
	b.ge	LBB0_18
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x27]
	sdiv	w9, w26, w8
	msub	w1, w9, w8, w26
	mov	x0, x22
	bl	_guc_client_alloc
	ldr	x8, [x25]
	lsl	x9, x26, #3
	str	x0, [x8, x9]
	ldr	x8, [x25]
	ldr	x0, [x8, x9]
	cbz	x0, LBB0_17
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	bl	_IS_ERR
	mov	x8, x0
	ldr	x9, [x25]
	ldr	x0, [x9, x26, lsl #3]
	cbz	x8, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	bl	_PTR_ERR
	ldr	w8, [x21]
	cmn	w0, w8
	b.ne	LBB0_19
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x27]
	sdiv	w9, w26, w8
	msub	w1, w9, w8, w26
	mov	x0, x22
	bl	_available_dbs
	cbz	x0, LBB0_4
	b	LBB0_20
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x0]
Lloh8:
	adrp	x9, _GUC_NUM_DOORBELLS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _GUC_NUM_DOORBELLS@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_21
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x27]
	sdiv	w9, w26, w8
	msub	w1, w9, w8, w26
	bl	_validate_client
	cbnz	w0, LBB0_22
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x25]
	ldr	x0, [x8, x26, lsl #3]
	ldr	x28, [x0, #8]
	bl	___guc_client_enable
	cbnz	w0, LBB0_23
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x25]
	ldr	x8, [x8, x26, lsl #3]
	ldr	x8, [x8, #8]
	cmp	x28, x8
	b.ne	LBB0_24
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	bl	_check_all_doorbells
	cbnz	w0, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x25]
	ldr	x0, [x8, x26, lsl #3]
	bl	_ring_doorbell_nop
	cbz	w0, LBB0_4
LBB0_15:
	mov	x23, x0
	b	LBB0_26
LBB0_16:
	mov	w23, #0
	b	LBB0_1
LBB0_17:
	str	x26, [sp]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_25
LBB0_18:
	mov	w23, #0
	ldr	w21, [sp, #28]                  ; 4-byte Folded Reload
	b	LBB0_27
LBB0_19:
	str	x26, [sp]
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
	ldr	x8, [x25]
	ldr	x0, [x8, x26, lsl #3]
	bl	_PTR_ERR
	mov	x23, x0
	b	LBB0_26
LBB0_20:
	str	x26, [sp]
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_25
LBB0_21:
	stp	x8, x9, [sp, #8]
	str	x26, [sp]
Lloh17:
	adrp	x0, l_.str.4@PAGE
Lloh18:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_25
LBB0_22:
	str	x26, [sp]
Lloh19:
	adrp	x0, l_.str.5@PAGE
Lloh20:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_25
LBB0_23:
	mov	x23, x0
	str	x26, [sp]
Lloh21:
	adrp	x0, l_.str.6@PAGE
Lloh22:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_pr_err
	b	LBB0_26
LBB0_24:
	stp	x28, x8, [sp, #8]
	str	x26, [sp]
Lloh23:
	adrp	x0, l_.str.7@PAGE
Lloh24:
	add	x0, x0, l_.str.7@PAGEOFF
LBB0_25:
	bl	_pr_err
Lloh25:
	adrp	x8, _EINVAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_26:
	ldr	w21, [sp, #28]                  ; 4-byte Folded Reload
	ldr	w8, [x24]
LBB0_27:
	cmp	w8, #1
	b.lt	LBB0_1
; %bb.28:
	mov	x22, #0
	b	LBB0_30
LBB0_29:                                ;   in Loop: Header=BB0_30 Depth=1
	add	x22, x22, #1
	ldrsw	x8, [x24]
	cmp	x22, x8
	b.ge	LBB0_1
LBB0_30:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25]
	ldr	x0, [x8, x22, lsl #3]
	bl	_IS_ERR_OR_NULL
	cbnz	w0, LBB0_29
; %bb.31:                               ;   in Loop: Header=BB0_30 Depth=1
	ldr	x8, [x25]
	lsl	x26, x22, #3
	ldr	x0, [x8, x26]
	bl	___guc_client_disable
	ldr	x8, [x25]
	ldr	x0, [x8, x26]
	bl	_guc_client_free
	b	LBB0_29
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ATTEMPTS,4,2                   ; @ATTEMPTS
	.comm	_GUC_CLIENT_PRIORITY_NUM,4,2    ; @GUC_CLIENT_PRIORITY_NUM
	.comm	_clients,8,3                    ; @clients
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"[%d] No guc client\n"

	.comm	_ENOSPC,4,2                     ; @ENOSPC
l_.str.2:                               ; @.str.2
	.asciz	"[%d] unexpected error\n"

l_.str.3:                               ; @.str.3
	.asciz	"[%d] non-db related alloc fail\n"

	.comm	_GUC_NUM_DOORBELLS,8,3          ; @GUC_NUM_DOORBELLS
l_.str.4:                               ; @.str.4
	.asciz	"[%d] more clients than doorbells (%d >= %d)\n"

l_.str.5:                               ; @.str.5
	.asciz	"[%d] client_alloc sanity check failed!\n"

l_.str.6:                               ; @.str.6
	.asciz	"[%d] Failed to create a doorbell\n"

l_.str.7:                               ; @.str.7
	.asciz	"[%d] doorbell id changed (%d != %d)\n"

	.no_dead_strip	_igt_guc_doorbells
.subsections_via_symbols
