	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gdbsim_load
_gdbsim_load:                           ## @gdbsim_load
	.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
	xorl	%eax, %eax
	callq	_sr_get_debug
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	callq	_printf_filtered
LBB0_2:
	movq	_null_ptid@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_inferior_ptid@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_gdbsim_desc@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	movl	%r14d, %ecx
	callq	_sim_load
	movq	_SIM_RC_FAIL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	callq	_error
LBB0_4:
	movq	_program_loaded@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gdbsim_load: prog \"%s\"\n"

	.comm	_null_ptid,4,2                  ## @null_ptid
	.comm	_inferior_ptid,4,2              ## @inferior_ptid
	.comm	_gdbsim_desc,4,2                ## @gdbsim_desc
	.comm	_SIM_RC_FAIL,8,3                ## @SIM_RC_FAIL
L_.str.1:                               ## @.str.1
	.asciz	"unable to load program"

	.comm	_program_loaded,4,2             ## @program_loaded
	.no_dead_strip	_gdbsim_load
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gdbsim_load
_gdbsim_load:                           ; @gdbsim_load
	.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
	bl	_sr_get_debug
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_printf_filtered
LBB0_2:
Lloh2:
	adrp	x8, _null_ptid@GOTPAGE
Lloh3:
	ldr	x8, [x8, _null_ptid@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _inferior_ptid@GOTPAGE
Lloh6:
	ldr	x9, [x9, _inferior_ptid@GOTPAGEOFF]
Lloh7:
	str	w8, [x9]
Lloh8:
	adrp	x8, _gdbsim_desc@GOTPAGE
Lloh9:
	ldr	x8, [x8, _gdbsim_desc@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	mov	x1, x20
	mov	x2, #0
	mov	x3, x19
	bl	_sim_load
Lloh11:
	adrp	x8, _SIM_RC_FAIL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SIM_RC_FAIL@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.3:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_error
LBB0_4:
Lloh16:
	adrp	x8, _program_loaded@GOTPAGE
Lloh17:
	ldr	x8, [x8, _program_loaded@GOTPAGEOFF]
	mov	w9, #1
Lloh18:
	str	w9, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotStr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gdbsim_load: prog \"%s\"\n"

	.comm	_null_ptid,4,2                  ; @null_ptid
	.comm	_inferior_ptid,4,2              ; @inferior_ptid
	.comm	_gdbsim_desc,4,2                ; @gdbsim_desc
	.comm	_SIM_RC_FAIL,8,3                ; @SIM_RC_FAIL
l_.str.1:                               ; @.str.1
	.asciz	"unable to load program"

	.comm	_program_loaded,4,2             ; @program_loaded
	.no_dead_strip	_gdbsim_load
.subsections_via_symbols
