	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bs_map                         ## -- Begin function bs_map
	.p2align	4, 0x90
_bs_map:                                ## @bs_map
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_PATH_MAX@GOTPCREL(%rip), %r12
	movl	(%r12), %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	leaq	L_.str(%rip), %rdx
	movq	%r13, %rdi
	movl	%ebx, %esi
	movq	%r15, %rcx
	movq	%r14, %r8
	callq	_snprintf
	cmpl	(%r12), %eax
	jge	LBB0_1
## %bb.2:
	xorl	%eax, %eax
	callq	_rid_alloc
	movl	$-1, %r12d
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.3:
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_rid_lookup
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	movq	%rax, %r15
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_open
	movl	%eax, (%r15)
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.5:
	movl	$-1, 4(%r15)
	movq	_PROTO_IOC_REGION@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	-56(%rbp), %rdx
	movl	%eax, %edi
	callq	_ioctl
	cmpl	$-1, %eax
	je	LBB0_6
## %bb.7:
	movl	-52(%rbp), %eax
	movl	%eax, 24(%r15)
	movl	-56(%rbp), %esi
	movl	%esi, 16(%r15)
	movq	$0, 8(%r15)
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movq	_PROT_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_MAP_NOCORE@GOTPCREL(%rip), %rax
	movq	_MAP_SHARED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	(%r15), %r8d
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	callq	_mmap
	movl	%eax, 20(%r15)
	movl	%r14d, %r12d
	jmp	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$-1, %r12d
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_10
## %bb.9:
	movl	%r12d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	(%r15), %edi
	callq	_close
	movl	$-1, (%r15)
	jmp	LBB0_8
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PATH_MAX,4,2                   ## @PATH_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/dev/proto/%s/%s"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_PROTO_IOC_REGION,4,2           ## @PROTO_IOC_REGION
	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_PROT_WRITE,4,2                 ## @PROT_WRITE
	.comm	_MAP_NOCORE,4,2                 ## @MAP_NOCORE
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bs_map                         ; -- Begin function bs_map
	.p2align	2
_bs_map:                                ; @bs_map
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	sub	sp, sp, #16
	mov	x4, x1
	mov	x3, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x19, _PATH_MAX@GOTPAGE
Lloh4:
	ldr	x19, [x19, _PATH_MAX@GOTPAGEOFF]
	ldr	w1, [x19]
	mov	x9, x1
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x1, #15
	and	x9, x9, #0x1fffffff0
	sub	x21, x8, x9
	mov	sp, x21
Lloh7:
	adrp	x2, l_.str@PAGE
Lloh8:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_snprintf
	ldr	w8, [x19]
	cmp	w0, w8
	b.ge	LBB0_6
; %bb.1:
	bl	_rid_alloc
	mov	x19, x0
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.2:
	mov	x0, x19
	bl	_rid_lookup
	cbz	x0, LBB0_7
; %bb.3:
	mov	x20, x0
Lloh9:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_open
	str	w0, [x20]
	mov	w8, #-1
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.4:
	str	w8, [x20, #4]
Lloh12:
	adrp	x8, _PROTO_IOC_REGION@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PROTO_IOC_REGION@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	sub	x2, x29, #48
	bl	_ioctl
	cmn	w0, #1
	b.eq	LBB0_10
; %bb.5:
	ldp	w1, w8, [x29, #-48]
	str	w8, [x20, #24]
	str	w1, [x20, #16]
	str	xzr, [x20, #8]
Lloh15:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _PROT_WRITE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PROT_WRITE@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh21:
	adrp	x8, _MAP_NOCORE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MAP_NOCORE@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _MAP_SHARED@GOTPAGE
Lloh25:
	ldr	x9, [x9, _MAP_SHARED@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w3, w9, w8
	ldr	w4, [x20]
	mov	x0, #0
	mov	x5, #0
	bl	_mmap
	str	w0, [x20, #20]
	b	LBB0_8
LBB0_6:
Lloh27:
	adrp	x8, _EINVAL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
Lloh30:
	adrp	x9, _errno@GOTPAGE
Lloh31:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh32:
	str	w8, [x9]
LBB0_7:
	mov	w19, #-1
LBB0_8:
	ldur	x8, [x29, #-40]
Lloh33:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh34:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh35:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.9:
	mov	x0, x19
	sub	sp, x29, #32
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_10:
	ldr	w0, [x20]
	bl	_close
	mov	w19, #-1
	str	w19, [x20]
	b	LBB0_8
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotStr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_PATH_MAX,4,2                   ; @PATH_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/dev/proto/%s/%s"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_PROTO_IOC_REGION,4,2           ; @PROTO_IOC_REGION
	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_PROT_WRITE,4,2                 ; @PROT_WRITE
	.comm	_MAP_NOCORE,4,2                 ; @MAP_NOCORE
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
.subsections_via_symbols
