	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function softing_card_boot
_softing_card_boot:                     ## @softing_card_boot
	.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
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	8(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_27
LBB0_2:
	cmpl	$0, 4(%r15)
	je	LBB0_5
## %bb.3:
	movq	%rbx, %rdi
LBB0_4:
	callq	_mutex_unlock
	xorl	%ebx, %ebx
	jmp	LBB0_27
LBB0_5:
	movq	24(%r15), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	16(%r15), %rdi
	movl	$1, %esi
	callq	*%rax
LBB0_7:
	movq	%rbx, -120(%rbp)                ## 8-byte Spill
	movq	%r15, %rdi
	callq	_softing_set_reset_dpram
	movq	24(%r15), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	16(%r15), %rdi
	movl	$1, %esi
	callq	*%rax
LBB0_9:
	cmpl	$65, (%r15)
	jb	LBB0_14
## %bb.10:
	movl	$64, %r12d
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	shlq	$2, %r14
	movq	32(%r15), %rdi
	addq	%r14, %rdi
	leaq	_softing_card_boot.stream(%rip), %rsi
	movl	$64, %edx
	callq	_memcpy_toio
	xorl	%eax, %eax
	callq	_mb
	addq	32(%r15), %r14
	movq	%r15, %r13
	leaq	-112(%rbp), %r15
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$64, %edx
	callq	_memcpy_fromio
	movq	%r15, %rdi
	leaq	_softing_card_boot.stream(%rip), %rsi
	movl	$64, %edx
	callq	_memcmp
	testl	%eax, %eax
	jne	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	%r12d, %ebx
	movslq	%r12d, %r14
	leaq	64(%r14), %r12
	movslq	(%r13), %rax
	cmpq	%rax, %r12
	movq	%r13, %r15
	jb	LBB0_12
LBB0_14:
	xorl	%eax, %eax
	callq	_wmb
	movq	24(%r15), %rax
	movl	64(%rax), %edi
	movq	32(%r15), %rdx
	movl	(%r15), %ecx
	movq	56(%rax), %r8
	subq	48(%rax), %r8
	movq	%r15, %rsi
	callq	_softing_load_fw
	testl	%eax, %eax
	js	LBB0_21
## %bb.15:
	movq	24(%r15), %rax
	movl	40(%rax), %edi
	movq	32(%r15), %rdx
	movl	(%r15), %ecx
	movq	32(%rax), %r8
	subq	24(%rax), %r8
	movq	%r15, %rsi
	callq	_softing_load_fw
	testl	%eax, %eax
	js	LBB0_21
## %bb.16:
	movq	24(%r15), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:
	movq	16(%r15), %rdi
	xorl	%esi, %esi
	callq	*%rax
LBB0_18:
	movq	%r15, %rdi
	callq	_softing_clr_reset_dpram
	leaq	L_.str.1(%rip), %rdx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_softing_bootloader_command
	testl	%eax, %eax
	js	LBB0_21
## %bb.19:
	movq	24(%r15), %rax
	movl	16(%rax), %edi
	movq	%r15, %rsi
	callq	_softing_load_app_fw
	testl	%eax, %eax
	js	LBB0_21
## %bb.20:
	movq	%r15, %rdi
	callq	_softing_chip_poweron
	testl	%eax, %eax
	js	LBB0_21
## %bb.29:
	movl	$1, 4(%r15)
	movq	-120(%rbp), %rdi                ## 8-byte Reload
	jmp	LBB0_4
LBB0_21:
	movl	%eax, %ebx
	jmp	LBB0_22
LBB0_13:
	movq	16(%r13), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_alert
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r13, %r15
LBB0_22:
	movl	$0, 4(%r15)
	movq	24(%r15), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_24
## %bb.23:
	movq	16(%r15), %rdi
	xorl	%esi, %esi
	callq	*%rax
LBB0_24:
	movq	%r15, %rdi
	callq	_softing_set_reset_dpram
	movq	24(%r15), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_26
## %bb.25:
	movq	16(%r15), %rdi
	movl	$1, %esi
	callq	*%rax
LBB0_26:
	movq	-120(%rbp), %rdi                ## 8-byte Reload
	callq	_mutex_unlock
LBB0_27:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_30
## %bb.28:
	movl	%ebx, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_30:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @softing_card_boot.stream
_softing_card_boot.stream:
	.long	0                               ## 0x0
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	3                               ## 0x3
	.long	4                               ## 0x4
	.long	5                               ## 0x5
	.long	6                               ## 0x6
	.long	7                               ## 0x7
	.long	8                               ## 0x8
	.long	9                               ## 0x9
	.long	10                              ## 0xa
	.long	11                              ## 0xb
	.long	12                              ## 0xc
	.long	13                              ## 0xd
	.long	14                              ## 0xe
	.long	15                              ## 0xf

	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dpram failed at 0x%04x\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"card boot"

	.no_dead_strip	_softing_card_boot
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function softing_card_boot
_softing_card_boot:                     ; @softing_card_boot
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_27
LBB0_2:
	ldr	w8, [x20, #4]
	cbz	w8, LBB0_4
LBB0_3:
	mov	x0, x19
	bl	_mutex_unlock
	mov	w21, #0
	b	LBB0_27
LBB0_4:
	ldr	x8, [x20, #24]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_6
; %bb.5:
	ldr	x0, [x20, #16]
	mov	w1, #1
	blr	x8
LBB0_6:
	mov	x0, x20
	bl	_softing_set_reset_dpram
	ldr	x8, [x20, #24]
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.7:
	ldr	x0, [x20, #16]
	mov	w1, #1
	blr	x8
LBB0_8:
	ldr	w8, [x20]
	cmp	w8, #65
	b.lo	LBB0_12
; %bb.9:
	mov	x8, #0
	mov	w21, #0
	mov	w23, #64
Lloh6:
	adrp	x22, _softing_card_boot.stream@PAGE
Lloh7:
	add	x22, x22, _softing_card_boot.stream@PAGEOFF
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x20, #32]
	lsl	x24, x8, #2
	add	x0, x9, x24
	mov	x1, x22
	mov	w2, #64
	bl	_memcpy_toio
	bl	_mb
	ldr	x8, [x20, #32]
	add	x1, x8, x24
	add	x0, sp, #8
	mov	w2, #64
	bl	_memcpy_fromio
	add	x0, sp, #8
	mov	x1, x22
	mov	w2, #64
	bl	_memcmp
	cbnz	w0, LBB0_21
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x21, x23
	sxtw	x8, w23
	add	x23, x8, #64
	ldrsw	x9, [x20]
	cmp	x23, x9
	b.lo	LBB0_10
LBB0_12:
	bl	_wmb
	ldp	x8, x2, [x20, #24]
	ldr	w0, [x8, #64]
	ldr	w3, [x20]
	ldp	x8, x9, [x8, #48]
	sub	x4, x9, x8
	mov	x1, x20
	bl	_softing_load_fw
	tbnz	w0, #31, LBB0_20
; %bb.13:
	ldp	x8, x2, [x20, #24]
	ldr	w0, [x8, #40]
	ldr	w3, [x20]
	ldp	x8, x9, [x8, #24]
	sub	x4, x9, x8
	mov	x1, x20
	bl	_softing_load_fw
	tbnz	w0, #31, LBB0_20
; %bb.14:
	ldr	x8, [x20, #24]
	ldr	x8, [x8]
	cbz	x8, LBB0_16
; %bb.15:
	ldr	x0, [x20, #16]
	mov	w1, #0
	blr	x8
LBB0_16:
	mov	x0, x20
	bl	_softing_clr_reset_dpram
Lloh8:
	adrp	x2, l_.str.1@PAGE
Lloh9:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	w1, #0
	bl	_softing_bootloader_command
	tbnz	w0, #31, LBB0_20
; %bb.17:
	ldr	x8, [x20, #24]
	ldr	w0, [x8, #16]
	mov	x1, x20
	bl	_softing_load_app_fw
	tbnz	w0, #31, LBB0_20
; %bb.18:
	mov	x0, x20
	bl	_softing_chip_poweron
	tbnz	w0, #31, LBB0_20
; %bb.19:
	mov	w8, #1
	str	w8, [x20, #4]
	b	LBB0_3
LBB0_20:
	mov	x21, x0
	b	LBB0_22
LBB0_21:
	ldr	x0, [x20, #16]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_alert
Lloh12:
	adrp	x8, _EIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_22:
	str	wzr, [x20, #4]
	ldr	x8, [x20, #24]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_24
; %bb.23:
	ldr	x0, [x20, #16]
	mov	w1, #0
	blr	x8
LBB0_24:
	mov	x0, x20
	bl	_softing_set_reset_dpram
	ldr	x8, [x20, #24]
	ldr	x8, [x8]
	cbz	x8, LBB0_26
; %bb.25:
	ldr	x0, [x20, #16]
	mov	w1, #1
	blr	x8
LBB0_26:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_27:
	ldur	x8, [x29, #-56]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_29
; %bb.28:
	mov	x0, x21
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_29:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @softing_card_boot.stream
_softing_card_boot.stream:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	3                               ; 0x3
	.long	4                               ; 0x4
	.long	5                               ; 0x5
	.long	6                               ; 0x6
	.long	7                               ; 0x7
	.long	8                               ; 0x8
	.long	9                               ; 0x9
	.long	10                              ; 0xa
	.long	11                              ; 0xb
	.long	12                              ; 0xc
	.long	13                              ; 0xd
	.long	14                              ; 0xe
	.long	15                              ; 0xf

	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dpram failed at 0x%04x\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"card boot"

	.no_dead_strip	_softing_card_boot
.subsections_via_symbols
