	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hix5hd2_ir_config
_hix5hd2_ir_config:                     ## @hix5hd2_ir_config
	.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, %r15
	movq	_IR_ENABLE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%rdi), %rsi
	movl	$1, %edi
	callq	_writel_relaxed
	movq	_IR_BUSY@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	addq	(%r15), %rdi
	callq	_readl_relaxed
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movl	$-10001, %ebx                   ## imm = 0xD8EF
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	incl	%ebx
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %edi
	callq	_udelay
	movq	(%r14), %rdi
	addq	(%r15), %rdi
	callq	_readl_relaxed
	testq	%rax, %rax
	jne	LBB0_2
LBB0_4:
	movl	8(%r15), %edi
	movl	$1000000, %esi                  ## imm = 0xF4240
	callq	_DIV_ROUND_CLOSEST
	movq	_IR_CFG_WIDTH_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_IR_CFG_WIDTH_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
                                        ## kill: def $eax killed $eax def $rax
	movq	_IR_CFG_SYMBOL_MAXWIDTH@GOTPCREL(%rip), %rcx
	andl	(%rcx), %edx
	movq	_IR_CFG_SYMBOL_FMT@GOTPCREL(%rip), %rsi
	movq	_IR_CFG_FORMAT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	_IR_CFG_FORMAT_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edi
	andl	(%rsi), %edi
	orl	%edx, %edi
	movq	_IR_CFG_INT_THRESHOLD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_IR_CFG_INT_LEVEL_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_IR_CFG_INT_LEVEL_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	decl	%edx
	andl	%edx, %esi
	movq	_IR_CFG_MODE_RAW@GOTPCREL(%rip), %rdx
	decl	%eax
	movq	_IR_CFG_FREQ_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movq	_IR_CFG_FREQ_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %ebx
	andl	%eax, %ebx
	orl	%esi, %ebx
	orl	(%rdx), %edi
	orl	%ebx, %edi
	movq	_IR_CONFIG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	callq	_writel_relaxed
	movq	_IR_INTM@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	xorl	%r14d, %r14d
	xorl	%edi, %edi
	callq	_writel_relaxed
	movq	_IR_START@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	movl	$1, %edi
	callq	_writel_relaxed
	jmp	LBB0_5
