	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sh_mobile_ceu_set_crop
_sh_mobile_ceu_set_crop:                ## @sh_mobile_ceu_set_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$120, %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
	movq	8(%rdi), %rdi
	callq	_to_soc_camera_host
	movq	(%rax), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	16(%r14), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_soc_camera_to_subdev
	movq	%rax, %rbx
	movq	8(%r14), %r12
	leaq	-56(%rbp), %rsi
	leaq	-52(%rbp), %rdx
	movq	%r14, %rdi
	callq	_get_scales
	testl	%eax, %eax
	js	LBB0_5
## %bb.1:
	movl	-56(%rbp), %edx
	movl	-52(%rbp), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_geo
	leaq	-112(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_client_s_crop
	testl	%eax, %eax
	js	LBB0_5
## %bb.2:
	movl	-112(%rbp), %ecx
	movl	-108(%rbp), %edx
	movq	-96(%rbp), %r8
	movq	-104(%rbp), %r9
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_geo
	movl	4(%r15), %edi
	movl	-56(%rbp), %esi
	callq	_scale_down
	movq	%rax, %rbx
	movl	%ebx, -48(%rbp)
	movl	(%r15), %edi
	movl	-52(%rbp), %esi
	callq	_scale_down
	movl	%eax, -44(%rbp)
	cmpl	$2561, %ebx                     ## imm = 0xA01
	jb	LBB0_6
## %bb.3:
	movl	$2560, -48(%rbp)                ## imm = 0xA00
	movl	$2560, %ebx                     ## imm = 0xA00
	jmp	LBB0_8
LBB0_5:
	movl	%eax, %r13d
	jmp	LBB0_17
LBB0_6:
	cmpl	$1, %ebx
	ja	LBB0_8
## %bb.7:
	movl	$2, -48(%rbp)
	movl	$2, %ebx
LBB0_8:
	cmpl	$1921, %eax                     ## imm = 0x781
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	jb	LBB0_10
## %bb.9:
	movl	$1920, -44(%rbp)                ## imm = 0x780
	movl	$1920, %eax                     ## imm = 0x780
	jmp	LBB0_12
LBB0_10:
	cmpl	$3, %eax
	ja	LBB0_12
## %bb.11:
	movl	$4, -44(%rbp)
	movl	$4, %eax
LBB0_12:
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	leaq	8(%r15), %rcx
	movq	%rcx, -144(%rbp)                ## 8-byte Spill
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	movq	%rbx, -160(%rbp)                ## 8-byte Spill
	movl	%ebx, %edx
	movq	%rax, -152(%rbp)                ## 8-byte Spill
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_geo
	movl	-108(%rbp), %edi
	movl	-56(%rbp), %esi
	callq	_scale_down
	movq	%rax, %r13
	movl	%r13d, -132(%rbp)
	movl	-112(%rbp), %edi
	movl	-52(%rbp), %esi
	callq	_scale_down
	movl	%eax, -128(%rbp)
	leaq	L_.str.3(%rip), %rsi
	movq	%r12, %rdi
	movl	%r13d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_geo
	movq	(%r15), %rax
	movl	4(%rax), %ecx
	movl	%ecx, -120(%rbp)
	movl	(%rax), %eax
	movl	%eax, -124(%rbp)
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_capture_save_reset
	movl	(%rbx), %ecx
	leaq	L_.str.4(%rip), %rsi
	movq	%r12, %r15
	movq	%r12, %rdi
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	%eax, %edx
	callq	_dev_dbg
	xorl	%r9d, %r9d
	movdqu	-104(%rbp), %xmm0
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movdqu	8(%rax), %xmm1
	psubq	%xmm0, %xmm1
	movdqu	%xmm1, 8(%rax)
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -136(%rbp)
	cmpq	$0, 24(%rbx)
	je	LBB0_14
## %bb.13:
	xorl	%r9d, %r9d
	cmpl	$0, 16(%rbx)
	sete	%r9b
LBB0_14:
	leaq	-112(%rbp), %rsi
	leaq	-136(%rbp), %r8
	movq	%r14, %rdi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	-144(%rbp), %rcx                ## 8-byte Reload
	callq	_client_scale
	movl	%eax, %r13d
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_geo
	movq	%r14, %rdi
	movq	-160(%rbp), %rsi                ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movq	-152(%rbp), %rdx                ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_sh_mobile_ceu_set_rect
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movl	8(%rbx), %ecx
	movl	12(%rbx), %edx
	movq	24(%rbx), %r8
	movq	16(%rbx), %r9
	leaq	L_.str.6(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_geo
	movl	12(%rbx), %edi
	leaq	-48(%rbp), %rsi
	callq	_calc_scale
	movl	%eax, %r12d
	movl	8(%rbx), %edi
	leaq	-44(%rbp), %rsi
	callq	_calc_scale
	movl	%eax, %ebx
	leaq	L_.str.7(%rip), %rsi
	movq	%r15, %rdi
	movl	%r12d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_geo
	shll	$16, %ebx
	orl	%r12d, %ebx
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	cmpl	(%r15), %ebx
	je	LBB0_16
## %bb.15:
	movl	%ebx, (%r15)
	movq	_CFLCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_ceu_write
LBB0_16:
	xorl	%eax, %eax
	cmpq	$0, 8(%r15)
	setne	%al
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	orl	%eax, %esi
	movq	%r15, %rdi
	callq	_capture_restore
	movl	-48(%rbp), %eax
	movl	%eax, (%r14)
	movl	-44(%rbp), %eax
	movl	%eax, 4(%r14)
LBB0_17:
	movl	%r13d, %eax
	addq	$120, %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	"1: combined scales %u:%u\n"

L_.str.1:                               ## @.str.1
	.asciz	"2: camera cropped to %ux%u@%u:%u\n"

L_.str.2:                               ## @.str.2
	.asciz	"3: Adjusted output %ux%u\n"

L_.str.3:                               ## @.str.3
	.asciz	"5: camera target %ux%u\n"

L_.str.4:                               ## @.str.4
	.asciz	"CAPSR 0x%x, CFLCR 0x%x\n"

	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,4,2 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE
L_.str.5:                               ## @.str.5
	.asciz	"6-9: %d\n"

L_.str.6:                               ## @.str.6
	.asciz	"10: CEU cropped to %ux%u@%u:%u\n"

L_.str.7:                               ## @.str.7
	.asciz	"11: CEU scales %u:%u\n"

	.comm	_CFLCR,4,2                      ## @CFLCR
	.no_dead_strip	_sh_mobile_ceu_set_crop
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sh_mobile_ceu_set_crop
_sh_mobile_ceu_set_crop:                ; @sh_mobile_ceu_set_crop
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x28, x27, [sp, #96]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #112]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x1
	mov	x19, x0
	ldr	x0, [x0, #8]
	bl	_to_soc_camera_host
	ldr	x20, [x0]
	ldr	x27, [x19, #16]
	mov	x0, x19
	bl	_soc_camera_to_subdev
	mov	x23, x0
	ldr	x21, [x19, #8]
	add	x1, sp, #44
	add	x2, sp, #40
	mov	x0, x19
	bl	_get_scales
	tbnz	w0, #31, LBB0_4
; %bb.1:
	ldp	w8, w2, [sp, #40]
	str	x8, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_geo
	add	x2, sp, #72
	mov	x0, x23
	mov	x1, x22
	bl	_client_s_crop
	tbnz	w0, #31, LBB0_4
; %bb.2:
	ldp	x9, x8, [sp, #80]
	ldp	w10, w2, [sp, #72]
	stp	x8, x9, [sp, #8]
	str	x10, [sp]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_geo
	ldr	w0, [x22, #4]
	ldr	w1, [sp, #44]
	bl	_scale_down
	mov	x23, x0
	str	w23, [sp, #36]
	ldr	w0, [x22]
	ldr	w1, [sp, #40]
	bl	_scale_down
	mov	x24, x0
	str	w0, [sp, #32]
	cmp	w23, #2561
	b.lo	LBB0_5
; %bb.3:
	mov	w23, #2560
	b	LBB0_7
LBB0_4:
	mov	x26, x0
	b	LBB0_19
LBB0_5:
	cmp	w23, #1
	b.hi	LBB0_8
; %bb.6:
	mov	w23, #2
LBB0_7:
	str	w23, [sp, #36]
LBB0_8:
	add	x26, x27, #8
	cmp	w24, #1921
	b.lo	LBB0_10
; %bb.9:
	mov	w24, #1920
	b	LBB0_12
LBB0_10:
	cmp	w24, #3
	b.hi	LBB0_13
; %bb.11:
	mov	w24, #4
LBB0_12:
	str	w24, [sp, #32]
LBB0_13:
	str	x24, [sp]
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	mov	x2, x23
	bl	_dev_geo
	ldr	w0, [sp, #76]
	ldr	w1, [sp, #44]
	bl	_scale_down
	mov	x25, x0
	str	w25, [sp, #52]
	ldr	w0, [sp, #72]
	ldr	w1, [sp, #40]
	bl	_scale_down
	str	w0, [sp, #56]
	str	x0, [sp]
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	mov	x2, x25
	bl	_dev_geo
	ldr	x8, [x27]
	ldr	d0, [x8]
	stur	d0, [sp, #60]
	mov	x0, x20
	bl	_capture_save_reset
	mov	x25, x0
	ldr	w3, [x20]
Lloh8:
	adrp	x1, l_.str.4@PAGE
Lloh9:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	mov	x2, x25
	bl	_dev_dbg
	ldur	q0, [sp, #80]
	ldur	q1, [x22, #8]
	sub.2d	v0, v1, v0
	stur	q0, [x22, #8]
Lloh10:
	adrp	x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [sp, #48]
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_15
; %bb.14:
	ldr	w8, [x20, #16]
	cmp	w8, #0
	cset	w5, eq
	b	LBB0_16
LBB0_15:
	mov	w5, #0
LBB0_16:
	add	x1, sp, #72
	add	x4, sp, #48
	mov	x0, x19
	mov	x2, x22
	mov	x3, x26
	bl	_client_scale
	mov	x26, x0
Lloh13:
	adrp	x1, l_.str.5@PAGE
Lloh14:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x21
	mov	x2, x26
	bl	_dev_geo
	mov	x0, x19
	mov	x1, x23
	mov	x2, x24
	bl	_sh_mobile_ceu_set_rect
	ldp	x9, x8, [x27, #16]
	ldp	w10, w2, [x27, #8]
	stp	x8, x9, [sp, #8]
	str	x10, [sp]
Lloh15:
	adrp	x1, l_.str.6@PAGE
Lloh16:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x21
	bl	_dev_geo
	ldr	w0, [x27, #12]
	add	x1, sp, #36
	bl	_calc_scale
	mov	x22, x0
	ldr	w0, [x27, #8]
	add	x1, sp, #32
	bl	_calc_scale
	mov	x23, x0
	str	x23, [sp]
Lloh17:
	adrp	x1, l_.str.7@PAGE
Lloh18:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_dev_geo
	orr	w2, w22, w23, lsl #16
	ldr	w8, [x20]
	cmp	w2, w8
	b.eq	LBB0_18
; %bb.17:
	str	w2, [x20]
Lloh19:
	adrp	x8, _CFLCR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CFLCR@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_ceu_write
LBB0_18:
	ldr	x8, [x20, #8]
	cmp	x8, #0
	cset	w8, ne
	orr	w1, w25, w8
	mov	x0, x20
	bl	_capture_restore
	ldp	w9, w8, [sp, #32]
	stp	w8, w9, [x19]
LBB0_19:
	mov	x0, x26
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"1: combined scales %u:%u\n"

l_.str.1:                               ; @.str.1
	.asciz	"2: camera cropped to %ux%u@%u:%u\n"

l_.str.2:                               ; @.str.2
	.asciz	"3: Adjusted output %ux%u\n"

l_.str.3:                               ; @.str.3
	.asciz	"5: camera target %ux%u\n"

l_.str.4:                               ; @.str.4
	.asciz	"CAPSR 0x%x, CFLCR 0x%x\n"

	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,4,2 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE
l_.str.5:                               ; @.str.5
	.asciz	"6-9: %d\n"

l_.str.6:                               ; @.str.6
	.asciz	"10: CEU cropped to %ux%u@%u:%u\n"

l_.str.7:                               ; @.str.7
	.asciz	"11: CEU scales %u:%u\n"

	.comm	_CFLCR,4,2                      ; @CFLCR
	.no_dead_strip	_sh_mobile_ceu_set_crop
.subsections_via_symbols
