	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smscore_detect_mode
_smscore_detect_mode:                   ## @smscore_detect_mode
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_SMS_DMA_ALIGNMENT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	$4, %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%r15), %esi
	orl	(%rax), %esi
	callq	_kmalloc
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_SMS_ALIGN_ADDRESS
	testq	%r14, %r14
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	_MSG_SMS_GET_VERSION_EX_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$4, %edx
	callq	_SMS_INIT_MSG
	movl	(%r12), %edx
	leaq	4(%r15), %r13
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%r13, %rcx
	callq	_smscore_sendrequest_and_wait
	movl	%eax, %ebx
	movq	_ETIME@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	jne	LBB0_7
## %bb.3:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_err
	leaq	8(%r15), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	$5000, %edi                     ## imm = 0x1388
	callq	_msecs_to_jiffies
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movl	(%r12), %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%r13, %rcx
	callq	_smscore_sendrequest_and_wait
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_7
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_7
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_6:
	movq	_ETIME@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_7:
	movq	%r14, %rdi
	callq	_kfree
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SMS_DMA_ALIGNMENT,8,3          ## @SMS_DMA_ALIGNMENT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MSG_SMS_GET_VERSION_EX_REQ,4,2 ## @MSG_SMS_GET_VERSION_EX_REQ
	.comm	_ETIME,4,2                      ## @ETIME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MSG_SMS_GET_VERSION_EX_REQ failed first try\n"

L_.str.1:                               ## @.str.1
	.asciz	"MSG_SMS_GET_VERSION_EX_REQ failed second try, rc %d\n"

	.no_dead_strip	_smscore_detect_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smscore_detect_mode
_smscore_detect_mode:                   ; @smscore_detect_mode
	.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
Lloh0:
	adrp	x8, _SMS_DMA_ALIGNMENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SMS_DMA_ALIGNMENT@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	add	x0, x8, #4
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w1, w9, w8
	bl	_kmalloc
	mov	x19, x0
	bl	_SMS_ALIGN_ADDRESS
	cbz	x19, LBB0_5
; %bb.1:
	mov	x21, x0
Lloh6:
	adrp	x8, _MSG_SMS_GET_VERSION_EX_REQ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MSG_SMS_GET_VERSION_EX_REQ@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	w2, #4
	bl	_SMS_INIT_MSG
	ldr	w2, [x21]
	add	x22, x20, #4
	mov	x0, x20
	mov	x1, x21
	mov	x3, x22
	bl	_smscore_sendrequest_and_wait
	mov	x23, x0
Lloh9:
	adrp	x24, _ETIME@GOTPAGE
Lloh10:
	ldr	x24, [x24, _ETIME@GOTPAGEOFF]
	ldr	w8, [x24]
	cmn	w0, w8
	b.ne	LBB0_7
; %bb.2:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	add	x23, x20, #8
	mov	w0, #5000
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x23
	bl	_wait_for_completion_timeout
	cbz	x0, LBB0_6
; %bb.3:
	ldr	w2, [x21]
	mov	x0, x20
	mov	x1, x21
	mov	x3, x22
	bl	_smscore_sendrequest_and_wait
	mov	x23, x0
	tbz	w0, #31, LBB0_7
; %bb.4:
	str	x23, [sp]
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	b	LBB0_7
LBB0_5:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_8
LBB0_6:
	ldr	w8, [x24]
	neg	w23, w8
LBB0_7:
	mov	x0, x19
	bl	_kfree
LBB0_8:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_SMS_DMA_ALIGNMENT,8,3          ; @SMS_DMA_ALIGNMENT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MSG_SMS_GET_VERSION_EX_REQ,4,2 ; @MSG_SMS_GET_VERSION_EX_REQ
	.comm	_ETIME,4,2                      ; @ETIME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MSG_SMS_GET_VERSION_EX_REQ failed first try\n"

l_.str.1:                               ; @.str.1
	.asciz	"MSG_SMS_GET_VERSION_EX_REQ failed second try, rc %d\n"

	.no_dead_strip	_smscore_detect_mode
.subsections_via_symbols
