	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nsim_bus_dev_new
_nsim_bus_dev_new:                      ## @nsim_bus_dev_new
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movl	%edi, %ebx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	$32, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movl	(%r12), %ecx
	movq	_nsim_bus_dev_ids@GOTPCREL(%rip), %rdi
	movl	%ebx, %esi
	movl	%ebx, %edx
	callq	_ida_alloc_range
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_5
## %bb.3:
	movq	%r14, %r12
	addq	$8, %r12
	movl	%ebx, 8(%r14)
	movq	_nsim_bus@GOTPCREL(%rip), %rax
	movq	%rax, 24(%r14)
	movq	_nsim_bus_dev_type@GOTPCREL(%rip), %rax
	movq	%rax, 16(%r14)
	movl	%r15d, (%r14)
	movq	%r12, %rdi
	callq	_device_register
	testl	%eax, %eax
	je	LBB0_7
## %bb.4:
	movl	%eax, %ebx
	movl	(%r12), %esi
	movq	_nsim_bus_dev_ids@GOTPCREL(%rip), %rdi
	callq	_ida_free
LBB0_5:
	movq	%r14, %rdi
	callq	_kfree
	jmp	LBB0_6
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_7:
	movq	%r14, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_nsim_bus_dev_ids,4,2           ## @nsim_bus_dev_ids
	.comm	_nsim_bus,4,2                   ## @nsim_bus
	.comm	_nsim_bus_dev_type,4,2          ## @nsim_bus_dev_type
	.no_dead_strip	_nsim_bus_dev_new
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nsim_bus_dev_new
_nsim_bus_dev_new:                      ; @nsim_bus_dev_new
	.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
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x22, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	w0, #32
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
	ldr	w3, [x22]
Lloh2:
	adrp	x0, _nsim_bus_dev_ids@GOTPAGE
Lloh3:
	ldr	x0, [x0, _nsim_bus_dev_ids@GOTPAGEOFF]
	mov	x1, x20
	mov	x2, x20
	bl	_ida_alloc_range
	mov	x20, x0
	tbnz	w0, #31, LBB0_4
; %bb.2:
	mov	x22, x19
	str	w20, [x22, #8]!
Lloh4:
	adrp	x8, _nsim_bus@GOTPAGE
Lloh5:
	ldr	x8, [x8, _nsim_bus@GOTPAGEOFF]
Lloh6:
	adrp	x9, _nsim_bus_dev_type@GOTPAGE
Lloh7:
	ldr	x9, [x9, _nsim_bus_dev_type@GOTPAGEOFF]
	stp	x9, x8, [x19, #16]
	str	w21, [x19]
	mov	x0, x22
	bl	_device_register
	cbz	w0, LBB0_7
; %bb.3:
	mov	x20, x0
	ldr	w1, [x22]
Lloh8:
	adrp	x0, _nsim_bus_dev_ids@GOTPAGE
Lloh9:
	ldr	x0, [x0, _nsim_bus_dev_ids@GOTPAGEOFF]
	bl	_ida_free
LBB0_4:
	mov	x0, x19
	bl	_kfree
	b	LBB0_6
LBB0_5:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_6:
	mov	x0, x20
	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
	b	_ERR_PTR
LBB0_7:
	mov	x0, x19
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_nsim_bus_dev_ids,4,2           ; @nsim_bus_dev_ids
	.comm	_nsim_bus,4,2                   ; @nsim_bus
	.comm	_nsim_bus_dev_type,4,2          ; @nsim_bus_dev_type
	.no_dead_strip	_nsim_bus_dev_new
.subsections_via_symbols
