	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpia2_set_flicker_mode         ## -- Begin function cpia2_set_flicker_mode
	.p2align	4, 0x90
_cpia2_set_flicker_mode:                ## @cpia2_set_flicker_mode
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	16(%rdi), %rax
	movq	_DEVICE_STV_672@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_CPIA2_CMD_GET_FLICKER_MODES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TRANSFER_READ@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	xorl	%ecx, %ecx
	callq	_cpia2_do_command
	testl	%eax, %eax
	jne	LBB0_15
## %bb.3:
	movb	(%rbx), %al
	cmpl	$130, %r14d
	je	LBB0_7
## %bb.4:
	cmpl	$129, %r14d
	je	LBB0_8
## %bb.5:
	cmpl	$128, %r14d
	jne	LBB0_1
## %bb.6:
	movq	_CPIA2_VP_FLICKER_MODES_NEVER_FLICKER@GOTPCREL(%rip), %rcx
	orb	(%rcx), %al
	movq	_CPIA2_VP_FLICKER_MODES_50HZ@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	notb	%cl
	andb	%al, %cl
	jmp	LBB0_10
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_CPIA2_VP_FLICKER_MODES_NEVER_FLICKER@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	notb	%cl
	andb	%cl, %al
	movq	_CPIA2_VP_FLICKER_MODES_50HZ@GOTPCREL(%rip), %rcx
	orb	(%rcx), %al
	jmp	LBB0_9
LBB0_8:
	movq	_CPIA2_VP_FLICKER_MODES_NEVER_FLICKER@GOTPCREL(%rip), %rcx
	movq	_CPIA2_VP_FLICKER_MODES_50HZ@GOTPCREL(%rip), %rdx
	movb	(%rdx), %dl
	orb	(%rcx), %dl
	notb	%dl
	andb	%dl, %al
LBB0_9:
	movl	%eax, %ecx
LBB0_10:
	movq	_CPIA2_CMD_SET_FLICKER_MODES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TRANSFER_WRITE@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movzbl	%cl, %ecx
	movq	%rbx, %rdi
	callq	_cpia2_do_command
	testl	%eax, %eax
	jne	LBB0_15
## %bb.11:
	movq	_CPIA2_CMD_GET_VP_EXP_MODES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_cpia2_do_command
	testl	%eax, %eax
	jne	LBB0_15
## %bb.12:
	movb	8(%rbx), %al
	movq	_CPIA2_VP_EXPOSURE_MODES_INHIBIT_FLICKER@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%ecx, %edx
	orb	%al, %dl
	notb	%cl
	andb	%al, %cl
	cmpl	$128, %r14d
	movzbl	%dl, %eax
	movzbl	%cl, %ecx
	cmovel	%eax, %ecx
	movq	_CPIA2_CMD_SET_VP_EXP_MODES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	movzbl	%cl, %ecx
	movq	%rbx, %rdi
	callq	_cpia2_do_command
	testl	%eax, %eax
	jne	LBB0_15
## %bb.13:
	movq	_CPIA2_CMD_REHASH_VP4@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_cpia2_do_command
	testl	%eax, %eax
	jne	LBB0_15
