	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gemini_poweroff_probe
_gemini_poweroff_probe:                 ## @gemini_poweroff_probe
	.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, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$16, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r12
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_platform_get_resource
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_devm_ioremap_resource
	movq	%rax, (%r12)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	movq	(%r12), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
LBB0_5:
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_platform_get_irq
	testl	%eax, %eax
	je	LBB0_13
## %bb.8:
	movl	%eax, %r15d
	movq	%r14, 8(%r12)
	movq	_GEMINI_PWC_IDREG@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r12), %rdi
	callq	_readl
	andl	$-256, %eax
	movq	_GEMINI_PWC_ID@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_14
## %bb.9:
	movq	_GEMINI_PWC_CTRLREG@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	(%r12), %rdi
	callq	_readl
	movq	_GEMINI_CTRL_ENABLE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	(%rbx), %rsi
	addq	(%r12), %rsi
	movl	%eax, %edi
	callq	_writel
	movq	(%rbx), %rdi
	addq	(%r12), %rdi
	callq	_readl
	movq	_GEMINI_CTRL_IRQ_CLR@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	(%rbx), %rsi
	addq	(%r12), %rsi
	movl	%eax, %edi
	callq	_writel
	movq	_GEMINI_PWC_STATREG@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rdi
	addq	(%r12), %rdi
	callq	_readl
	testb	$112, %al
	jne	LBB0_10
## %bb.11:
	movq	(%rbx), %rdi
	addq	(%r12), %rdi
	callq	_readl
	movq	_GEMINI_CTRL_IRQ_CLR@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	(%rbx), %rsi
	addq	(%r12), %rsi
	movl	%eax, %edi
	callq	_writel
	movq	_gemini_powerbutton_interrupt@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %r8
	movq	%r14, %rdi
	movl	%r15d, %esi
	xorl	%ecx, %ecx
	movq	%r12, %r9
	callq	_devm_request_irq
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.12:
	movq	_gemini_poweroff@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_pm_power_off@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_gpw_poweroff@GOTPCREL(%rip), %rax
	movq	%r12, (%rax)
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_info
	xorl	%ebx, %ebx
	jmp	LBB0_6
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_14:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_IORESOURCE_MEM,4,2             ## @IORESOURCE_MEM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GEMINI_PWC_IDREG,8,3           ## @GEMINI_PWC_IDREG
	.comm	_GEMINI_PWC_ID,4,2              ## @GEMINI_PWC_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wrong power controller ID: %08x\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GEMINI_PWC_CTRLREG,8,3         ## @GEMINI_PWC_CTRLREG
	.comm	_GEMINI_CTRL_ENABLE,4,2         ## @GEMINI_CTRL_ENABLE
	.comm	_GEMINI_CTRL_IRQ_CLR,4,2        ## @GEMINI_CTRL_IRQ_CLR
	.comm	_GEMINI_PWC_STATREG,8,3         ## @GEMINI_PWC_STATREG
	.comm	_gemini_powerbutton_interrupt,4,2 ## @gemini_powerbutton_interrupt
L_.str.1:                               ## @.str.1
	.asciz	"poweroff"

	.comm	_gemini_poweroff,4,2            ## @gemini_poweroff
	.comm	_pm_power_off,4,2               ## @pm_power_off
	.comm	_gpw_poweroff,8,3               ## @gpw_poweroff
L_.str.2:                               ## @.str.2
	.asciz	"Gemini poweroff driver registered\n"

	.no_dead_strip	_gemini_poweroff_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gemini_poweroff_probe
_gemini_poweroff_probe:                 ; @gemini_poweroff_probe
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #16
	bl	_devm_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
Lloh3:
	adrp	x8, _IORESOURCE_MEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IORESOURCE_MEM@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_platform_get_resource
	mov	x1, x0
	mov	x0, x19
	bl	_devm_ioremap_resource
	str	x0, [x20]
	bl	_IS_ERR
	cbz	x0, LBB0_6
; %bb.2:
	ldr	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_3:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	x0, x19
	mov	w1, #0
	bl	_platform_get_irq
	cbz	w0, LBB0_11
