	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pwc_vidioc_set_fmt
_pwc_vidioc_set_fmt:                    ## @pwc_vidioc_set_fmt
	.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	%rsi, %r15
	movq	%rdi, %r14
	callq	_pwc_vidioc_try_fmt
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	(%r15), %edx
	movl	4(%r15), %eax
	movl	4(%r14), %ebx
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movq	_PWC_QLT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	andl	%eax, %r12d
	movq	_PWC_QLT_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %r12d
	movq	_PWC_FPS_SNAPSHOT@GOTPCREL(%rip), %rcx
	xorl	%r13d, %r13d
	testl	%eax, (%rcx)
	setne	%r13b
	movq	_PWC_FPS_FRMASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_PWC_FPS_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	testl	%eax, %eax
	cmovnel	%eax, %ebx
	jmp	LBB0_5
LBB0_1:
	movl	%eax, %ebx
	jmp	LBB0_14
LBB0_3:
	movl	(%r14), %r12d
	xorl	%r13d, %r13d
LBB0_5:
	movq	_V4L2_PIX_FMT_YUV420@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	je	LBB0_10
## %bb.6:
	movq	_V4L2_PIX_FMT_PWC1@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	je	LBB0_10
## %bb.7:
	movq	_V4L2_PIX_FMT_PWC2@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	je	LBB0_10
## %bb.8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_10:
	cmpq	$0, 16(%r14)
	je	LBB0_12
## %bb.11:
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_9:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	%edx, %ecx
	movl	8(%r15), %edx
	movl	12(%r15), %esi
	movzbl	%cl, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movzbl	%ch, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%ecx, %eax
	shrl	$16, %eax
	movzbl	%al, %r11d
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r10d
	shrl	$24, %r10d
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %ecx
	movl	%r12d, %r8d
	movl	%r13d, %r9d
	xorl	%eax, %eax
	pushq	%r10
	pushq	%r11
	pushq	-56(%rbp)                       ## 8-byte Folded Reload
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	callq	_PWC_DEBUG_IOCTL
	addq	$32, %rsp
	movl	8(%r15), %edx
	movl	12(%r15), %esi
	movq	%r14, %rdi
	movl	%ebx, %ecx
	movl	%r12d, %r8d
	movl	%r13d, %r9d
	callq	_pwc_set_video_mode
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_PWC_DEBUG_IOCTL
	testl	%ebx, %ebx
	jne	LBB0_14
## %bb.13:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%r14)
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_pwc_vidioc_fill_fmt
	xorl	%ebx, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_PWC_QLT_MASK,4,2               ## @PWC_QLT_MASK
	.comm	_PWC_QLT_SHIFT,4,2              ## @PWC_QLT_SHIFT
	.comm	_PWC_FPS_SNAPSHOT,4,2           ## @PWC_FPS_SNAPSHOT
	.comm	_PWC_FPS_FRMASK,4,2             ## @PWC_FPS_FRMASK
	.comm	_PWC_FPS_SHIFT,4,2              ## @PWC_FPS_SHIFT
	.comm	_V4L2_PIX_FMT_YUV420,4,2        ## @V4L2_PIX_FMT_YUV420
	.comm	_V4L2_PIX_FMT_PWC1,4,2          ## @V4L2_PIX_FMT_PWC1
	.comm	_V4L2_PIX_FMT_PWC2,4,2          ## @V4L2_PIX_FMT_PWC2
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EBUSY,4,2                      ## @EBUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Trying to set format to: width=%d height=%d fps=%d compression=%d snapshot=%d format=%c%c%c%c\n"

L_.str.1:                               ## @.str.1
	.asciz	"pwc_set_video_mode(), return=%d\n"

	.no_dead_strip	_pwc_vidioc_set_fmt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pwc_vidioc_set_fmt
_pwc_vidioc_set_fmt:                    ; @pwc_vidioc_set_fmt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	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
	mov	x19, x1
	mov	x20, x0
	bl	_pwc_vidioc_try_fmt
	tbnz	w0, #31, LBB0_3
