	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5k4aa_set_hvflip
_s5k4aa_set_hvflip:                     ## @s5k4aa_set_hvflip
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_S5K4AA_PAGE_MAP_2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movq	(%rdi), %rax
	movq	8(%rdi), %rcx
	movl	(%rcx), %r15d
	movl	(%rax), %r14d
	movq	_D_CONF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movl	%r15d, %ecx
	movl	%r14d, %r8d
	callq	_gspca_dbg
	movq	_S5K4AA_PAGE_MAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_m5602_write_sensor
	testl	%eax, %eax
	js	LBB0_7
## %bb.1:
	movq	_S5K4AA_READ_MODE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_m5602_read_sensor
	testl	%eax, %eax
	js	LBB0_7
## %bb.2:
	movq	_s5k4aa_vflip_dmi_table@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_dmi_check_system
	xorl	%r13d, %r13d
	testl	%r15d, %r15d
	sete	%r13b
	movq	%r12, %rdx
	xorl	%r12d, %r12d
	testl	%r14d, %r14d
	sete	%r12b
	testq	%rax, %rax
	cmovel	%r15d, %r13d
	cmovel	%r14d, %r12d
	movl	-44(%rbp), %eax
	andl	$127, %eax
	movl	%r12d, %ecx
	shll	$7, %ecx
	orl	%eax, %ecx
	movl	%r13d, %eax
	shll	$6, %eax
	orl	%ecx, %eax
	movl	%eax, -44(%rbp)
	movl	(%rdx), %esi
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_m5602_write_sensor
	testl	%eax, %eax
	js	LBB0_7
## %bb.3:
	movq	_S5K4AA_COLSTART_LO@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_m5602_read_sensor
	testl	%eax, %eax
	js	LBB0_7
## %bb.4:
	movl	-44(%rbp), %eax
	movl	%eax, %ecx
	orl	$1, %ecx
	andl	$254, %eax
	testl	%r13d, %r13d
	cmovel	%ecx, %eax
	movl	%eax, -44(%rbp)
	movl	(%r14), %esi
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_m5602_write_sensor
	testl	%eax, %eax
	js	LBB0_7
## %bb.5:
	movq	_S5K4AA_ROWSTART_LO@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_m5602_read_sensor
	testl	%eax, %eax
	js	LBB0_7
## %bb.6:
	movl	-44(%rbp), %eax
	movl	%eax, %ecx
	orl	$1, %ecx
	andl	$254, %eax
	testl	%r12d, %r12d
	cmovel	%ecx, %eax
	movl	%eax, -44(%rbp)
	movl	(%r14), %esi
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_m5602_write_sensor
	movl	%eax, %ecx
	sarl	$31, %eax
	andl	%ecx, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_S5K4AA_PAGE_MAP_2,4,2          ## @S5K4AA_PAGE_MAP_2
	.comm	_D_CONF,4,2                     ## @D_CONF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Set hvflip %d %d\n"

	.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_COLSTART_LO,4,2         ## @S5K4AA_COLSTART_LO
	.comm	_S5K4AA_ROWSTART_LO,4,2         ## @S5K4AA_ROWSTART_LO
	.no_dead_strip	_s5k4aa_set_hvflip
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s5k4aa_set_hvflip
_s5k4aa_set_hvflip:                     ; @s5k4aa_set_hvflip
	.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	x19, x0
Lloh0:
	adrp	x8, _S5K4AA_PAGE_MAP_2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _S5K4AA_PAGE_MAP_2@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #12]
	ldp	x9, x8, [x0]
	ldr	w21, [x8]
	ldr	w20, [x9]
Lloh3:
	adrp	x8, _D_CONF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _D_CONF@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x3, x21
	mov	x4, x20
	bl	_gspca_dbg
Lloh8:
	adrp	x8, _S5K4AA_PAGE_MAP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _S5K4AA_PAGE_MAP@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #1
	bl	_m5602_write_sensor
	tbnz	w0, #31, LBB0_7
; %bb.1:
Lloh11:
	adrp	x22, _S5K4AA_READ_MODE@GOTPAGE
Lloh12:
	ldr	x22, [x22, _S5K4AA_READ_MODE@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #1
	bl	_m5602_read_sensor
	tbnz	w0, #31, LBB0_7
; %bb.2:
Lloh13:
	adrp	x8, _s5k4aa_vflip_dmi_table@GOTPAGE
Lloh14:
	ldr	x8, [x8, _s5k4aa_vflip_dmi_table@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	bl	_dmi_check_system
	cmp	w21, #0
	cset	w8, eq
	cmp	w20, #0
	cset	w9, eq
	cmp	x0, #0
	csel	w21, w21, w8, eq
	csel	w20, w20, w9, eq
	ldr	w8, [sp, #12]
	bfi	w8, w20, #7, #25
	orr	w8, w8, w21, lsl #6
	str	w8, [sp, #12]
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #1
	bl	_m5602_write_sensor
	tbnz	w0, #31, LBB0_7
; %bb.3:
Lloh16:
	adrp	x22, _S5K4AA_COLSTART_LO@GOTPAGE
Lloh17:
	ldr	x22, [x22, _S5K4AA_COLSTART_LO@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #1
	bl	_m5602_read_sensor
	tbnz	w0, #31, LBB0_7
; %bb.4:
	ldr	w8, [sp, #12]
	orr	w9, w8, #0x1
	and	w8, w8, #0xfe
	cmp	w21, #0
	csel	w8, w9, w8, eq
	str	w8, [sp, #12]
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #1
	bl	_m5602_write_sensor
	tbnz	w0, #31, LBB0_7
; %bb.5:
Lloh18:
	adrp	x21, _S5K4AA_ROWSTART_LO@GOTPAGE
Lloh19:
	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_7
; %bb.6:
	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
	cmp	w0, #0
	csel	w0, w0, wzr, lt
LBB0_7:
	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	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_S5K4AA_PAGE_MAP_2,4,2          ; @S5K4AA_PAGE_MAP_2
	.comm	_D_CONF,4,2                     ; @D_CONF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Set hvflip %d %d\n"

	.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_COLSTART_LO,4,2         ; @S5K4AA_COLSTART_LO
	.comm	_S5K4AA_ROWSTART_LO,4,2         ; @S5K4AA_ROWSTART_LO
	.no_dead_strip	_s5k4aa_set_hvflip
.subsections_via_symbols
