	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smscore_init_ir
_smscore_init_ir:                       ## @smscore_init_ir
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	$0, 16(%rdi)
	callq	_smscore_get_board_id
	movl	%eax, %edi
	callq	_sms_get_board
	cmpl	$0, (%rax)
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_debug
	movq	%rbx, %rdi
	callq	_sms_ir_init
	testl	%eax, %eax
	je	LBB0_4
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
LBB0_7:
	callq	_pr_err
	jmp	LBB0_8
LBB0_3:
	leaq	L_.str.3(%rip), %rdi
	callq	_pr_info
	jmp	LBB0_8
LBB0_4:
	movq	_SMS_DMA_ALIGNMENT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	$16, %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rbx), %esi
	orl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_SMS_ALIGN_ADDRESS
	movq	%rax, %r15
	movq	_MSG_SMS_START_IR_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$16, %edx
	callq	_SMS_INIT_MSG
	movl	12(%rbx), %eax
	movq	8(%r15), %rcx
	movl	%eax, (%rcx)
	movl	8(%rbx), %eax
	movl	%eax, 4(%rcx)
	movl	(%r15), %edx
	leaq	4(%rbx), %rcx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_smscore_sendrequest_and_wait
	movq	%r14, %rdi
	callq	_kfree
LBB0_8:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"IR loading\n"

L_.str.1:                               ## @.str.1
	.asciz	"Error initialization DTV IR sub-module\n"

	.comm	_SMS_DMA_ALIGNMENT,8,3          ## @SMS_DMA_ALIGNMENT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_MSG_SMS_START_IR_REQ,4,2       ## @MSG_SMS_START_IR_REQ
L_.str.2:                               ## @.str.2
	.asciz	"Sending IR initialization message failed\n"

L_.str.3:                               ## @.str.3
	.asciz	"IR port has not been detected\n"

	.no_dead_strip	_smscore_init_ir
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smscore_init_ir
_smscore_init_ir:                       ; @smscore_init_ir
	.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	x19, x0
	str	xzr, [x0, #16]
	bl	_smscore_get_board_id
	bl	_sms_get_board
	ldr	w8, [x0]
	cbz	w8, LBB0_4
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
	mov	x0, x19
	bl	_sms_ir_init
	cbz	w0, LBB0_5
; %bb.2:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_3:
	bl	_pr_err
	b	LBB0_7
LBB0_4:
Lloh4:
	adrp	x0, l_.str.3@PAGE
Lloh5:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_info
	b	LBB0_7
LBB0_5:
Lloh6:
	adrp	x8, _SMS_DMA_ALIGNMENT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SMS_DMA_ALIGNMENT@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	add	x0, x8, #16
Lloh9:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w1, w9, w8
	bl	_kmalloc
	cbz	x0, LBB0_8
; %bb.6:
	mov	x20, x0
	bl	_SMS_ALIGN_ADDRESS
	mov	x21, x0
Lloh12:
	adrp	x8, _MSG_SMS_START_IR_REQ@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MSG_SMS_START_IR_REQ@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	w2, #16
	bl	_SMS_INIT_MSG
	ldr	w8, [x19, #12]
	ldr	x9, [x21, #8]
	str	w8, [x9]
	ldr	w8, [x19, #8]
	str	w8, [x9, #4]
	ldr	w2, [x21]
	add	x3, x19, #4
	mov	x0, x19
	mov	x1, x21
	bl	_smscore_sendrequest_and_wait
	mov	x0, x20
	bl	_kfree
LBB0_7:
	mov	w0, #0
	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_8:
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"IR loading\n"

l_.str.1:                               ; @.str.1
	.asciz	"Error initialization DTV IR sub-module\n"

	.comm	_SMS_DMA_ALIGNMENT,8,3          ; @SMS_DMA_ALIGNMENT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_MSG_SMS_START_IR_REQ,4,2       ; @MSG_SMS_START_IR_REQ
l_.str.2:                               ; @.str.2
	.asciz	"Sending IR initialization message failed\n"

l_.str.3:                               ; @.str.3
	.asciz	"IR port has not been detected\n"

	.no_dead_strip	_smscore_init_ir
.subsections_via_symbols