; %bb.7:
	mov	x21, x0
	str	x19, [x20, #8]
	ldr	x8, [x20]
Lloh8:
	adrp	x9, _GEMINI_PWC_IDREG@GOTPAGE
Lloh9:
	ldr	x9, [x9, _GEMINI_PWC_IDREG@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	and	w2, w0, #0xffffff00
Lloh11:
	adrp	x8, _GEMINI_PWC_ID@GOTPAGE
Lloh12:
	ldr	x8, [x8, _GEMINI_PWC_ID@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w2, w8
	b.ne	LBB0_12
; %bb.8:
	ldr	x8, [x20]
Lloh14:
	adrp	x22, _GEMINI_PWC_CTRLREG@GOTPAGE
Lloh15:
	ldr	x22, [x22, _GEMINI_PWC_CTRLREG@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_readl
Lloh16:
	adrp	x8, _GEMINI_CTRL_ENABLE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _GEMINI_CTRL_ENABLE@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	orr	w0, w8, w0
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_readl
Lloh19:
	adrp	x23, _GEMINI_CTRL_IRQ_CLR@GOTPAGE
Lloh20:
	ldr	x23, [x23, _GEMINI_CTRL_IRQ_CLR@GOTPAGEOFF]
	ldr	w8, [x23]
	orr	w0, w8, w0
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x20]
Lloh21:
	adrp	x24, _GEMINI_PWC_STATREG@GOTPAGE
Lloh22:
	ldr	x24, [x24, _GEMINI_PWC_STATREG@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_readl
	tst	w0, #0x70
	b.eq	LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x20]
	b	LBB0_9
LBB0_11:
Lloh23:
	adrp	x8, _EINVAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_12:
Lloh25:
	adrp	x1, l_.str@PAGE
Lloh26:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh27:
	adrp	x8, _ENODEV@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_4
LBB0_13:
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_readl
	ldr	w8, [x23]
	orr	w0, w8, w0
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel
Lloh29:
	adrp	x8, _gemini_powerbutton_interrupt@GOTPAGE
Lloh30:
	ldr	x8, [x8, _gemini_powerbutton_interrupt@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
Lloh32:
	adrp	x4, l_.str.1@PAGE
Lloh33:
	add	x4, x4, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x1, x21
	mov	w3, #0
	mov	x5, x20
	bl	_devm_request_irq
	cbnz	w0, LBB0_5
; %bb.14:
Lloh34:
	adrp	x8, _gemini_poweroff@GOTPAGE
Lloh35:
	ldr	x8, [x8, _gemini_poweroff@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
Lloh37:
	adrp	x9, _pm_power_off@GOTPAGE
Lloh38:
	ldr	x9, [x9, _pm_power_off@GOTPAGEOFF]
Lloh39:
	str	w8, [x9]
Lloh40:
	adrp	x8, _gpw_poweroff@GOTPAGE
Lloh41:
	ldr	x8, [x8, _gpw_poweroff@GOTPAGEOFF]
Lloh42:
	str	x20, [x8]
Lloh43:
	adrp	x1, l_.str.2@PAGE
Lloh44:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_info
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotStr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotStr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_IORESOURCE_MEM,4,2             ; @IORESOURCE_MEM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GEMINI_PWC_IDREG,8,3           ; @GEMINI_PWC_IDREG
	.comm	_GEMINI_PWC_ID,4,2              ; @GEMINI_PWC_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wrong power controller ID: %08x\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GEMINI_PWC_CTRLREG,8,3         ; @GEMINI_PWC_CTRLREG
	.comm	_GEMINI_CTRL_ENABLE,4,2         ; @GEMINI_CTRL_ENABLE
	.comm	_GEMINI_CTRL_IRQ_CLR,4,2        ; @GEMINI_CTRL_IRQ_CLR
	.comm	_GEMINI_PWC_STATREG,8,3         ; @GEMINI_PWC_STATREG
	.comm	_gemini_powerbutton_interrupt,4,2 ; @gemini_powerbutton_interrupt
l_.str.1:                               ; @.str.1
	.asciz	"poweroff"

	.comm	_gemini_poweroff,4,2            ; @gemini_poweroff
	.comm	_pm_power_off,4,2               ; @pm_power_off
	.comm	_gpw_poweroff,8,3               ; @gpw_poweroff
l_.str.2:                               ; @.str.2
	.asciz	"Gemini poweroff driver registered\n"

	.no_dead_strip	_gemini_poweroff_probe
.subsections_via_symbols
