	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vt8231_device_add
_vt8231_device_add:                     ## @vt8231_device_add
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edi, %ebx
	movw	%bx, -40(%rbp)
	leaq	L_.str(%rip), %rax
	movq	%rax, -32(%rbp)
	movq	_IORESOURCE_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -24(%rbp)
	movq	_VT8231_EXTENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	decl	%eax
	movl	%eax, -20(%rbp)
	leaq	-40(%rbp), %rdi
	callq	_acpi_check_resource_conflict
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	movzwl	%bx, %esi
	leaq	L_.str(%rip), %rdi
	callq	_platform_device_alloc
	movq	_pdev@GOTPCREL(%rip), %rbx
	movl	%eax, (%rbx)
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	leaq	-40(%rbp), %rsi
	movl	%eax, %edi
	movl	$1, %edx
	callq	_platform_device_add_resources
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r14d
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_8
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_9
LBB0_5:
	movl	(%rbx), %edi
	callq	_platform_device_add
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movl	%eax, %r14d
	leaq	L_.str.3(%rip), %rdi
LBB0_8:
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_pr_err
	movl	(%rbx), %edi
	callq	_platform_device_put
LBB0_9:
	movl	%r14d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	xorl	%r14d, %r14d
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vt8231"

	.comm	_IORESOURCE_IO,4,2              ## @IORESOURCE_IO
	.comm	_VT8231_EXTENT,4,2              ## @VT8231_EXTENT
	.comm	_pdev,4,2                       ## @pdev
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"Device allocation failed\n"

L_.str.2:                               ## @.str.2
	.asciz	"Device resource addition failed (%d)\n"

L_.str.3:                               ## @.str.3
	.asciz	"Device addition failed (%d)\n"

	.no_dead_strip	_vt8231_device_add
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vt8231_device_add
_vt8231_device_add:                     ; @vt8231_device_add
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x20, x0
Lloh0:
	adrp	x8, l_.str@PAGE
Lloh1:
	add	x8, x8, l_.str@PAGEOFF
	strh	w0, [sp, #8]
	str	x8, [sp, #16]
Lloh2:
	adrp	x8, _IORESOURCE_IO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IORESOURCE_IO@GOTPAGEOFF]
Lloh4:
	adrp	x9, _VT8231_EXTENT@GOTPAGE
Lloh5:
	ldr	x9, [x9, _VT8231_EXTENT@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	ldr	w9, [x9]
	add	w9, w0, w9
	sub	w9, w9, #1
	stp	w8, w9, [sp, #24]
	add	x0, sp, #8
	bl	_acpi_check_resource_conflict
	mov	x19, x0
	cbnz	w0, LBB0_8
; %bb.1:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_platform_device_alloc
Lloh10:
	adrp	x20, _pdev@GOTPAGE
Lloh11:
	ldr	x20, [x20, _pdev@GOTPAGEOFF]
	str	w0, [x20]
	cbz	w0, LBB0_4
; %bb.2:
	add	x1, sp, #8
	mov	w2, #1
	bl	_platform_device_add_resources
	cbz	w0, LBB0_5
; %bb.3:
	mov	x19, x0
	str	x19, [sp]
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
	b	LBB0_7
LBB0_4:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w19, w8
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	b	LBB0_8
LBB0_5:
	ldr	w0, [x20]
	bl	_platform_device_add
	mov	x19, x0
	cbz	w0, LBB0_8
; %bb.6:
	str	x19, [sp]
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_err
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
LBB0_7:
	ldr	w0, [x20]
	bl	_platform_device_put
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh6
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vt8231"

	.comm	_IORESOURCE_IO,4,2              ; @IORESOURCE_IO
	.comm	_VT8231_EXTENT,4,2              ; @VT8231_EXTENT
	.comm	_pdev,4,2                       ; @pdev
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"Device allocation failed\n"

l_.str.2:                               ; @.str.2
	.asciz	"Device resource addition failed (%d)\n"

l_.str.3:                               ; @.str.3
	.asciz	"Device addition failed (%d)\n"

	.no_dead_strip	_vt8231_device_add
.subsections_via_symbols
