	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gsc_get_dst_buf_index
_gsc_get_dst_buf_index:                 ## @gsc_get_dst_buf_index
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_GSC_MAX_DST@GOTPCREL(%rip), %r13
	movl	(%r13), %r15d
	movl	(%rdi), %edi
	movl	4(%r14), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_DRM_DEV_DEBUG_KMS
	movq	_GSC_OUT_BASE_ADDR_Y_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_gsc_read
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_GSC_OUT_CURR_GET_INDEX
	movl	%eax, %r12d
	movl	(%r13), %eax
	cmpl	%eax, %r12d
	jge	LBB0_5
## %bb.1:
	movl	%r12d, %ecx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	btl	%ecx, %ebx
	jae	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	incl	%ecx
	cmpl	%ecx, %eax
	jne	LBB0_2
LBB0_5:
	cmpl	%eax, %r15d
	jne	LBB0_7
LBB0_6:
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_DRM_DEV_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_8
LBB0_3:
	movl	%ecx, %r15d
	cmpl	%eax, %r15d
	je	LBB0_6
LBB0_7:
	movq	%r14, %rdi
	movl	%r15d, %esi
	xorl	%edx, %edx
	callq	_gsc_dst_set_buf_seq
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edx
	movl	%r12d, %ecx
	movl	%r15d, %r8d
	xorl	%eax, %eax
	callq	_DRM_DEV_DEBUG_KMS
LBB0_8:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GSC_MAX_DST,4,2                ## @GSC_MAX_DST
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gsc id[%d]\n"

	.comm	_GSC_OUT_BASE_ADDR_Y_MASK,4,2   ## @GSC_OUT_BASE_ADDR_Y_MASK
L_.str.1:                               ## @.str.1
	.asciz	"failed to get out buffer index.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"cfg[0x%x]curr_index[%d]buf_id[%d]\n"

	.no_dead_strip	_gsc_get_dst_buf_index
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gsc_get_dst_buf_index
_gsc_get_dst_buf_index:                 ; @gsc_get_dst_buf_index
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x0
Lloh0:
	adrp	x23, _GSC_MAX_DST@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GSC_MAX_DST@GOTPAGEOFF]
	ldr	w19, [x23]
	ldr	w0, [x0]
	ldr	w2, [x20, #4]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DRM_DEV_DEBUG_KMS
Lloh4:
	adrp	x8, _GSC_OUT_BASE_ADDR_Y_MASK@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GSC_OUT_BASE_ADDR_Y_MASK@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	bl	_gsc_read
	mov	x21, x0
	bl	_GSC_OUT_CURR_GET_INDEX
	mov	x22, x0
	ldr	w8, [x23]
	cmp	w0, w8
	b.ge	LBB0_4
; %bb.1:
	mov	x9, x22
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	lsr	w10, w21, w9
	tbz	w10, #0, LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w9, w9, #1
	cmp	w8, w9
	b.ne	LBB0_2
LBB0_4:
	cmp	w19, w8
	b.ne	LBB0_7
LBB0_5:
	ldr	w0, [x20]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_DRM_DEV_ERROR
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_8
LBB0_6:
	mov	x19, x9
	cmp	w19, w8
	b.eq	LBB0_5
LBB0_7:
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	bl	_gsc_dst_set_buf_seq
	ldr	w0, [x20]
	stp	x22, x19, [sp]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x21
	bl	_DRM_DEV_DEBUG_KMS
LBB0_8:
	mov	x0, x19
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_GSC_MAX_DST,4,2                ; @GSC_MAX_DST
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gsc id[%d]\n"

	.comm	_GSC_OUT_BASE_ADDR_Y_MASK,4,2   ; @GSC_OUT_BASE_ADDR_Y_MASK
l_.str.1:                               ; @.str.1
	.asciz	"failed to get out buffer index.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"cfg[0x%x]curr_index[%d]buf_id[%d]\n"

	.no_dead_strip	_gsc_get_dst_buf_index
.subsections_via_symbols
