	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5k4aa_set_vflip
_s5k4aa_set_vflip:                      ## @s5k4aa_set_vflip
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	_S5K4AA_PAGE_MAP_2@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -36(%rbp)
	movq	_VFLIP_IDX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%esi, (%rax,%rcx,4)
	movq	_D_V4L2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_PDEBUG
	movq	_S5K4AA_PAGE_MAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	movq	%r14, %rdi
	movl	$1, %ecx
	callq	_m5602_write_sensor
	testl	%eax, %eax
	js	LBB0_5
## %bb.1:
	movq	_S5K4AA_READ_MODE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-36(%rbp), %rdx
	movq	%r14, %rdi
	movl	$1, %ecx
	callq	_m5602_read_sensor
	testl	%eax, %eax
	js	LBB0_5
## %bb.2:
	movq	_s5k4aa_vflip_dmi_table@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_dmi_check_system
	xorl	%r15d, %r15d
	testl	%ebx, %ebx
	sete	%r15b
	testq	%rax, %rax
	cmovel	%ebx, %r15d
	movq	_S5K4AA_RM_V_FLIP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	-36(%rbp), %eax
	movl	%r15d, %ecx
	shll	$7, %ecx
	movzbl	%cl, %ecx
	orl	%eax, %ecx
	movl	%ecx, -36(%rbp)
	movl	(%r12), %esi
	leaq	-36(%rbp), %rdx
	movq	%r14, %rdi
	movl	$1, %ecx
	callq	_m5602_write_sensor
	testl	%eax, %eax
	js	LBB0_5
## %bb.3:
	movq	_S5K4AA_ROWSTART_LO@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-36(%rbp), %rdx
	movq	%r14, %rdi
	movl	$1, %ecx
	callq	_m5602_read_sensor
	testl	%eax, %eax
	js	LBB0_5
## %bb.4:
	movl	-36(%rbp), %eax
	movl	%eax, %ecx
	orl	$1, %ecx
	andl	$254, %eax
	testl	%r15d, %r15d
	cmovel	%ecx, %eax
	movl	%eax, -36(%rbp)
	movl	(%rbx), %esi
	leaq	-36(%rbp), %rdx
	movq	%r14, %rdi
	movl	$1, %ecx
	callq	_m5602_write_sensor
LBB0_5:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_S5K4AA_PAGE_MAP_2,4,2          ## @S5K4AA_PAGE_MAP_2
	.comm	_VFLIP_IDX,8,3                  ## @VFLIP_IDX
	.comm	_D_V4L2,4,2                     ## @D_V4L2
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Set vertical flip to %d"

	.comm	_S5K4AA_PAGE_MAP,4,2            ## @S5K4AA_PAGE_MAP
	.comm	_S5K4AA_READ_MODE,4,2           ## @S5K4AA_READ_MODE
	.comm	_s5k4aa_vflip_dmi_table,4,2     ## @s5k4aa_vflip_dmi_table
	.comm	_S5K4AA_RM_V_FLIP,4,2           ## @S5K4AA_RM_V_FLIP
	.comm	_S5K4AA_ROWSTART_LO,4,2         ## @S5K4AA_ROWSTART_LO
	.no_dead_strip	_s5k4aa_set_vflip
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s5k4aa_set_vflip
_s5k4aa_set_vflip:                      ; @s5k4aa_set_vflip
	.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	x20, x1
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _S5K4AA_PAGE_MAP_2@GOTPAGE
Lloh1:
	ldr	x9, [x9, _S5K4AA_PAGE_MAP_2@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	str	w9, [sp, #12]
Lloh3:
	adrp	x9, _VFLIP_IDX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VFLIP_IDX@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	str	w1, [x8, x9, lsl #2]
Lloh6:
	adrp	x8, _D_V4L2@GOTPAGE
Lloh7:
	ldr	x8, [x8, _D_V4L2@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_PDEBUG
Lloh11:
	adrp	x8, _S5K4AA_PAGE_MAP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _S5K4AA_PAGE_MAP@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #1
	bl	_m5602_write_sensor
	tbnz	w0, #31, LBB0_5
; %bb.1:
Lloh14:
	adrp	x21, _S5K4AA_READ_MODE@GOTPAGE
Lloh15:
	ldr	x21, [x21, _S5K4AA_READ_MODE@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #1
	bl	_m5602_read_sensor
	tbnz	w0, #31, LBB0_5
; %bb.2:
Lloh16:
	adrp	x8, _s5k4aa_vflip_dmi_table@GOTPAGE
Lloh17:
	ldr	x8, [x8, _s5k4aa_vflip_dmi_table@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_dmi_check_system
	cmp	w20, #0
	cset	w8, eq
	cmp	x0, #0
	csel	w20, w20, w8, eq
	ldr	w8, [sp, #12]
Lloh19:
	adrp	x9, _S5K4AA_RM_V_FLIP@GOTPAGE
Lloh20:
	ldr	x9, [x9, _S5K4AA_RM_V_FLIP@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	bic	w8, w8, w9
	ubfiz	w9, w20, #7, #1
	orr	w8, w9, w8
	str	w8, [sp, #12]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #1
	bl	_m5602_write_sensor
	tbnz	w0, #31, LBB0_5
; %bb.3:
Lloh22:
	adrp	x21, _S5K4AA_ROWSTART_LO@GOTPAGE
Lloh23:
	ldr	x21, [x21, _S5K4AA_ROWSTART_LO@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #1
	bl	_m5602_read_sensor
	tbnz	w0, #31, LBB0_5
; %bb.4:
	ldr	w8, [sp, #12]
	orr	w9, w8, #0x1
	and	w8, w8, #0xfe
	cmp	w20, #0
	csel	w8, w9, w8, eq
	str	w8, [sp, #12]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #1
	bl	_m5602_write_sensor
LBB0_5:
	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	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_S5K4AA_PAGE_MAP_2,4,2          ; @S5K4AA_PAGE_MAP_2
	.comm	_VFLIP_IDX,8,3                  ; @VFLIP_IDX
	.comm	_D_V4L2,4,2                     ; @D_V4L2
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Set vertical flip to %d"

	.comm	_S5K4AA_PAGE_MAP,4,2            ; @S5K4AA_PAGE_MAP
	.comm	_S5K4AA_READ_MODE,4,2           ; @S5K4AA_READ_MODE
	.comm	_s5k4aa_vflip_dmi_table,4,2     ; @s5k4aa_vflip_dmi_table
	.comm	_S5K4AA_RM_V_FLIP,4,2           ; @S5K4AA_RM_V_FLIP
	.comm	_S5K4AA_ROWSTART_LO,4,2         ; @S5K4AA_ROWSTART_LO
	.no_dead_strip	_s5k4aa_set_vflip
.subsections_via_symbols
