	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ivtvfb_set_display_window
_ivtvfb_set_display_window:             ## @ivtvfb_set_display_window
	.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
	cmpq	$0, 16(%rdi)
	movl	$480, %eax                      ## imm = 0x1E0
	movl	$576, %ebx                      ## imm = 0x240
	cmovel	%eax, %ebx
	movl	(%rsi), %ecx
	cmpl	%ebx, %ecx
	jg	LBB0_2
## %bb.1:
	movq	%rsi, %r12
	movq	%rdi, %r14
	movl	4(%rsi), %edx
	movq	_IVTV_OSD_MAX_WIDTH@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	cmpl	%edi, %edx
	jle	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_3:
	movl	8(%r12), %eax
	leal	(%rax,%rcx), %esi
	cmpl	%ebx, %esi
	jle	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	movl	%ecx, %edx
	callq	_IVTVFB_DEBUG_WARN
	subl	(%r12), %ebx
	movl	%ebx, 8(%r12)
	movl	4(%r12), %edx
	movl	(%r15), %edi
	movl	%ebx, %eax
LBB0_5:
	movl	12(%r12), %esi
	leal	(%rdx,%rsi), %ecx
	cmpl	%edi, %ecx
	jle	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_IVTVFB_DEBUG_WARN
	movl	(%r15), %esi
	subl	4(%r12), %esi
	movl	%esi, 12(%r12)
	movl	8(%r12), %eax
LBB0_7:
	shll	$16, %eax
	orl	%esi, %eax
	movl	%eax, %edi
	movl	$10756, %esi                    ## imm = 0x2A04
	callq	_write_reg
	movq	8(%r12), %xmm0                  ## xmm0 = mem[0],zero
	movq	(%r12), %xmm1                   ## xmm1 = mem[0],zero
	paddd	%xmm0, %xmm1
	movd	%xmm1, %eax
	shll	$16, %eax
	pextrd	$1, %xmm1, %edi
	orl	%eax, %edi
	movl	$10760, %esi                    ## imm = 0x2A08
	callq	_write_reg
	movdqu	(%r12), %xmm0
	pshufd	$177, %xmm0, %xmm0              ## xmm0 = xmm0[1,0,3,2]
	movdqu	%xmm0, (%r14)
	xorl	%eax, %eax
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IVTV_OSD_MAX_WIDTH,4,2         ## @IVTV_OSD_MAX_WIDTH
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ivtv_ioctl_fb_set_display_window - Invalid height setting (%d, %d)\n"

L_.str.1:                               ## @.str.1
	.asciz	"ivtv_ioctl_fb_set_display_window - Invalid width setting (%d, %d)\n"

	.no_dead_strip	_ivtvfb_set_display_window
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ivtvfb_set_display_window
_ivtvfb_set_display_window:             ; @ivtvfb_set_display_window
	.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
	ldr	x8, [x0, #16]
	cmp	x8, #0
	mov	w8, #576
	mov	w9, #480
	csel	w22, w9, w8, eq
	ldr	w8, [x1]
	cmp	w8, w22
	b.gt	LBB0_2
; %bb.1:
	mov	x20, x1
	ldr	w2, [x1, #4]
Lloh0:
	adrp	x21, _IVTV_OSD_MAX_WIDTH@GOTPAGE
Lloh1:
	ldr	x21, [x21, _IVTV_OSD_MAX_WIDTH@GOTPAGEOFF]
	ldr	w9, [x21]
	cmp	w2, w9
	b.le	LBB0_3
LBB0_2:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_3:
	mov	x19, x0
	ldr	w1, [x20, #8]
	add	w10, w1, w8
	cmp	w10, w22
	b.le	LBB0_5
; %bb.4:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x8
	bl	_IVTVFB_DEBUG_WARN
	ldp	w8, w2, [x20]
	sub	w1, w22, w8
	str	w1, [x20, #8]
	ldr	w9, [x21]
LBB0_5:
	ldr	w8, [x20, #12]
	add	w10, w2, w8
	cmp	w10, w9
	b.le	LBB0_7
; %bb.6:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x8
	bl	_IVTVFB_DEBUG_WARN
	ldr	w8, [x21]
	ldp	w9, w1, [x20, #4]
	sub	w8, w8, w9
	str	w8, [x20, #12]
LBB0_7:
	orr	w0, w8, w1, lsl #16
	mov	w1, #10756
	bl	_write_reg
	ldp	w8, w9, [x20, #8]
	ldp	w10, w11, [x20]
	add	w8, w10, w8
	add	w9, w11, w9
	orr	w0, w9, w8, lsl #16
	mov	w1, #10760
	bl	_write_reg
	mov	w0, #0
	ldr	q0, [x20]
	rev64.4s	v0, v0
	str	q0, [x19]
LBB0_8:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_IVTV_OSD_MAX_WIDTH,4,2         ; @IVTV_OSD_MAX_WIDTH
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ivtv_ioctl_fb_set_display_window - Invalid height setting (%d, %d)\n"

l_.str.1:                               ; @.str.1
	.asciz	"ivtv_ioctl_fb_set_display_window - Invalid width setting (%d, %d)\n"

	.no_dead_strip	_ivtvfb_set_display_window
.subsections_via_symbols
