	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msm_ioctl_wait_fence
_msm_ioctl_wait_fence:                  ## @msm_ioctl_wait_fence
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	(%rdi), %r15
	movl	16(%rsi), %edi
	callq	_to_ktime
	movl	%eax, -28(%rbp)
	movq	8(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	(%r15), %r15
	testq	%r15, %r15
	je	LBB0_3
## %bb.4:
	movl	(%r14), %edi
	movl	4(%rbx), %esi
	callq	_msm_submitqueue_get
	testq	%rax, %rax
	je	LBB0_5
## %bb.7:
	movq	%rax, %r14
	movq	(%r15), %rax
	movq	(%r14), %rcx
	movq	(%rax,%rcx,8), %rax
	movl	(%rax), %edi
	movl	(%rbx), %esi
	leaq	-28(%rbp), %rdx
	movl	$1, %ecx
	callq	_msm_wait_fence
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_msm_submitqueue_put
	jmp	LBB0_8
LBB0_3:
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_5:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid pad: %08x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOENT,4,2                     ## @ENOENT
	.no_dead_strip	_msm_ioctl_wait_fence
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msm_ioctl_wait_fence
_msm_ioctl_wait_fence:                  ; @msm_ioctl_wait_fence
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x2
	mov	x19, x1
	ldr	x21, [x0]
	ldr	w0, [x1, #16]
	bl	_to_ktime
	str	w0, [sp, #12]
	ldr	x1, [x19, #8]
	cbz	x1, LBB0_4
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_3:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_4:
	ldr	x21, [x21]
	cbz	x21, LBB0_7
; %bb.5:
	ldr	w0, [x20]
	ldr	w1, [x19, #4]
	bl	_msm_submitqueue_get
	cbz	x0, LBB0_8
; %bb.6:
	mov	x20, x0
	ldr	x8, [x21]
	ldr	x9, [x0]
	ldr	x8, [x8, x9, lsl #3]
	ldr	w0, [x8]
	ldr	w1, [x19]
	add	x2, sp, #12
	mov	w3, #1
	bl	_msm_wait_fence
	mov	x19, x0
	mov	x0, x20
	bl	_msm_submitqueue_put
	b	LBB0_3
LBB0_7:
	mov	w19, #0
	b	LBB0_3
LBB0_8:
Lloh4:
	adrp	x8, _ENOENT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid pad: %08x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOENT,4,2                     ; @ENOENT
	.no_dead_strip	_msm_ioctl_wait_fence
.subsections_via_symbols
