	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hid_magn_3d_probe
_hid_magn_3d_probe:                     ## @hid_magn_3d_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	(%rdi), %r12
	movl	$0, -44(%rbp)
	movl	$64, %esi
	callq	_devm_iio_device_alloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_platform_set_drvdata
	movq	%r14, %rdi
	callq	_iio_priv
	movq	%rax, %r15
	movq	%r12, 16(%rax)
	movq	%r13, 8(%rax)
	movq	_HID_USAGE_SENSOR_COMPASS_3D@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	_hid_sensor_parse_common_attributes
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_4
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_5:
	movq	16(%r15), %rax
	movq	%rax, 56(%r15)
	movups	(%r15), %xmm0
	movups	%xmm0, 40(%r15)
	movq	_HID_USAGE_SENSOR_COMPASS_3D@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	-56(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %r9
	callq	_magn_3d_parse_report
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_4
LBB0_7:
	movq	-56(%rbp), %rax
	movq	%rax, 40(%r14)
	movl	-44(%rbp), %eax
	movl	%eax, (%r14)
	movq	%r13, 32(%r14)
	movq	_magn_3d_info@GOTPCREL(%rip), %rax
	movq	%rax, 24(%r14)
	leaq	L_.str(%rip), %rax
	movq	%rax, 8(%r14)
	movq	_INDIO_DIRECT_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r14)
	movq	_iio_pollfunc_store_time@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_iio_triggered_buffer_setup
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
LBB0_4:
	movq	%r13, %rdi
	callq	_dev_err
LBB0_17:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_atomic_set
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_hid_sensor_setup_trigger
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	movq	%r14, %rdi
	callq	_iio_device_register
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %ebx
	leaq	L_.str.5(%rip), %rsi
	movq	%r13, %rdi
	callq	_dev_err
LBB0_15:
	movq	%r15, %rdi
	callq	_hid_sensor_remove_trigger
	jmp	LBB0_16
LBB0_10:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
	movq	%r13, %rdi
	callq	_dev_err
LBB0_16:
	movq	%r14, %rdi
	callq	_iio_triggered_buffer_cleanup
	jmp	LBB0_17
LBB0_13:
	movq	_magn_3d_proc_event@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%r15, %rdx
	addq	$24, %rdx
	movl	%eax, 36(%r15)
	movq	_magn_3d_capture_sample@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r15)
	movq	%r13, 24(%r15)
	movq	_HID_USAGE_SENSOR_COMPASS_3D@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_sensor_hub_register_callback
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_17
## %bb.14:
	leaq	L_.str.6(%rip), %rsi
	movq	%r13, %rdi
	callq	_dev_err
	movq	%r14, %rdi
	callq	_iio_device_unregister
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"magn_3d"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_HID_USAGE_SENSOR_COMPASS_3D,4,2 ## @HID_USAGE_SENSOR_COMPASS_3D
L_.str.1:                               ## @.str.1
	.asciz	"failed to setup common attributes\n"

L_.str.2:                               ## @.str.2
	.asciz	"failed to parse report\n"

	.comm	_magn_3d_info,4,2               ## @magn_3d_info
	.comm	_INDIO_DIRECT_MODE,4,2          ## @INDIO_DIRECT_MODE
	.comm	_iio_pollfunc_store_time,4,2    ## @iio_pollfunc_store_time
L_.str.3:                               ## @.str.3
	.asciz	"failed to initialize trigger buffer\n"

L_.str.4:                               ## @.str.4
	.asciz	"trigger setup failed\n"

L_.str.5:                               ## @.str.5
	.asciz	"device register failed\n"

	.comm	_magn_3d_proc_event,4,2         ## @magn_3d_proc_event
	.comm	_magn_3d_capture_sample,4,2     ## @magn_3d_capture_sample
L_.str.6:                               ## @.str.6
	.asciz	"callback reg failed\n"

	.no_dead_strip	_hid_magn_3d_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hid_magn_3d_probe
