	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sh_mobile_ceu_set_fmt
_sh_mobile_ceu_set_fmt:                 ## @sh_mobile_ceu_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	$168, %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, %rbx
	movq	8(%rdi), %rdi
	callq	_to_soc_camera_host
	movq	(%rax), %rax
	movq	%rax, -176(%rbp)                ## 8-byte Spill
	movq	16(%rbx), %r15
	movq	(%r13), %rax
	movq	%rax, -112(%rbp)
	movq	%rbx, %rdi
	callq	_soc_camera_to_subdev
	movq	%rax, %r12
	movq	8(%rbx), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	(%r13), %r14d
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	movl	4(%r13), %eax
	cmpl	$132, %eax
	je	LBB0_4
## %bb.1:
	cmpl	$133, %eax
	jne	LBB0_3
## %bb.2:
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_5
LBB0_3:
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movl	$132, 4(%rax)
LBB0_4:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$1, -48(%rbp)                   ## 4-byte Folded Spill
LBB0_5:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_soc_camera_xlate_by_fourcc
	testq	%rax, %rax
	je	LBB0_19
## %bb.6:
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, -168(%rbp)                ## 8-byte Spill
	leaq	-200(%rbp), %rbx
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -208(%rbp)
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_client_g_rect
	testl	%eax, %eax
	js	LBB0_22
## %bb.7:
	leaq	-56(%rbp), %rdx
	leaq	-52(%rbp), %rcx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_get_camera_scales
	testl	%eax, %eax
	js	LBB0_22
## %bb.8:
	movl	-56(%rbp), %edx
	movl	-52(%rbp), %ecx
	leaq	L_.str.1(%rip), %rsi
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_dev_geo
	movl	-56(%rbp), %edx
	movl	-52(%rbp), %ecx
	leaq	-160(%rbp), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_get_camera_subwin
	testl	%eax, %eax
	js	LBB0_22
## %bb.9:
	movl	-152(%rbp), %edx
	movq	-160(%rbp), %rcx
	movl	-140(%rbp), %r8d
	movl	-144(%rbp), %r9d
	leaq	L_.str.2(%rip), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_dev_geo
	movq	-152(%rbp), %rdi
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	16(%rbx), %rsi
	callq	_calc_generic_scale
	movl	%eax, %r15d
	movq	-160(%rbp), %rdi
	movq	8(%rbx), %rsi
	callq	_calc_generic_scale
	movl	%eax, %r12d
	leaq	L_.str.3(%rip), %rsi
	movq	%r13, %rdi
	movl	%r15d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_geo
	movq	-192(%rbp), %rdi
	movl	%r15d, %esi
	callq	_scale_down
	movq	%rax, %r15
	movq	%rax, -96(%rbp)
	movq	-200(%rbp), %rdi
	movl	%r12d, %esi
	callq	_scale_down
	movq	%rax, -104(%rbp)
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -112(%rbp)
	andl	$-4, %r14d
	xorl	%r12d, %r12d
	cmpl	$128, %r14d
	movq	%rbx, %r14
	sete	%r12b
	leaq	L_.str.4(%rip), %rsi
	movq	%r13, %rdi
	movl	%r15d, %edx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_dev_geo
	movl	-48(%rbp), %r9d                 ## 4-byte Reload
	andl	%r12d, %r9d
	leaq	-160(%rbp), %rdx
	leaq	-136(%rbp), %rcx
	leaq	-112(%rbp), %r8
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	leaq	-200(%rbp), %rsi
	callq	_client_scale
	movl	%eax, %r15d
	leaq	L_.str.5(%rip), %rsi
	movq	%r13, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_geo
	movq	-104(%rbp), %r8
	movq	-96(%rbp), %rcx
	movq	16(%rbx), %r9
	subq	$8, %rsp
	leaq	L_.str.6(%rip), %rsi
	movq	%r13, %rdi
	movl	%r15d, %edx
	pushq	8(%rbx)
	callq	_dev_dbg
	addq	$16, %rsp
	testl	%r15d, %r15d
	js	LBB0_23
## %bb.10:
	leaq	16(%r14), %r15
	movq	(%r15), %rax
	movq	-96(%rbp), %rcx
	cmpq	%rcx, %rax
	jbe	LBB0_12
## %bb.11:
	movq	%rcx, (%r15)
	movq	%rcx, %rax
LBB0_12:
	addq	$8, %r14
	movq	-128(%rbp), %rdi
	cmpq	%rdi, %rax
	jbe	LBB0_14
## %bb.13:
	movq	%rdi, (%r15)
LBB0_14:
	movq	(%r14), %rax
	movq	-104(%rbp), %rcx
	cmpq	%rcx, %rax
	jbe	LBB0_16
## %bb.15:
	movq	%rcx, (%r14)
	movq	%rcx, %rax
LBB0_16:
	movl	%r12d, %r13d
	movq	-136(%rbp), %rcx
	cmpq	%rcx, %rax
	jbe	LBB0_18
## %bb.17:
	movq	%rcx, (%r14)
