	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dvb_ca_en50221_check_camstatus
_dvb_ca_en50221_check_camstatus:        ## @dvb_ca_en50221_check_camstatus
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_2
## %bb.1:
	movq	8(%rbx), %rax
	movslq	%r14d, %rcx
	shlq	$4, %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$8, %rdi
	callq	_atomic_read
	xorl	%ebx, %ebx
	testq	%rax, %rax
	setne	%bl
	jmp	LBB0_11
LBB0_2:
	movq	24(%rbx), %rdi
	movl	16(%rbx), %edx
	movl	%r14d, %esi
	callq	*(%rdi)
	movq	_DVB_CA_EN50221_POLL_CAM_PRESENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_DVB_CA_EN50221_POLL_CAM_CHANGED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_4
## %bb.3:
	testl	%eax, %esi
	sete	%r9b
	movq	8(%rbx), %r8
	movslq	%r14d, %rdx
	shlq	$4, %rdx
	movq	(%r8,%rdx), %rdi
	movq	_DVB_CA_SLOTSTATE_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdi
	sete	%cl
	cmpb	%cl, %r9b
	je	LBB0_8
LBB0_4:
	testl	%eax, %esi
	je	LBB0_5
## %bb.6:
	movq	_DVB_CA_EN50221_CAMCHANGE_INSERTED@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	_DVB_CA_EN50221_CAMCHANGE_REMOVED@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %edx
	movq	8(%rbx), %rax
	movslq	%r14d, %rcx
	movq	%rcx, %rsi
	shlq	$4, %rsi
	movl	%edx, 12(%rax,%rsi)
	shlq	$4, %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$8, %rdi
	movl	$1, %ebx
	movl	$1, %esi
	callq	_atomic_set
LBB0_11:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_8:
	movq	_DVB_CA_SLOTSTATE_WAITREADY@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rdi
	jne	LBB0_11
