	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt9v022_s_crop
_mt9v022_s_crop:                        ## @mt9v022_s_crop
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	callq	_v4l2_get_subdevdata
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_to_mt9v022
	movq	%rax, %r14
	movups	(%rbx), %xmm0
	movaps	%xmm0, -48(%rbp)
	movq	(%rax), %rax
	movq	_mt9v022_colour_fmts@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movl	-48(%rbp), %edi
	movl	$2, %esi
	callq	_ALIGN
	movl	%eax, -48(%rbp)
	movl	-44(%rbp), %edi
	movl	$2, %esi
	callq	_ALIGN
	movl	%eax, -44(%rbp)
LBB0_2:
	leaq	-40(%rbp), %rdi
	movq	_MT9V022_COLUMN_SKIP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MT9V022_MIN_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_MT9V022_MAX_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	-48(%rbp), %rsi
	callq	_soc_camera_limit_side
	leaq	-36(%rbp), %rdi
	leaq	-44(%rbp), %rsi
	movq	_MT9V022_ROW_SKIP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MT9V022_MIN_HEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_MT9V022_MAX_HEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	callq	_soc_camera_limit_side
	movq	_MT9V022_AEC_AGC_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_reg_read
	testl	%eax, %eax
	js	LBB0_15
## %bb.3:
	testb	$1, %al
	jne	LBB0_4
## %bb.5:
	movq	_MT9V022_TOTAL_SHUTTER_WIDTH@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	_MT9V022_MAX_TOTAL_SHUTTER_WIDTH@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %esi
	movl	-44(%rbp), %eax
	movl	8(%r14), %ecx
	leal	(%rax,%rcx), %edx
	addl	$43, %edx
	movq	%r15, %rdi
	callq	_reg_write
	testl	%eax, %eax
	jne	LBB0_13
## %bb.7:
	movq	_MT9V022_COLUMN_START@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-40(%rbp), %edx
	movq	%r15, %rdi
	callq	_reg_write
	testl	%eax, %eax
	jne	LBB0_13
## %bb.8:
	movq	_MT9V022_ROW_START@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-36(%rbp), %edx
	movq	%r15, %rdi
	callq	_reg_write
	testl	%eax, %eax
	jne	LBB0_13
## %bb.9:
	movq	_MT9V022_HORIZONTAL_BLANKING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-48(%rbp), %eax
	movl	$660, %ecx                      ## imm = 0x294
	subl	%eax, %ecx
	cmpl	$618, %eax                      ## imm = 0x26A
	movl	$43, %edx
	cmovll	%ecx, %edx
	movq	%r15, %rdi
	callq	_reg_write
	testl	%eax, %eax
	jne	LBB0_13
## %bb.10:
	movq	_MT9V022_VERTICAL_BLANKING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$45, %edx
	callq	_reg_write
	testl	%eax, %eax
	jne	LBB0_13
## %bb.11:
	movq	_MT9V022_WINDOW_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-48(%rbp), %edx
	movq	%r15, %rdi
	callq	_reg_write
	testl	%eax, %eax
	jne	LBB0_13
## %bb.12:
	movq	_MT9V022_WINDOW_HEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r14), %edx
	addl	-44(%rbp), %edx
	movq	%r15, %rdi
	callq	_reg_write
LBB0_13:
	testl	%eax, %eax
	js	LBB0_15