; %bb.1:
	ldr	w21, [x20, #4]
	ldp	w24, w8, [x19]
	cbz	w8, LBB0_4
; %bb.2:
Lloh0:
	adrp	x9, _PWC_QLT_MASK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PWC_QLT_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _PWC_QLT_SHIFT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _PWC_QLT_SHIFT@GOTPAGEOFF]
	and	w9, w9, w8
Lloh5:
	ldr	w10, [x10]
	asr	w22, w9, w10
Lloh6:
	adrp	x9, _PWC_FPS_SNAPSHOT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PWC_FPS_SNAPSHOT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w23, ne
Lloh9:
	adrp	x9, _PWC_FPS_FRMASK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PWC_FPS_FRMASK@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh12:
	adrp	x9, _PWC_FPS_SHIFT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PWC_FPS_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	asr	w8, w8, w9
	cmp	w8, #0
	csel	w21, w21, w8, eq
	b	LBB0_5
LBB0_3:
	mov	x21, x0
	b	LBB0_10
LBB0_4:
	mov	w23, #0
	ldr	w22, [x20]
LBB0_5:
Lloh15:
	adrp	x8, _V4L2_PIX_FMT_YUV420@GOTPAGE
Lloh16:
	ldr	x8, [x8, _V4L2_PIX_FMT_YUV420@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _V4L2_PIX_FMT_PWC1@GOTPAGE
Lloh19:
	ldr	x9, [x9, _V4L2_PIX_FMT_PWC1@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	adrp	x10, _V4L2_PIX_FMT_PWC2@GOTPAGE
Lloh22:
	ldr	x10, [x10, _V4L2_PIX_FMT_PWC2@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	cmp	w24, w8
	ccmp	w24, w9, #4, ne
	ccmp	w24, w10, #4, ne
	b.ne	LBB0_8
; %bb.6:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_11
; %bb.7:
Lloh24:
	adrp	x8, _EBUSY@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_10:
	mov	x0, x21
	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
	add	sp, sp, #128
	ret
LBB0_11:
	and	w8, w24, #0xff
	ubfx	w9, w24, #8, #8
	ubfx	w10, w24, #16, #8
	ldp	w11, w1, [x19, #8]
	lsr	w12, w24, #24
	stp	x10, x12, [sp, #48]
	stp	x8, x9, [sp, #32]
	stp	x22, x23, [sp, #16]
Lloh28:
	adrp	x0, l_.str@PAGE
Lloh29:
	add	x0, x0, l_.str@PAGEOFF
	stp	x11, x21, [sp]
	bl	_PWC_DEBUG_IOCTL
	ldp	w2, w1, [x19, #8]
	mov	x0, x20
	mov	x3, x21
	mov	x4, x22
	mov	x5, x23
	bl	_pwc_set_video_mode
	mov	x21, x0
Lloh30:
	adrp	x0, l_.str.1@PAGE
Lloh31:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_PWC_DEBUG_IOCTL
	cbnz	w21, LBB0_10
; %bb.12:
	str	w24, [x20, #8]
	mov	x0, x20
	mov	x1, x19
	bl	_pwc_vidioc_fill_fmt
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_PWC_QLT_MASK,4,2               ; @PWC_QLT_MASK
	.comm	_PWC_QLT_SHIFT,4,2              ; @PWC_QLT_SHIFT
	.comm	_PWC_FPS_SNAPSHOT,4,2           ; @PWC_FPS_SNAPSHOT
	.comm	_PWC_FPS_FRMASK,4,2             ; @PWC_FPS_FRMASK
	.comm	_PWC_FPS_SHIFT,4,2              ; @PWC_FPS_SHIFT
	.comm	_V4L2_PIX_FMT_YUV420,4,2        ; @V4L2_PIX_FMT_YUV420
	.comm	_V4L2_PIX_FMT_PWC1,4,2          ; @V4L2_PIX_FMT_PWC1
	.comm	_V4L2_PIX_FMT_PWC2,4,2          ; @V4L2_PIX_FMT_PWC2
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EBUSY,4,2                      ; @EBUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Trying to set format to: width=%d height=%d fps=%d compression=%d snapshot=%d format=%c%c%c%c\n"

l_.str.1:                               ; @.str.1
	.asciz	"pwc_set_video_mode(), return=%d\n"

	.no_dead_strip	_pwc_vidioc_set_fmt
.subsections_via_symbols
