	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gdbsim_open
_gdbsim_open:                           ## @gdbsim_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	%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, %r14
	xorl	%eax, %eax
	callq	_sr_get_debug
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	testq	%r14, %r14
	leaq	L_.str.1(%rip), %rsi
	cmovneq	%r14, %rsi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf_filtered
LBB0_2:
	movq	_gdbsim_desc@GOTPCREL(%rip), %r13
	cmpq	$0, (%r13)
	je	LBB0_4
## %bb.3:
	movq	_gdbsim_ops@GOTPCREL(%rip), %rdi
	callq	_unpush_target
LBB0_4:
	leaq	L_.str.2(%rip), %r15
	movq	%r15, %rdi
	callq	_strlen
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	callq	_strlen
	movl	%eax, %r12d
	testq	%r14, %r14
	je	LBB0_5
## %bb.6:
	movq	%r14, %rdi
	callq	_strlen
                                        ## kill: def $eax killed $eax def $rax
	jmp	LBB0_7
LBB0_5:
	xorl	%eax, %eax
LBB0_7:
	addl	%r12d, %ebx
	leal	(%rax,%rbx), %edi
	addl	$58, %edi
	callq	_alloca
	movq	%rax, %rbx
	leaq	L_.str.4(%rip), %rsi
	movq	%rax, %rdi
	callq	_strcpy
	xorl	%eax, %eax
	callq	_selected_byte_order
	cmpl	$130, %eax
	je	LBB0_8
## %bb.9:
	cmpl	$129, %eax
	je	LBB0_10
	jmp	LBB0_11
LBB0_8:
	leaq	L_.str.5(%rip), %r15
