	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function remote_rdp_open
_remote_rdp_open:                       ## @remote_rdp_open
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	testq	%rdi, %rdi
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_error_no_arg
LBB0_2:
	movq	_baud_rate@GOTPCREL(%rip), %r15
	movl	$9600, (%r15)                   ## imm = 0x2580
	movl	%ebx, %edi
	callq	_target_preopen
	movq	%r14, %rdi
	callq	_serial_open
	movq	_io@GOTPCREL(%rip), %r12
	movl	%eax, (%r12)
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_perror_with_name
	movl	(%r12), %eax
LBB0_4:
	movl	%eax, %edi
	callq	_serial_raw
	movl	$1, %edi
	movl	%ebx, %esi
	callq	_rdp_init
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.5:
	movl	(%r15), %edx
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rsi
	callq	_printf_unfiltered
LBB0_6:
	xorl	%eax, %eax
	callq	_rdp_info
	xorl	%eax, %eax
	callq	_rdp_catch_vectors
	movq	_RDP_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RDP_INFO_ICEBREAKER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.2(%rip), %rdi
	leaq	-36(%rbp), %rcx
	xorl	%eax, %eax
	callq	_send_rdp
	cmpl	$0, -36(%rbp)
	jne	LBB0_8
## %bb.7:
	leaq	L_.str.3(%rip), %rbx
	movq	%rbx, %rdi
	callq	_strlen
	movl	%eax, %ecx
	movq	_RDP_SELECT_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RDI_ConfigCPU@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_RDI_MatchAny@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	subq	$8, %rsp
	leaq	-40(%rbp), %r10
	leaq	L_.str.4(%rip), %rdi
	xorl	%r9d, %r9d
	xorl	%eax, %eax
	pushq	%r10
	pushq	%rcx
	pushq	%rbx
	callq	_send_rdp
	addq	$32, %rsp
LBB0_8:
	movq	_remote_rdp_ops@GOTPCREL(%rip), %rdi
	callq	_push_target
	movq	_callback@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	*(%rdi)
	xorl	%eax, %eax
	callq	_flush_cached_frames
	xorl	%eax, %eax
	callq	_registers_changed
	xorl	%eax, %eax
	callq	_read_pc
	movq	_stop_pc@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	callq	_get_selected_frame
	movl	%eax, %edi
	movl	$-1, %esi
	movl	$1, %edx
	callq	_print_stack_frame
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"serial port device name"

	.comm	_baud_rate,4,2                  ## @baud_rate
	.comm	_io,4,2                         ## @io
L_.str.1:                               ## @.str.1
	.asciz	"Remote RDP debugging using %s at %d baud\n"

L_.str.2:                               ## @.str.2
	.asciz	"bw-SB"

	.comm	_RDP_INFO,4,2                   ## @RDP_INFO
	.comm	_RDP_INFO_ICEBREAKER,4,2        ## @RDP_INFO_ICEBREAKER
L_.str.3:                               ## @.str.3
	.asciz	"ARM7TDI"

L_.str.4:                               ## @.str.4
	.asciz	"bbbbw-p-SWZ"

	.comm	_RDP_SELECT_CONFIG,4,2          ## @RDP_SELECT_CONFIG
	.comm	_RDI_ConfigCPU,4,2              ## @RDI_ConfigCPU
	.comm	_RDI_MatchAny,4,2               ## @RDI_MatchAny
	.comm	_remote_rdp_ops,4,2             ## @remote_rdp_ops
	.comm	_callback,8,3                   ## @callback
	.comm	_stop_pc,4,2                    ## @stop_pc
	.no_dead_strip	_remote_rdp_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function remote_rdp_open
_remote_rdp_open:                       ; @remote_rdp_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x20, x1
	mov	x19, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_error_no_arg
LBB0_2:
Lloh2:
	adrp	x21, _baud_rate@GOTPAGE
Lloh3:
	ldr	x21, [x21, _baud_rate@GOTPAGEOFF]
	mov	w8, #9600
	str	w8, [x21]
	mov	x0, x20
	bl	_target_preopen
	mov	x0, x19
	bl	_serial_open