LBB0_18:
	movq	%r15, %rsi
	callq	_calc_scale
	movl	%eax, %r12d
	movq	-136(%rbp), %rdi
	movq	%r14, %rsi
	callq	_calc_scale
	movl	%eax, %ebx
	movl	-128(%rbp), %edx
	movq	(%r15), %r8
	movq	-136(%rbp), %r9
	leaq	L_.str.7(%rip), %rsi
	xorl	%r15d, %r15d
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %ecx
	xorl	%eax, %eax
	pushq	(%r14)
	pushq	%rbx
	callq	_dev_geo
	addq	$16, %rsp
	shll	$16, %ebx
	orl	%r12d, %ebx
	movq	-176(%rbp), %rcx                ## 8-byte Reload
	movl	%ebx, (%rcx)
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movl	12(%rdx), %eax
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%eax, 4(%rsi)
	movl	8(%rdx), %eax
	movl	%eax, (%rsi)
	movq	(%rdx), %rax
	movq	-168(%rbp), %rdx                ## 8-byte Reload
	movq	%rax, 24(%rdx)
	movq	-120(%rbp), %rax
	movq	%rax, 16(%rdx)
	movups	-136(%rbp), %xmm0
	movups	%xmm0, (%rdx)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%rcx)
	movl	%r13d, 8(%rcx)
	jmp	LBB0_23
LBB0_22:
	movl	%eax, %r15d
	jmp	LBB0_23
LBB0_19:
	leaq	L_.str(%rip), %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %edx
	callq	_dev_warn
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_23:
	movl	%r15d, %eax
	addq	$168, %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	"Format %x not found\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,4,2 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE
L_.str.1:                               ## @.str.1
	.asciz	"1: camera scales %u:%u\n"

L_.str.2:                               ## @.str.2
	.asciz	"2: subwin %ux%u@%u:%u\n"

L_.str.3:                               ## @.str.3
	.asciz	"3: scales %u:%u\n"

L_.str.4:                               ## @.str.4
	.asciz	"4: camera output %ux%u\n"

L_.str.5:                               ## @.str.5
	.asciz	"5-9: client scale %d\n"

L_.str.6:                               ## @.str.6
	.asciz	"Camera %d fmt %ux%u, requested %ux%u\n"

L_.str.7:                               ## @.str.7
	.asciz	"10: W: %u : 0x%x = %u, H: %u : 0x%x = %u\n"

	.no_dead_strip	_sh_mobile_ceu_set_fmt
