	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function zd1201_set_mode
_zd1201_set_mode:                       ## @zd1201_set_mode
	.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	%rdx, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_netdev_priv
	movq	%rax, %r15
	movq	_IW_ESSID_MAX_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	addl	$2, %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	cmpq	$0, 24(%r15)
	je	LBB0_3
## %bb.1:
	movl	(%rbx), %ecx
	movq	_IW_MODE_MASTER@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpl	(%rdx), %ecx
	je	LBB0_17
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_17
LBB0_3:
	movq	_ZD1201_RID_PROMISCUOUSMODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_zd1201_setconfig16
	testl	%eax, %eax
	jne	LBB0_17
## %bb.4:
	movq	_ARPHRD_ETHER@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	16(%r15), %rax
	movl	%ecx, (%rax)
	movl	(%rbx), %ecx
	cmpl	$128, %ecx
	jg	LBB0_7
## %bb.5:
	movq	_ZD1201_PORTTYPE_PSEUDOIBSS@GOTPCREL(%rip), %rbx
	cmpl	$8, %ecx
	je	LBB0_6
## %bb.11:
	cmpl	$128, %ecx
	jne	LBB0_2
## %bb.12:
	movq	_ARPHRD_IEEE80211@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
	leaq	l_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	$5, %edx
	callq	_zd1201_join
	movw	$1, %ax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movb	$1, %r13b
	jmp	LBB0_13
LBB0_7:
	cmpl	$129, %ecx
	je	LBB0_10
## %bb.8:
	cmpl	$130, %ecx
	jne	LBB0_2
## %bb.9:
	movq	_ZD1201_PORTTYPE_IBSS@GOTPCREL(%rip), %rbx
	jmp	LBB0_6
LBB0_10:
	movq	_ZD1201_PORTTYPE_BSS@GOTPCREL(%rip), %rbx
LBB0_6:
	xorl	%r13d, %r13d
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
LBB0_13:
	movswl	(%rbx), %edx
	movq	_ZD1201_RID_CNFPORTTYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_zd1201_setconfig16
	testl	%eax, %eax
	jne	LBB0_17
## %bb.14:
	cmpw	$0, (%r15)
	sete	%al
	orb	%al, %r13b
	jne	LBB0_16
## %bb.15:
	movq	%r15, %rdi
	callq	_zd1201_disable
	movl	4(%r15), %edi
	callq	_cpu_to_le16
	movl	%eax, (%r14)
	movq	%r14, %rdi
	addq	$2, %rdi
	movl	4(%r15), %edx
	movl	8(%r15), %esi
	callq	_memcpy
	movq	_ZD1201_RID_CNFDESIREDSSID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %ecx
	addl	$2, %ecx
	movq	%r15, %rdi
	movq	%r14, %rdx
	movl	$1, %r8d
	callq	_zd1201_setconfig
	testl	%eax, %eax
	jne	LBB0_17
LBB0_16:
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movw	%ax, (%r15)
	movq	%r15, %rdi
	callq	_zd1201_mac_reset
	xorl	%eax, %eax
LBB0_17:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_19
## %bb.18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_IW_ESSID_MAX_SIZE,4,2          ## @IW_ESSID_MAX_SIZE
	.comm	_IW_MODE_MASTER,4,2             ## @IW_MODE_MASTER
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ZD1201_RID_PROMISCUOUSMODE,4,2 ## @ZD1201_RID_PROMISCUOUSMODE
	.comm	_ARPHRD_ETHER,4,2               ## @ARPHRD_ETHER
	.comm	_ARPHRD_IEEE80211,4,2           ## @ARPHRD_IEEE80211
	.section	__TEXT,__const
l_.str:                                 ## @.str
	.asciz	"\000-*#\000"

	.comm	_ZD1201_PORTTYPE_PSEUDOIBSS,2,1 ## @ZD1201_PORTTYPE_PSEUDOIBSS
	.comm	_ZD1201_PORTTYPE_IBSS,2,1       ## @ZD1201_PORTTYPE_IBSS
	.comm	_ZD1201_PORTTYPE_BSS,2,1        ## @ZD1201_PORTTYPE_BSS
	.comm	_ZD1201_RID_CNFPORTTYPE,4,2     ## @ZD1201_RID_CNFPORTTYPE
	.comm	_ZD1201_RID_CNFDESIREDSSID,4,2  ## @ZD1201_RID_CNFDESIREDSSID
	.no_dead_strip	_zd1201_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function zd1201_set_mode
_zd1201_set_mode:                       ; @zd1201_set_mode
	.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
	sub	sp, sp, #16
	mov	x21, x2
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	bl	_netdev_priv
	mov	x19, x0
Lloh3:
	adrp	x22, _IW_ESSID_MAX_SIZE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _IW_ESSID_MAX_SIZE@GOTPAGEOFF]
	ldr	w8, [x22]
	add	w8, w8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x20, x9, x8
	mov	sp, x20
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	w8, [x21]
Lloh7:
	adrp	x9, _IW_MODE_MASTER@GOTPAGE
