	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function oaktrail_rfkill_new
_oaktrail_rfkill_new:                   ## @oaktrail_rfkill_new
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %rbx
	movl	%esi, %edx
	movq	_oaktrail_device@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_oaktrail_rfkill_ops@GOTPCREL(%rip), %rcx
	movq	%rbx, %r8
	callq	_rfkill_alloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%rax, %r14
	movq	_OT_EC_DEVICE_STATE_ADDRESS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-24(%rbp), %rsi
	callq	_ec_read
	andq	-24(%rbp), %rbx
	xorl	%esi, %esi
	cmpq	$1, %rbx
	setne	%sil
	movq	%r14, %rdi
	callq	_rfkill_init_sw_state
	movq	%r14, %rdi
	callq	_rfkill_register
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_rfkill_destroy
	movl	%ebx, %edi
	callq	_ERR_PTR
	movq	%rax, %r14
LBB0_3:
	movq	%r14, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_oaktrail_device,8,3            ## @oaktrail_device
	.comm	_oaktrail_rfkill_ops,4,2        ## @oaktrail_rfkill_ops
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_OT_EC_DEVICE_STATE_ADDRESS,4,2 ## @OT_EC_DEVICE_STATE_ADDRESS
	.no_dead_strip	_oaktrail_rfkill_new
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function oaktrail_rfkill_new
_oaktrail_rfkill_new:                   ; @oaktrail_rfkill_new
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x2
	mov	x2, x1
Lloh0:
	adrp	x8, _oaktrail_device@GOTPAGE
Lloh1:
	ldr	x8, [x8, _oaktrail_device@GOTPAGEOFF]
Lloh2:
	ldr	x1, [x8]
Lloh3:
	adrp	x3, _oaktrail_rfkill_ops@GOTPAGE
Lloh4:
	ldr	x3, [x3, _oaktrail_rfkill_ops@GOTPAGEOFF]
	mov	x4, x20
	bl	_rfkill_alloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
Lloh5:
	adrp	x8, _OT_EC_DEVICE_STATE_ADDRESS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _OT_EC_DEVICE_STATE_ADDRESS@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	add	x1, sp, #8
	bl	_ec_read
	ldr	x8, [sp, #8]
	and	x8, x8, x20
	cmp	x8, #1
	cset	w1, ne
	mov	x0, x19
	bl	_rfkill_init_sw_state
	mov	x0, x19
	bl	_rfkill_register
	cbz	w0, LBB0_3
; %bb.2:
	mov	x20, x0
	mov	x0, x19
	bl	_rfkill_destroy
	mov	x0, x20
	bl	_ERR_PTR
	mov	x19, x0
LBB0_3:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_4:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_ERR_PTR
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_oaktrail_device,8,3            ; @oaktrail_device
	.comm	_oaktrail_rfkill_ops,4,2        ; @oaktrail_rfkill_ops
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_OT_EC_DEVICE_STATE_ADDRESS,4,2 ; @OT_EC_DEVICE_STATE_ADDRESS
	.no_dead_strip	_oaktrail_rfkill_new
.subsections_via_symbols