## %bb.14:
	movl	%r14d, 4(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_DEVICE_STV_672,8,3             ## @DEVICE_STV_672
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CPIA2_CMD_GET_FLICKER_MODES,4,2 ## @CPIA2_CMD_GET_FLICKER_MODES
	.comm	_TRANSFER_READ,4,2              ## @TRANSFER_READ
	.comm	_CPIA2_VP_FLICKER_MODES_NEVER_FLICKER,1,0 ## @CPIA2_VP_FLICKER_MODES_NEVER_FLICKER
	.comm	_CPIA2_VP_FLICKER_MODES_50HZ,1,0 ## @CPIA2_VP_FLICKER_MODES_50HZ
	.comm	_CPIA2_CMD_SET_FLICKER_MODES,4,2 ## @CPIA2_CMD_SET_FLICKER_MODES
	.comm	_TRANSFER_WRITE,4,2             ## @TRANSFER_WRITE
	.comm	_CPIA2_CMD_GET_VP_EXP_MODES,4,2 ## @CPIA2_CMD_GET_VP_EXP_MODES
	.comm	_CPIA2_VP_EXPOSURE_MODES_INHIBIT_FLICKER,1,0 ## @CPIA2_VP_EXPOSURE_MODES_INHIBIT_FLICKER
	.comm	_CPIA2_CMD_SET_VP_EXP_MODES,4,2 ## @CPIA2_CMD_SET_VP_EXP_MODES
	.comm	_CPIA2_CMD_REHASH_VP4,4,2       ## @CPIA2_CMD_REHASH_VP4
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpia2_set_flicker_mode         ; -- Begin function cpia2_set_flicker_mode
	.p2align	2
_cpia2_set_flicker_mode:                ; @cpia2_set_flicker_mode
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x8, [x0, #16]
Lloh0:
	adrp	x9, _DEVICE_STV_672@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DEVICE_STV_672@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh3:
	adrp	x8, _CPIA2_CMD_GET_FLICKER_MODES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CPIA2_CMD_GET_FLICKER_MODES@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x21, _TRANSFER_READ@GOTPAGE
Lloh7:
	ldr	x21, [x21, _TRANSFER_READ@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	w3, #0
	bl	_cpia2_do_command
	cbnz	w0, LBB0_7
; %bb.2:
	ldrb	w8, [x20]
	cmp	w19, #130
	b.eq	LBB0_8
; %bb.3:
	cmp	w19, #129
	b.eq	LBB0_9
; %bb.4:
	cmp	w19, #128
	b.ne	LBB0_6
; %bb.5:
Lloh8:
	adrp	x9, _CPIA2_VP_FLICKER_MODES_NEVER_FLICKER@GOTPAGE
Lloh9:
	ldr	x9, [x9, _CPIA2_VP_FLICKER_MODES_NEVER_FLICKER@GOTPAGEOFF]
	ldrb	w9, [x9]
	orr	w8, w9, w8
Lloh10:
	adrp	x9, _CPIA2_VP_FLICKER_MODES_50HZ@GOTPAGE
Lloh11:
	ldr	x9, [x9, _CPIA2_VP_FLICKER_MODES_50HZ@GOTPAGEOFF]
	ldrb	w9, [x9]
	b	LBB0_10
LBB0_6:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_8:
Lloh15:
	adrp	x9, _CPIA2_VP_FLICKER_MODES_NEVER_FLICKER@GOTPAGE
Lloh16:
	ldr	x9, [x9, _CPIA2_VP_FLICKER_MODES_NEVER_FLICKER@GOTPAGEOFF]
	ldrb	w9, [x9]
	bic	w8, w8, w9
Lloh17:
	adrp	x9, _CPIA2_VP_FLICKER_MODES_50HZ@GOTPAGE
Lloh18:
	ldr	x9, [x9, _CPIA2_VP_FLICKER_MODES_50HZ@GOTPAGEOFF]
	ldrb	w9, [x9]
	orr	w8, w8, w9
	b	LBB0_11
LBB0_9:
Lloh19:
	adrp	x9, _CPIA2_VP_FLICKER_MODES_NEVER_FLICKER@GOTPAGE
Lloh20:
	ldr	x9, [x9, _CPIA2_VP_FLICKER_MODES_NEVER_FLICKER@GOTPAGEOFF]
	ldrb	w9, [x9]
Lloh21:
	adrp	x10, _CPIA2_VP_FLICKER_MODES_50HZ@GOTPAGE
Lloh22:
	ldr	x10, [x10, _CPIA2_VP_FLICKER_MODES_50HZ@GOTPAGEOFF]
	ldrb	w10, [x10]
	orr	w9, w10, w9
LBB0_10:
	bic	w8, w8, w9
LBB0_11:
Lloh23:
	adrp	x9, _CPIA2_CMD_SET_FLICKER_MODES@GOTPAGE
Lloh24:
	ldr	x9, [x9, _CPIA2_CMD_SET_FLICKER_MODES@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x9]
Lloh26:
	adrp	x22, _TRANSFER_WRITE@GOTPAGE
Lloh27:
	ldr	x22, [x22, _TRANSFER_WRITE@GOTPAGEOFF]
	ldr	w2, [x22]
	and	w3, w8, #0xff
	mov	x0, x20
	bl	_cpia2_do_command
	cbnz	w0, LBB0_7
; %bb.12:
Lloh28:
	adrp	x8, _CPIA2_CMD_GET_VP_EXP_MODES@GOTPAGE
Lloh29:
	ldr	x8, [x8, _CPIA2_CMD_GET_VP_EXP_MODES@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	ldr	w2, [x21]
	mov	x0, x20
	mov	w3, #0
	bl	_cpia2_do_command
	cbnz	w0, LBB0_7
; %bb.13:
	ldrb	w8, [x20, #8]
Lloh31:
	adrp	x9, _CPIA2_VP_EXPOSURE_MODES_INHIBIT_FLICKER@GOTPAGE
Lloh32:
	ldr	x9, [x9, _CPIA2_VP_EXPOSURE_MODES_INHIBIT_FLICKER@GOTPAGEOFF]
	ldrb	w9, [x9]
	orr	w10, w9, w8
	bic	w8, w8, w9
	cmp	w19, #128
	csel	w8, w10, w8, eq
Lloh33:
	adrp	x9, _CPIA2_CMD_SET_VP_EXP_MODES@GOTPAGE
Lloh34:
	ldr	x9, [x9, _CPIA2_CMD_SET_VP_EXP_MODES@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x9]
	ldr	w2, [x22]
	and	w3, w8, #0xff
	mov	x0, x20
	bl	_cpia2_do_command
	cbnz	w0, LBB0_7
; %bb.14:
Lloh36:
	adrp	x8, _CPIA2_CMD_REHASH_VP4@GOTPAGE
Lloh37:
	ldr	x8, [x8, _CPIA2_CMD_REHASH_VP4@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	ldr	w2, [x22]
	mov	x0, x20
	mov	w3, #1
	bl	_cpia2_do_command
	cbnz	w0, LBB0_7
; %bb.15:
	str	w19, [x20, #4]
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_DEVICE_STV_672,8,3             ; @DEVICE_STV_672
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CPIA2_CMD_GET_FLICKER_MODES,4,2 ; @CPIA2_CMD_GET_FLICKER_MODES
	.comm	_TRANSFER_READ,4,2              ; @TRANSFER_READ
	.comm	_CPIA2_VP_FLICKER_MODES_NEVER_FLICKER,1,0 ; @CPIA2_VP_FLICKER_MODES_NEVER_FLICKER
	.comm	_CPIA2_VP_FLICKER_MODES_50HZ,1,0 ; @CPIA2_VP_FLICKER_MODES_50HZ
	.comm	_CPIA2_CMD_SET_FLICKER_MODES,4,2 ; @CPIA2_CMD_SET_FLICKER_MODES
	.comm	_TRANSFER_WRITE,4,2             ; @TRANSFER_WRITE
	.comm	_CPIA2_CMD_GET_VP_EXP_MODES,4,2 ; @CPIA2_CMD_GET_VP_EXP_MODES
	.comm	_CPIA2_VP_EXPOSURE_MODES_INHIBIT_FLICKER,1,0 ; @CPIA2_VP_EXPOSURE_MODES_INHIBIT_FLICKER
	.comm	_CPIA2_CMD_SET_VP_EXP_MODES,4,2 ; @CPIA2_CMD_SET_VP_EXP_MODES
	.comm	_CPIA2_CMD_REHASH_VP4,4,2       ; @CPIA2_CMD_REHASH_VP4
.subsections_via_symbols