Lloh8:
	ldr	x9, [x9, _IW_MODE_MASTER@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_11
LBB0_2:
	mov	w0, #0
	b	LBB0_12
LBB0_3:
Lloh10:
	adrp	x8, _ZD1201_RID_PROMISCUOUSMODE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ZD1201_RID_PROMISCUOUSMODE@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_zd1201_setconfig16
	cbnz	w0, LBB0_12
; %bb.4:
Lloh13:
	adrp	x8, _ARPHRD_ETHER@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ARPHRD_ETHER@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x8]
	ldr	x8, [x19, #16]
	str	w9, [x8]
	ldr	w9, [x21]
	cmp	w9, #128
	b.gt	LBB0_8
; %bb.5:
	cmp	w9, #8
	b.eq	LBB0_14
; %bb.6:
	cmp	w9, #128
	b.ne	LBB0_11
; %bb.7:
Lloh16:
	adrp	x9, _ARPHRD_IEEE80211@GOTPAGE
Lloh17:
	ldr	x9, [x9, _ARPHRD_IEEE80211@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	str	w9, [x8]
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	w2, #5
	bl	_zd1201_join
Lloh21:
	adrp	x8, _ZD1201_PORTTYPE_PSEUDOIBSS@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ZD1201_PORTTYPE_PSEUDOIBSS@GOTPAGEOFF]
	mov	w21, #1
	b	LBB0_16
LBB0_8:
	cmp	w9, #129
	b.eq	LBB0_15
; %bb.9:
	cmp	w9, #130
	b.ne	LBB0_11
; %bb.10:
	mov	w21, #0
Lloh23:
	adrp	x8, _ZD1201_PORTTYPE_IBSS@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ZD1201_PORTTYPE_IBSS@GOTPAGEOFF]
	b	LBB0_16
LBB0_11:
Lloh25:
	adrp	x8, _EINVAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	ldur	x8, [x29, #-40]
Lloh28:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh29:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_20
; %bb.13:
	sub	sp, x29, #32
	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
LBB0_14:
	mov	w21, #0
Lloh31:
	adrp	x8, _ZD1201_PORTTYPE_PSEUDOIBSS@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ZD1201_PORTTYPE_PSEUDOIBSS@GOTPAGEOFF]
	b	LBB0_16
LBB0_15:
	mov	w21, #0
Lloh33:
	adrp	x8, _ZD1201_PORTTYPE_BSS@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ZD1201_PORTTYPE_BSS@GOTPAGEOFF]
LBB0_16:
	ldrsh	w2, [x8]
Lloh35:
	adrp	x8, _ZD1201_RID_CNFPORTTYPE@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ZD1201_RID_CNFPORTTYPE@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_zd1201_setconfig16
	cbnz	w0, LBB0_12
; %bb.17:
	ldrh	w8, [x19]
	cmp	w8, #0
	cset	w8, eq
	orr	w8, w21, w8
	tbnz	w8, #0, LBB0_19
; %bb.18:
	mov	x0, x19
	bl	_zd1201_disable
	ldr	w0, [x19, #4]
	bl	_cpu_to_le16
	mov	x8, x20
	str	w0, [x8], #2
	ldp	w2, w1, [x19, #4]
	mov	x0, x8
	bl	_memcpy
Lloh38:
	adrp	x8, _ZD1201_RID_CNFDESIREDSSID@GOTPAGE
Lloh39:
	ldr	x8, [x8, _ZD1201_RID_CNFDESIREDSSID@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	ldr	w8, [x22]
	add	w3, w8, #2
	mov	x0, x19
	mov	x2, x20
	mov	w4, #1
	bl	_zd1201_setconfig
	cbnz	w0, LBB0_12
LBB0_19:
	strh	w21, [x19]
	mov	x0, x19
	bl	_zd1201_mac_reset
	b	LBB0_2
LBB0_20:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_IW_ESSID_MAX_SIZE,4,2          ; @IW_ESSID_MAX_SIZE
	.comm	_IW_MODE_MASTER,4,2             ; @IW_MODE_MASTER
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ZD1201_RID_PROMISCUOUSMODE,4,2 ; @ZD1201_RID_PROMISCUOUSMODE
	.comm	_ARPHRD_ETHER,4,2               ; @ARPHRD_ETHER
	.comm	_ARPHRD_IEEE80211,4,2           ; @ARPHRD_IEEE80211
	.section	__TEXT,__const
l_.str:                                 ; @.str
	.asciz	"\000-*#\000"

	.comm	_ZD1201_PORTTYPE_PSEUDOIBSS,2,1 ; @ZD1201_PORTTYPE_PSEUDOIBSS
	.comm	_ZD1201_PORTTYPE_IBSS,2,1       ; @ZD1201_PORTTYPE_IBSS
	.comm	_ZD1201_PORTTYPE_BSS,2,1        ; @ZD1201_PORTTYPE_BSS
	.comm	_ZD1201_RID_CNFPORTTYPE,4,2     ; @ZD1201_RID_CNFPORTTYPE
	.comm	_ZD1201_RID_CNFDESIREDSSID,4,2  ; @ZD1201_RID_CNFDESIREDSSID
	.no_dead_strip	_zd1201_set_mode
.subsections_via_symbols
