	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function r592_set_mode
_r592_set_mode:                         ## @r592_set_mode
	.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
	testl	%esi, %esi
	je	LBB0_1
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	callq	_dbg
	movq	_R592_POWER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_R592_POWER_20@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_r592_set_reg_mask
	movq	_R592_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_R592_IO_SERIAL1@GOTPCREL(%rip), %rax
	movq	_R592_IO_SERIAL2@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_r592_clear_reg_mask
	movq	_R592_IO_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_R592_IO_MODE_PARALLEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_r592_write_reg
	jmp	LBB0_3
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_dbg
	movq	_R592_IO_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_R592_IO_MODE_SERIAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_r592_write_reg
	movq	_R592_POWER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_R592_POWER_20@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_r592_clear_reg_mask
LBB0_3:
	movl	%r14d, (%rbx)
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"switching to serial mode"

	.comm	_R592_IO_MODE,4,2               ## @R592_IO_MODE
	.comm	_R592_IO_MODE_SERIAL,4,2        ## @R592_IO_MODE_SERIAL
	.comm	_R592_POWER,4,2                 ## @R592_POWER
	.comm	_R592_POWER_20,4,2              ## @R592_POWER_20
L_.str.1:                               ## @.str.1
	.asciz	"switching to parallel mode"

	.comm	_R592_IO,4,2                    ## @R592_IO
	.comm	_R592_IO_SERIAL1,4,2            ## @R592_IO_SERIAL1
	.comm	_R592_IO_SERIAL2,4,2            ## @R592_IO_SERIAL2
	.comm	_R592_IO_MODE_PARALLEL,4,2      ## @R592_IO_MODE_PARALLEL
	.no_dead_strip	_r592_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function r592_set_mode
_r592_set_mode:                         ; @r592_set_mode
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.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
	cbz	w1, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dbg
Lloh2:
	adrp	x8, _R592_POWER@GOTPAGE
Lloh3:
	ldr	x8, [x8, _R592_POWER@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x8, _R592_POWER_20@GOTPAGE
Lloh6:
	ldr	x8, [x8, _R592_POWER_20@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_r592_set_reg_mask
Lloh8:
	adrp	x8, _R592_IO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _R592_IO@GOTPAGEOFF]
Lloh10:
	adrp	x9, _R592_IO_SERIAL1@GOTPAGE
Lloh11:
	ldr	x9, [x9, _R592_IO_SERIAL1@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	ldr	w8, [x9]
Lloh14:
	adrp	x9, _R592_IO_SERIAL2@GOTPAGE
Lloh15:
	ldr	x9, [x9, _R592_IO_SERIAL2@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x20
	bl	_r592_clear_reg_mask
Lloh17:
	adrp	x8, _R592_IO_MODE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _R592_IO_MODE@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x8, _R592_IO_MODE_PARALLEL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _R592_IO_MODE_PARALLEL@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_r592_write_reg
	b	LBB0_3
LBB0_2:
Lloh23:
	adrp	x0, l_.str@PAGE
Lloh24:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dbg
Lloh25:
	adrp	x8, _R592_IO_MODE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _R592_IO_MODE@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	adrp	x8, _R592_IO_MODE_SERIAL@GOTPAGE
Lloh29:
	ldr	x8, [x8, _R592_IO_MODE_SERIAL@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_r592_write_reg
Lloh31:
	adrp	x8, _R592_POWER@GOTPAGE
Lloh32:
	ldr	x8, [x8, _R592_POWER@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
Lloh34:
	adrp	x8, _R592_POWER_20@GOTPAGE
Lloh35:
	ldr	x8, [x8, _R592_POWER_20@GOTPAGEOFF]
Lloh36:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_r592_clear_reg_mask
LBB0_3:
	str	w19, [x20]
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"switching to serial mode"

	.comm	_R592_IO_MODE,4,2               ; @R592_IO_MODE
	.comm	_R592_IO_MODE_SERIAL,4,2        ; @R592_IO_MODE_SERIAL
	.comm	_R592_POWER,4,2                 ; @R592_POWER
	.comm	_R592_POWER_20,4,2              ; @R592_POWER_20
l_.str.1:                               ; @.str.1
	.asciz	"switching to parallel mode"

	.comm	_R592_IO,4,2                    ; @R592_IO
	.comm	_R592_IO_SERIAL1,4,2            ; @R592_IO_SERIAL1
	.comm	_R592_IO_SERIAL2,4,2            ; @R592_IO_SERIAL2
	.comm	_R592_IO_MODE_PARALLEL,4,2      ; @R592_IO_MODE_PARALLEL
	.no_dead_strip	_r592_set_mode
.subsections_via_symbols
