	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bfa_ioc_ct_firmware_lock
_bfa_ioc_ct_firmware_lock:              ## @bfa_ioc_ct_firmware_lock
	.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
	movq	%rdi, %rbx
	callq	_bfa_ioc_asic_gen
	movl	%eax, %edi
	callq	_bfa_cb_image_get_size
	movq	_BFA_IOC_FWIMG_MINSZ@GOTPCREL(%rip), %rcx
	movl	$1, %r14d
	cmpq	(%rcx), %rax
	jl	LBB0_6
## %bb.1:
	movl	(%rbx), %edi
	callq	_bfa_nw_ioc_sem_get
	movl	4(%rbx), %edi
	callq	_readl
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movl	%eax, %r15d
	movl	8(%rbx), %edi
	callq	_readl
	movq	_BFI_IOC_UNINIT@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpl	(%rcx), %eax
	sete	%dil
	callq	_BUG_ON
	leaq	-40(%rbp), %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_bfa_nw_ioc_fwver_get
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_bfa_nw_ioc_fwver_cmp
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	incl	%r15d
	movl	4(%rbx), %esi
	movl	%r15d, %edi
	callq	_writel
	movl	(%rbx), %edi
	callq	_bfa_nw_ioc_sem_release
	jmp	LBB0_6
LBB0_2:
	movl	4(%rbx), %esi
	movl	$1, %r14d
	movl	$1, %edi
	callq	_writel
	movl	(%rbx), %edi
	callq	_bfa_nw_ioc_sem_release
	movl	12(%rbx), %esi
	xorl	%edi, %edi
	callq	_writel
	jmp	LBB0_6
LBB0_4:
	movl	(%rbx), %edi
	callq	_bfa_nw_ioc_sem_release
	xorl	%r14d, %r14d
LBB0_6:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BFA_IOC_FWIMG_MINSZ,8,3        ## @BFA_IOC_FWIMG_MINSZ
	.comm	_BFI_IOC_UNINIT,4,2             ## @BFI_IOC_UNINIT
	.no_dead_strip	_bfa_ioc_ct_firmware_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bfa_ioc_ct_firmware_lock
_bfa_ioc_ct_firmware_lock:              ; @bfa_ioc_ct_firmware_lock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	bl	_bfa_ioc_asic_gen
	bl	_bfa_cb_image_get_size
Lloh0:
	adrp	x8, _BFA_IOC_FWIMG_MINSZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BFA_IOC_FWIMG_MINSZ@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.lt	LBB0_4
; %bb.1:
	ldr	w0, [x19]
	bl	_bfa_nw_ioc_sem_get
	ldr	w0, [x19, #4]
	bl	_readl
	cbz	w0, LBB0_5
; %bb.2:
	mov	x20, x0
	ldr	w0, [x19, #8]
	bl	_readl
Lloh3:
	adrp	x8, _BFI_IOC_UNINIT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BFI_IOC_UNINIT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w0, w8
	cset	w0, eq
	bl	_BUG_ON
	add	x1, sp, #8
	mov	x0, x19
	bl	_bfa_nw_ioc_fwver_get
	add	x1, sp, #8
	mov	x0, x19
	bl	_bfa_nw_ioc_fwver_cmp
	cbz	w0, LBB0_6
; %bb.3:
	add	w0, w20, #1
	ldr	w1, [x19, #4]
	bl	_writel
	ldr	w0, [x19]
	bl	_bfa_nw_ioc_sem_release
LBB0_4:
	mov	w20, #1
	b	LBB0_7
LBB0_5:
	ldr	w1, [x19, #4]
	mov	w20, #1
	mov	w0, #1
	bl	_writel
	ldr	w0, [x19]
	bl	_bfa_nw_ioc_sem_release
	ldr	w1, [x19, #12]
	mov	w0, #0
	bl	_writel
	b	LBB0_7
LBB0_6:
	ldr	w0, [x19]
	bl	_bfa_nw_ioc_sem_release
	mov	w20, #0
LBB0_7:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_BFA_IOC_FWIMG_MINSZ,8,3        ; @BFA_IOC_FWIMG_MINSZ
	.comm	_BFI_IOC_UNINIT,4,2             ; @BFI_IOC_UNINIT
	.no_dead_strip	_bfa_ioc_ct_firmware_lock
.subsections_via_symbols
