	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function load_sbus_firmware
_load_sbus_firmware:                    ## @load_sbus_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %r15
	movq	_SBUS_MASTER_BROADCAST@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leaq	L_.str(%rip), %rsi
	callq	_dd_dev_info
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_load_security_variables
	movq	_WRITE_SBUS_RECEIVER@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	$1, %edx
	movl	$192, %r8d
	callq	_sbus_request
	movl	(%r12), %ecx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	$1, %edx
	movl	$576, %r8d                      ## imm = 0x240
	callq	_sbus_request
	movl	(%r12), %ecx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	$3, %edx
	movl	$-2147483648, %r8d              ## imm = 0x80000000
	callq	_sbus_request
	cmpl	$0, (%r13)
	jle	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %ecx
	movq	8(%r13), %rax
	movl	(%rax,%rbx,4), %r8d
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	$20, %edx
	callq	_sbus_request
	addq	$4, %rbx
	cmpl	%ebx, (%r13)
	jg	LBB0_2
LBB0_3:
	movl	(%r12), %ecx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	$1, %edx
	movl	$64, %r8d
	callq	_sbus_request
	movl	(%r12), %ecx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	$22, %edx
	movl	$786432, %r8d                   ## imm = 0xC0000
	callq	_sbus_request
	movl	4(%r13), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_run_rsa
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movl	(%r12), %ecx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	$1, %edx
	movl	$320, %r8d                      ## imm = 0x140
	callq	_sbus_request
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SBUS_MASTER_BROADCAST,4,2      ## @SBUS_MASTER_BROADCAST
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Downloading SBus firmware\n"

	.comm	_WRITE_SBUS_RECEIVER,4,2        ## @WRITE_SBUS_RECEIVER
L_.str.1:                               ## @.str.1
	.asciz	"SBus"

	.no_dead_strip	_load_sbus_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function load_sbus_firmware
_load_sbus_firmware:                    ; @load_sbus_firmware
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _SBUS_MASTER_BROADCAST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SBUS_MASTER_BROADCAST@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dd_dev_info
	mov	x0, x19
	mov	x1, x21
	bl	_load_security_variables
Lloh5:
	adrp	x22, _WRITE_SBUS_RECEIVER@GOTPAGE
Lloh6:
	ldr	x22, [x22, _WRITE_SBUS_RECEIVER@GOTPAGEOFF]
	ldr	w3, [x22]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	mov	w4, #192
	bl	_sbus_request
	ldr	w3, [x22]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	mov	w4, #576
	bl	_sbus_request
	ldr	w3, [x22]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #3
	mov	w4, #-2147483648
	bl	_sbus_request
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x23, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w3, [x22]
	ldr	x8, [x21, #8]
	ldr	w4, [x8, x23, lsl #2]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #20
	bl	_sbus_request
	add	x23, x23, #4
	ldr	w8, [x21]
	cmp	w8, w23
	b.gt	LBB0_2
LBB0_3:
	ldr	w3, [x22]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	mov	w4, #64
	bl	_sbus_request
	ldr	w3, [x22]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #22
	mov	w4, #786432
	bl	_sbus_request
	ldr	w2, [x21, #4]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_run_rsa
	mov	x21, x0
	cbnz	w0, LBB0_5
; %bb.4:
	ldr	w3, [x22]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	mov	w4, #320
	bl	_sbus_request
LBB0_5:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_SBUS_MASTER_BROADCAST,4,2      ; @SBUS_MASTER_BROADCAST
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Downloading SBus firmware\n"

	.comm	_WRITE_SBUS_RECEIVER,4,2        ; @WRITE_SBUS_RECEIVER
l_.str.1:                               ; @.str.1
	.asciz	"SBus"

	.no_dead_strip	_load_sbus_firmware
.subsections_via_symbols
