	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ves1820_attach                 ## -- Begin function ves1820_attach
	.p2align	4, 0x90
_ves1820_attach:                        ## @ves1820_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$48, %edi
	callq	_kzalloc
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	_ves1820_inittab@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movq	%r12, 16(%rbx)
	movq	%r15, 32(%rbx)
	movl	%r14d, 24(%rbx)
	movq	%rbx, %rdi
	movl	$26, %esi
	callq	_ves1820_readreg
	andl	$240, %eax
	cmpl	$112, %eax
	jne	LBB0_5
## %bb.2:
	movq	_verbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.3:
	movl	24(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_printk
LBB0_4:
	movq	%rbx, %rdi
	addq	$8, %rdi
	movq	_ves1820_ops@GOTPCREL(%rip), %rsi
	movl	$4, %edx
	callq	_memcpy
	movq	16(%rbx), %rax
	movl	(%rax), %eax
	leal	127(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	leal	7(%rax), %edx
	cmovnsl	%eax, %edx
	sarl	$7, %ecx
	movl	%ecx, 8(%rbx)
	sarl	$3, %edx
	movl	%edx, 12(%rbx)
	movq	%rbx, (%rbx)
	jmp	LBB0_6
LBB0_5:
	movq	%rbx, %rdi
	callq	_kfree
	xorl	%ebx, %ebx
LBB0_6:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ves1820_inittab,8,3            ## @ves1820_inittab
	.comm	_verbose,8,3                    ## @verbose
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ves1820: pwm=0x%02x\n"

	.comm	_ves1820_ops,4,2                ## @ves1820_ops
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ves1820_attach                 ; -- Begin function ves1820_attach
	.p2align	2
_ves1820_attach:                        ; @ves1820_attach
	.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	x20, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #48
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_5
; %bb.1:
Lloh3:
	adrp	x8, _ves1820_inittab@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ves1820_inittab@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	w8, [x8]
	str	w8, [x19, #40]
	str	x22, [x19, #16]
	str	x21, [x19, #32]
	str	w20, [x19, #24]
	mov	x0, x19
	mov	w1, #26
	bl	_ves1820_readreg
	and	w8, w0, #0xf0
	cmp	w8, #112
	b.ne	LBB0_5
; %bb.2:
Lloh6:
	adrp	x8, _verbose@GOTPAGE
Lloh7:
	ldr	x8, [x8, _verbose@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	w1, [x19, #24]
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printk
LBB0_4:
	add	x0, x19, #8
Lloh11:
	adrp	x1, _ves1820_ops@GOTPAGE
Lloh12:
	ldr	x1, [x1, _ves1820_ops@GOTPAGEOFF]
	mov	w2, #4
	bl	_memcpy
	ldr	x8, [x19, #16]
	ldr	w8, [x8]
	add	w9, w8, #127
	cmp	w8, #0
	csel	w9, w9, w8, lt
	asr	w9, w9, #7
	add	w10, w8, #7
	csel	w8, w10, w8, lt
	asr	w8, w8, #3
	stp	w9, w8, [x19, #8]
	str	x19, [x19]
	b	LBB0_6
LBB0_5:
	mov	x0, x19
	bl	_kfree
	mov	x19, #0
LBB0_6:
	mov	x0, x19
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ves1820_inittab,8,3            ; @ves1820_inittab
	.comm	_verbose,8,3                    ; @verbose
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ves1820: pwm=0x%02x\n"

	.comm	_ves1820_ops,4,2                ; @ves1820_ops
.subsections_via_symbols
