	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___iio_device_register          ## -- Begin function __iio_device_register
	.p2align	4, 0x90
___iio_device_register:                 ## @__iio_device_register
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	%rsi, 56(%rdi)
	leaq	8(%rdi), %r14
	cmpq	$0, 24(%rdi)
	jne	LBB0_3
## %bb.1:
	movq	(%r14), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	(%rax), %rax
	movq	%rax, 24(%r12)
LBB0_3:
	movq	%r12, %rdi
	callq	_iio_check_unique_scan_index
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	cmpl	$0, 52(%r12)
	je	LBB0_6
## %bb.7:
	movq	_iio_devt@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_MAJOR
	movl	48(%r12), %esi
	movl	%eax, %edi
	callq	_MKDEV
	movl	%eax, 16(%r12)
	movq	%r12, %rdi
	callq	_iio_device_register_debugfs
	movq	%r12, %rdi
	callq	_iio_buffer_alloc_sysfs_and_mask
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %ebx
	movq	(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_22
LBB0_4:
	movl	%eax, %ebx
	jmp	LBB0_23
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_23
LBB0_9:
	movq	%r12, %rdi
	callq	_iio_device_register_sysfs
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %ebx
	movq	(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_21
LBB0_11:
	movq	%r12, %rdi
	callq	_iio_device_register_eventset
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %ebx
	movq	(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
LBB0_20:
	movq	%r12, %rdi
	callq	_iio_device_unregister_sysfs
LBB0_21:
	movq	%r12, %rdi
	callq	_iio_buffer_free_sysfs_and_mask
LBB0_22:
	movq	%r12, %rdi
	callq	_iio_device_unregister_debugfs
LBB0_23:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movl	(%r12), %eax
	movq	_INDIO_ALL_TRIGGERED_MODES@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_15
## %bb.14:
	movq	%r12, %rdi
	callq	_iio_device_register_trigger_consumer
	movl	(%r12), %eax
LBB0_15:
	movq	_INDIO_ALL_BUFFER_MODES@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_18
## %bb.16:
	cmpq	$0, 40(%r12)
	jne	LBB0_18
## %bb.17:
	movq	_noop_ring_setup_ops@GOTPCREL(%rip), %rax
	movq	%rax, 40(%r12)
LBB0_18:
	leaq	32(%r12), %rbx
	movq	_iio_buffer_fileops@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	callq	_cdev_init
	movq	%r15, 32(%r12)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_cdev_device_add
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jns	LBB0_23
## %bb.19:
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_iio_device_unregister_eventset
	movl	%r14d, %ebx
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_iio_devt,4,2                   ## @iio_devt
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to create buffer sysfs interfaces\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to register sysfs interfaces\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to register event set\n"

	.comm	_INDIO_ALL_TRIGGERED_MODES,4,2  ## @INDIO_ALL_TRIGGERED_MODES
	.comm	_INDIO_ALL_BUFFER_MODES,4,2     ## @INDIO_ALL_BUFFER_MODES
	.comm	_noop_ring_setup_ops,4,2        ## @noop_ring_setup_ops
	.comm	_iio_buffer_fileops,4,2         ## @iio_buffer_fileops
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___iio_device_register          ; -- Begin function __iio_device_register
	.p2align	2
___iio_device_register:                 ; @__iio_device_register
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x1
	mov	x19, x0
	str	x1, [x0, #56]
	add	x20, x0, #8
	ldr	x8, [x0, #24]
	cbnz	x8, LBB0_3
; %bb.1:
	ldr	x8, [x20]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	x8, [x8]
	str	x8, [x19, #24]
LBB0_3:
	mov	x0, x19
	bl	_iio_check_unique_scan_index
	tbnz	w0, #31, LBB0_7
; %bb.4:
	ldr	w8, [x19, #52]
	cbz	w8, LBB0_8
; %bb.5:
Lloh0:
	adrp	x8, _iio_devt@GOTPAGE
Lloh1:
	ldr	x8, [x8, _iio_devt@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_MAJOR
	ldr	w1, [x19, #48]
	bl	_MKDEV
	str	w0, [x19, #16]
	mov	x0, x19
	bl	_iio_device_register_debugfs
	mov	x0, x19
	bl	_iio_buffer_alloc_sysfs_and_mask
	cbz	w0, LBB0_9
; %bb.6:
	mov	x22, x0
	ldr	x0, [x20]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_15
LBB0_7:
	mov	x22, x0
	b	LBB0_16
LBB0_8:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_16
LBB0_9:
	mov	x0, x19
	bl	_iio_device_register_sysfs
	cbz	w0, LBB0_11
; %bb.10:
	mov	x22, x0
	ldr	x0, [x20]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_14
LBB0_11:
	mov	x0, x19
	bl	_iio_device_register_eventset
	cbz	w0, LBB0_17
; %bb.12:
	mov	x22, x0
	ldr	x0, [x20]
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
LBB0_13:
	mov	x0, x19
	bl	_iio_device_unregister_sysfs
LBB0_14:
	mov	x0, x19
	bl	_iio_buffer_free_sysfs_and_mask
LBB0_15:
	mov	x0, x19
	bl	_iio_device_unregister_debugfs
LBB0_16:
	mov	x0, x22
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_17:
	ldr	w8, [x19]
Lloh12:
	adrp	x9, _INDIO_ALL_TRIGGERED_MODES@GOTPAGE
Lloh13:
	ldr	x9, [x9, _INDIO_ALL_TRIGGERED_MODES@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_19
; %bb.18:
	mov	x0, x19
	bl	_iio_device_register_trigger_consumer
	ldr	w8, [x19]
LBB0_19:
Lloh15:
	adrp	x9, _INDIO_ALL_BUFFER_MODES@GOTPAGE
Lloh16:
	ldr	x9, [x9, _INDIO_ALL_BUFFER_MODES@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_22
; %bb.20:
	ldr	x8, [x19, #40]
	cbnz	x8, LBB0_22
; %bb.21:
Lloh18:
	adrp	x8, _noop_ring_setup_ops@GOTPAGE
Lloh19:
	ldr	x8, [x8, _noop_ring_setup_ops@GOTPAGEOFF]
	str	x8, [x19, #40]
LBB0_22:
	add	x22, x19, #32
Lloh20:
	adrp	x1, _iio_buffer_fileops@GOTPAGE
Lloh21:
	ldr	x1, [x1, _iio_buffer_fileops@GOTPAGEOFF]
	mov	x0, x22
	bl	_cdev_init
	str	x21, [x19, #32]
	mov	x0, x22
	mov	x1, x20
	bl	_cdev_device_add
	tbnz	w0, #31, LBB0_24
; %bb.23:
	mov	w22, #0
	b	LBB0_16
LBB0_24:
	mov	x22, x0
	mov	x0, x19
	bl	_iio_device_unregister_eventset
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_iio_devt,4,2                   ; @iio_devt
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to create buffer sysfs interfaces\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to register sysfs interfaces\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to register event set\n"

	.comm	_INDIO_ALL_TRIGGERED_MODES,4,2  ; @INDIO_ALL_TRIGGERED_MODES
	.comm	_INDIO_ALL_BUFFER_MODES,4,2     ; @INDIO_ALL_BUFFER_MODES
	.comm	_noop_ring_setup_ops,4,2        ; @noop_ring_setup_ops
	.comm	_iio_buffer_fileops,4,2         ; @iio_buffer_fileops
.subsections_via_symbols