LBB0_6:
	movl	12(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_5:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IR_ENABLE,8,3                  ## @IR_ENABLE
	.comm	_IR_BUSY,8,3                    ## @IR_BUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"IR_BUSY timeout\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_IR_CFG_SYMBOL_MAXWIDTH,4,2     ## @IR_CFG_SYMBOL_MAXWIDTH
	.comm	_IR_CFG_WIDTH_MASK,4,2          ## @IR_CFG_WIDTH_MASK
	.comm	_IR_CFG_WIDTH_SHIFT,4,2         ## @IR_CFG_WIDTH_SHIFT
	.comm	_IR_CFG_SYMBOL_FMT,4,2          ## @IR_CFG_SYMBOL_FMT
	.comm	_IR_CFG_FORMAT_MASK,4,2         ## @IR_CFG_FORMAT_MASK
	.comm	_IR_CFG_FORMAT_SHIFT,4,2        ## @IR_CFG_FORMAT_SHIFT
	.comm	_IR_CFG_INT_THRESHOLD,4,2       ## @IR_CFG_INT_THRESHOLD
	.comm	_IR_CFG_INT_LEVEL_MASK,4,2      ## @IR_CFG_INT_LEVEL_MASK
	.comm	_IR_CFG_INT_LEVEL_SHIFT,4,2     ## @IR_CFG_INT_LEVEL_SHIFT
	.comm	_IR_CFG_MODE_RAW,4,2            ## @IR_CFG_MODE_RAW
	.comm	_IR_CFG_FREQ_MASK,4,2           ## @IR_CFG_FREQ_MASK
	.comm	_IR_CFG_FREQ_SHIFT,4,2          ## @IR_CFG_FREQ_SHIFT
	.comm	_IR_CONFIG,8,3                  ## @IR_CONFIG
	.comm	_IR_INTM,8,3                    ## @IR_INTM
	.comm	_IR_START,8,3                   ## @IR_START
	.no_dead_strip	_hix5hd2_ir_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hix5hd2_ir_config
_hix5hd2_ir_config:                     ; @hix5hd2_ir_config
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _IR_ENABLE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IR_ENABLE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #1
	bl	_writel_relaxed
	ldr	x8, [x19]
Lloh3:
	adrp	x20, _IR_BUSY@GOTPAGE
Lloh4:
	ldr	x20, [x20, _IR_BUSY@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl_relaxed
	cbz	x0, LBB0_4
; %bb.1:
	mov	w21, #-10001
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	adds	w21, w21, #1
	b.hs	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #1
	bl	_udelay
	ldr	x8, [x19]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl_relaxed
	cbnz	x0, LBB0_2
LBB0_4:
	ldr	w0, [x19, #8]
	mov	w1, #16960
	movk	w1, #15, lsl #16
	bl	_DIV_ROUND_CLOSEST
Lloh5:
	adrp	x8, _IR_CFG_SYMBOL_MAXWIDTH@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IR_CFG_SYMBOL_MAXWIDTH@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _IR_CFG_WIDTH_MASK@GOTPAGE
Lloh9:
	ldr	x9, [x9, _IR_CFG_WIDTH_MASK@GOTPAGEOFF]
Lloh10:
	adrp	x10, _IR_CFG_WIDTH_SHIFT@GOTPAGE
Lloh11:
	ldr	x10, [x10, _IR_CFG_WIDTH_SHIFT@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
Lloh13:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	and	w8, w9, w8
Lloh14:
	adrp	x9, _IR_CFG_SYMBOL_FMT@GOTPAGE
Lloh15:
	ldr	x9, [x9, _IR_CFG_SYMBOL_FMT@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x10, _IR_CFG_FORMAT_MASK@GOTPAGE
Lloh18:
	ldr	x10, [x10, _IR_CFG_FORMAT_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
Lloh20:
	adrp	x11, _IR_CFG_FORMAT_SHIFT@GOTPAGE
Lloh21:
	ldr	x11, [x11, _IR_CFG_FORMAT_SHIFT@GOTPAGEOFF]
Lloh22:
	ldr	w11, [x11]
	lsl	w10, w10, w11
	and	w9, w10, w9
	orr	w8, w9, w8
Lloh23:
	adrp	x9, _IR_CFG_INT_THRESHOLD@GOTPAGE
Lloh24:
	ldr	x9, [x9, _IR_CFG_INT_THRESHOLD@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	sub	w9, w9, #1
Lloh26:
	adrp	x10, _IR_CFG_INT_LEVEL_MASK@GOTPAGE
Lloh27:
	ldr	x10, [x10, _IR_CFG_INT_LEVEL_MASK@GOTPAGEOFF]
Lloh28:
	adrp	x11, _IR_CFG_INT_LEVEL_SHIFT@GOTPAGE
Lloh29:
	ldr	x11, [x11, _IR_CFG_INT_LEVEL_SHIFT@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
Lloh31:
	ldr	w11, [x11]
	lsl	w10, w10, w11
	and	w9, w10, w9
Lloh32:
	adrp	x10, _IR_CFG_MODE_RAW@GOTPAGE
Lloh33:
	ldr	x10, [x10, _IR_CFG_MODE_RAW@GOTPAGEOFF]
Lloh34:
	ldr	w10, [x10]
	sub	w11, w0, #1
Lloh35:
	adrp	x12, _IR_CFG_FREQ_MASK@GOTPAGE
Lloh36:
	ldr	x12, [x12, _IR_CFG_FREQ_MASK@GOTPAGEOFF]
Lloh37:
	adrp	x13, _IR_CFG_FREQ_SHIFT@GOTPAGE
Lloh38:
	ldr	x13, [x13, _IR_CFG_FREQ_SHIFT@GOTPAGEOFF]
Lloh39:
	ldr	w12, [x12]
Lloh40:
	ldr	w13, [x13]
	lsl	w12, w12, w13
	and	w11, w12, w11
	orr	w8, w8, w10
	orr	w8, w8, w9
	orr	w0, w8, w11
	ldr	x8, [x19]
Lloh41:
	adrp	x9, _IR_CONFIG@GOTPAGE
Lloh42:
	ldr	x9, [x9, _IR_CONFIG@GOTPAGEOFF]
Lloh43:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel_relaxed
	ldr	x8, [x19]
Lloh44:
	adrp	x9, _IR_INTM@GOTPAGE
Lloh45:
	ldr	x9, [x9, _IR_INTM@GOTPAGEOFF]
Lloh46:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel_relaxed
	ldr	x8, [x19]
Lloh47:
	adrp	x9, _IR_START@GOTPAGE
Lloh48:
	ldr	x9, [x9, _IR_START@GOTPAGEOFF]
Lloh49:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #1
	bl	_writel_relaxed
	mov	w0, #0
	b	LBB0_6
LBB0_5:
	ldr	w0, [x19, #12]
Lloh50:
	adrp	x1, l_.str@PAGE
Lloh51:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh52:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh53:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh54:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh39
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh30
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpAdd	Lloh50, Lloh51
	.cfi_endproc
                                        ; -- End function
	.comm	_IR_ENABLE,8,3                  ; @IR_ENABLE
	.comm	_IR_BUSY,8,3                    ; @IR_BUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"IR_BUSY timeout\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_IR_CFG_SYMBOL_MAXWIDTH,4,2     ; @IR_CFG_SYMBOL_MAXWIDTH
	.comm	_IR_CFG_WIDTH_MASK,4,2          ; @IR_CFG_WIDTH_MASK
	.comm	_IR_CFG_WIDTH_SHIFT,4,2         ; @IR_CFG_WIDTH_SHIFT
	.comm	_IR_CFG_SYMBOL_FMT,4,2          ; @IR_CFG_SYMBOL_FMT
	.comm	_IR_CFG_FORMAT_MASK,4,2         ; @IR_CFG_FORMAT_MASK
	.comm	_IR_CFG_FORMAT_SHIFT,4,2        ; @IR_CFG_FORMAT_SHIFT
	.comm	_IR_CFG_INT_THRESHOLD,4,2       ; @IR_CFG_INT_THRESHOLD
	.comm	_IR_CFG_INT_LEVEL_MASK,4,2      ; @IR_CFG_INT_LEVEL_MASK
	.comm	_IR_CFG_INT_LEVEL_SHIFT,4,2     ; @IR_CFG_INT_LEVEL_SHIFT
	.comm	_IR_CFG_MODE_RAW,4,2            ; @IR_CFG_MODE_RAW
	.comm	_IR_CFG_FREQ_MASK,4,2           ; @IR_CFG_FREQ_MASK
	.comm	_IR_CFG_FREQ_SHIFT,4,2          ; @IR_CFG_FREQ_SHIFT
	.comm	_IR_CONFIG,8,3                  ; @IR_CONFIG
	.comm	_IR_INTM,8,3                    ; @IR_INTM
	.comm	_IR_START,8,3                   ; @IR_START
	.no_dead_strip	_hix5hd2_ir_config
.subsections_via_symbols
