	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gr_open                        ## -- Begin function gr_open
	.p2align	4, 0x90
_gr_open:                               ## @gr_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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	%esi, %edi
	callq	_target_preopen
	movq	(%r15), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_sr_scan_args
	movq	(%r15), %rdi
	callq	_unpush_target
	movq	_gr_settings@GOTPCREL(%rip), %r12
	movq	%r15, (%r12)
	xorl	%eax, %eax
	callq	_sr_get_desc
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	xorl	%edi, %edi
	callq	_gr_close
LBB0_2:
	xorl	%eax, %eax
	callq	_sr_get_device
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	(%r15), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_usage
LBB0_4:
	xorl	%eax, %eax
	callq	_sr_get_device
	movq	%rax, %rdi
	callq	_serial_open
	movl	%eax, %edi
	callq	_sr_set_desc
	xorl	%eax, %eax
	callq	_sr_get_desc
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	xorl	%eax, %eax
	callq	_sr_get_device
	movq	%rax, %rdi
	callq	_perror_with_name
LBB0_6:
	movq	_baud_rate@GOTPCREL(%rip), %rbx
	cmpl	$-1, (%rbx)
	je	LBB0_9
## %bb.7:
	xorl	%eax, %eax
	callq	_sr_get_desc
	movl	(%rbx), %esi
	movq	%rax, %rdi
	callq	_serial_setbaudrate
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	xorl	%eax, %eax
	callq	_sr_get_desc
	movq	%rax, %rdi
	callq	_serial_close
	xorl	%eax, %eax
	callq	_sr_get_device
	movq	%rax, %rdi
	callq	_perror_with_name
LBB0_9:
	xorl	%eax, %eax
	callq	_sr_get_desc
	movq	%rax, %rdi
	callq	_serial_raw
	xorl	%eax, %eax
	callq	_sr_get_desc
	movq	%rax, %rdi
	callq	_serial_flush_input
	xorl	%eax, %eax
	callq	_sr_get_retries
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:
	movl	$1, %edi
	callq	_sr_set_retries
LBB0_11:
	movq	(%r12), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_12
## %bb.13:
	testl	%r14d, %r14d
	jne	LBB0_14
	jmp	LBB0_17
LBB0_12:
	movq	_remove_breakpoints@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 8(%rax)
	testl	%r14d, %r14d
	je	LBB0_17
LBB0_14:
	xorl	%eax, %eax
	callq	_sr_get_device
	leaq	L_.str(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_printf_filtered
	movl	(%rbx), %esi
	cmpl	$-1, %esi
	je	LBB0_16
## %bb.15:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf_filtered
LBB0_16:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf_filtered
LBB0_17:
	movq	(%r15), %rdi
	callq	_push_target
	xorl	%eax, %eax
	callq	_gr_checkin
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gr_clear_all_breakpoints       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_gr_settings,8,3                ## @gr_settings
	.comm	_baud_rate,4,2                  ## @baud_rate
	.comm	_remove_breakpoints,8,3         ## @remove_breakpoints
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Remote debugging using `%s'"

L_.str.1:                               ## @.str.1
	.asciz	" at baud rate of %d"

L_.str.2:                               ## @.str.2
	.asciz	"\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gr_open                        ; -- Begin function gr_open
	.p2align	2
_gr_open:                               ; @gr_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	mov	x0, x1
	bl	_target_preopen
	ldr	x8, [x19]
	ldr	w0, [x8]
	mov	x1, x21
	bl	_sr_scan_args
	ldr	x0, [x19]
	bl	_unpush_target
Lloh0:
	adrp	x21, _gr_settings@GOTPAGE
Lloh1:
	ldr	x21, [x21, _gr_settings@GOTPAGEOFF]
	str	x19, [x21]
	bl	_sr_get_desc
	cbz	x0, LBB0_2
; %bb.1:
	mov	w0, #0
	bl	_gr_close
LBB0_2:
	bl	_sr_get_device
	cbnz	x0, LBB0_4
; %bb.3:
	ldr	x8, [x19]
	ldr	w0, [x8]
	mov	x1, #0
	bl	_usage
LBB0_4:
	bl	_sr_get_device
	bl	_serial_open
	bl	_sr_set_desc
	bl	_sr_get_desc
	cbnz	x0, LBB0_6
; %bb.5:
	bl	_sr_get_device
	bl	_perror_with_name
LBB0_6:
Lloh2:
	adrp	x22, _baud_rate@GOTPAGE
Lloh3:
	ldr	x22, [x22, _baud_rate@GOTPAGEOFF]
	ldr	w8, [x22]
	cmn	w8, #1
	b.eq	LBB0_9
; %bb.7:
	bl	_sr_get_desc
	ldr	w1, [x22]
	bl	_serial_setbaudrate
	cbz	x0, LBB0_9
; %bb.8:
	bl	_sr_get_desc
	bl	_serial_close
	bl	_sr_get_device
	bl	_perror_with_name
LBB0_9:
	bl	_sr_get_desc
	bl	_serial_raw
	bl	_sr_get_desc
	bl	_serial_flush_input
	bl	_sr_get_retries
	cbnz	x0, LBB0_11
; %bb.10:
	mov	w0, #1
	bl	_sr_set_retries
LBB0_11:
	ldr	x8, [x21]
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_13
; %bb.12:
	cbnz	w20, LBB0_14
	b	LBB0_17
LBB0_13:
Lloh4:
	adrp	x9, _remove_breakpoints@GOTPAGE
Lloh5:
	ldr	x9, [x9, _remove_breakpoints@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	str	x9, [x8, #8]
	cbz	w20, LBB0_17
LBB0_14:
	bl	_sr_get_device
	str	x0, [sp]
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf_filtered
	ldr	w8, [x22]
	cmn	w8, #1
	b.eq	LBB0_16
; %bb.15:
	str	x8, [sp]
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf_filtered
LBB0_16:
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printf_filtered
LBB0_17:
	ldr	x0, [x19]
	bl	_push_target
	bl	_gr_checkin
	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
	add	sp, sp, #64
	b	_gr_clear_all_breakpoints
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_gr_settings,8,3                ; @gr_settings
	.comm	_baud_rate,4,2                  ; @baud_rate
	.comm	_remove_breakpoints,8,3         ; @remove_breakpoints
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Remote debugging using `%s'"

l_.str.1:                               ; @.str.1
	.asciz	" at baud rate of %d"

l_.str.2:                               ; @.str.2
	.asciz	"\n"

.subsections_via_symbols
