	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function reset_uart401
_reset_uart401:                         ## @reset_uart401
	.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	%rdi, %r12
	movb	$1, %al
	movq	_MPU_RESET@GOTPCREL(%rip), %r15
	movq	_MPU_ACK@GOTPCREL(%rip), %r13
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
                                        ##     Child Loop BB0_5 Depth 2
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	$30000, %ebx                    ## imm = 0x7530
	.p2align	4, 0x90
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r12, %rdi
	callq	_output_ready
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=2
	leal	-1(%rbx), %eax
	cmpl	$1, %ebx
	movl	%eax, %ebx
	ja	LBB0_2
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	$0, (%r12)
	movq	%r15, %rbx
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_uart401_cmd
	movl	$50000, %r15d                   ## imm = 0xC350
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r12), %rax
	cmpq	(%r13), %rax
	je	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=2
	movq	%r12, %rdi
	callq	_input_avail
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=2
	movq	%r12, %rdi
	callq	_uart401_read
	xorl	%r14d, %r14d
	cmpq	(%r13), %rax
	sete	%r14b
	cmpl	$2, %r15d
	jae	LBB0_12
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=2
	xorl	%r14d, %r14d
	cmpl	$2, %r15d
	jb	LBB0_13
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=2
	decl	%r15d
	testl	%r14d, %r14d
	je	LBB0_5
LBB0_13:                                ##   in Loop: Header=BB0_1 Depth=1
	testl	%r14d, %r14d
	sete	%al
	testb	%al, -44(%rbp)                  ## 1-byte Folded Reload
	movl	$0, %eax
	movq	%rbx, %r15
	jne	LBB0_1
## %bb.14:
	testl	%r14d, %r14d
	jne	LBB0_7
## %bb.15:
	leaq	L_.str.1(%rip), %rdi
	callq	_printk
	movl	%eax, %edi
	callq	_DDB
	jmp	LBB0_16
LBB0_6:
	movl	$1, %r14d
LBB0_7:
	leaq	L_.str(%rip), %rdi
	callq	_printk
	movl	%eax, %edi
	callq	_DEB
	movq	%r12, %rdi
	callq	_uart401_input_loop
LBB0_16:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MPU_RESET,4,2                  ## @MPU_RESET
	.comm	_MPU_ACK,8,3                    ## @MPU_ACK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Reset UART401 OK\n"

L_.str.1:                               ## @.str.1
	.asciz	"Reset UART401 failed - No hardware detected.\n"

	.no_dead_strip	_reset_uart401
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function reset_uart401
_reset_uart401:                         ; @reset_uart401
	.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	x19, x0
	mov	w20, #30000
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_output_ready
	subs	w20, w20, #1
	cbnz	w0, LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	b.hi	LBB0_1
LBB0_3:
	str	xzr, [x19]
Lloh0:
	adrp	x22, _MPU_RESET@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MPU_RESET@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_uart401_cmd
	mov	w23, #50000
Lloh2:
	adrp	x21, _MPU_ACK@GOTPAGE
Lloh3:
	ldr	x21, [x21, _MPU_ACK@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	x9, [x21]
	cmp	x8, x9
	b.eq	LBB0_23
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	bl	_input_avail
	cbz	x0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	bl	_uart401_read
	ldr	x8, [x21]
	cmp	x0, x8
	cset	w20, eq
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	w20, #0
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmp	w20, #0
	cset	w8, eq
	cmp	w23, #2
	b.lo	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	w23, w23, #1
	cbz	w20, LBB0_4
LBB0_10:
	cbz	w20, LBB0_13
LBB0_11:
	cbz	w8, LBB0_24
; %bb.12:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printk
	bl	_DDB
	b	LBB0_25
LBB0_13:
	mov	w20, #30000
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_output_ready
	subs	w20, w20, #1
	cbnz	w0, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	b.hi	LBB0_14
LBB0_16:
	str	xzr, [x19]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_uart401_cmd
	mov	w22, #50000
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	x9, [x21]
	cmp	x8, x9
	b.eq	LBB0_23
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	mov	x0, x19
	bl	_input_avail
	cbz	x0, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_17 Depth=1
	mov	x0, x19
	bl	_uart401_read
	ldr	x8, [x21]
	cmp	x0, x8
	cset	w20, eq
	b	LBB0_21
LBB0_20:                                ;   in Loop: Header=BB0_17 Depth=1
	mov	w20, #0
LBB0_21:                                ;   in Loop: Header=BB0_17 Depth=1
	cmp	w20, #0
	cset	w8, eq
	cmp	w22, #2
	b.lo	LBB0_11
; %bb.22:                               ;   in Loop: Header=BB0_17 Depth=1
	sub	w22, w22, #1
	cbz	w20, LBB0_17
	b	LBB0_11
LBB0_23:
	mov	w20, #1
LBB0_24:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printk
	bl	_DEB
	mov	x0, x19
	bl	_uart401_input_loop
LBB0_25:
	mov	x0, x20
	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	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_MPU_RESET,4,2                  ; @MPU_RESET
	.comm	_MPU_ACK,8,3                    ; @MPU_ACK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Reset UART401 OK\n"

l_.str.1:                               ; @.str.1
	.asciz	"Reset UART401 failed - No hardware detected.\n"

	.no_dead_strip	_reset_uart401
.subsections_via_symbols
