	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ideapad_register_rfkill
_ideapad_register_rfkill:               ## @ideapad_register_rfkill
	.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	%rdi, %r13
	movq	_no_bt_rfkill@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_1
## %bb.4:
	movq	_ideapad_rfk_data@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%esi, %r12
	leaq	(%r12,%r12,2), %rcx
	movq	(%rax,%rcx,8), %rdx
	movq	_RFKILL_TYPE_BLUETOOTH@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rdx
	jne	LBB0_2
## %bb.5:
	movq	8(%r13), %rdx
	movl	(%rdx), %edi
	movq	8(%rax,%rcx,8), %rsi
	movl	$1, %edx
	callq	_write_ec_cmd
	xorl	%r14d, %r14d
	jmp	LBB0_10
LBB0_1:
	movslq	%esi, %r12
LBB0_2:
	movq	16(%r13), %rax
	movq	%r12, %rcx
	shlq	$4, %rcx
	leaq	(%rax,%rcx), %r8
	movl	%esi, (%rax,%rcx)
	movq	%r13, 8(%rax,%rcx)
	movq	_ideapad_rfk_data@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	leaq	(%r12,%r12,2), %rbx
	movl	16(%rax,%rbx,8), %edi
	movq	24(%r13), %rsi
	movq	(%rax,%rbx,8), %rdx
	movq	_ideapad_rfk_ops@GOTPCREL(%rip), %rcx
	callq	_rfkill_alloc
	movq	(%r13), %rcx
	movl	%eax, (%rcx,%r12,4)
	testl	%eax, %eax
	je	LBB0_3
## %bb.6:
	movq	8(%r13), %rax
	movl	(%rax), %edi
	movq	(%r14), %rax
	movq	8(%rax,%rbx,8), %rsi
	decq	%rsi
	leaq	-48(%rbp), %rdx
	callq	_read_ec_data
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	testq	%rax, %rax
	jne	LBB0_8
## %bb.7:
	cmpq	$0, -48(%rbp)
	sete	%sil
	movq	%rsi, -48(%rbp)
LBB0_8:
	movq	(%r13), %rax
	movl	(%rax,%r12,4), %edi
	callq	_rfkill_init_sw_state
	movq	(%r13), %rax
	movl	(%rax,%r12,4), %edi
	callq	_rfkill_register
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %r15d
	movq	(%r13), %rax
	movl	(%rax,%r12,4), %edi
	callq	_rfkill_destroy
	movl	%r15d, %r14d
	jmp	LBB0_10
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_10:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_no_bt_rfkill,8,3               ## @no_bt_rfkill
	.comm	_ideapad_rfk_data,8,3           ## @ideapad_rfk_data
	.comm	_RFKILL_TYPE_BLUETOOTH,8,3      ## @RFKILL_TYPE_BLUETOOTH
	.comm	_ideapad_rfk_ops,4,2            ## @ideapad_rfk_ops
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_ideapad_register_rfkill
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ideapad_register_rfkill
_ideapad_register_rfkill:               ; @ideapad_register_rfkill
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
                                        ; kill: def $w1 killed $w1 def $x1
	mov	x19, x0
Lloh0:
	adrp	x8, _no_bt_rfkill@GOTPAGE
Lloh1:
	ldr	x8, [x8, _no_bt_rfkill@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x20, _ideapad_rfk_data@GOTPAGE
Lloh4:
	ldr	x20, [x20, _ideapad_rfk_data@GOTPAGEOFF]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	x8, [x20]
	sxtw	x21, w1
	mov	w9, #24
	smull	x9, w1, w9
	ldr	x9, [x8, x9]
Lloh5:
	adrp	x10, _RFKILL_TYPE_BLUETOOTH@GOTPAGE
Lloh6:
	ldr	x10, [x10, _RFKILL_TYPE_BLUETOOTH@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_4
; %bb.2:
	ldr	x9, [x19, #8]
	ldr	w0, [x9]
	mov	w9, #24
	madd	x8, x21, x9, x8
	ldr	x1, [x8, #8]
	mov	w2, #1
	bl	_write_ec_cmd
	mov	w20, #0
	b	LBB0_11
LBB0_3:
	mov	x8, x1
	sxtw	x21, w8
LBB0_4:
	ldp	x9, x8, [x19, #16]
	add	x4, x9, x21, lsl #4
	str	w1, [x4]
	str	x19, [x4, #8]
	ldr	x9, [x20]
	mov	w10, #24
	madd	x9, x21, x10, x9
	ldr	w0, [x9, #16]
	ldr	x2, [x9]
Lloh8:
	adrp	x3, _ideapad_rfk_ops@GOTPAGE
Lloh9:
	ldr	x3, [x3, _ideapad_rfk_ops@GOTPAGEOFF]
	mov	x1, x8
	bl	_rfkill_alloc
	ldr	x8, [x19]
	str	w0, [x8, x21, lsl #2]
	cbz	w0, LBB0_7
; %bb.5:
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	ldr	x8, [x20]
	mov	w9, #24
	madd	x8, x21, x9, x8
	ldr	x8, [x8, #8]
	sub	x1, x8, #1
	add	x2, sp, #8
	bl	_read_ec_data
	cbz	x0, LBB0_8
; %bb.6:
	mov	x1, #0
	b	LBB0_9
LBB0_7:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_8:
	ldr	x8, [sp, #8]
	cmp	x8, #0
	cset	w1, eq
	str	x1, [sp, #8]
LBB0_9:
	ldr	x8, [x19]
	lsl	x20, x21, #2
	ldr	w0, [x8, x20]
	bl	_rfkill_init_sw_state
	ldr	x8, [x19]
	ldr	w0, [x8, x20]
	bl	_rfkill_register
	mov	x20, x0
	cbz	w0, LBB0_11
; %bb.10:
	ldr	x8, [x19]
	ldr	w0, [x8, x21, lsl #2]
	bl	_rfkill_destroy
LBB0_11:
	mov	x0, x20
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_no_bt_rfkill,8,3               ; @no_bt_rfkill
	.comm	_ideapad_rfk_data,8,3           ; @ideapad_rfk_data
	.comm	_RFKILL_TYPE_BLUETOOTH,8,3      ; @RFKILL_TYPE_BLUETOOTH
	.comm	_ideapad_rfk_ops,4,2            ; @ideapad_rfk_ops
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_ideapad_register_rfkill
.subsections_via_symbols