_hid_magn_3d_probe:                     ; @hid_magn_3d_probe
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x0
	ldr	x22, [x0]
	str	wzr, [sp, #4]
	mov	w1, #64
	bl	_devm_iio_device_alloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	mov	x0, x20
	mov	x1, x19
	bl	_platform_set_drvdata
	mov	x0, x19
	bl	_iio_priv
	mov	x21, x0
	stp	x20, x22, [x0, #8]
Lloh0:
	adrp	x24, _HID_USAGE_SENSOR_COMPASS_3D@GOTPAGE
Lloh1:
	ldr	x24, [x24, _HID_USAGE_SENSOR_COMPASS_3D@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x22
	mov	x2, x21
	bl	_hid_sensor_parse_common_attributes
	cbz	w0, LBB0_4
; %bb.2:
	mov	x23, x0
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_3:
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_9
LBB0_4:
	ldr	q0, [x21]
	stur	q0, [x21, #40]
	ldr	x8, [x21, #16]
	str	x8, [x21, #56]
	ldr	w4, [x24]
	add	x2, sp, #8
	add	x3, sp, #4
	mov	x0, x20
	mov	x1, x22
	mov	x5, x21
	bl	_magn_3d_parse_report
	cbz	w0, LBB0_6
; %bb.5:
	mov	x23, x0
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_8
LBB0_6:
	ldr	x8, [sp, #8]
	str	x8, [x19, #40]
	ldr	w8, [sp, #4]
	str	w8, [x19]
Lloh9:
	adrp	x8, _magn_3d_info@GOTPAGE
Lloh10:
	ldr	x8, [x8, _magn_3d_info@GOTPAGEOFF]
Lloh11:
	adrp	x9, l_.str@PAGE
Lloh12:
	add	x9, x9, l_.str@PAGEOFF
	stp	x8, x20, [x19, #24]
	str	x9, [x19, #8]
Lloh13:
	adrp	x8, _INDIO_DIRECT_MODE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _INDIO_DIRECT_MODE@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	str	w8, [x19, #16]
Lloh16:
	adrp	x1, _iio_pollfunc_store_time@GOTPAGE
Lloh17:
	ldr	x1, [x1, _iio_pollfunc_store_time@GOTPAGEOFF]
	mov	x0, x19
	mov	x2, #0
	mov	x3, #0
	bl	_iio_triggered_buffer_setup
	cbz	w0, LBB0_10
; %bb.7:
	mov	x23, x0
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_8:
	mov	x0, x20
	bl	_dev_err
LBB0_9:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_10:
	mov	x0, x21
	mov	w1, #0
	bl	_atomic_set
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_hid_sensor_setup_trigger
	tbnz	w0, #31, LBB0_14
; %bb.11:
	mov	x0, x19
	bl	_iio_device_register
	cbz	w0, LBB0_16
; %bb.12:
	mov	x23, x0
Lloh22:
	adrp	x1, l_.str.5@PAGE
Lloh23:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x20
	bl	_dev_err
LBB0_13:
	mov	x0, x21
	bl	_hid_sensor_remove_trigger
	b	LBB0_15
LBB0_14:
	mov	x23, x0
Lloh24:
	adrp	x1, l_.str.4@PAGE
Lloh25:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_dev_err
LBB0_15:
	mov	x0, x19
	bl	_iio_triggered_buffer_cleanup
	b	LBB0_9
LBB0_16:
Lloh26:
	adrp	x8, _magn_3d_proc_event@GOTPAGE
Lloh27:
	ldr	x8, [x8, _magn_3d_proc_event@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	mov	x2, x21
	str	x20, [x2, #24]!
Lloh29:
	adrp	x9, _magn_3d_capture_sample@GOTPAGE
Lloh30:
	ldr	x9, [x9, _magn_3d_capture_sample@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	stp	w9, w8, [x2, #8]
	ldr	w1, [x24]
	mov	x0, x22
	bl	_sensor_hub_register_callback
	mov	x23, x0
	tbz	w0, #31, LBB0_9
; %bb.17:
Lloh32:
	adrp	x1, l_.str.6@PAGE
Lloh33:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	mov	x0, x19
	bl	_iio_device_unregister
	b	LBB0_13
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"magn_3d"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_HID_USAGE_SENSOR_COMPASS_3D,4,2 ; @HID_USAGE_SENSOR_COMPASS_3D
l_.str.1:                               ; @.str.1
	.asciz	"failed to setup common attributes\n"

l_.str.2:                               ; @.str.2
	.asciz	"failed to parse report\n"

	.comm	_magn_3d_info,4,2               ; @magn_3d_info
	.comm	_INDIO_DIRECT_MODE,4,2          ; @INDIO_DIRECT_MODE
	.comm	_iio_pollfunc_store_time,4,2    ; @iio_pollfunc_store_time
l_.str.3:                               ; @.str.3
	.asciz	"failed to initialize trigger buffer\n"

l_.str.4:                               ; @.str.4
	.asciz	"trigger setup failed\n"

l_.str.5:                               ; @.str.5
	.asciz	"device register failed\n"

	.comm	_magn_3d_proc_event,4,2         ; @magn_3d_proc_event
	.comm	_magn_3d_capture_sample,4,2     ; @magn_3d_capture_sample
l_.str.6:                               ; @.str.6
	.asciz	"callback reg failed\n"

	.no_dead_strip	_hid_magn_3d_probe
.subsections_via_symbols