LBB0_10:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_strcat
LBB0_11:
	xorl	%eax, %eax
	callq	_selected_architecture_name
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	leaq	L_.str.6(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcat
	xorl	%eax, %eax
	callq	_selected_architecture_name
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_strcat
LBB0_13:
	testq	%r14, %r14
	je	LBB0_15
## %bb.14:
	leaq	L_.str.7(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcat
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_strcat
LBB0_15:
	movq	%rbx, %rdi
	callq	_buildargv
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_17
## %bb.16:
	leaq	L_.str.8(%rip), %rdi
	callq	_error
LBB0_17:
	movq	%rbx, %rdi
	callq	_make_cleanup_freeargv
	xorl	%eax, %eax
	callq	_init_callbacks
	movq	_SIM_OPEN_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_exec_bfd@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_gdb_callback@GOTPCREL(%rip), %rsi
	movq	%rbx, %rcx
	callq	_sim_open
	movq	%rax, (%r13)
	testq	%rax, %rax
	jne	LBB0_19
## %bb.18:
	leaq	L_.str.9(%rip), %rdi
	callq	_error
LBB0_19:
	movq	_gdbsim_ops@GOTPCREL(%rip), %rdi
	callq	_push_target
	movl	$-1, %edi
	callq	_target_fetch_registers
	leaq	L_.str.10(%rip), %rdi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_printf_filtered                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gdbsim_open: args \"%s\"\n"

L_.str.1:                               ## @.str.1
	.asciz	"(null)"

	.comm	_gdbsim_desc,8,3                ## @gdbsim_desc
	.comm	_gdbsim_ops,4,2                 ## @gdbsim_ops
L_.str.2:                               ## @.str.2
	.asciz	" -E little"

L_.str.3:                               ## @.str.3
	.asciz	" --architecture=xxxxxxxxxx"

L_.str.4:                               ## @.str.4
	.asciz	"gdbsim"

L_.str.5:                               ## @.str.5
	.asciz	" -E big"

L_.str.6:                               ## @.str.6
	.asciz	" --architecture="

L_.str.7:                               ## @.str.7
	.asciz	" "

L_.str.8:                               ## @.str.8
	.asciz	"Insufficient memory available to allocate simulator arg list."

	.comm	_SIM_OPEN_DEBUG,4,2             ## @SIM_OPEN_DEBUG
	.comm	_gdb_callback,4,2               ## @gdb_callback
	.comm	_exec_bfd,4,2                   ## @exec_bfd
L_.str.9:                               ## @.str.9
	.asciz	"unable to create simulator instance"

L_.str.10:                              ## @.str.10
	.asciz	"Connected to the simulator.\n"

	.no_dead_strip	_gdbsim_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gdbsim_open
_gdbsim_open:                           ; @gdbsim_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, x0
	bl	_sr_get_debug
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, l_.str.1@PAGE
Lloh1:
	add	x8, x8, l_.str.1@PAGEOFF
	cmp	x19, #0
	csel	x8, x8, x19, eq
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf_filtered
LBB0_2:
Lloh4:
	adrp	x22, _gdbsim_desc@GOTPAGE
Lloh5:
	ldr	x22, [x22, _gdbsim_desc@GOTPAGEOFF]
	ldr	x8, [x22]
	cbz	x8, LBB0_4
; %bb.3:
Lloh6:
	adrp	x0, _gdbsim_ops@GOTPAGE
Lloh7:
	ldr	x0, [x0, _gdbsim_ops@GOTPAGEOFF]
	bl	_unpush_target
LBB0_4:
Lloh8:
	adrp	x0, l_.str.2@PAGE
Lloh9:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_strlen
	mov	x20, x0
Lloh10:
	adrp	x0, l_.str.3@PAGE
Lloh11:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_strlen
	mov	x21, x0
	cbz	x19, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_strlen
	b	LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	add	w8, w20, w21
	add	w8, w8, w0
	add	w0, w8, #58
	bl	_alloca
	mov	x20, x0
Lloh12:
	adrp	x1, l_.str.4@PAGE
Lloh13:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_strcpy
	bl	_selected_byte_order
	cmp	w0, #130
	b.eq	LBB0_10
; %bb.8:
	cmp	w0, #129
	b.ne	LBB0_12
; %bb.9:
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_10:
Lloh16:
	adrp	x1, l_.str.5@PAGE
Lloh17:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_11:
	mov	x0, x20
	bl	_strcat
LBB0_12:
	bl	_selected_architecture_name
	cbz	x0, LBB0_14
; %bb.13:
Lloh18:
	adrp	x1, l_.str.6@PAGE
Lloh19:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x20
	bl	_strcat
	bl	_selected_architecture_name
	mov	x1, x0
	mov	x0, x20
	bl	_strcat
LBB0_14:
	cbz	x19, LBB0_16
; %bb.15:
Lloh20:
	adrp	x1, l_.str.7@PAGE
Lloh21:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x20
	bl	_strcat
	mov	x0, x20
	mov	x1, x19
	bl	_strcat
LBB0_16:
	mov	x0, x20
	bl	_buildargv
	mov	x19, x0
	cbnz	x0, LBB0_18
; %bb.17:
Lloh22:
	adrp	x0, l_.str.8@PAGE
Lloh23:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_error
LBB0_18:
	mov	x0, x19
	bl	_make_cleanup_freeargv
	bl	_init_callbacks
Lloh24:
	adrp	x8, _SIM_OPEN_DEBUG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SIM_OPEN_DEBUG@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
Lloh27:
	adrp	x8, _exec_bfd@GOTPAGE
Lloh28:
	ldr	x8, [x8, _exec_bfd@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
Lloh30:
	adrp	x1, _gdb_callback@GOTPAGE
Lloh31:
	ldr	x1, [x1, _gdb_callback@GOTPAGEOFF]
	mov	x3, x19
	bl	_sim_open
	str	x0, [x22]
	cbnz	x0, LBB0_20
; %bb.19:
Lloh32:
	adrp	x0, l_.str.9@PAGE
Lloh33:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_error
LBB0_20:
Lloh34:
	adrp	x0, _gdbsim_ops@GOTPAGE
Lloh35:
	ldr	x0, [x0, _gdbsim_ops@GOTPAGEOFF]
	bl	_push_target
	mov	w0, #-1
	bl	_target_fetch_registers
Lloh36:
	adrp	x0, l_.str.10@PAGE
Lloh37:
	add	x0, x0, l_.str.10@PAGEOFF
	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	_printf_filtered
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gdbsim_open: args \"%s\"\n"

l_.str.1:                               ; @.str.1
	.asciz	"(null)"

	.comm	_gdbsim_desc,8,3                ; @gdbsim_desc
	.comm	_gdbsim_ops,4,2                 ; @gdbsim_ops
l_.str.2:                               ; @.str.2
	.asciz	" -E little"

l_.str.3:                               ; @.str.3
	.asciz	" --architecture=xxxxxxxxxx"

l_.str.4:                               ; @.str.4
	.asciz	"gdbsim"

l_.str.5:                               ; @.str.5
	.asciz	" -E big"

l_.str.6:                               ; @.str.6
	.asciz	" --architecture="

l_.str.7:                               ; @.str.7
	.asciz	" "

l_.str.8:                               ; @.str.8
	.asciz	"Insufficient memory available to allocate simulator arg list."

	.comm	_SIM_OPEN_DEBUG,4,2             ; @SIM_OPEN_DEBUG
	.comm	_gdb_callback,4,2               ; @gdb_callback
	.comm	_exec_bfd,4,2                   ; @exec_bfd
l_.str.9:                               ; @.str.9
	.asciz	"unable to create simulator instance"

l_.str.10:                              ; @.str.10
	.asciz	"Connected to the simulator.\n"

	.no_dead_strip	_gdbsim_open
.subsections_via_symbols
