	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sur40_init
_sur40_init:                            ## @sur40_init
	.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	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kmalloc
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	_SUR40_GET_VERSION@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	movq	%r15, %rcx
	movl	$12, %r8d
	callq	_sur40_command
	testl	%eax, %eax
	js	LBB0_8
## %bb.3:
	movl	(%r12), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	movq	%r15, %rcx
	movl	$12, %r8d
	callq	_sur40_command
	testl	%eax, %eax
	js	LBB0_8
## %bb.4:
	movl	(%r12), %esi
	movq	%r14, %rdi
	movl	$2, %edx
	movq	%r15, %rcx
	movl	$12, %r8d
	callq	_sur40_command
	testl	%eax, %eax
	js	LBB0_8
## %bb.5:
	movq	_SUR40_SENSOR_CAPS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	movq	%r15, %rcx
	movl	$24, %r8d
	callq	_sur40_command
	testl	%eax, %eax
	js	LBB0_8
## %bb.6:
	movq	_SUR40_ACCEL_CAPS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	movq	%r15, %rcx
	movl	$5, %r8d
	callq	_sur40_command
	testl	%eax, %eax
	js	LBB0_8
## %bb.7:
	movl	(%r12), %esi
	movq	%r14, %rdi
	movl	$3, %edx
	movq	%r15, %rcx
	movl	$12, %r8d
	callq	_sur40_command
LBB0_8:
	movl	%eax, %ebx
	jmp	LBB0_9
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movq	%r15, %rdi
	callq	_kfree
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SUR40_GET_VERSION,4,2          ## @SUR40_GET_VERSION
	.comm	_SUR40_SENSOR_CAPS,4,2          ## @SUR40_SENSOR_CAPS
	.comm	_SUR40_ACCEL_CAPS,4,2           ## @SUR40_ACCEL_CAPS
	.no_dead_strip	_sur40_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sur40_init
_sur40_init:                            ; @sur40_init
	.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, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kmalloc
	mov	x19, x0
	cbz	x0, LBB0_8
; %bb.1:
Lloh3:
	adrp	x22, _SUR40_GET_VERSION@GOTPAGE
Lloh4:
	ldr	x22, [x22, _SUR40_GET_VERSION@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	mov	w2, #0
	mov	x3, x19
	mov	w4, #12
	bl	_sur40_command
	tbnz	w0, #31, LBB0_7
; %bb.2:
	ldr	w1, [x22]
	mov	x0, x20
	mov	w2, #1
	mov	x3, x19
	mov	w4, #12
	bl	_sur40_command
	tbnz	w0, #31, LBB0_7
; %bb.3:
	ldr	w1, [x22]
	mov	x0, x20
	mov	w2, #2
	mov	x3, x19
	mov	w4, #12
	bl	_sur40_command
	tbnz	w0, #31, LBB0_7
; %bb.4:
Lloh5:
	adrp	x8, _SUR40_SENSOR_CAPS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SUR40_SENSOR_CAPS@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	mov	x3, x19
	mov	w4, #24
	bl	_sur40_command
	tbnz	w0, #31, LBB0_7
; %bb.5:
Lloh8:
	adrp	x8, _SUR40_ACCEL_CAPS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SUR40_ACCEL_CAPS@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	mov	x3, x19
	mov	w4, #5
	bl	_sur40_command
	tbnz	w0, #31, LBB0_7
; %bb.6:
	ldr	w1, [x22]
	mov	x0, x20
	mov	w2, #3
	mov	x3, x19
	mov	w4, #12
	bl	_sur40_command
LBB0_7:
	mov	x21, x0
	b	LBB0_9
LBB0_8:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_9:
	mov	x0, x19
	bl	_kfree
	mov	x0, x21
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SUR40_GET_VERSION,4,2          ; @SUR40_GET_VERSION
	.comm	_SUR40_SENSOR_CAPS,4,2          ; @SUR40_SENSOR_CAPS
	.comm	_SUR40_ACCEL_CAPS,4,2           ; @SUR40_ACCEL_CAPS
	.no_dead_strip	_sur40_init
.subsections_via_symbols
