	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ams_sensor_attach              ## -- Begin function ams_sensor_attach
	.p2align	4, 0x90
_ams_sensor_attach:                     ## @ams_sensor_attach
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_ams_info@GOTPCREL(%rip), %r15
	movl	24(%r15), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	callq	_of_get_property
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	(%rax), %ecx
	movl	%ecx, 44(%r15)
	movl	4(%rax), %eax
	movl	%eax, 40(%r15)
	movl	24(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	_ams_freefall_client@GOTPCREL(%rip), %rdx
	callq	_pmf_register_irq_client
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	$0, 32(%r15)
	movl	24(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	_ams_shock_client@GOTPCREL(%rip), %rdx
	callq	_pmf_register_irq_client
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movl	24(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	callq	_of_platform_device_create
	movq	%rax, 16(%r15)
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	_dev_attr_current@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	callq	_device_create_file
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.9:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	*8(%r15)
	shrl	$4, %eax
	andl	$1, %eax
	movl	%eax, (%r15)
	xorl	%eax, %eax
	callq	_ams_input_init
	testl	%eax, %eax
	je	LBB0_14
## %bb.10:
	movl	%eax, %r14d
	movq	16(%r15), %rdi
	movq	_dev_attr_current@GOTPCREL(%rip), %rsi
	callq	_device_remove_file
	movl	%r14d, %ebx
LBB0_11:
	movq	16(%r15), %rdi
	callq	_of_device_unregister
	jmp	LBB0_12
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_3:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_5:
	movl	%eax, %ebx
	jmp	LBB0_13
LBB0_7:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_12:
	movq	_ams_shock_client@GOTPCREL(%rip), %rdi
	callq	_pmf_unregister_irq_client
LBB0_13:
	movq	_ams_freefall_client@GOTPCREL(%rip), %rdi
	callq	_pmf_unregister_irq_client
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ams_info,48,3                  ## @ams_info
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"orientation"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"accel-int-1"

	.comm	_ams_freefall_client,4,2        ## @ams_freefall_client
L_.str.2:                               ## @.str.2
	.asciz	"accel-int-2"

	.comm	_ams_shock_client,4,2           ## @ams_shock_client
L_.str.3:                               ## @.str.3
	.asciz	"ams"

	.comm	_dev_attr_current,4,2           ## @dev_attr_current
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ams_sensor_attach              ; -- Begin function ams_sensor_attach
	.p2align	2
_ams_sensor_attach:                     ; @ams_sensor_attach
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x20, _ams_info@GOTPAGE
Lloh1:
	ldr	x20, [x20, _ams_info@GOTPAGEOFF]
	ldr	w0, [x20, #24]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, #0
	bl	_of_get_property
	cbz	x0, LBB0_8
; %bb.1:
	ldr	w8, [x0]
	str	w8, [x20, #44]
	ldr	w8, [x0, #4]
	str	w8, [x20, #40]
	ldr	w0, [x20, #24]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
Lloh6:
	adrp	x2, _ams_freefall_client@GOTPAGE
Lloh7:
	ldr	x2, [x2, _ams_freefall_client@GOTPAGEOFF]
	bl	_pmf_register_irq_client
	tbnz	w0, #31, LBB0_8
; %bb.2:
	str	xzr, [x20, #32]
	ldr	w0, [x20, #24]
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
Lloh10:
	adrp	x2, _ams_shock_client@GOTPAGE
Lloh11:
	ldr	x2, [x2, _ams_shock_client@GOTPAGEOFF]
	bl	_pmf_register_irq_client
	tbnz	w0, #31, LBB0_9
; %bb.3:
	ldr	w0, [x20, #24]
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, #0
	bl	_of_platform_device_create
	str	x0, [x20, #16]
	cbz	x0, LBB0_10
; %bb.4:
Lloh14:
	adrp	x1, _dev_attr_current@GOTPAGE
Lloh15:
	ldr	x1, [x1, _dev_attr_current@GOTPAGEOFF]
	bl	_device_create_file
	mov	x19, x0
	cbnz	w0, LBB0_7
; %bb.5:
	ldr	x8, [x20, #8]
	blr	x8
	ubfx	w8, w0, #4, #1
	str	w8, [x20]
	bl	_ams_input_init
	mov	x19, x0
	cbz	w0, LBB0_13
; %bb.6:
	ldr	x0, [x20, #16]
Lloh16:
	adrp	x1, _dev_attr_current@GOTPAGE
Lloh17:
	ldr	x1, [x1, _dev_attr_current@GOTPAGEOFF]
	bl	_device_remove_file
LBB0_7:
	ldr	x0, [x20, #16]
	bl	_of_device_unregister
	b	LBB0_11
LBB0_8:
Lloh18:
	adrp	x8, _ENODEV@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_13
LBB0_9:
	mov	x19, x0
	b	LBB0_12
LBB0_10:
Lloh21:
	adrp	x8, _ENODEV@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_11:
Lloh24:
	adrp	x0, _ams_shock_client@GOTPAGE
Lloh25:
	ldr	x0, [x0, _ams_shock_client@GOTPAGEOFF]
	bl	_pmf_unregister_irq_client
LBB0_12:
Lloh26:
	adrp	x0, _ams_freefall_client@GOTPAGE
Lloh27:
	ldr	x0, [x0, _ams_freefall_client@GOTPAGEOFF]
	bl	_pmf_unregister_irq_client
LBB0_13:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_ams_info,48,3                  ; @ams_info
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"orientation"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"accel-int-1"

	.comm	_ams_freefall_client,4,2        ; @ams_freefall_client
l_.str.2:                               ; @.str.2
	.asciz	"accel-int-2"

	.comm	_ams_shock_client,4,2           ; @ams_shock_client
l_.str.3:                               ; @.str.3
	.asciz	"ams"

	.comm	_dev_attr_current,4,2           ; @dev_attr_current
.subsections_via_symbols