## %bb.14:
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_dbg
	movaps	-48(%rbp), %xmm0
	movups	%xmm0, 12(%r14)
	xorl	%eax, %eax
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mt9v022_colour_fmts,8,3        ## @mt9v022_colour_fmts
	.comm	_MT9V022_COLUMN_SKIP,4,2        ## @MT9V022_COLUMN_SKIP
	.comm	_MT9V022_MIN_WIDTH,4,2          ## @MT9V022_MIN_WIDTH
	.comm	_MT9V022_MAX_WIDTH,4,2          ## @MT9V022_MAX_WIDTH
	.comm	_MT9V022_ROW_SKIP,4,2           ## @MT9V022_ROW_SKIP
	.comm	_MT9V022_MIN_HEIGHT,4,2         ## @MT9V022_MIN_HEIGHT
	.comm	_MT9V022_MAX_HEIGHT,4,2         ## @MT9V022_MAX_HEIGHT
	.comm	_MT9V022_AEC_AGC_ENABLE,4,2     ## @MT9V022_AEC_AGC_ENABLE
	.comm	_MT9V022_MAX_TOTAL_SHUTTER_WIDTH,4,2 ## @MT9V022_MAX_TOTAL_SHUTTER_WIDTH
	.comm	_MT9V022_TOTAL_SHUTTER_WIDTH,4,2 ## @MT9V022_TOTAL_SHUTTER_WIDTH
	.comm	_MT9V022_COLUMN_START,4,2       ## @MT9V022_COLUMN_START
	.comm	_MT9V022_ROW_START,4,2          ## @MT9V022_ROW_START
	.comm	_MT9V022_HORIZONTAL_BLANKING,4,2 ## @MT9V022_HORIZONTAL_BLANKING
	.comm	_MT9V022_VERTICAL_BLANKING,4,2  ## @MT9V022_VERTICAL_BLANKING
	.comm	_MT9V022_WINDOW_WIDTH,4,2       ## @MT9V022_WINDOW_WIDTH
	.comm	_MT9V022_WINDOW_HEIGHT,4,2      ## @MT9V022_WINDOW_HEIGHT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Frame %dx%d pixel\n"

	.no_dead_strip	_mt9v022_s_crop
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt9v022_s_crop
_mt9v022_s_crop:                        ; @mt9v022_s_crop
	.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, x1
	bl	_v4l2_get_subdevdata
	mov	x20, x0
	bl	_to_mt9v022
	mov	x19, x0
	ldr	q0, [x21]
	str	q0, [sp]
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _mt9v022_colour_fmts@GOTPAGE
Lloh1:
	ldr	x9, [x9, _mt9v022_colour_fmts@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	w0, [sp]
	mov	w1, #2
	bl	_ALIGN
	str	w0, [sp]
	ldr	w0, [sp, #4]
	mov	w1, #2
	bl	_ALIGN
	str	w0, [sp, #4]
LBB0_2:
	mov	x21, sp
	orr	x0, x21, #0x8
Lloh3:
	adrp	x8, _MT9V022_COLUMN_SKIP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT9V022_COLUMN_SKIP@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _MT9V022_MIN_WIDTH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MT9V022_MIN_WIDTH@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
Lloh9:
	adrp	x8, _MT9V022_MAX_WIDTH@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MT9V022_MAX_WIDTH@GOTPAGEOFF]
Lloh11:
	ldr	w4, [x8]
	mov	x1, sp
	bl	_soc_camera_limit_side
	orr	x0, x21, #0xc
	orr	x1, x21, #0x4
Lloh12:
	adrp	x8, _MT9V022_ROW_SKIP@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MT9V022_ROW_SKIP@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
Lloh15:
	adrp	x8, _MT9V022_MIN_HEIGHT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MT9V022_MIN_HEIGHT@GOTPAGEOFF]
Lloh17:
	ldr	w3, [x8]
Lloh18:
	adrp	x8, _MT9V022_MAX_HEIGHT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MT9V022_MAX_HEIGHT@GOTPAGEOFF]
Lloh20:
	ldr	w4, [x8]
	bl	_soc_camera_limit_side
Lloh21:
	adrp	x8, _MT9V022_AEC_AGC_ENABLE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MT9V022_AEC_AGC_ENABLE@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_reg_read
	tbnz	w0, #31, LBB0_12
; %bb.3:
Lloh24:
	adrp	x8, _MT9V022_TOTAL_SHUTTER_WIDTH@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MT9V022_TOTAL_SHUTTER_WIDTH@GOTPAGEOFF]
Lloh26:
	adrp	x9, _MT9V022_MAX_TOTAL_SHUTTER_WIDTH@GOTPAGE
