	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpia2_s_fmt_vid_cap
_cpia2_s_fmt_vid_cap:                   ## @cpia2_s_fmt_vid_cap
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %rbx
	callq	_video_drvdata
	movq	%rax, %r14
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	_cpia2_try_fmt_vid_cap
	testl	%eax, %eax
	jne	LBB0_11
## %bb.1:
	movl	16(%r12), %eax
	movl	%eax, 56(%r14)
	movq	$0, 48(%r14)
	movq	(%r12), %rsi
	movq	8(%r12), %rdx
	leaq	L_.str(%rip), %rdi
	callq	_DBG
	movq	(%r12), %rax
	movq	8(%r12), %rcx
	cmpq	(%r14), %rax
	jne	LBB0_3
## %bb.2:
	cmpq	8(%r14), %rcx
	je	LBB0_4
LBB0_3:
	movq	%rax, (%r14)
	movq	%rcx, 8(%r14)
	movq	%rax, 32(%r14)
	movq	%rcx, 40(%r14)
	movq	%r14, %rdi
	callq	_cpia2_set_format
LBB0_4:
	movl	16(%r14), %eax
	testl	%eax, %eax
	jle	LBB0_10
## %bb.5:
	movq	24(%r14), %rcx
	xorl	%ebx, %ebx
	movq	_FRAME_READING@GOTPCREL(%rip), %r15
	movq	_FRAME_EMPTY@GOTPCREL(%rip), %r12
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	24(%r14), %rcx
	movl	16(%r14), %eax
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	(%r12), %rdx
	movq	%rdx, (%rcx,%rbx,8)
	incq	%rbx
	movslq	%eax, %rdx
	cmpq	%rdx, %rbx
	jge	LBB0_10
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rbx,8), %rdx
	cmpq	(%r15), %rdx
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_sync
	testl	%eax, %eax
	jns	LBB0_8
	jmp	LBB0_11
LBB0_10:
	xorl	%eax, %eax
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Requested width = %d, height = %d\n"

	.comm	_FRAME_READING,8,3              ## @FRAME_READING
	.comm	_FRAME_EMPTY,8,3                ## @FRAME_EMPTY
	.no_dead_strip	_cpia2_s_fmt_vid_cap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpia2_s_fmt_vid_cap
_cpia2_s_fmt_vid_cap:                   ; @cpia2_s_fmt_vid_cap
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x1
	mov	x22, x0
	bl	_video_drvdata
	mov	x19, x0
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_cpia2_try_fmt_vid_cap
	cbnz	w0, LBB0_11
; %bb.1:
	ldr	w8, [x20, #16]
	str	w8, [x19, #56]
	str	xzr, [x19, #48]
	ldp	x1, x2, [x20]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DBG
	ldr	x10, [x19]
	ldp	x9, x8, [x20]
	cmp	x9, x10
	b.ne	LBB0_3
; %bb.2:
	ldr	x10, [x19, #8]
	cmp	x8, x10
	b.eq	LBB0_4
LBB0_3:
	stp	x9, x8, [x19]
	stp	x9, x8, [x19, #32]
	mov	x0, x19
	bl	_cpia2_set_format
LBB0_4:
	ldr	w8, [x19, #16]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.5:
	mov	x20, #0
	ldr	x9, [x19, #24]
Lloh2:
	adrp	x21, _FRAME_READING@GOTPAGE
Lloh3:
	ldr	x21, [x21, _FRAME_READING@GOTPAGEOFF]
Lloh4:
	adrp	x22, _FRAME_EMPTY@GOTPAGE
Lloh5:
	ldr	x22, [x22, _FRAME_EMPTY@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	x9, [x19, #24]
	ldr	w8, [x19, #16]
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	x10, [x22]
	str	x10, [x9, x20, lsl #3]
	add	x20, x20, #1
	cmp	x20, w8, sxtw
	b.ge	LBB0_10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9, x20, lsl #3]
	ldr	x11, [x21]
	cmp	x10, x11
	b.ne	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_sync
	tbz	w0, #31, LBB0_6
	b	LBB0_11
LBB0_10:
	mov	w0, #0
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Requested width = %d, height = %d\n"

	.comm	_FRAME_READING,8,3              ; @FRAME_READING
	.comm	_FRAME_EMPTY,8,3                ; @FRAME_EMPTY
	.no_dead_strip	_cpia2_s_fmt_vid_cap
.subsections_via_symbols
