	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nto_find_and_open_solib        ## -- Begin function nto_find_and_open_solib
	.p2align	4, 0x90
_nto_find_and_open_solib:               ## @nto_find_and_open_solib
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_PATH_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	xorl	%eax, %eax
	callq	_nto_target
	movq	%rax, %r13
	movq	_TARGET_ARCHITECTURE@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	(%rax), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	(%rbx), %rax
	movq	(%rax), %rdi
	leaq	L_.str.4(%rip), %rsi
	callq	_strcmp
	leaq	L_.str.7(%rip), %r15
	leaq	L_.str.6(%rip), %r14
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	(%rbx), %rax
	movq	(%rax), %rdi
	leaq	L_.str.5(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	(%rbx), %rax
	movq	(%rax), %r14
	movq	_TARGET_BYTE_ORDER@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_BFD_ENDIAN_BIG@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	leaq	L_.str.7(%rip), %rax
	leaq	L_.str.8(%rip), %r15
	cmoveq	%rax, %r15
	jmp	LBB0_5
LBB0_1:
	leaq	L_.str.3(%rip), %r15
	leaq	L_.str.2(%rip), %r14
LBB0_5:
	leaq	L_.str.9(%rip), %rsi
	movq	%r12, %rdi
	movq	%r13, %rdx
	movq	%r14, %rcx
	movq	%r15, %r8
	xorl	%eax, %eax
	callq	_sprintf
	leaq	L_.str(%rip), %r14
	movq	%r14, %rdi
	callq	_strlen
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_strlen
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rax,4), %eax
	leal	(%rbx,%rax), %edi
	incl	%edi
	callq	_alloca
	movq	%rax, %rbx
	subq	$8, %rsp
	movq	%rax, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	movq	%r12, %rcx
	movq	%r12, %r8
	movq	%r12, %r9
	xorl	%eax, %eax
	pushq	%r12
	callq	_sprintf
	addq	$16, %rsp
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	xorl	%r8d, %r8d
	movq	-72(%rbp), %r9                  ## 8-byte Reload
	callq	_openp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_7
## %bb.6:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PATH_MAX,4,2                   ## @PATH_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s/lib:%s/usr/lib:%s/usr/photon/lib:%s/usr/photon/dll:%s/lib/dll"

	.comm	_TARGET_ARCHITECTURE,8,3        ## @TARGET_ARCHITECTURE
L_.str.1:                               ## @.str.1
	.asciz	"i386"

L_.str.2:                               ## @.str.2
	.asciz	"x86"

L_.str.3:                               ## @.str.3
	.space	1

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

L_.str.5:                               ## @.str.5
	.asciz	"powerpc"

L_.str.6:                               ## @.str.6
	.asciz	"ppc"

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

	.comm	_TARGET_BYTE_ORDER,8,3          ## @TARGET_BYTE_ORDER
	.comm	_BFD_ENDIAN_BIG,8,3             ## @BFD_ENDIAN_BIG
L_.str.8:                               ## @.str.8
	.asciz	"le"

L_.str.9:                               ## @.str.9
	.asciz	"%s/%s%s"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nto_find_and_open_solib        ; -- Begin function nto_find_and_open_solib
	.p2align	2
_nto_find_and_open_solib:               ; @nto_find_and_open_solib
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	sub	sp, sp, #16
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, _PATH_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PATH_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x22, x9, x8
	mov	sp, x22
	bl	_nto_target
	mov	x23, x0
Lloh8:
	adrp	x24, _TARGET_ARCHITECTURE@GOTPAGE
Lloh9:
	ldr	x24, [x24, _TARGET_ARCHITECTURE@GOTPAGEOFF]
	ldr	x8, [x24]
	ldr	x0, [x8]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_4
; %bb.1:
	ldr	x8, [x24]
	ldr	x0, [x8]
Lloh12:
	adrp	x1, l_.str.4@PAGE
