	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtk_vcodec_wait_for_done_ctx   ## -- Begin function mtk_vcodec_wait_for_done_ctx
	.p2align	4, 0x90
_mtk_vcodec_wait_for_done_ctx:          ## @mtk_vcodec_wait_for_done_ctx
	.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
	movl	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	%edx, %edi
	callq	_msecs_to_jiffies
	movl	8(%rbx), %esi
	movl	20(%rbx), %edi
	movq	%rax, %rdx
	callq	_wait_event_interruptible_timeout
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rcx
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	addq	(%rdx), %rcx
	jne	LBB0_5
## %bb.3:
	movl	16(%rbx), %esi
	movl	12(%rbx), %edx
	movl	8(%rbx), %r8d
	movq	(%rbx), %r9
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %ecx
	jmp	LBB0_4
LBB0_1:
	movl	16(%rbx), %esi
	movl	12(%rbx), %edx
	movslq	8(%rbx), %r9
	movq	(%rbx), %rax
	movq	%rax, (%rsp)
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %ecx
	movl	%r15d, %r8d
LBB0_4:
	xorl	%eax, %eax
	callq	_mtk_v4l2_err
	movl	$-1, %eax
LBB0_5:
	movl	$0, 8(%rbx)
	movq	$0, (%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[%d] cmd=%d, ctx->type=%d, wait_event_interruptible_timeout time=%ums out %d %d!"

	.comm	_ERESTARTSYS,8,3                ## @ERESTARTSYS
L_.str.1:                               ## @.str.1
	.asciz	"[%d] cmd=%d, ctx->type=%d, wait_event_interruptible_timeout interrupted by a signal %d %d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtk_vcodec_wait_for_done_ctx   ; -- Begin function mtk_vcodec_wait_for_done_ctx
	.p2align	2
_mtk_vcodec_wait_for_done_ctx:          ; @mtk_vcodec_wait_for_done_ctx
	.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	x21, x2
	mov	x20, x1
	mov	x19, x0
	mov	x0, x2
	bl	_msecs_to_jiffies
	mov	x2, x0
	ldr	w0, [x19, #20]
	ldr	w1, [x19, #8]
	bl	_wait_event_interruptible_timeout
	cbz	x0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmn	x0, x8
	b.ne	LBB0_5
; %bb.2:
	ldp	w2, w1, [x19, #12]
	ldr	w4, [x19, #8]
	ldr	x5, [x19]
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x3, x20
	b	LBB0_4
LBB0_3:
	ldp	w2, w1, [x19, #12]
	ldrsw	x5, [x19, #8]
	ldr	x8, [x19]
	str	x8, [sp]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x3, x20
	mov	x4, x21
LBB0_4:
	bl	_mtk_v4l2_err
	mov	w0, #-1
	b	LBB0_6
LBB0_5:
	mov	w0, #0
LBB0_6:
	str	wzr, [x19, #8]
	str	xzr, [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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[%d] cmd=%d, ctx->type=%d, wait_event_interruptible_timeout time=%ums out %d %d!"

	.comm	_ERESTARTSYS,8,3                ; @ERESTARTSYS
l_.str.1:                               ; @.str.1
	.asciz	"[%d] cmd=%d, ctx->type=%d, wait_event_interruptible_timeout interrupted by a signal %d %d"

.subsections_via_symbols