Lloh27:
	ldr	x9, [x9, _MT9V022_MAX_TOTAL_SHUTTER_WIDTH@GOTPAGEOFF]
	tst	w0, #0x1
	csel	x8, x8, x9, eq
	ldr	w1, [x8]
	ldr	w8, [sp, #4]
	ldr	w9, [x19, #8]
	add	w8, w8, w9
	add	w2, w8, #43
	mov	x0, x20
	bl	_reg_write
	cbnz	w0, LBB0_10
; %bb.4:
Lloh28:
	adrp	x8, _MT9V022_COLUMN_START@GOTPAGE
Lloh29:
	ldr	x8, [x8, _MT9V022_COLUMN_START@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	ldr	w2, [sp, #8]
	mov	x0, x20
	bl	_reg_write
	cbnz	w0, LBB0_10
; %bb.5:
Lloh31:
	adrp	x8, _MT9V022_ROW_START@GOTPAGE
Lloh32:
	ldr	x8, [x8, _MT9V022_ROW_START@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	ldr	w2, [sp, #12]
	mov	x0, x20
	bl	_reg_write
	cbnz	w0, LBB0_10
; %bb.6:
Lloh34:
	adrp	x8, _MT9V022_HORIZONTAL_BLANKING@GOTPAGE
Lloh35:
	ldr	x8, [x8, _MT9V022_HORIZONTAL_BLANKING@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	ldr	w8, [sp]
	mov	w9, #660
	sub	w9, w9, w8
	mov	w10, #43
	cmp	w8, #617
	csel	w2, w10, w9, gt
	mov	x0, x20
	bl	_reg_write
	cbnz	w0, LBB0_10
; %bb.7:
Lloh37:
	adrp	x8, _MT9V022_VERTICAL_BLANKING@GOTPAGE
Lloh38:
	ldr	x8, [x8, _MT9V022_VERTICAL_BLANKING@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #45
	bl	_reg_write
	cbnz	w0, LBB0_10
; %bb.8:
Lloh40:
	adrp	x8, _MT9V022_WINDOW_WIDTH@GOTPAGE
Lloh41:
	ldr	x8, [x8, _MT9V022_WINDOW_WIDTH@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
	ldr	w2, [sp]
	mov	x0, x20
	bl	_reg_write
	cbnz	w0, LBB0_10
; %bb.9:
Lloh43:
	adrp	x8, _MT9V022_WINDOW_HEIGHT@GOTPAGE
Lloh44:
	ldr	x8, [x8, _MT9V022_WINDOW_HEIGHT@GOTPAGEOFF]
Lloh45:
	ldr	w1, [x8]
	ldr	w8, [sp, #4]
	ldr	w9, [x19, #8]
	add	w2, w9, w8
	mov	x0, x20
	bl	_reg_write
LBB0_10:
	tbnz	w0, #31, LBB0_12
; %bb.11:
	ldp	w2, w3, [sp]
Lloh46:
	adrp	x1, l_.str@PAGE
Lloh47:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	mov	w0, #0
	ldr	q0, [sp]
	stur	q0, [x19, #12]
LBB0_12:
	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 AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdd	Lloh46, Lloh47
	.cfi_endproc
                                        ; -- End function
	.comm	_mt9v022_colour_fmts,8,3        ; @mt9v022_colour_fmts
	.comm	_MT9V022_COLUMN_SKIP,4,2        ; @MT9V022_COLUMN_SKIP
	.comm	_MT9V022_MIN_WIDTH,4,2          ; @MT9V022_MIN_WIDTH
	.comm	_MT9V022_MAX_WIDTH,4,2          ; @MT9V022_MAX_WIDTH
	.comm	_MT9V022_ROW_SKIP,4,2           ; @MT9V022_ROW_SKIP
	.comm	_MT9V022_MIN_HEIGHT,4,2         ; @MT9V022_MIN_HEIGHT
	.comm	_MT9V022_MAX_HEIGHT,4,2         ; @MT9V022_MAX_HEIGHT
	.comm	_MT9V022_AEC_AGC_ENABLE,4,2     ; @MT9V022_AEC_AGC_ENABLE
	.comm	_MT9V022_MAX_TOTAL_SHUTTER_WIDTH,4,2 ; @MT9V022_MAX_TOTAL_SHUTTER_WIDTH
	.comm	_MT9V022_TOTAL_SHUTTER_WIDTH,4,2 ; @MT9V022_TOTAL_SHUTTER_WIDTH
	.comm	_MT9V022_COLUMN_START,4,2       ; @MT9V022_COLUMN_START
	.comm	_MT9V022_ROW_START,4,2          ; @MT9V022_ROW_START
	.comm	_MT9V022_HORIZONTAL_BLANKING,4,2 ; @MT9V022_HORIZONTAL_BLANKING
	.comm	_MT9V022_VERTICAL_BLANKING,4,2  ; @MT9V022_VERTICAL_BLANKING
	.comm	_MT9V022_WINDOW_WIDTH,4,2       ; @MT9V022_WINDOW_WIDTH
	.comm	_MT9V022_WINDOW_HEIGHT,4,2      ; @MT9V022_WINDOW_HEIGHT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Frame %dx%d pixel\n"

	.no_dead_strip	_mt9v022_s_crop
.subsections_via_symbols