Lloh13:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_5
; %bb.2:
	ldr	x8, [x24]
	ldr	x0, [x8]
Lloh14:
	adrp	x1, l_.str.5@PAGE
Lloh15:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_strcmp
Lloh16:
	adrp	x4, l_.str.7@PAGE
Lloh17:
	add	x4, x4, l_.str.7@PAGEOFF
	cbz	x0, LBB0_6
; %bb.3:
	ldr	x8, [x24]
	ldr	x3, [x8]
Lloh18:
	adrp	x8, _TARGET_BYTE_ORDER@GOTPAGE
Lloh19:
	ldr	x8, [x8, _TARGET_BYTE_ORDER@GOTPAGEOFF]
Lloh20:
	adrp	x9, _BFD_ENDIAN_BIG@GOTPAGE
Lloh21:
	ldr	x9, [x9, _BFD_ENDIAN_BIG@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
Lloh23:
	ldr	x9, [x9]
Lloh24:
	adrp	x10, l_.str.8@PAGE
Lloh25:
	add	x10, x10, l_.str.8@PAGEOFF
	cmp	x8, x9
	csel	x4, x4, x10, eq
	b	LBB0_7
LBB0_4:
Lloh26:
	adrp	x4, l_.str.3@PAGE
Lloh27:
	add	x4, x4, l_.str.3@PAGEOFF
Lloh28:
	adrp	x3, l_.str.2@PAGE
Lloh29:
	add	x3, x3, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_5:
Lloh30:
	adrp	x4, l_.str.7@PAGE
Lloh31:
	add	x4, x4, l_.str.7@PAGEOFF
LBB0_6:
Lloh32:
	adrp	x3, l_.str.6@PAGE
Lloh33:
	add	x3, x3, l_.str.6@PAGEOFF
LBB0_7:
Lloh34:
	adrp	x1, l_.str.9@PAGE
Lloh35:
	add	x1, x1, l_.str.9@PAGEOFF
	mov	x0, x22
	mov	x2, x23
	bl	_sprintf
Lloh36:
	adrp	x23, l_.str@PAGE
Lloh37:
	add	x23, x23, l_.str@PAGEOFF
	mov	x0, x23
	bl	_strlen
	mov	x24, x0
	mov	x0, x22
	bl	_strlen
	add	w8, w0, w0, lsl #2
	add	w8, w24, w8
	add	w0, w8, #1
	bl	_alloca
	mov	x24, x0
	stp	x22, x22, [sp, #-16]!
	mov	x1, x23
	mov	x2, x22
	mov	x3, x22
	mov	x4, x22
	bl	_sprintf
	add	sp, sp, #16
	mov	x0, x24
	mov	w1, #1
	mov	x2, x21
	mov	x3, x20
	mov	w4, #0
	mov	x5, x19
	bl	_openp
	ldur	x8, [x29, #-56]
Lloh38:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh39:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh40:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	sub	sp, x29, #48
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh22
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_PATH_MAX,4,2                   ; @PATH_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s/lib:%s/usr/lib:%s/usr/photon/lib:%s/usr/photon/dll:%s/lib/dll"

	.comm	_TARGET_ARCHITECTURE,8,3        ; @TARGET_ARCHITECTURE
l_.str.1:                               ; @.str.1
	.asciz	"i386"

l_.str.2:                               ; @.str.2
	.asciz	"x86"

l_.str.3:                               ; @.str.3
	.space	1

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

l_.str.5:                               ; @.str.5
	.asciz	"powerpc"

l_.str.6:                               ; @.str.6
	.asciz	"ppc"

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

	.comm	_TARGET_BYTE_ORDER,8,3          ; @TARGET_BYTE_ORDER
	.comm	_BFD_ENDIAN_BIG,8,3             ; @BFD_ENDIAN_BIG
l_.str.8:                               ; @.str.8
	.asciz	"le"

l_.str.9:                               ; @.str.9
	.asciz	"%s/%s%s"

.subsections_via_symbols
