	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rj54n1_set_selection
_rj54n1_set_selection:                  ## @rj54n1_set_selection
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rdi, %r14
	callq	_v4l2_get_subdevdata
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_to_rj54n1
	movq	%rax, %r15
	movl	16(%rbx), %eax
	movl	%eax, -44(%rbp)
	movl	20(%rbx), %eax
	movl	%eax, -48(%rbp)
	movq	(%rbx), %rax
	movq	_V4L2_SUBDEV_FORMAT_ACTIVE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	8(%rbx), %rax
	movq	_V4L2_SEL_TGT_CROP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.3:
	movq	_RJ54N1_MAX_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_RJ54N1_MAX_HEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	subq	$8, %rsp
	leaq	-44(%rbp), %rdi
	xorl	%ebx, %ebx
	leaq	-48(%rbp), %r13
	movl	$8, %esi
	xorl	%ecx, %ecx
	movq	%r13, %r8
	movl	$8, %r9d
	pushq	$0
	pushq	$0
	pushq	%rax
	callq	_v4l_bound_align_image
	addq	$32, %rsp
	movl	-44(%rbp), %r10d
	movl	%r10d, %ecx
	shll	$10, %ecx
	movl	(%r15), %esi
	movl	%esi, %eax
	shrl	$31, %eax
	addl	%esi, %eax
	sarl	%eax
	addl	%ecx, %eax
	cltd
	idivl	%esi
	movl	%eax, %r9d
	movl	%eax, -56(%rbp)
	movl	-48(%rbp), %ecx
	movl	%ecx, %edx
	shll	$10, %edx
	movl	(%r15), %esi
	movl	%esi, %eax
	shrl	$31, %eax
	addl	%esi, %eax
	sarl	%eax
	addl	%edx, %eax
	cltd
	idivl	%esi
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, -52(%rbp)
	movl	(%r15), %r8d
	subq	$8, %rsp
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%r10d, %edx
	pushq	%rax
	callq	_dev_dbg
	addq	$16, %rsp
	leaq	-56(%rbp), %rcx
	leaq	-52(%rbp), %r8
	movq	%r14, %rdi
	leaq	-44(%rbp), %rsi
	movq	%r13, %rdx
	callq	_rj54n1_sensor_scale
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movl	-56(%rbp), %ecx
	movl	%ecx, 4(%r15)
	movl	-52(%rbp), %ecx
	movl	%ecx, 8(%r15)
	movl	%eax, (%r15)
	movl	-44(%rbp), %eax
	movl	%eax, 12(%r15)
	movl	-48(%rbp), %eax
	movl	%eax, 16(%r15)
	jmp	LBB0_6
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	%eax, %ebx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_SUBDEV_FORMAT_ACTIVE,8,3  ## @V4L2_SUBDEV_FORMAT_ACTIVE
	.comm	_V4L2_SEL_TGT_CROP,8,3          ## @V4L2_SEL_TGT_CROP
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RJ54N1_MAX_WIDTH,4,2           ## @RJ54N1_MAX_WIDTH
	.comm	_RJ54N1_MAX_HEIGHT,4,2          ## @RJ54N1_MAX_HEIGHT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Scaling for %dx%d : %u = %dx%d\n"

	.no_dead_strip	_rj54n1_set_selection
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rj54n1_set_selection
_rj54n1_set_selection:                  ; @rj54n1_set_selection
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x22, x2
	mov	x20, x0
	bl	_v4l2_get_subdevdata
	mov	x21, x0
	bl	_to_rj54n1
	ldp	w8, w9, [x22, #16]
	stp	w9, w8, [sp, #16]
	ldr	x8, [x22]
Lloh0:
	adrp	x9, _V4L2_SUBDEV_FORMAT_ACTIVE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_SUBDEV_FORMAT_ACTIVE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.1:
	ldr	x8, [x22, #8]
Lloh3:
	adrp	x9, _V4L2_SEL_TGT_CROP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V4L2_SEL_TGT_CROP@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	mov	x19, x0
Lloh6:
	adrp	x8, _RJ54N1_MAX_WIDTH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RJ54N1_MAX_WIDTH@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x8, _RJ54N1_MAX_HEIGHT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RJ54N1_MAX_HEIGHT@GOTPAGEOFF]
Lloh11:
	ldr	w6, [x8]
	str	wzr, [sp]
	add	x0, sp, #20
	add	x4, sp, #16
	mov	w1, #8
	mov	w3, #0
	mov	w5, #8
	mov	w7, #0
	bl	_v4l_bound_align_image
	ldp	w3, w2, [sp, #16]
	ldr	w8, [x19]
	cmp	w8, #0
	cinc	w9, w8, lt
	asr	w9, w9, #1
	add	w9, w9, w2, lsl #10
	sdiv	w5, w9, w8
	str	w5, [sp, #28]
	ldr	w8, [x19]
	cmp	w8, #0
	cinc	w9, w8, lt
	asr	w9, w9, #1
	add	w9, w9, w3, lsl #10
	sdiv	w6, w9, w8
	str	w6, [sp, #24]
	ldr	w4, [x19]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_dbg
	add	x1, sp, #20
	add	x2, sp, #16
	add	x3, sp, #28
	add	x4, sp, #24
	mov	x0, x20
	bl	_rj54n1_sensor_scale
	tbnz	w0, #31, LBB0_5
; %bb.3:
	ldp	w9, w8, [sp, #24]
	stp	w0, w8, [x19]
	ldr	w8, [sp, #20]
	stp	w9, w8, [x19, #8]
	ldr	w8, [sp, #16]
	str	w8, [x19, #16]
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_SUBDEV_FORMAT_ACTIVE,8,3  ; @V4L2_SUBDEV_FORMAT_ACTIVE
	.comm	_V4L2_SEL_TGT_CROP,8,3          ; @V4L2_SEL_TGT_CROP
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RJ54N1_MAX_WIDTH,4,2           ; @RJ54N1_MAX_WIDTH
	.comm	_RJ54N1_MAX_HEIGHT,4,2          ; @RJ54N1_MAX_HEIGHT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Scaling for %dx%d : %u = %dx%d\n"

	.no_dead_strip	_rj54n1_set_selection
.subsections_via_symbols