Lloh4:
	adrp	x22, _io@GOTPAGE
Lloh5:
	ldr	x22, [x22, _io@GOTPAGEOFF]
	str	w0, [x22]
	cbnz	w0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_perror_with_name
	ldr	w0, [x22]
LBB0_4:
	bl	_serial_raw
	mov	w0, #1
	mov	x1, x20
	bl	_rdp_init
	cbz	w20, LBB0_6
; %bb.5:
	ldr	w2, [x21]
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_printf_unfiltered
LBB0_6:
	bl	_rdp_info
	bl	_rdp_catch_vectors
Lloh8:
	adrp	x8, _RDP_INFO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RDP_INFO@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _RDP_INFO_ICEBREAKER@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RDP_INFO_ICEBREAKER@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	sub	x8, x29, #36
	str	x8, [sp]
Lloh14:
	adrp	x0, l_.str.2@PAGE
Lloh15:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_send_rdp
	ldur	w8, [x29, #-36]
	cbnz	w8, LBB0_8
; %bb.7:
Lloh16:
	adrp	x19, l_.str.3@PAGE
Lloh17:
	add	x19, x19, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_strlen
                                        ; kill: def $w0 killed $w0 def $x0
Lloh18:
	adrp	x8, _RDP_SELECT_CONFIG@GOTPAGE
Lloh19:
	ldr	x8, [x8, _RDP_SELECT_CONFIG@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x8, _RDI_ConfigCPU@GOTPAGE
Lloh22:
	ldr	x8, [x8, _RDI_ConfigCPU@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
Lloh24:
	adrp	x8, _RDI_MatchAny@GOTPAGE
Lloh25:
	ldr	x8, [x8, _RDI_MatchAny@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	sub	x9, x29, #40
	stp	x0, x9, [sp, #32]
	stp	xzr, x19, [sp, #16]
	stp	x0, x8, [sp]
Lloh27:
	adrp	x0, l_.str.4@PAGE
Lloh28:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_send_rdp
LBB0_8:
Lloh29:
	adrp	x0, _remote_rdp_ops@GOTPAGE
Lloh30:
	ldr	x0, [x0, _remote_rdp_ops@GOTPAGEOFF]
	bl	_push_target
Lloh31:
	adrp	x8, _callback@GOTPAGE
Lloh32:
	ldr	x8, [x8, _callback@GOTPAGEOFF]
Lloh33:
	ldr	x0, [x8]
	ldr	x8, [x0]
	blr	x8
	bl	_flush_cached_frames
	bl	_registers_changed
	bl	_read_pc
Lloh34:
	adrp	x8, _stop_pc@GOTPAGE
Lloh35:
	ldr	x8, [x8, _stop_pc@GOTPAGEOFF]
Lloh36:
	str	w0, [x8]
	bl	_get_selected_frame
	mov	w1, #-1
	mov	w2, #1
	bl	_print_stack_frame
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotStr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"serial port device name"

	.comm	_baud_rate,4,2                  ; @baud_rate
	.comm	_io,4,2                         ; @io
l_.str.1:                               ; @.str.1
	.asciz	"Remote RDP debugging using %s at %d baud\n"

l_.str.2:                               ; @.str.2
	.asciz	"bw-SB"

	.comm	_RDP_INFO,4,2                   ; @RDP_INFO
	.comm	_RDP_INFO_ICEBREAKER,4,2        ; @RDP_INFO_ICEBREAKER
l_.str.3:                               ; @.str.3
	.asciz	"ARM7TDI"

l_.str.4:                               ; @.str.4
	.asciz	"bbbbw-p-SWZ"

	.comm	_RDP_SELECT_CONFIG,4,2          ; @RDP_SELECT_CONFIG
	.comm	_RDI_ConfigCPU,4,2              ; @RDI_ConfigCPU
	.comm	_RDI_MatchAny,4,2               ; @RDI_MatchAny
	.comm	_remote_rdp_ops,4,2             ; @remote_rdp_ops
	.comm	_callback,8,3                   ; @callback
	.comm	_stop_pc,4,2                    ; @stop_pc
	.no_dead_strip	_remote_rdp_open
.subsections_via_symbols
