	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function olpc_xo175_ec_probe
_olpc_xo175_ec_probe:                   ## @olpc_xo175_ec_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_olpc_ec@GOTPCREL(%rip), %r12
	cmpq	$0, (%r12)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	$80, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	movq	%rax, %r15
	movq	_GPIOD_OUT_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_devm_gpiod_get
	movl	%eax, 72(%r15)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movl	72(%r15), %edi
	callq	_PTR_ERR
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movl	72(%r15), %edi
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_5:
	movq	%r14, 64(%r15)
	leaq	56(%r15), %rdi
	callq	_spin_lock_init
	movq	_CMD_STATE_IDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%r15)
	leaq	48(%r15), %rdi
	callq	_init_completion
	movq	$0, 40(%r15)
	movq	%r14, %rdi
	callq	_devm_input_allocate_device
	movq	%rax, 32(%r15)
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	leaq	L_.str.3(%rip), %rcx
	movq	%rcx, (%rax)
	movq	%r14, 8(%rax)
	movq	_EV_KEY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_KEY_POWER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rax, %rdi
	callq	_input_set_capability
	movq	32(%r15), %rdi
	callq	_input_register_device
	testl	%eax, %eax
	je	LBB0_11
## %bb.7:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_10
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_9:
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_spi_set_drvdata
	movq	%r15, %rax
	addq	$24, %rax
	movq	%rax, 16(%r15)
	movq	%r15, 8(%r15)
	movq	%r15, %rdi
	callq	_olpc_xo175_ec_read_packet
	movq	_olpc_xo175_ec_driver@GOTPCREL(%rip), %rdi
	movq	%r15, %rsi
	callq	_olpc_ec_driver_register
	movl	$0, (%rsp)
	leaq	L_.str.5(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	$-1, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_platform_device_register_resndata
	movq	%rax, (%r12)
	movq	_EC_ALL_EVENTS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_olpc_xo175_ec_set_event_mask
	movq	_pm_power_off@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_13
## %bb.12:
	movq	_olpc_xo175_ec_power_off@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%rax)
