	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ivtvfb_set_var
_ivtvfb_set_var:                        ## @ivtvfb_set_var
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %r15
	movq	16(%rdi), %r14
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_IVTVFB_DEBUG_INFO
	xorl	%ebx, %ebx
	cmpq	$0, 8(%r13)
	setne	%bl
	movl	$10752, %edi                    ## imm = 0x2A00
	callq	_read_reg
	andl	$-8193, %eax                    ## imm = 0xDFFF
	shll	$13, %ebx
	orl	%eax, %ebx
	movl	%ebx, %edi
	movl	$10752, %esi                    ## imm = 0x2A00
	callq	_write_reg
	movl	(%r13), %eax
	cmpl	$8, %eax
	je	LBB0_1
## %bb.2:
	cmpl	$16, %eax
	je	LBB0_5
## %bb.3:
	cmpl	$32, %eax
	jne	LBB0_6
## %bb.4:
	movq	_IVTV_OSD_BPP_32@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_1:
	movq	_IVTV_OSD_BPP_8@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_5:
	movl	48(%r13), %eax
	addl	$-4, %eax
	cmpl	$3, %eax
	jae	LBB0_6
## %bb.7:
	cltq
	leaq	l_switch.table.ivtvfb_set_var(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
LBB0_8:
	movl	(%rax), %r12d
	cmpl	$-1, %r12d
	je	LBB0_10
## %bb.9:
	movq	_CX2341X_OSD_SET_PIXEL_FORMAT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_ivtv_vapi
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	movl	%r12d, %ecx
	callq	_ivtv_vapi
	jmp	LBB0_10
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	callq	_IVTVFB_DEBUG_WARN
LBB0_10:
	movl	(%r13), %eax
	leal	7(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	movl	%eax, (%r14)
	sarl	$3, %ecx
	movl	%ecx, 4(%r14)
	movq	_FB_VMODE_MASK@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	andl	4(%r13), %eax
	cmpl	$129, %eax
	je	LBB0_13
## %bb.11:
	cmpl	$128, %eax
	jne	LBB0_14
## %bb.12:
	movq	_CX2341X_OSD_SET_FLICKER_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	movl	$1, %ecx
	callq	_ivtv_vapi
	jmp	LBB0_15
LBB0_13:
	movq	_CX2341X_OSD_SET_FLICKER_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_ivtv_vapi
	jmp	LBB0_15
LBB0_14:
	leaq	L_.str.2(%rip), %rdi
	callq	_IVTVFB_DEBUG_WARN
LBB0_15:
	leaq	-64(%rbp), %rbx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_ivtvfb_get_osd_coords
	movl	36(%r13), %eax
	movl	%eax, -60(%rbp)
	movl	32(%r13), %eax
	movl	%eax, -64(%rbp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, -56(%rbp)
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_ivtvfb_set_osd_coords
	movl	44(%r13), %eax
	movl	%eax, -68(%rbp)
	movl	40(%r13), %eax
	movl	%eax, -72(%rbp)
	movq	16(%r13), %rax
	testq	%rax, %rax
	jne	LBB0_17
## %bb.16:
	movq	$1, 16(%r13)
	movl	$1, %eax
LBB0_17:
	movq	24(%r13), %rcx
	testq	%rcx, %rcx
	jne	LBB0_19
## %bb.18:
	movq	$1, 24(%r13)
	movl	$1, %ecx
LBB0_19:
	decq	%rax
	movq	%rax, -80(%rbp)
	decq	%rcx
	movq	%rcx, -88(%rbp)
	leaq	-88(%rbp), %rsi
	movq	%r15, %rdi
	callq	_ivtvfb_set_display_window
	movl	-60(%rbp), %eax
	movl	%eax, 8(%r15)
	movl	-64(%rbp), %eax
	movl	%eax, 4(%r15)
	movl	$1, (%r15)
	addq	$8, %r14
	movq	%r14, %rdi
	movq	%r13, %rsi
	movl	$4, %edx
	callq	_memcpy
	movl	44(%r13), %esi
	movl	40(%r13), %edx
	movl	36(%r13), %ecx
	movl	(%r13), %r9d
	movl	32(%r13), %r8d
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_IVTVFB_DEBUG_INFO
	movq	16(%r13), %rdx
	movq	24(%r13), %rsi
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_IVTVFB_DEBUG_INFO
	movl	(%r12), %eax
	andl	4(%r13), %eax
	cmpl	$128, %eax
	leaq	L_.str.6(%rip), %rax
	leaq	L_.str.7(%rip), %rsi
	cmoveq	%rax, %rsi
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_IVTVFB_DEBUG_INFO
	cmpq	$0, 8(%r13)
	leaq	L_.str.10(%rip), %rax
	leaq	L_.str.9(%rip), %rsi
	cmoveq	%rax, %rsi
	leaq	L_.str.8(%rip), %rdi
	xorl	%eax, %eax
	callq	_IVTVFB_DEBUG_INFO
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ivtvfb_set_var\n"

	.comm	_IVTV_OSD_BPP_8,4,2             ## @IVTV_OSD_BPP_8
	.comm	_IVTV_OSD_BPP_32,4,2            ## @IVTV_OSD_BPP_32
	.comm	_IVTV_OSD_BPP_16_444,4,2        ## @IVTV_OSD_BPP_16_444
	.comm	_IVTV_OSD_BPP_16_555,4,2        ## @IVTV_OSD_BPP_16_555
	.comm	_IVTV_OSD_BPP_16_565,4,2        ## @IVTV_OSD_BPP_16_565
L_.str.1:                               ## @.str.1
	.asciz	"ivtvfb_set_var - Invalid bpp\n"

	.comm	_CX2341X_OSD_SET_PIXEL_FORMAT,4,2 ## @CX2341X_OSD_SET_PIXEL_FORMAT
	.comm	_FB_VMODE_MASK,4,2              ## @FB_VMODE_MASK
	.comm	_CX2341X_OSD_SET_FLICKER_STATE,4,2 ## @CX2341X_OSD_SET_FLICKER_STATE
L_.str.2:                               ## @.str.2
	.asciz	"ivtvfb_set_var - Invalid video mode\n"

L_.str.3:                               ## @.str.3
	.asciz	"Display size: %dx%d (virtual %dx%d) @ %dbpp\n"

L_.str.4:                               ## @.str.4
	.asciz	"Display position: %d, %d\n"

L_.str.5:                               ## @.str.5
	.asciz	"Display filter: %s\n"

L_.str.6:                               ## @.str.6
	.asciz	"on"

L_.str.7:                               ## @.str.7
	.asciz	"off"

L_.str.8:                               ## @.str.8
	.asciz	"Color space: %s\n"

L_.str.9:                               ## @.str.9
	.asciz	"YUV"

L_.str.10:                              ## @.str.10
	.asciz	"RGB"

	.no_dead_strip	_ivtvfb_set_var
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.ivtvfb_set_var
l_switch.table.ivtvfb_set_var:
	.quad	_IVTV_OSD_BPP_16_444
	.quad	_IVTV_OSD_BPP_16_555
	.quad	_IVTV_OSD_BPP_16_565

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ivtvfb_set_var
_ivtvfb_set_var:                        ; @ivtvfb_set_var
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	ldr	x22, [x0, #16]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTVFB_DEBUG_INFO
	ldr	x8, [x19, #8]
	cmp	x8, #0
	cset	w21, ne
	mov	w0, #10752
	bl	_read_reg
	bfi	w0, w21, #13, #1
	mov	w1, #10752
	bl	_write_reg
	ldr	w8, [x19]
	cmp	w8, #8
	b.eq	LBB0_4
; %bb.1:
	cmp	w8, #16
	b.eq	LBB0_5
; %bb.2:
	cmp	w8, #32
	b.ne	LBB0_9
; %bb.3:
Lloh2:
	adrp	x8, _IVTV_OSD_BPP_32@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IVTV_OSD_BPP_32@GOTPAGEOFF]
	b	LBB0_7
LBB0_4:
Lloh4:
	adrp	x8, _IVTV_OSD_BPP_8@GOTPAGE
Lloh5:
	ldr	x8, [x8, _IVTV_OSD_BPP_8@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
	ldr	w8, [x19, #48]
	sub	w8, w8, #4
	cmp	w8, #3
	b.hs	LBB0_9
; %bb.6:
Lloh6:
	adrp	x9, l_switch.table.ivtvfb_set_var@PAGE
Lloh7:
	add	x9, x9, l_switch.table.ivtvfb_set_var@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
LBB0_7:
	ldr	w21, [x8]
	cmn	w21, #1
	b.eq	LBB0_10
; %bb.8:
Lloh8:
	adrp	x23, _CX2341X_OSD_SET_PIXEL_FORMAT@GOTPAGE
Lloh9:
	ldr	x23, [x23, _CX2341X_OSD_SET_PIXEL_FORMAT@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x20
	mov	w2, #1
	mov	w3, #0
	bl	_ivtv_vapi
	ldr	w1, [x23]
	mov	x0, x20
	mov	w2, #1
	mov	x3, x21
	bl	_ivtv_vapi
	b	LBB0_10
LBB0_9:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IVTVFB_DEBUG_WARN
LBB0_10:
	ldr	w8, [x19]
	add	w9, w8, #7
	cmp	w8, #0
	csel	w9, w9, w8, lt
	asr	w9, w9, #3
	stp	w8, w9, [x22]
	ldr	w8, [x19, #4]
Lloh12:
	adrp	x21, _FB_VMODE_MASK@GOTPAGE
Lloh13:
	ldr	x21, [x21, _FB_VMODE_MASK@GOTPAGEOFF]
	ldr	w9, [x21]
	and	w8, w9, w8
	cmp	w8, #129
	b.eq	LBB0_13
; %bb.11:
	cmp	w8, #128
	b.ne	LBB0_14
; %bb.12:
Lloh14:
	adrp	x8, _CX2341X_OSD_SET_FLICKER_STATE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CX2341X_OSD_SET_FLICKER_STATE@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	mov	w3, #1
	bl	_ivtv_vapi
	b	LBB0_15
LBB0_13:
Lloh17:
	adrp	x8, _CX2341X_OSD_SET_FLICKER_STATE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _CX2341X_OSD_SET_FLICKER_STATE@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	mov	w3, #0
	bl	_ivtv_vapi
	b	LBB0_15
LBB0_14:
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_IVTVFB_DEBUG_WARN
LBB0_15:
	add	x1, sp, #72
	mov	x0, x20
	bl	_ivtvfb_get_osd_coords
	ldr	d0, [x19, #32]
	str	d0, [sp, #72]
	stp	xzr, xzr, [sp, #80]
	add	x1, sp, #72
	mov	x0, x20
	bl	_ivtvfb_set_osd_coords
	ldr	d0, [x19, #40]
	str	d0, [sp, #64]
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_18
; %bb.16:
	ldr	x9, [x19, #24]
	cbz	x9, LBB0_19
LBB0_17:
	sub	x8, x8, #1
	sub	x9, x9, #1
	stp	x9, x8, [sp, #48]
	add	x1, sp, #48
	mov	x0, x20
	bl	_ivtvfb_set_display_window
	ldr	d0, [sp, #72]
	stur	d0, [x20, #4]
	mov	w8, #1
	str	w8, [x20]
	add	x0, x22, #8
	mov	x1, x19
	mov	w2, #4
	bl	_memcpy
	ldp	w9, w8, [x19, #40]
	ldp	w11, w10, [x19, #32]
	ldr	w12, [x19]
	stp	x11, x12, [sp, #24]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh22:
	adrp	x0, l_.str.3@PAGE
Lloh23:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_IVTVFB_DEBUG_INFO
	ldp	x9, x8, [x19, #16]
	stp	x8, x9, [sp]
Lloh24:
	adrp	x0, l_.str.4@PAGE
Lloh25:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_IVTVFB_DEBUG_INFO
	ldr	w8, [x19, #4]
	ldr	w9, [x21]
	and	w8, w9, w8
Lloh26:
	adrp	x9, l_.str.7@PAGE
Lloh27:
	add	x9, x9, l_.str.7@PAGEOFF
Lloh28:
	adrp	x10, l_.str.6@PAGE
Lloh29:
	add	x10, x10, l_.str.6@PAGEOFF
	cmp	w8, #128
	csel	x8, x10, x9, eq
	str	x8, [sp]
Lloh30:
	adrp	x0, l_.str.5@PAGE
Lloh31:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_IVTVFB_DEBUG_INFO
	ldr	x8, [x19, #8]
Lloh32:
	adrp	x9, l_.str.9@PAGE
Lloh33:
	add	x9, x9, l_.str.9@PAGEOFF
Lloh34:
	adrp	x10, l_.str.10@PAGE
Lloh35:
	add	x10, x10, l_.str.10@PAGEOFF
	cmp	x8, #0
	csel	x8, x10, x9, eq
	str	x8, [sp]
Lloh36:
	adrp	x0, l_.str.8@PAGE
Lloh37:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_IVTVFB_DEBUG_INFO
	mov	w0, #0
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_18:
	mov	w8, #1
	str	x8, [x19, #16]
	ldr	x9, [x19, #24]
	cbnz	x9, LBB0_17
LBB0_19:
	mov	w9, #1
	str	x9, [x19, #24]
	b	LBB0_17
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ivtvfb_set_var\n"

	.comm	_IVTV_OSD_BPP_8,4,2             ; @IVTV_OSD_BPP_8
	.comm	_IVTV_OSD_BPP_32,4,2            ; @IVTV_OSD_BPP_32
	.comm	_IVTV_OSD_BPP_16_444,4,2        ; @IVTV_OSD_BPP_16_444
	.comm	_IVTV_OSD_BPP_16_555,4,2        ; @IVTV_OSD_BPP_16_555
	.comm	_IVTV_OSD_BPP_16_565,4,2        ; @IVTV_OSD_BPP_16_565
l_.str.1:                               ; @.str.1
	.asciz	"ivtvfb_set_var - Invalid bpp\n"

	.comm	_CX2341X_OSD_SET_PIXEL_FORMAT,4,2 ; @CX2341X_OSD_SET_PIXEL_FORMAT
	.comm	_FB_VMODE_MASK,4,2              ; @FB_VMODE_MASK
	.comm	_CX2341X_OSD_SET_FLICKER_STATE,4,2 ; @CX2341X_OSD_SET_FLICKER_STATE
l_.str.2:                               ; @.str.2
	.asciz	"ivtvfb_set_var - Invalid video mode\n"

l_.str.3:                               ; @.str.3
	.asciz	"Display size: %dx%d (virtual %dx%d) @ %dbpp\n"

l_.str.4:                               ; @.str.4
	.asciz	"Display position: %d, %d\n"

l_.str.5:                               ; @.str.5
	.asciz	"Display filter: %s\n"

l_.str.6:                               ; @.str.6
	.asciz	"on"

l_.str.7:                               ; @.str.7
	.asciz	"off"

l_.str.8:                               ; @.str.8
	.asciz	"Color space: %s\n"

l_.str.9:                               ; @.str.9
	.asciz	"YUV"

l_.str.10:                              ; @.str.10
	.asciz	"RGB"

	.no_dead_strip	_ivtvfb_set_var
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.ivtvfb_set_var
l_switch.table.ivtvfb_set_var:
	.quad	_IVTV_OSD_BPP_16_444
	.quad	_IVTV_OSD_BPP_16_555
	.quad	_IVTV_OSD_BPP_16_565

.subsections_via_symbols
