	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function um_new_card
_um_new_card:                           ## @um_new_card
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	xorl	%edi, %edi
	movl	$16, %esi
	callq	_diva_os_malloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %r15
	leaq	8(%rax), %rdi
	movq	%r14, %rsi
	movl	$4, %edx
	callq	_memcpy
	movq	$0, -40(%rbp)
	movq	_IDI_SYNC_REQ_XDI_GET_LOGICAL_ADAPTER_NUMBER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	leaq	-48(%rbp), %rdi
	callq	*8(%r15)
	movl	-48(%rbp), %ebx
	movl	%ebx, (%r15)
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_diva_user_mode_idi_create_adapter
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movslq	%ebx, %rdi
	callq	_DBG_ERR
	xorl	%edi, %edi
	movq	%r15, %rsi
	callq	_diva_os_free
	jmp	LBB0_4
LBB0_5:
	leaq	L_.str(%rip), %rdi
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DBG_ERR                        ## TAILCALL
LBB0_2:
	movq	_ll_lock@GOTPCREL(%rip), %r12
	leaq	L_.str.1(%rip), %r14
	leaq	-52(%rbp), %rbx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_diva_os_enter_spin_lock
	addq	$4, %r15
	movq	_cards@GOTPCREL(%rip), %rsi
	movq	%r15, %rdi
	callq	_list_add_tail
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_diva_os_leave_spin_lock
LBB0_4:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot get buffer for card"

	.comm	_IDI_SYNC_REQ_XDI_GET_LOGICAL_ADAPTER_NUMBER,4,2 ## @IDI_SYNC_REQ_XDI_GET_LOGICAL_ADAPTER_NUMBER
	.comm	_ll_lock,4,2                    ## @ll_lock
L_.str.1:                               ## @.str.1
	.asciz	"add card"

	.comm	_cards,4,2                      ## @cards
	.no_dead_strip	_um_new_card
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function um_new_card
_um_new_card:                           ; @um_new_card
	.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
	mov	x20, x0
	mov	w0, #0
	mov	w1, #16
	bl	_diva_os_malloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	add	x0, x0, #8
	mov	x1, x20
	mov	w2, #4
	bl	_memcpy
	str	xzr, [sp, #24]
Lloh0:
	adrp	x8, _IDI_SYNC_REQ_XDI_GET_LOGICAL_ADAPTER_NUMBER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IDI_SYNC_REQ_XDI_GET_LOGICAL_ADAPTER_NUMBER@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #20]
	ldr	x8, [x19, #8]
	add	x0, sp, #16
	blr	x8
	ldr	w21, [sp, #16]
	str	w21, [x19]
	mov	x0, x20
	mov	x1, x21
	bl	_diva_user_mode_idi_create_adapter
	cbz	w0, LBB0_4
; %bb.2:
	sxtw	x0, w21
	bl	_DBG_ERR
	mov	w0, #0
	mov	x1, x19
	bl	_diva_os_free
	b	LBB0_5
LBB0_3:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	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	_DBG_ERR
LBB0_4:
Lloh5:
	adrp	x20, _ll_lock@GOTPAGE
Lloh6:
	ldr	x20, [x20, _ll_lock@GOTPAGEOFF]
Lloh7:
	adrp	x21, l_.str.1@PAGE
Lloh8:
	add	x21, x21, l_.str.1@PAGEOFF
	add	x1, sp, #12
	mov	x0, x20
	mov	x2, x21
	bl	_diva_os_enter_spin_lock
	add	x0, x19, #4
Lloh9:
	adrp	x1, _cards@GOTPAGE
Lloh10:
	ldr	x1, [x1, _cards@GOTPAGEOFF]
	bl	_list_add_tail
	add	x1, sp, #12
	mov	x0, x20
	mov	x2, x21
	bl	_diva_os_leave_spin_lock
LBB0_5:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot get buffer for card"

	.comm	_IDI_SYNC_REQ_XDI_GET_LOGICAL_ADAPTER_NUMBER,4,2 ; @IDI_SYNC_REQ_XDI_GET_LOGICAL_ADAPTER_NUMBER
	.comm	_ll_lock,4,2                    ; @ll_lock
l_.str.1:                               ; @.str.1
	.asciz	"add card"

	.comm	_cards,4,2                      ; @cards
	.no_dead_strip	_um_new_card
.subsections_via_symbols