## %bb.9:
	movq	_DVB_CA_EN50221_POLL_CAM_READY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.10:
	addq	%rdx, %r8
	movq	_DVB_CA_SLOTSTATE_VALIDATE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r8)
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE,4,2 ## @DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE
	.comm	_DVB_CA_EN50221_POLL_CAM_PRESENT,4,2 ## @DVB_CA_EN50221_POLL_CAM_PRESENT
	.comm	_DVB_CA_EN50221_POLL_CAM_CHANGED,4,2 ## @DVB_CA_EN50221_POLL_CAM_CHANGED
	.comm	_DVB_CA_SLOTSTATE_NONE,8,3      ## @DVB_CA_SLOTSTATE_NONE
	.comm	_DVB_CA_EN50221_CAMCHANGE_REMOVED,4,2 ## @DVB_CA_EN50221_CAMCHANGE_REMOVED
	.comm	_DVB_CA_EN50221_CAMCHANGE_INSERTED,4,2 ## @DVB_CA_EN50221_CAMCHANGE_INSERTED
	.comm	_DVB_CA_SLOTSTATE_WAITREADY,8,3 ## @DVB_CA_SLOTSTATE_WAITREADY
	.comm	_DVB_CA_EN50221_POLL_CAM_READY,4,2 ## @DVB_CA_EN50221_POLL_CAM_READY
	.comm	_DVB_CA_SLOTSTATE_VALIDATE,8,3  ## @DVB_CA_SLOTSTATE_VALIDATE
	.no_dead_strip	_dvb_ca_en50221_check_camstatus
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dvb_ca_en50221_check_camstatus
_dvb_ca_en50221_check_camstatus:        ; @dvb_ca_en50221_check_camstatus
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	ldr	x8, [x20, #8]
	add	x8, x8, w19, sxtw #4
	add	x0, x8, #8
	bl	_atomic_read
	cmp	x0, #0
	cset	w19, ne
	b	LBB0_8
LBB0_2:
	ldr	x0, [x20, #24]
	ldr	x8, [x0]
	ldr	w2, [x20, #16]
	mov	x1, x19
	blr	x8
Lloh3:
	adrp	x8, _DVB_CA_EN50221_POLL_CAM_PRESENT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DVB_CA_EN50221_POLL_CAM_PRESENT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w9, w8, w0
Lloh6:
	adrp	x8, _DVB_CA_EN50221_POLL_CAM_CHANGED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DVB_CA_EN50221_POLL_CAM_CHANGED@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_4
; %bb.3:
	cmp	w9, #0
	cset	w11, eq
	ldr	x8, [x20, #8]
	add	x8, x8, w19, sxtw #4
	ldr	x10, [x8]
Lloh9:
	adrp	x12, _DVB_CA_SLOTSTATE_NONE@GOTPAGE
Lloh10:
	ldr	x12, [x12, _DVB_CA_SLOTSTATE_NONE@GOTPAGEOFF]
Lloh11:
	ldr	x12, [x12]
	cmp	x10, x12
	cset	w12, eq
	cmp	w11, w12
	b.eq	LBB0_9
LBB0_4:
	cbz	w9, LBB0_6
; %bb.5:
Lloh12:
	adrp	x8, _DVB_CA_EN50221_CAMCHANGE_INSERTED@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DVB_CA_EN50221_CAMCHANGE_INSERTED@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x8]
	ldr	x8, [x20, #8]
	mov	x9, x19
	sxtw	x9, w9
	b	LBB0_7
LBB0_6:
Lloh15:
	adrp	x8, _DVB_CA_EN50221_CAMCHANGE_REMOVED@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DVB_CA_EN50221_CAMCHANGE_REMOVED@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x8]
	ldr	x8, [x20, #8]
	sxtw	x9, w19
LBB0_7:
	add	x11, x8, w19, sxtw #4
	str	w10, [x11, #12]
	add	x8, x8, x9, lsl #4
	add	x0, x8, #8
	mov	w19, #1
	mov	w1, #1
	bl	_atomic_set
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_9:
Lloh18:
	adrp	x9, _DVB_CA_SLOTSTATE_WAITREADY@GOTPAGE
Lloh19:
	ldr	x9, [x9, _DVB_CA_SLOTSTATE_WAITREADY@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x10, x9
	b.ne	LBB0_12
; %bb.10:
Lloh21:
	adrp	x9, _DVB_CA_EN50221_POLL_CAM_READY@GOTPAGE
Lloh22:
	ldr	x9, [x9, _DVB_CA_EN50221_POLL_CAM_READY@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w0
	b.eq	LBB0_12
; %bb.11:
	mov	w19, #0
Lloh24:
	adrp	x9, _DVB_CA_SLOTSTATE_VALIDATE@GOTPAGE
Lloh25:
	ldr	x9, [x9, _DVB_CA_SLOTSTATE_VALIDATE@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	str	x9, [x8]
	b	LBB0_8
LBB0_12:
	mov	w19, #0
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE,4,2 ; @DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE
	.comm	_DVB_CA_EN50221_POLL_CAM_PRESENT,4,2 ; @DVB_CA_EN50221_POLL_CAM_PRESENT
	.comm	_DVB_CA_EN50221_POLL_CAM_CHANGED,4,2 ; @DVB_CA_EN50221_POLL_CAM_CHANGED
	.comm	_DVB_CA_SLOTSTATE_NONE,8,3      ; @DVB_CA_SLOTSTATE_NONE
	.comm	_DVB_CA_EN50221_CAMCHANGE_REMOVED,4,2 ; @DVB_CA_EN50221_CAMCHANGE_REMOVED
	.comm	_DVB_CA_EN50221_CAMCHANGE_INSERTED,4,2 ; @DVB_CA_EN50221_CAMCHANGE_INSERTED
	.comm	_DVB_CA_SLOTSTATE_WAITREADY,8,3 ; @DVB_CA_SLOTSTATE_WAITREADY
	.comm	_DVB_CA_EN50221_POLL_CAM_READY,4,2 ; @DVB_CA_EN50221_POLL_CAM_READY
	.comm	_DVB_CA_SLOTSTATE_VALIDATE,8,3  ; @DVB_CA_SLOTSTATE_VALIDATE
	.no_dead_strip	_dvb_ca_en50221_check_camstatus
.subsections_via_symbols
