	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nsim_sdev_get                  ## -- Begin function nsim_sdev_get
	.p2align	4, 0x90
_nsim_sdev_get:                         ## @nsim_sdev_get
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.1:
	movq	%rdi, %rbx
	xorl	%edi, %edi
	cmpq	$0, (%rbx)
	sete	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_6:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$12, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.9:
	movq	%rax, %rbx
	movl	$1, (%rax)
	movq	_nsim_sdev_id@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	leal	1(%rdx), %eax
	movl	%eax, (%r15)
	movl	%edx, 4(%rbx)
	leaq	L_.str(%rip), %rsi
	leaq	-42(%rbp), %r14
	movq	%r14, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_sprintf
	movq	_nsim_sdev_ddir@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_debugfs_create_dir
	movl	%eax, 8(%rbx)
	movl	%eax, %edi
	callq	_IS_ERR_OR_NULL
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movl	8(%rbx), %edi
	callq	_PTR_ERR_OR_ZERO
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	subl	(%rcx), %r14d
	testq	%rax, %rax
	cmovnel	%eax, %r14d
	decl	(%r15)
	movq	%rbx, %rdi
	callq	_kfree
	movl	%r14d, %edi
	callq	_ERR_PTR
	movq	%rax, %rbx
	jmp	LBB0_11
LBB0_5:
	movq	(%rbx), %rbx
	incl	(%rbx)
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_8
## %bb.12:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%edi, %edi
	subl	(%rax), %edi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_8
## %bb.4:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_nsim_sdev_id,4,2               ## @nsim_sdev_id
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%u"

	.comm	_nsim_sdev_ddir,4,2             ## @nsim_sdev_ddir
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nsim_sdev_get                  ; -- Begin function nsim_sdev_get
	.p2align	2
_nsim_sdev_get:                         ; @nsim_sdev_get
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0]
	cmp	x8, #0
	cset	w0, eq
	bl	_WARN_ON
	cbz	x0, LBB0_6
; %bb.2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_10
LBB0_3:
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w0, #12
	bl	_kzalloc
	cbz	x0, LBB0_9
; %bb.4:
	mov	x19, x0
	mov	w8, #1
	str	w8, [x0]
Lloh8:
	adrp	x21, _nsim_sdev_id@GOTPAGE
Lloh9:
	ldr	x21, [x21, _nsim_sdev_id@GOTPAGEOFF]
	ldr	w2, [x21]
	add	w8, w2, #1
	str	w8, [x21]
	str	w2, [x0, #4]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #14
	bl	_sprintf
Lloh12:
	adrp	x8, _nsim_sdev_ddir@GOTPAGE
Lloh13:
	ldr	x8, [x8, _nsim_sdev_ddir@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	add	x0, sp, #14
	bl	_debugfs_create_dir
	str	w0, [x19, #8]
	bl	_IS_ERR_OR_NULL
	cbz	x0, LBB0_7
; %bb.5:
	ldr	w0, [x19, #8]
	bl	_PTR_ERR_OR_ZERO
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	x0, #0
	csneg	w20, w0, w8, ne
	ldr	w8, [x21]
	sub	w8, w8, #1
	str	w8, [x21]
	mov	x0, x19
	bl	_kfree
	mov	x0, x20
	bl	_ERR_PTR
	mov	x19, x0
	b	LBB0_7
LBB0_6:
	ldr	x19, [x19]
	ldr	w8, [x19]
	add	w8, w8, #1
	str	w8, [x19]
LBB0_7:
	ldr	x8, [sp, #24]
Lloh18:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh19:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.8:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_9:
Lloh21:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	ldr	x9, [sp, #24]
Lloh23:
	adrp	x10, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x10, [x10, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x10, [x10]
	cmp	x10, x9
	b.ne	LBB0_12
; %bb.11:
	neg	w0, w8
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_ERR_PTR
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_nsim_sdev_id,4,2               ; @nsim_sdev_id
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%u"

	.comm	_nsim_sdev_ddir,4,2             ; @nsim_sdev_ddir
.subsections_via_symbols
