	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bt3c_load_firmware
_bt3c_load_firmware:                    ## @bt3c_load_firmware
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %rax
	movl	(%rax), %r14d
	movl	%r14d, %edi
	movl	$32832, %esi                    ## imm = 0x8040
	movl	$1028, %edx                     ## imm = 0x404
	callq	_bt3c_io_write
	movl	%r14d, %edi
	movl	$32832, %esi                    ## imm = 0x8040
	movl	$1024, %edx                     ## imm = 0x400
	callq	_bt3c_io_write
	movl	$1, %edi
	callq	_udelay
	movl	%r14d, %edi
	movl	$32832, %esi                    ## imm = 0x8040
	movl	$1028, %edx                     ## imm = 0x404
	callq	_bt3c_io_write
	movl	$17, %edi
	callq	_udelay
	testl	%ebx, %ebx
	je	LBB0_15
## %bb.1:
	leaq	-57(%rbp), %r13
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	addl	$6, %eax
	addq	%rax, %r12
	movl	-68(%rbp), %ebx                 ## 4-byte Reload
	subl	%eax, %ebx
	je	LBB0_15
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
                                        ##     Child Loop BB0_13 Depth 2
	cmpb	$83, (%r12)
	jne	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, -68(%rbp)                 ## 4-byte Spill
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$9, %edx
	callq	_memset
	leaq	2(%r12), %r14
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	$2, %edx
	callq	_memcpy
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_simple_strtoul
	movl	%eax, %r15d
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$9, %edx
	callq	_memset
	leaq	4(%r12), %rsi
	movq	%r13, %rdi
	movl	$8, %edx
	callq	_memcpy
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_simple_strtoul
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$9, %edx
	callq	_memset
	leal	(%r15,%r15), %eax
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	leaq	(%r12,%rax), %rsi
	addq	$2, %rsi
	movq	%r13, %rdi
	movl	$2, %edx
	callq	_memcpy
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_simple_strtoul
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$9, %edx
	callq	_memset
	testl	%r15d, %r15d
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r15d, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	$2, %edx
	callq	_memcpy
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_simple_strtol
	addl	%eax, %ebx
	addq	$2, %r14
	decq	%r12
	jne	LBB0_7
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	addl	-72(%rbp), %ebx                 ## 4-byte Folded Reload
	cmpb	$-1, %bl
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	cmpb	$51, 1(%r12)
	jne	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%r14d, %edi
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	callq	_bt3c_address
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$9, %edx
	callq	_memset
	addl	$-4, %r15d
	cmpl	$2, %r15d
	jb	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	shrl	%r15d
	leaq	12(%r12), %rbx
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	$4, %edx
	callq	_memcpy
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_simple_strtoul
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_bt3c_put
	addq	$4, %rbx
	decq	%r15
	jne	LBB0_13
	jmp	LBB0_14
LBB0_15:
	movl	$17, %edi
	callq	_udelay
	movl	%r14d, %edi
	movl	$12288, %esi                    ## imm = 0x3000
	callq	_bt3c_address
	movq	_CONTROL@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	%r14, %rdi
	callq	_inb
	orl	$64, %eax
	movq	(%rbx), %rsi
	addq	%r14, %rsi
	movl	%eax, %edi
	callq	_outb
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_3:
	leaq	L_.str(%rip), %rdi
	callq	_BT_ERR
	movq	_EFAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_9:
	leaq	L_.str.1(%rip), %rdi
	callq	_BT_ERR
	movq	_EILSEQ@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_16:
	movl	$17, %edi
	callq	_udelay
	movl	%r14d, %edi
	movl	$28678, %esi                    ## imm = 0x7006
	xorl	%edx, %edx
	callq	_bt3c_io_write
	movl	%r14d, %edi
	movl	$28677, %esi                    ## imm = 0x7005
	xorl	%edx, %edx
	callq	_bt3c_io_write
	movl	%r14d, %edi
	movl	$28673, %esi                    ## imm = 0x7001
	xorl	%edx, %edx
	callq	_bt3c_io_write
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_18
## %bb.17:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Bad address in firmware"

	.comm	_EFAULT,4,2                     ## @EFAULT
L_.str.1:                               ## @.str.1
	.asciz	"Checksum error in firmware"

	.comm	_EILSEQ,4,2                     ## @EILSEQ
	.comm	_CONTROL,8,3                    ## @CONTROL
	.no_dead_strip	_bt3c_load_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bt3c_load_firmware
_bt3c_load_firmware:                    ; @bt3c_load_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	mov	x21, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	x8, [x0]
	ldr	w19, [x8]
	mov	x0, x19
	mov	w1, #32832
	mov	w2, #1028
	bl	_bt3c_io_write
	mov	x0, x19
	mov	w1, #32832
	mov	w2, #1024
	bl	_bt3c_io_write
	mov	w0, #1
	bl	_udelay
	mov	x0, x19
	mov	w1, #32832
	mov	w2, #1028
	bl	_bt3c_io_write
	mov	w0, #17
	bl	_udelay
	cbnz	w20, LBB0_3
