	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wil_vif_add                    ## -- Begin function wil_vif_add
	.p2align	4, 0x90
_wil_vif_add:                           ## @wil_vif_add
	.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, %r15
	movq	%rdi, %r12
	movq	%rsi, %rdi
	callq	_vif_to_ndev
	movq	%rax, %r14
	movq	%r15, %rdi
	callq	_vif_to_wdev
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_wil_has_active_ifaces
	movl	%eax, %r13d
	xorl	%eax, %eax
	callq	_ASSERT_RTNL
	movq	(%r12), %rax
	movq	(%r15), %rdx
	cmpq	$0, (%rax,%rdx,8)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_dev_err
	movq	_EEXIST@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_2:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	testl	%r13d, %r13d
	je	LBB0_5
## %bb.3:
	testq	%rdx, %rdx
	je	LBB0_5
## %bb.4:
	movl	4(%r14), %eax
	movl	(%rcx), %ecx
	movq	%r12, %rdi
	movq	%rdx, %rsi
	movl	%eax, %edx
	callq	_wmi_port_allocate
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
LBB0_5:
	movq	%r14, %rdi
	callq	_register_netdevice
	testl	%eax, %eax
	js	LBB0_6
## %bb.9:
	movq	(%r12), %rax
	movq	(%r15), %rcx
	movq	%r15, (%rax,%rcx,8)
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_6:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_dev_err
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_10
## %bb.7:
	movq	(%r15), %rsi
	testq	%rsi, %rsi
	je	LBB0_10
## %bb.8:
	movq	%r12, %rdi
	callq	_wmi_port_delete
LBB0_10:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VIF with mid %d already in use\n"

	.comm	_EEXIST,4,2                     ## @EEXIST
L_.str.1:                               ## @.str.1
	.asciz	"Failed to register netdev: %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wil_vif_add                    ; -- Begin function wil_vif_add
	.p2align	2
_wil_vif_add:                           ; @wil_vif_add
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x19, x0
	mov	x0, x1
	bl	_vif_to_ndev
	mov	x21, x0
	mov	x0, x20
	bl	_vif_to_wdev
	mov	x23, x0
	mov	x0, x19
	mov	w1, #1
	mov	w2, #0
	bl	_wil_has_active_ifaces
	mov	x22, x0
	bl	_ASSERT_RTNL
	ldr	x8, [x19]
	ldr	x2, [x20]
	ldr	x8, [x8, x2, lsl #3]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_dev_err
Lloh2:
	adrp	x8, _EEXIST@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_10
LBB0_2:
	cbz	w22, LBB0_5
; %bb.3:
	cbz	x2, LBB0_5
; %bb.4:
	ldr	w8, [x21, #4]
	ldr	w3, [x23]
	mov	x0, x19
	mov	x1, x2
	mov	x2, x8
	bl	_wmi_port_allocate
	mov	x23, x0
	cbnz	w0, LBB0_10
LBB0_5:
	mov	x0, x21
	bl	_register_netdevice
	tbnz	w0, #31, LBB0_7
; %bb.6:
	mov	w23, #0
	ldr	x8, [x19]
	ldr	x9, [x20]
	str	x20, [x8, x9, lsl #3]
	b	LBB0_10
LBB0_7:
	mov	x23, x0
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x2, x23
	bl	_dev_err
	cbz	w22, LBB0_10
; %bb.8:
	ldr	x1, [x20]
	cbz	x1, LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_wmi_port_delete
LBB0_10:
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VIF with mid %d already in use\n"

	.comm	_EEXIST,4,2                     ; @EEXIST
l_.str.1:                               ; @.str.1
	.asciz	"Failed to register netdev: %d\n"

.subsections_via_symbols
