	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setregdomain_cb
_setregdomain_cb:                       ## @setregdomain_cb
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movl	%edi, %r14d
	xorl	%eax, %eax
	callq	_getregdata
	movq	%rax, %rbx
	movq	(%r15), %rsi
	movq	_NO_COUNTRY@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	je	LBB0_10
## %bb.1:
	movq	%rbx, %rdi
	callq	_lib80211_country_findbycc
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	movq	(%r15), %rdx
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_errx
LBB0_3:
	movq	8(%r12), %rax
	movl	8(%r15), %esi
	cmpl	%esi, (%rax)
	je	LBB0_10
## %bb.4:
	movq	%rbx, %rdi
	callq	_lib80211_regdomain_findbysku
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	8(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_10
## %bb.7:
	cmpq	%r12, %rcx
	je	LBB0_10
## %bb.8:
	movl	(%r12), %ecx
	movl	4(%r12), %edx
	movl	(%rax), %r8d
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_9
LBB0_5:
	movl	(%r12), %ecx
	movl	4(%r12), %edx
	movl	8(%r15), %r8d
	leaq	L_.str.1(%rip), %rsi
LBB0_9:
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_errx
LBB0_10:
	movq	_MAXCHAN@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	callq	_IEEE80211_DEVCAPS_SIZE
	movl	%eax, %edi
	callq	_malloc
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_errx
LBB0_12:
	movq	(%rbx), %rax
	movq	%rax, 40(%r12)
	movl	%r14d, %edi
	movq	%r12, %rsi
	callq	_getdevcaps
	movq	40(%r12), %rdi
	callq	_IEEE80211_REGDOMAIN_SIZE
	movl	%eax, %edi
	callq	_malloc
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_14
## %bb.13:
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_errx
LBB0_14:
	movups	(%r15), %xmm0
	movups	%xmm0, 24(%r13)
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_regdomain_makechannels
	movq	_verbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_20
## %bb.15:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movl	$58, %edi
	callq	_LINE_INIT
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_print_regdomain
	xorl	%eax, %eax
	callq	_LINE_BREAK
	movq	_chaninfo@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.16:
	callq	_free
LBB0_17:
	movq	%r13, %r15
	addq	$16, %r15
	movq	%r15, %rdi
	callq	_IEEE80211_CHANINFO_SPACE
	movl	%eax, %edi
	callq	_malloc
	movq	%rax, %rbx
	movq	%rax, (%r14)
	testq	%rax, %rax
	jne	LBB0_19
## %bb.18:
	leaq	L_.str.5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_errx
	movq	(%r14), %rbx
LBB0_19:
	movq	%r15, %rdi
	callq	_IEEE80211_CHANINFO_SPACE
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_memcpy
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %edi
	movq	%r15, %rsi
	movl	$1, %edx
	movl	$1, %ecx
	callq	_print_channels
LBB0_20:
	cmpq	$0, 16(%r13)
	jne	LBB0_22
## %bb.21:
	leaq	L_.str.6(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_errx
LBB0_22:
	movq	_IEEE80211_IOC_REGDOMAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r13, %rdi
	callq	_IEEE80211_REGDOMAIN_SPACE
	movl	%r14d, %edi
	movl	%ebx, %esi
	xorl	%edx, %edx
	movl	%eax, %ecx
	movq	%r13, %r8
	callq	_set80211
	movq	%r13, %rdi
	callq	_free
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_free                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NO_COUNTRY,8,3                 ## @NO_COUNTRY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown ISO country code %d"

L_.str.1:                               ## @.str.1
	.asciz	"country %s (%s) is not usable with regdomain %d"

L_.str.2:                               ## @.str.2
	.asciz	"country %s (%s) is not usable with regdomain %s"

	.comm	_MAXCHAN,8,3                    ## @MAXCHAN
L_.str.3:                               ## @.str.3
	.asciz	"no space for device capabilities"

L_.str.4:                               ## @.str.4
	.asciz	"no space for regdomain request"

	.comm	_verbose,8,3                    ## @verbose
	.comm	_chaninfo,8,3                   ## @chaninfo
L_.str.5:                               ## @.str.5
	.asciz	"no space for channel list"

L_.str.6:                               ## @.str.6
	.asciz	"no channels calculated"

	.comm	_IEEE80211_IOC_REGDOMAIN,4,2    ## @IEEE80211_IOC_REGDOMAIN
	.no_dead_strip	_setregdomain_cb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setregdomain_cb
_setregdomain_cb:                       ; @setregdomain_cb
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	bl	_getregdata
	ldr	x1, [x20]
Lloh0:
	adrp	x8, _NO_COUNTRY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NO_COUNTRY@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x1, x8
	b.eq	LBB0_9
; %bb.1:
	mov	x22, x0
	bl	_lib80211_country_findbycc
	mov	x21, x0
	cbnz	x0, LBB0_3
; %bb.2:
	ldr	x8, [x20]
	str	x8, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_3:
	ldr	x8, [x21, #8]
	ldr	w8, [x8]
	ldr	w1, [x20, #8]
	cmp	w8, w1
	b.eq	LBB0_9
; %bb.4:
	mov	x0, x22
	bl	_lib80211_regdomain_findbysku
	cbz	x0, LBB0_7
; %bb.5:
	ldr	x8, [x0, #8]
	cmp	x8, #0
	ccmp	x8, x21, #4, ne
	b.eq	LBB0_9
; %bb.6:
	ldp	w9, w8, [x21]
	ldr	w10, [x0]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh5:
	adrp	x1, l_.str.2@PAGE
Lloh6:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_8
LBB0_7:
	ldp	w9, w8, [x21]
	ldr	w10, [x20, #8]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_8:
	mov	w0, #1
	bl	_errx
LBB0_9:
Lloh9:
	adrp	x22, _MAXCHAN@GOTPAGE
Lloh10:
	ldr	x22, [x22, _MAXCHAN@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_IEEE80211_DEVCAPS_SIZE
	bl	_malloc
	mov	x21, x0
	cbnz	x0, LBB0_11
; %bb.10:
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_11:
	ldr	x8, [x22]
	str	x8, [x21, #40]
	mov	x0, x19
	mov	x1, x21
	bl	_getdevcaps
	ldr	x0, [x21, #40]
	bl	_IEEE80211_REGDOMAIN_SIZE
	bl	_malloc
	mov	x22, x0
	cbnz	x0, LBB0_13
; %bb.12:
Lloh13:
	adrp	x1, l_.str.4@PAGE
Lloh14:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_13:
	ldr	q0, [x20]
	stur	q0, [x22, #24]
	mov	x0, x22
	mov	x1, x21
	bl	_regdomain_makechannels
Lloh15:
	adrp	x8, _verbose@GOTPAGE
Lloh16:
	ldr	x8, [x8, _verbose@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cbz	x8, LBB0_19
; %bb.14:
	mov	w0, #58
	bl	_LINE_INIT
	mov	x0, x20
	mov	w1, #1
	bl	_print_regdomain
	bl	_LINE_BREAK
Lloh18:
	adrp	x24, _chaninfo@GOTPAGE
Lloh19:
	ldr	x24, [x24, _chaninfo@GOTPAGEOFF]
	ldr	x0, [x24]
	cbz	x0, LBB0_16
; %bb.15:
	bl	_free
LBB0_16:
	add	x20, x22, #16
	mov	x0, x20
	bl	_IEEE80211_CHANINFO_SPACE
	bl	_malloc
	mov	x23, x0
	str	x0, [x24]
	cbnz	x0, LBB0_18
; %bb.17:
Lloh20:
	adrp	x1, l_.str.5@PAGE
Lloh21:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w0, #1
	bl	_errx
	ldr	x23, [x24]
LBB0_18:
	mov	x0, x20
	bl	_IEEE80211_CHANINFO_SPACE
	mov	x2, x0
	mov	x0, x23
	mov	x1, x20
	bl	_memcpy
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	mov	w3, #1
	bl	_print_channels
LBB0_19:
	ldr	x8, [x22, #16]
	cbnz	x8, LBB0_21
; %bb.20:
Lloh22:
	adrp	x1, l_.str.6@PAGE
Lloh23:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_21:
Lloh24:
	adrp	x8, _IEEE80211_IOC_REGDOMAIN@GOTPAGE
Lloh25:
	ldr	x8, [x8, _IEEE80211_IOC_REGDOMAIN@GOTPAGEOFF]
Lloh26:
	ldr	w20, [x8]
	mov	x0, x22
	bl	_IEEE80211_REGDOMAIN_SPACE
	mov	x3, x0
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	mov	x4, x22
	bl	_set80211
	mov	x0, x22
	bl	_free
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_free
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_NO_COUNTRY,8,3                 ; @NO_COUNTRY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown ISO country code %d"

l_.str.1:                               ; @.str.1
	.asciz	"country %s (%s) is not usable with regdomain %d"

l_.str.2:                               ; @.str.2
	.asciz	"country %s (%s) is not usable with regdomain %s"

	.comm	_MAXCHAN,8,3                    ; @MAXCHAN
l_.str.3:                               ; @.str.3
	.asciz	"no space for device capabilities"

l_.str.4:                               ; @.str.4
	.asciz	"no space for regdomain request"

	.comm	_verbose,8,3                    ; @verbose
	.comm	_chaninfo,8,3                   ; @chaninfo
l_.str.5:                               ; @.str.5
	.asciz	"no space for channel list"

l_.str.6:                               ; @.str.6
	.asciz	"no channels calculated"

	.comm	_IEEE80211_IOC_REGDOMAIN,4,2    ; @IEEE80211_IOC_REGDOMAIN
	.no_dead_strip	_setregdomain_cb
.subsections_via_symbols