LBB0_13:
	leaq	L_.str.6(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_info
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_olpc_ec,8,3                    ## @olpc_ec
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"OLPC EC already registered.\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"cmd"

	.comm	_GPIOD_OUT_LOW,4,2              ## @GPIOD_OUT_LOW
L_.str.2:                               ## @.str.2
	.asciz	"failed to get cmd gpio: %ld\n"

	.comm	_CMD_STATE_IDLE,4,2             ## @CMD_STATE_IDLE
L_.str.3:                               ## @.str.3
	.asciz	"Power Button"

	.comm	_EV_KEY,4,2                     ## @EV_KEY
	.comm	_KEY_POWER,4,2                  ## @KEY_POWER
L_.str.4:                               ## @.str.4
	.asciz	"error registering input device: %d\n"

	.comm	_olpc_xo175_ec_driver,4,2       ## @olpc_xo175_ec_driver
L_.str.5:                               ## @.str.5
	.asciz	"olpc-ec"

	.comm	_EC_ALL_EVENTS,4,2              ## @EC_ALL_EVENTS
	.comm	_pm_power_off,8,3               ## @pm_power_off
	.comm	_olpc_xo175_ec_power_off,8,3    ## @olpc_xo175_ec_power_off
L_.str.6:                               ## @.str.6
	.asciz	"OLPC XO-1.75 Embedded Controller driver\n"

	.no_dead_strip	_olpc_xo175_ec_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function olpc_xo175_ec_probe
_olpc_xo175_ec_probe:                   ; @olpc_xo175_ec_probe
	.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
	mov	x19, x0
Lloh0:
	adrp	x22, _olpc_ec@GOTPAGE
Lloh1:
	ldr	x22, [x22, _olpc_ec@GOTPAGEOFF]
	ldr	x8, [x22]
	cbz	x8, LBB0_2
; %bb.1:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh4:
	adrp	x8, _EBUSY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_9
LBB0_2:
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #80
	bl	_devm_kzalloc
	cbz	x0, LBB0_8
; %bb.3:
	mov	x20, x0
Lloh9:
	adrp	x8, _GPIOD_OUT_LOW@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GPIOD_OUT_LOW@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_devm_gpiod_get
	str	w0, [x20, #72]
	bl	_IS_ERR
	cbz	x0, LBB0_5
; %bb.4:
	ldr	w0, [x20, #72]
	bl	_PTR_ERR
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	ldr	w0, [x20, #72]
	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
	b	_PTR_ERR
LBB0_5:
	str	x19, [x20, #64]
	add	x0, x20, #56
	bl	_spin_lock_init
Lloh16:
	adrp	x8, _CMD_STATE_IDLE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CMD_STATE_IDLE@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	str	w8, [x20, #52]
	add	x0, x20, #48
	bl	_init_completion
	str	xzr, [x20, #40]
	mov	x0, x19
	bl	_devm_input_allocate_device
	str	x0, [x20, #32]
	cbz	x0, LBB0_8
; %bb.6:
Lloh19:
	adrp	x8, l_.str.3@PAGE
Lloh20:
	add	x8, x8, l_.str.3@PAGEOFF
	stp	x8, x19, [x0]
Lloh21:
	adrp	x8, _EV_KEY@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EV_KEY@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _KEY_POWER@GOTPAGE
Lloh25:
	ldr	x8, [x8, _KEY_POWER@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	bl	_input_set_capability
	ldr	x0, [x20, #32]
	bl	_input_register_device
	cbz	w0, LBB0_11
; %bb.7:
	mov	x21, x0
	str	x21, [sp]
Lloh27:
	adrp	x1, l_.str.4@PAGE
Lloh28:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_10
LBB0_8:
Lloh29:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_10:
	mov	x0, x21
	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
LBB0_11:
	mov	x0, x19
	mov	x1, x20
	bl	_spi_set_drvdata
	add	x8, x20, #24
	stp	x20, x8, [x20, #8]
	mov	x0, x20
	bl	_olpc_xo175_ec_read_packet
Lloh31:
	adrp	x0, _olpc_xo175_ec_driver@GOTPAGE
Lloh32:
	ldr	x0, [x0, _olpc_xo175_ec_driver@GOTPAGEOFF]
	mov	x1, x20
	bl	_olpc_ec_driver_register
Lloh33:
	adrp	x1, l_.str.5@PAGE
Lloh34:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	mov	w2, #-1
	mov	x3, #0
	mov	w4, #0
	mov	x5, #0
	mov	w6, #0
	bl	_platform_device_register_resndata
	str	x0, [x22]
Lloh35:
	adrp	x8, _EC_ALL_EVENTS@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EC_ALL_EVENTS@GOTPAGEOFF]
Lloh37:
	ldr	w0, [x8]
	bl	_olpc_xo175_ec_set_event_mask
Lloh38:
	adrp	x8, _pm_power_off@GOTPAGE
Lloh39:
	ldr	x8, [x8, _pm_power_off@GOTPAGEOFF]
	ldr	x9, [x8]
	cbnz	x9, LBB0_13
; %bb.12:
Lloh40:
	adrp	x9, _olpc_xo175_ec_power_off@GOTPAGE
Lloh41:
	ldr	x9, [x9, _olpc_xo175_ec_power_off@GOTPAGEOFF]
Lloh42:
	ldr	x9, [x9]
	str	x9, [x8]
LBB0_13:
Lloh43:
	adrp	x1, l_.str.6@PAGE
Lloh44:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_dev_info
	mov	w21, #0
	b	LBB0_10
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_olpc_ec,8,3                    ; @olpc_ec
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"OLPC EC already registered.\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"cmd"

	.comm	_GPIOD_OUT_LOW,4,2              ; @GPIOD_OUT_LOW
l_.str.2:                               ; @.str.2
	.asciz	"failed to get cmd gpio: %ld\n"

	.comm	_CMD_STATE_IDLE,4,2             ; @CMD_STATE_IDLE
l_.str.3:                               ; @.str.3
	.asciz	"Power Button"

	.comm	_EV_KEY,4,2                     ; @EV_KEY
	.comm	_KEY_POWER,4,2                  ; @KEY_POWER
l_.str.4:                               ; @.str.4
	.asciz	"error registering input device: %d\n"

	.comm	_olpc_xo175_ec_driver,4,2       ; @olpc_xo175_ec_driver
l_.str.5:                               ; @.str.5
	.asciz	"olpc-ec"

	.comm	_EC_ALL_EVENTS,4,2              ; @EC_ALL_EVENTS
	.comm	_pm_power_off,8,3               ; @pm_power_off
	.comm	_olpc_xo175_ec_power_off,8,3    ; @olpc_xo175_ec_power_off
l_.str.6:                               ; @.str.6
	.asciz	"OLPC XO-1.75 Embedded Controller driver\n"

	.no_dead_strip	_olpc_xo175_ec_probe
.subsections_via_symbols