.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_fmt
_sh_mobile_ceu_set_fmt:                 ; @sh_mobile_ceu_set_fmt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #288
	.cfi_def_cfa_offset 288
	stp	x28, x27, [sp, #192]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #208]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #224]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #240]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #256]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #272]            ; 16-byte Folded Spill
	add	x29, sp, #272
	.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	x20, x1
	mov	x19, x0
	ldr	x0, [x0, #8]
	bl	_to_soc_camera_host
	ldr	x27, [x0]
	ldr	x25, [x19, #16]
	ldr	x8, [x20]
	stur	x8, [x29, #-112]
	mov	x0, x19
	bl	_soc_camera_to_subdev
	mov	x24, x0
	ldr	x21, [x19, #8]
	ldp	w23, w8, [x20]
	cmp	w8, #132
	b.eq	LBB0_4
; %bb.1:
	cmp	w8, #133
	b.ne	LBB0_3
; %bb.2:
	mov	w28, #0
	mov	w26, #1
	b	LBB0_5
LBB0_3:
	mov	w8, #132
	str	w8, [x20, #4]
LBB0_4:
	mov	w26, #0
	mov	w28, #1
LBB0_5:
	mov	x0, x19
	mov	x1, x23
	bl	_soc_camera_xlate_by_fourcc
	cbz	x0, LBB0_20
; %bb.6:
	mov	x22, x0
	str	w26, [sp, #60]                  ; 4-byte Folded Spill
	str	x25, [sp, #64]                  ; 8-byte Folded Spill
	add	x8, sp, #128
	add	x25, x8, #8
Lloh0:
	adrp	x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #128]
	mov	x0, x24
	mov	x1, x25
	bl	_client_g_rect
	tbnz	w0, #31, LBB0_19
; %bb.7:
	add	x2, sp, #76
	add	x3, sp, #72
	mov	x0, x24
	mov	x1, x25
	bl	_get_camera_scales
	tbnz	w0, #31, LBB0_19
; %bb.8:
	ldp	w8, w2, [sp, #72]
	str	x8, [sp]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_geo
	ldp	w3, w2, [sp, #72]
	add	x1, sp, #104
	mov	x0, x19
	bl	_get_camera_subwin
	tbnz	w0, #31, LBB0_19
; %bb.9:
	str	x27, [sp, #48]                  ; 8-byte Folded Spill
	ldr	x8, [sp, #104]
	ldp	w10, w9, [sp, #120]
	ldr	w2, [sp, #112]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh5:
	adrp	x1, l_.str.2@PAGE
Lloh6:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_dev_geo
	ldr	x0, [sp, #112]
	mov	x24, x20
	ldr	x1, [x24, #16]!
	bl	_calc_generic_scale
	mov	x26, x0
	ldr	x0, [sp, #104]
	ldr	x1, [x20, #8]!
	bl	_calc_generic_scale
	mov	x27, x0
	str	x27, [sp]
Lloh7:
	adrp	x1, l_.str.3@PAGE
Lloh8:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	mov	x2, x26
	bl	_dev_geo
	ldr	x0, [sp, #144]
	mov	x1, x26
	bl	_scale_down
	mov	x26, x0
	stur	x0, [x29, #-96]
	ldr	x0, [sp, #136]
	mov	x1, x27
	bl	_scale_down
	stur	x0, [x29, #-104]
	ldr	x8, [x22]
	ldr	w8, [x8]
	stur	w8, [x29, #-112]
	and	w8, w23, #0xfffffffc
	cmp	w8, #128
	cset	w27, eq
	str	x0, [sp]
Lloh9:
	adrp	x1, l_.str.4@PAGE
Lloh10:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	mov	x2, x26
	bl	_dev_geo
	and	w5, w28, w27
	add	x2, sp, #104
	add	x3, sp, #80
	sub	x4, x29, #112
	mov	x0, x19
	mov	x1, x25
	bl	_client_scale
	mov	x26, x0
Lloh11:
	adrp	x1, l_.str.5@PAGE
Lloh12:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x21
	mov	x2, x26
	bl	_dev_geo
	ldp	x4, x3, [x29, #-104]
	ldr	x5, [x24]
	ldr	x6, [x20]
Lloh13:
	adrp	x1, l_.str.6@PAGE
Lloh14:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x21
	mov	x2, x26
	bl	_dev_dbg
	tbnz	w26, #31, LBB0_21
; %bb.10:
	ldr	x8, [x24]
	ldur	x9, [x29, #-96]
	cmp	x8, x9
	b.ls	LBB0_12
; %bb.11:
	str	x9, [x24]
	mov	x8, x9
LBB0_12:
	ldr	x0, [sp, #88]
	cmp	x8, x0
	b.ls	LBB0_14
; %bb.13:
	str	x0, [x24]
LBB0_14:
	ldr	x8, [x20]
	ldur	x9, [x29, #-104]
	cmp	x8, x9
	b.ls	LBB0_16
; %bb.15:
	str	x9, [x20]
	mov	x8, x9
LBB0_16:
	ldr	x9, [sp, #80]
	cmp	x8, x9
	b.ls	LBB0_18
; %bb.17:
	str	x9, [x20]
LBB0_18:
	mov	x1, x24
	bl	_calc_scale
	mov	x23, x0
	ldr	x0, [sp, #80]
	mov	x1, x20
	bl	_calc_scale
	mov	x25, x0
	ldr	w2, [sp, #88]
	ldr	x8, [x24]
	ldr	x9, [sp, #80]
	ldr	x10, [x20]
	stp	x25, x10, [sp, #24]
	stp	x8, x9, [sp, #8]
	str	x23, [sp]
Lloh15:
	adrp	x1, l_.str.7@PAGE
Lloh16:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x21
	bl	_dev_geo
	mov	w26, #0
	orr	w8, w23, w25, lsl #16
	ldr	x10, [sp, #48]                  ; 8-byte Folded Reload
	str	w8, [x10]
	ldr	d0, [x22, #8]
	str	d0, [x19]
	ldr	x8, [x22]
	ldr	x9, [sp, #96]
	ldr	q0, [sp, #80]
	ldr	x11, [sp, #64]                  ; 8-byte Folded Reload
	str	q0, [x11]
	stp	x9, x8, [x11, #16]
	ldr	w8, [sp, #60]                   ; 4-byte Folded Reload
	stp	w8, w27, [x10, #4]
	b	LBB0_21
LBB0_19:
	mov	x26, x0
	b	LBB0_21
LBB0_20:
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x23
	bl	_dev_warn
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w26, w8
LBB0_21:
	mov	x0, x26
	ldp	x29, x30, [sp, #272]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #256]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #240]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #224]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #208]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #192]            ; 16-byte Folded Reload
	add	sp, sp, #288
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Format %x not found\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,4,2 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE
l_.str.1:                               ; @.str.1
	.asciz	"1: camera scales %u:%u\n"

l_.str.2:                               ; @.str.2
	.asciz	"2: subwin %ux%u@%u:%u\n"

l_.str.3:                               ; @.str.3
	.asciz	"3: scales %u:%u\n"

l_.str.4:                               ; @.str.4
	.asciz	"4: camera output %ux%u\n"

l_.str.5:                               ; @.str.5
	.asciz	"5-9: client scale %d\n"

l_.str.6:                               ; @.str.6
	.asciz	"Camera %d fmt %ux%u, requested %ux%u\n"

l_.str.7:                               ; @.str.7
	.asciz	"10: W: %u : 0x%x = %u, H: %u : 0x%x = %u\n"

	.no_dead_strip	_sh_mobile_ceu_set_fmt
.subsections_via_symbols
