	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function basl_open
_basl_open:                             ## @basl_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movl	8(%rdi), %edi
	testl	%esi, %esi
	je	LBB0_2
## %bb.1:
	movq	_basl_stemplate@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MAXPATHLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_strlcpy
	movl	8(%rbx), %r14d
	movq	_BHYVE_ASL_SUFFIX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strlen
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_mkstemps
	jmp	LBB0_3
LBB0_2:
	movq	_basl_template@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MAXPATHLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_strlcpy
	movl	8(%rbx), %edi
	callq	_mkstemp
LBB0_3:
	movq	%rax, (%rbx)
	testq	%rax, %rax
	jle	LBB0_4
## %bb.5:
	leaq	L_.str(%rip), %rsi
	movq	%rax, %rdi
	callq	_fdopen
	movq	%rax, 16(%rbx)
	xorl	%r14d, %r14d
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:
	movl	8(%rbx), %edi
	callq	_unlink
	movq	(%rbx), %rdi
	callq	_close
	jmp	LBB0_7
LBB0_4:
	movl	$1, %r14d
LBB0_7:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_basl_stemplate,4,2             ## @basl_stemplate
	.comm	_MAXPATHLEN,4,2                 ## @MAXPATHLEN
	.comm	_BHYVE_ASL_SUFFIX,4,2           ## @BHYVE_ASL_SUFFIX
	.comm	_basl_template,4,2              ## @basl_template
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"w+"

	.no_dead_strip	_basl_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function basl_open
_basl_open:                             ; @basl_open
	.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, x0
	ldr	w0, [x0, #8]
	cbz	w1, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _basl_stemplate@GOTPAGE
Lloh1:
	ldr	x8, [x8, _basl_stemplate@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _MAXPATHLEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAXPATHLEN@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_strlcpy
	ldr	w20, [x19, #8]
Lloh6:
	adrp	x8, _BHYVE_ASL_SUFFIX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BHYVE_ASL_SUFFIX@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_strlen
	mov	x1, x0
	mov	x0, x20
	bl	_mkstemps
	b	LBB0_3
LBB0_2:
Lloh9:
	adrp	x8, _basl_template@GOTPAGE
Lloh10:
	ldr	x8, [x8, _basl_template@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _MAXPATHLEN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MAXPATHLEN@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	bl	_strlcpy
	ldr	w0, [x19, #8]
	bl	_mkstemp
LBB0_3:
	str	x0, [x19]
	cmp	x0, #1
	b.lt	LBB0_7
; %bb.4:
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fdopen
	str	x0, [x19, #16]
	cbnz	x0, LBB0_6
; %bb.5:
	ldr	w0, [x19, #8]
	bl	_unlink
	ldr	x0, [x19]
	bl	_close
LBB0_6:
	mov	w0, #0
	b	LBB0_8
LBB0_7:
	mov	w0, #1
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_basl_stemplate,4,2             ; @basl_stemplate
	.comm	_MAXPATHLEN,4,2                 ; @MAXPATHLEN
	.comm	_BHYVE_ASL_SUFFIX,4,2           ; @BHYVE_ASL_SUFFIX
	.comm	_basl_template,4,2              ; @basl_template
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"w+"

	.no_dead_strip	_basl_open
.subsections_via_symbols
