	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function soc_button_device_create
_soc_button_device_create:              ## @soc_button_device_create
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movq	%rsi, %rbx
	movq	%rdi, %r13
	cmpq	$0, 8(%rsi)
	je	LBB0_1
## %bb.2:
	xorl	%esi, %esi
	movq	%rbx, %rax
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%ecx, %ecx
	cmpl	%r12d, (%rax)
	sete	%cl
	addl	%ecx, %esi
	cmpq	$0, 40(%rax)
	leaq	32(%rax), %rax
	jne	LBB0_3
## %bb.4:
	shll	$5, %esi
	orl	$16, %esi
	jmp	LBB0_5
LBB0_1:
	movl	$16, %esi
LBB0_5:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	cmpq	$0, 8(%rbx)
	je	LBB0_15
## %bb.8:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	addq	$16, %r14
	xorl	%r15d, %r15d
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	cmpq	$0, 40(%rbx)
	leaq	32(%rbx), %rbx
	je	LBB0_14
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r12d, (%rbx)
	jne	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	24(%rbx), %esi
	movq	%r13, %rdi
	callq	_soc_button_lookup_gpio
	movl	%eax, %r13d
	movl	%eax, %edi
	callq	_gpio_is_valid
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	20(%rbx), %eax
	movslq	%r15d, %r15
	movq	%r15, %rcx
	shlq	$5, %rcx
	movl	%eax, 28(%r14,%rcx)
	movl	16(%rbx), %eax
	movl	%eax, 24(%r14,%rcx)
	movl	%r13d, (%r14,%rcx)
	movl	$1, 4(%r14,%rcx)
	movq	8(%rbx), %rax
	movq	%rax, 16(%r14,%rcx)
	movl	4(%rbx), %eax
	movl	%eax, 12(%r14,%rcx)
	movl	$50, 8(%r14,%rcx)
	incl	%r15d
	jmp	LBB0_12
LBB0_14:
	testl	%r15d, %r15d
	je	LBB0_15
## %bb.16:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%r14, 8(%rax)
	movq	%rax, %r14
	movl	%r15d, (%rax)
	movl	%r12d, 4(%rax)
	movq	_PLATFORM_DEVID_AUTO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$16, (%rsp)
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movq	%r14, %r9
	callq	_platform_device_register_resndata
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_PTR_ERR_OR_ZERO
	testl	%eax, %eax
	je	LBB0_20
## %bb.17:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_18
LBB0_15:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
LBB0_18:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_devm_kfree
	jmp	LBB0_19
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_19:
	movl	%ebx, %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_20:
	movq	%r12, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gpio-keys"

	.comm	_PLATFORM_DEVID_AUTO,4,2        ## @PLATFORM_DEVID_AUTO
L_.str.1:                               ## @.str.1
	.asciz	"failed registering gpio-keys: %d\n"

	.no_dead_strip	_soc_button_device_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function soc_button_device_create
lCPI0_0:
	.long	1                               ; 0x1
	.long	50                              ; 0x32
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_soc_button_device_create:              ; @soc_button_device_create
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [sp, #-96]!             ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset b8, -88
	.cfi_offset b9, -96
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	x8, [x1, #8]
	cbz	x8, LBB0_4
; %bb.1:
	mov	w8, #0
	mov	x9, x22
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9]
	cmp	w10, w21
	cinc	w8, w8, eq
	ldr	x10, [x9, #40]
	add	x9, x9, #32
	cbnz	x10, LBB0_2
; %bb.3:
	mov	w1, #16
	bfi	w1, w8, #5, #27
	b	LBB0_5
LBB0_4:
	mov	w1, #16
LBB0_5:
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_devm_kzalloc
	cbz	x0, LBB0_17
; %bb.6:
	mov	x20, x0
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_15
; %bb.7:
	mov	w23, #0
	add	x24, x20, #16
	add	x25, x22, #24
Lloh3:
	adrp	x8, lCPI0_0@PAGE
Lloh4:
	ldr	d8, [x8, lCPI0_0@PAGEOFF]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x25, #16]
	add	x25, x25, #32
	cbz	x8, LBB0_12
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w8, [x25, #-24]
	cmp	w8, w21
	b.ne	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w1, [x25]
	mov	x0, x19
	bl	_soc_button_lookup_gpio
	mov	x22, x0
	bl	_gpio_is_valid
	cbz	w0, LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	sxtw	x8, w23
	add	x8, x24, x8, lsl #5
	ldur	d0, [x25, #-8]
	str	d0, [x8, #24]
	str	w22, [x8]
	ldur	x9, [x25, #-16]
	str	x9, [x8, #16]
	ldur	w9, [x25, #-20]
	str	w9, [x8, #12]
	stur	d8, [x8, #4]
	add	w23, w23, #1
	b	LBB0_8
LBB0_12:
	cbz	w23, LBB0_15
; %bb.13:
	str	x24, [x20, #8]
	stp	w23, w21, [x20]
Lloh5:
	adrp	x8, _PLATFORM_DEVID_AUTO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PLATFORM_DEVID_AUTO@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x3, #0
	mov	w4, #0
	mov	x5, x20
	mov	w6, #16
	bl	_platform_device_register_resndata
	mov	x22, x0
	bl	_PTR_ERR_OR_ZERO
	cbz	w0, LBB0_19
; %bb.14:
	mov	x21, x0
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_dev_err
	b	LBB0_16
LBB0_15:
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_16:
	mov	x0, x19
	mov	x1, x20
	bl	_devm_kfree
	b	LBB0_18
LBB0_17:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_18:
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp], #96               ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_19:
	mov	x0, x22
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp], #96               ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdr	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gpio-keys"

	.comm	_PLATFORM_DEVID_AUTO,4,2        ; @PLATFORM_DEVID_AUTO
l_.str.1:                               ; @.str.1
	.asciz	"failed registering gpio-keys: %d\n"

	.no_dead_strip	_soc_button_device_create
.subsections_via_symbols
