	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cosa_start
_cosa_start:                            ## @cosa_start
	.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
	movl	(%rdi), %edx
	cmpl	$2, %edx
	jl	LBB0_2
## %bb.1:
	movl	12(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
LBB0_2:
	movl	4(%rbx), %edx
	movq	_COSA_FW_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_COSA_FW_DOWNLOAD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%eax, %ecx
	movl	%edx, %esi
	notl	%esi
	testl	%esi, %ecx
	jne	LBB0_5
## %bb.3:
	notl	%eax
	andl	%eax, %edx
	movl	%edx, 4(%rbx)
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_startmicrocode
	movl	12(%rbx), %esi
	testl	%eax, %eax
	js	LBB0_6
## %bb.4:
	leaq	L_.str.3(%rip), %rdi
	movl	%r14d, %edx
	callq	_pr_info
	movl	%r14d, 8(%rbx)
	movq	_COSA_FW_START@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%rbx)
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_5:
	movl	16(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_notice
	movq	_EPERM@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r14d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_pr_notice
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_7:
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cosa%d: WARNING: start microcode requested with cosa->usage > 1 (%d). Odd things may happen.\n"

	.comm	_COSA_FW_RESET,4,2              ## @COSA_FW_RESET
	.comm	_COSA_FW_DOWNLOAD,4,2           ## @COSA_FW_DOWNLOAD
L_.str.1:                               ## @.str.1
	.asciz	"%s: download the microcode and/or reset the card first (status %d)\n"

	.comm	_EPERM,4,2                      ## @EPERM
L_.str.2:                               ## @.str.2
	.asciz	"cosa%d: start microcode at 0x%04x failed: %d\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.3:                               ## @.str.3
	.asciz	"cosa%d: starting microcode at 0x%04x\n"

	.comm	_COSA_FW_START,4,2              ## @COSA_FW_START
	.no_dead_strip	_cosa_start
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cosa_start
_cosa_start:                            ; @cosa_start
	.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, x1
	mov	x20, x0
	ldr	w2, [x0]
	cmp	w2, #2
	b.lt	LBB0_2
; %bb.1:
	ldr	w1, [x20, #12]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
LBB0_2:
	ldr	w2, [x20, #4]
Lloh2:
	adrp	x8, _COSA_FW_RESET@GOTPAGE
Lloh3:
	ldr	x8, [x8, _COSA_FW_RESET@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _COSA_FW_DOWNLOAD@GOTPAGE
Lloh6:
	ldr	x9, [x9, _COSA_FW_DOWNLOAD@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w9, w9, w8
	bics	wzr, w9, w2
	b.ne	LBB0_5
; %bb.3:
	bic	w8, w2, w8
	str	w8, [x20, #4]
	mov	x0, x20
	mov	x1, x19
	bl	_startmicrocode
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w1, [x20, #12]
	tbnz	w0, #31, LBB0_6
; %bb.4:
Lloh8:
	adrp	x0, l_.str.3@PAGE
Lloh9:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x2, x19
	bl	_pr_info
	mov	w0, #0
Lloh10:
	adrp	x8, _COSA_FW_START@GOTPAGE
Lloh11:
	ldr	x8, [x8, _COSA_FW_START@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ldr	w9, [x20, #4]
	orr	w8, w9, w8
	stp	w8, w19, [x20, #4]
	b	LBB0_8
LBB0_5:
	ldr	w1, [x20, #16]
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_notice
Lloh15:
	adrp	x8, _EPERM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
	str	x0, [sp]
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x2, x19
	bl	_pr_notice
Lloh19:
	adrp	x8, _EIO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cosa%d: WARNING: start microcode requested with cosa->usage > 1 (%d). Odd things may happen.\n"

	.comm	_COSA_FW_RESET,4,2              ; @COSA_FW_RESET
	.comm	_COSA_FW_DOWNLOAD,4,2           ; @COSA_FW_DOWNLOAD
l_.str.1:                               ; @.str.1
	.asciz	"%s: download the microcode and/or reset the card first (status %d)\n"

	.comm	_EPERM,4,2                      ; @EPERM
l_.str.2:                               ; @.str.2
	.asciz	"cosa%d: start microcode at 0x%04x failed: %d\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.3:                               ; @.str.3
	.asciz	"cosa%d: starting microcode at 0x%04x\n"

	.comm	_COSA_FW_START,4,2              ; @COSA_FW_START
	.no_dead_strip	_cosa_start
.subsections_via_symbols
