	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_brcms_led_register             ## -- Begin function brcms_led_register
	.p2align	4, 0x90
_brcms_led_register:                    ## @brcms_led_register
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	40(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	(%rax), %r15
	movq	%r15, -80(%rbp)
	leaq	4(%r15), %rax
	movq	%rax, -72(%rbp)
	leaq	8(%r15), %rax
	movq	%rax, -64(%rbp)
	leaq	12(%r15), %rax
	movq	%rax, -56(%rbp)
	movl	$4294967295, %eax               ## imm = 0xFFFFFFFF
	movq	%rax, (%rdi)
	movl	16(%r15), %edi
	callq	_gpio_is_valid
	testl	%eax, %eax
	je	LBB0_8
## %bb.1:
	movq	_BRCMS_LED_NO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_8
## %bb.2:
	movq	_BRCMS_LED_BEH_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_BRCMS_LED_RADIO@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	(%r15), %r12d
	movl	%ecx, %esi
	andl	%r12d, %esi
	xorl	%ebx, %ebx
	cmpl	%edx, %esi
	je	LBB0_6
## %bb.3:
	decq	%rax
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rbx, %rax
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-72(%rbp,%rbx,8), %rsi
	movl	(%rsi), %r12d
	movl	%ecx, %esi
	andl	%r12d, %esi
	incq	%rbx
	cmpl	%edx, %esi
	jne	LBB0_4
LBB0_6:
	addl	16(%r15), %ebx
	movq	_BRCMS_LED_AL_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r12d
	setne	%r13b
	cmpl	$-1, %ebx
	je	LBB0_8
## %bb.7:
	movl	%ebx, %edi
	callq	_gpio_is_valid
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	testl	%r12d, %r12d
	je	LBB0_10
## %bb.11:
	movq	_GPIOF_OUT_INIT_HIGH@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_8:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_21:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_23
## %bb.22:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_GPIOF_OUT_INIT_LOW@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movl	%ebx, %edi
	callq	_gpio_request_one
	testl	%eax, %eax
	je	LBB0_16
## %bb.13:
	movl	%eax, %r15d
	movl	12(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_14
LBB0_16:
	movl	%ebx, %edi
	movl	$1, %esi
	callq	_gpio_direction_output
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movl	%eax, %r15d
	movl	12(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_14:
	movl	%ebx, %edx
LBB0_15:
	movl	%r15d, %ecx
	callq	_wiphy_err
	jmp	LBB0_21
LBB0_18:
	movl	8(%r14), %r15d
	movl	12(%r14), %edi
	callq	_wiphy_name
	leaq	L_.str.3(%rip), %rdx
	movl	%r15d, %edi
	movl	$4, %esi
	movq	%rax, %rcx
	callq	_snprintf
	movl	8(%r14), %eax
	leaq	16(%r14), %r15
	movl	%eax, 16(%r14)
	movq	32(%r14), %rax
	movl	(%rax), %edi
	callq	_ieee80211_get_radio_led_name
	movl	%eax, 24(%r14)
	movq	_brcms_led_brightness_set@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r14)
	movl	12(%r14), %edi
	callq	_wiphy_dev
	movl	%eax, %edi
	movq	%r15, %rsi
	callq	_led_classdev_register
	movl	8(%r14), %edx
	movl	12(%r14), %edi
	testl	%eax, %eax
	je	LBB0_20
## %bb.19:
	movl	%eax, %r15d
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_15
LBB0_20:
	xorl	%r15d, %r15d
	movb	%r13b, %r15b
	leaq	L_.str.5(%rip), %rsi
	movl	%ebx, %ecx
	callq	_wiphy_info
	movl	%ebx, (%r14)
	movl	%r15d, 4(%r14)
	xorl	%r15d, %r15d
	jmp	LBB0_21
LBB0_23:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_BRCMS_LED_NO,4,2               ## @BRCMS_LED_NO
	.comm	_BRCMS_LED_BEH_MASK,4,2         ## @BRCMS_LED_BEH_MASK
	.comm	_BRCMS_LED_RADIO,4,2            ## @BRCMS_LED_RADIO
	.comm	_BRCMS_LED_AL_MASK,4,2          ## @BRCMS_LED_AL_MASK
	.comm	_GPIOF_OUT_INIT_HIGH,4,2        ## @GPIOF_OUT_INIT_HIGH
	.comm	_GPIOF_OUT_INIT_LOW,4,2         ## @GPIOF_OUT_INIT_LOW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"radio on"

L_.str.1:                               ## @.str.1
	.asciz	"requesting led gpio %d failed (err: %d)\n"

L_.str.2:                               ## @.str.2
	.asciz	"cannot set led gpio %d to output (err: %d)\n"

L_.str.3:                               ## @.str.3
	.asciz	"brcmsmac-%s:radio"

	.comm	_brcms_led_brightness_set,4,2   ## @brcms_led_brightness_set
L_.str.4:                               ## @.str.4
	.asciz	"cannot register led device: %s (err: %d)\n"

L_.str.5:                               ## @.str.5
	.asciz	"registered radio enabled led device: %s gpio: %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_brcms_led_register             ; -- Begin function brcms_led_register
	.p2align	2
_brcms_led_register:                    ; @brcms_led_register
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	ldr	x8, [x0, #40]
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldr	x20, [x8]
	add	x8, x20, #4
	stp	x20, x8, [sp, #8]
	add	x8, x20, #8
	add	x9, x20, #12
	stp	x8, x9, [sp, #24]
	movi	d0, #0x000000ffffffff
	str	d0, [x0]
	ldr	w0, [x20, #16]
	bl	_gpio_is_valid
	cbz	w0, LBB0_11
; %bb.1:
Lloh3:
	adrp	x8, _BRCMS_LED_NO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BRCMS_LED_NO@GOTPAGEOFF]
Lloh5:
	ldr	w13, [x8]
	cmp	w13, #1
	b.lt	LBB0_11
; %bb.2:
Lloh6:
	adrp	x8, _BRCMS_LED_BEH_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BRCMS_LED_BEH_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x8]
Lloh9:
	adrp	x8, _BRCMS_LED_RADIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BRCMS_LED_RADIO@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x8]
	ldr	w10, [x20]
	and	w8, w9, w10
	cmp	w8, w11
	b.ne	LBB0_4
; %bb.3:
	mov	w8, #0
	b	LBB0_7
LBB0_4:
	mov	x8, #0
	add	x10, sp, #8
	add	x12, x10, #8
	sub	x13, x13, #1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x13, x8
	b.eq	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x10, [x12, x8, lsl #3]
	ldr	w10, [x10]
	and	w14, w9, w10
	add	x8, x8, #1
	cmp	w14, w11
	b.ne	LBB0_5
LBB0_7:
	ldr	w9, [x20, #16]
	add	w20, w9, w8
Lloh12:
	adrp	x8, _BRCMS_LED_AL_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BRCMS_LED_AL_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	ands	w21, w8, w10
	cset	w22, ne
	cmn	w20, #1
	b.eq	LBB0_11
; %bb.8:
	mov	x0, x20
	bl	_gpio_is_valid
	cbz	w0, LBB0_11
; %bb.9:
Lloh15:
	adrp	x8, _GPIOF_OUT_INIT_HIGH@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GPIOF_OUT_INIT_HIGH@GOTPAGEOFF]
Lloh17:
	adrp	x9, _GPIOF_OUT_INIT_LOW@GOTPAGE
Lloh18:
	ldr	x9, [x9, _GPIOF_OUT_INIT_LOW@GOTPAGEOFF]
	cmp	w21, #0
	csel	x8, x8, x9, ne
	ldr	w1, [x8]
Lloh19:
	adrp	x2, l_.str@PAGE
Lloh20:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_gpio_request_one
	cbz	w0, LBB0_14
; %bb.10:
	mov	x21, x0
	ldr	w0, [x19, #12]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_16
LBB0_11:
Lloh23:
	adrp	x8, _ENODEV@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_12:
	ldr	x8, [sp, #40]
Lloh26:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh27:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.13:
	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
	add	sp, sp, #96
	ret
LBB0_14:
	mov	x0, x20
	mov	w1, #1
	bl	_gpio_direction_output
	cbz	w0, LBB0_18
; %bb.15:
	mov	x21, x0
	ldr	w0, [x19, #12]
Lloh29:
	adrp	x1, l_.str.2@PAGE
Lloh30:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_16:
	mov	x2, x20
LBB0_17:
	mov	x3, x21
	bl	_wiphy_err
	b	LBB0_12
LBB0_18:
	ldp	w21, w0, [x19, #8]
	bl	_wiphy_name
	mov	x3, x0
Lloh31:
	adrp	x2, l_.str.3@PAGE
Lloh32:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x21
	mov	w1, #4
	bl	_snprintf
	ldr	w8, [x19, #8]
	mov	x21, x19
	str	w8, [x21, #16]!
	ldr	x8, [x21, #16]
	ldr	w0, [x8]
	bl	_ieee80211_get_radio_led_name
Lloh33:
	adrp	x8, _brcms_led_brightness_set@GOTPAGE
Lloh34:
	ldr	x8, [x8, _brcms_led_brightness_set@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	stp	w8, w0, [x21, #4]
	ldr	w0, [x19, #12]
	bl	_wiphy_dev
	mov	x1, x21
	bl	_led_classdev_register
	mov	x21, x0
	ldp	w2, w0, [x19, #8]
	cbz	w21, LBB0_20
; %bb.19:
Lloh36:
	adrp	x1, l_.str.4@PAGE
Lloh37:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_17
LBB0_20:
Lloh38:
	adrp	x1, l_.str.5@PAGE
Lloh39:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x3, x20
	bl	_wiphy_info
	stp	w20, w22, [x19]
	b	LBB0_12
LBB0_21:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_BRCMS_LED_NO,4,2               ; @BRCMS_LED_NO
	.comm	_BRCMS_LED_BEH_MASK,4,2         ; @BRCMS_LED_BEH_MASK
	.comm	_BRCMS_LED_RADIO,4,2            ; @BRCMS_LED_RADIO
	.comm	_BRCMS_LED_AL_MASK,4,2          ; @BRCMS_LED_AL_MASK
	.comm	_GPIOF_OUT_INIT_HIGH,4,2        ; @GPIOF_OUT_INIT_HIGH
	.comm	_GPIOF_OUT_INIT_LOW,4,2         ; @GPIOF_OUT_INIT_LOW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"radio on"

l_.str.1:                               ; @.str.1
	.asciz	"requesting led gpio %d failed (err: %d)\n"

l_.str.2:                               ; @.str.2
	.asciz	"cannot set led gpio %d to output (err: %d)\n"

l_.str.3:                               ; @.str.3
	.asciz	"brcmsmac-%s:radio"

	.comm	_brcms_led_brightness_set,4,2   ; @brcms_led_brightness_set
l_.str.4:                               ; @.str.4
	.asciz	"cannot register led device: %s (err: %d)\n"

l_.str.5:                               ; @.str.5
	.asciz	"registered radio enabled led device: %s gpio: %d\n"

.subsections_via_symbols