LBB0_1:
	mov	w0, #17
	bl	_udelay
	mov	x0, x19
	mov	w1, #12288
	bl	_bt3c_address
Lloh3:
	adrp	x20, _CONTROL@GOTPAGE
Lloh4:
	ldr	x20, [x20, _CONTROL@GOTPAGEOFF]
	ldr	x8, [x20]
	add	x0, x8, x19
	bl	_inb
	orr	w0, w0, #0x40
	ldr	x8, [x20]
	add	x1, x8, x19
	bl	_outb
	mov	w20, #0
	b	LBB0_15
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w8, w26, #6
	add	x21, x21, x8
	subs	w20, w20, w8
	b.eq	LBB0_1
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
                                        ;     Child Loop BB0_11 Depth 2
	ldrb	w8, [x21]
	cmp	w8, #83
	b.ne	LBB0_12
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x0, sp, #15
	mov	w1, #0
	mov	w2, #9
	bl	_memset
	add	x23, x21, #2
	add	x0, sp, #15
	mov	x1, x23
	mov	w2, #2
	bl	_memcpy
	add	x0, sp, #15
	mov	x1, #0
	mov	w2, #16
	bl	_simple_strtoul
	mov	x22, x0
	add	x0, sp, #15
	mov	w1, #0
	mov	w2, #9
	bl	_memset
	add	x1, x21, #4
	add	x0, sp, #15
	mov	w2, #8
	bl	_memcpy
	add	x0, sp, #15
	mov	x1, #0
	mov	w2, #16
	bl	_simple_strtoul
	mov	x24, x0
	add	x0, sp, #15
	mov	w1, #0
	mov	w2, #9
	bl	_memset
	lsl	w26, w22, #1
	add	x1, x23, x26
	add	x0, sp, #15
	mov	w2, #2
	bl	_memcpy
	add	x0, sp, #15
	mov	x1, #0
	mov	w2, #16
	bl	_simple_strtoul
	mov	x25, x0
	add	x0, sp, #15
	mov	w1, #0
	mov	w2, #9
	bl	_memset
	mov	w27, #0
	cbz	w22, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w28, w22
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x0, sp, #15
	mov	x1, x23
	mov	w2, #2
	bl	_memcpy
	add	x0, sp, #15
	mov	x1, #0
	mov	w2, #16
	bl	_simple_strtol
	add	w27, w27, w0
	add	x23, x23, #2
	subs	x28, x28, #1
	b.ne	LBB0_6
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w8, w27, w25
	mvn	w8, w8
	tst	w8, #0xff
	b.ne	LBB0_13
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	ldrb	w8, [x21, #1]
	cmp	w8, #51
	b.ne	LBB0_2
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	x1, x24
	bl	_bt3c_address
	add	x0, sp, #15
	mov	w1, #0
	mov	w2, #9
	bl	_memset
	sub	w8, w22, #4
	cmp	w8, #2
	b.lo	LBB0_2
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	lsr	w23, w8, #1
	add	x22, x21, #12
LBB0_11:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x0, sp, #15
	mov	x1, x22
	mov	w2, #4
	bl	_memcpy
	add	x0, sp, #15
	mov	x1, #0
	mov	w2, #16
	bl	_simple_strtoul
	mov	x1, x0
	mov	x0, x19
	bl	_bt3c_put
	add	x22, x22, #4
	subs	x23, x23, #1
	b.ne	LBB0_11
	b	LBB0_2
LBB0_12:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BT_ERR
Lloh7:
	adrp	x8, _EFAULT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_14
LBB0_13:
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_BT_ERR
Lloh11:
	adrp	x8, _EILSEQ@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EILSEQ@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_15:
	mov	w0, #17
	bl	_udelay
	mov	x0, x19
	mov	w1, #28678
	mov	w2, #0
	bl	_bt3c_io_write
	mov	x0, x19
	mov	w1, #28677
	mov	w2, #0
	bl	_bt3c_io_write
	mov	x0, x19
	mov	w1, #28673
	mov	w2, #0
	bl	_bt3c_io_write
	ldr	x8, [sp, #24]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.16:
	mov	x0, x20
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Bad address in firmware"

	.comm	_EFAULT,4,2                     ; @EFAULT
l_.str.1:                               ; @.str.1
	.asciz	"Checksum error in firmware"

	.comm	_EILSEQ,4,2                     ; @EILSEQ
	.comm	_CONTROL,8,3                    ; @CONTROL
	.no_dead_strip	_bt3c_load_firmware
.subsections_via_symbols
