	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rohm_ts_load_firmware
_rohm_ts_load_firmware:                 ## @rohm_ts_load_firmware
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	-48(%rbp), %rdi
	movq	%r15, %rdx
	callq	_request_firmware
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	movl	%eax, %ecx
	callq	_dev_err
	jmp	LBB0_20
LBB0_2:
	movq	_COORD_UPDATE@GOTPCREL(%rip), %rax
	movq	_CALIBRATION_DONE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_INT_MASK@GOTPCREL(%rip), %r14
	movq	_SLEEP_IN@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	(%r14), %esi
	movq	_SLEEP_OUT@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r15, %rdi
	callq	_i2c_smbus_write_byte_data
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_19
## %bb.3:
	xorl	%ebx, %ebx
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_warn
	movq	_EX_WDAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	jne	LBB0_24
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_EX_ADDR_H@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	jne	LBB0_24
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_EX_ADDR_L@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	jne	LBB0_24
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_COMMON_SETUP1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_COMMON_SETUP1_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	jne	LBB0_24
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movq	-48(%rbp), %rax
	movl	(%rax), %r13d
	testl	%r13d, %r13d
	je	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_FIRMWARE_BLOCK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r13d, %esi
	callq	_min
	movl	%eax, %ebx
	movq	_EX_WDAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rax
	movl	%r14d, %ecx
	shlq	$2, %rcx
	addq	8(%rax), %rcx
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_i2c_smbus_write_i2c_block_data
	testl	%eax, %eax
	jne	LBB0_18
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=2
	addl	%ebx, %r14d
	subl	%ebx, %r13d
	jne	LBB0_11
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_INT_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %r12d
	testl	%eax, %eax
	movq	_INT_MASK@GOTPCREL(%rip), %r14
	js	LBB0_19
## %bb.14:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	_INT_CLEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$255, %edx
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	jne	LBB0_24
## %bb.15:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	_PROGRAM_LOAD_DONE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	je	LBB0_26
## %bb.16:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	incl	%ebx
	movq	_FIRMWARE_RETRY_MAX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jbe	LBB0_4
## %bb.17:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_19
LBB0_18:
	movl	%eax, %r12d
	movq	_INT_MASK@GOTPCREL(%rip), %r14
	jmp	LBB0_19
LBB0_24:
	movl	%eax, %r12d
LBB0_19:
	movl	(%r14), %esi
	movq	_INT_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_i2c_smbus_write_byte_data
	movl	%eax, %ebx
	movq	-48(%rbp), %rdi
	callq	_release_firmware
	testl	%r12d, %r12d
	cmovnel	%r12d, %ebx
LBB0_20:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_26:
	xorl	%r12d, %r12d
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to retrieve firmware %s: %d\n"

	.comm	_INT_MASK,4,2                   ## @INT_MASK
	.comm	_COORD_UPDATE,4,2               ## @COORD_UPDATE
	.comm	_CALIBRATION_DONE,4,2           ## @CALIBRATION_DONE
	.comm	_SLEEP_IN,4,2                   ## @SLEEP_IN
	.comm	_SLEEP_OUT,4,2                  ## @SLEEP_OUT
L_.str.1:                               ## @.str.1
	.asciz	"retrying firmware load\n"

	.comm	_EX_WDAT,4,2                    ## @EX_WDAT
	.comm	_EX_ADDR_H,4,2                  ## @EX_ADDR_H
	.comm	_EX_ADDR_L,4,2                  ## @EX_ADDR_L
	.comm	_COMMON_SETUP1,4,2              ## @COMMON_SETUP1
	.comm	_COMMON_SETUP1_DEFAULT,4,2      ## @COMMON_SETUP1_DEFAULT
	.comm	_FIRMWARE_BLOCK_SIZE,4,2        ## @FIRMWARE_BLOCK_SIZE
	.comm	_INT_STATUS,4,2                 ## @INT_STATUS
	.comm	_INT_CLEAR,4,2                  ## @INT_CLEAR
	.comm	_PROGRAM_LOAD_DONE,4,2          ## @PROGRAM_LOAD_DONE
	.comm	_EIO,4,2                        ## @EIO
	.comm	_FIRMWARE_RETRY_MAX,4,2         ## @FIRMWARE_RETRY_MAX
	.comm	_INT_ALL,4,2                    ## @INT_ALL
	.no_dead_strip	_rohm_ts_load_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rohm_ts_load_firmware
_rohm_ts_load_firmware:                 ; @rohm_ts_load_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x1
	mov	x19, x0
	add	x0, sp, #8
	mov	x2, x19
	bl	_request_firmware
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	mov	x3, x20
	bl	_dev_err
	b	LBB0_20
LBB0_2:
Lloh2:
	adrp	x24, _INT_MASK@GOTPAGE
Lloh3:
	ldr	x24, [x24, _INT_MASK@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh4:
	adrp	x8, _COORD_UPDATE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _COORD_UPDATE@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _CALIBRATION_DONE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _CALIBRATION_DONE@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh10:
	adrp	x9, _SLEEP_IN@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SLEEP_IN@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh13:
	adrp	x9, _SLEEP_OUT@GOTPAGE
Lloh14:
	ldr	x9, [x9, _SLEEP_OUT@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_i2c_smbus_write_byte_data
	mov	x21, x0
	cbnz	w0, LBB0_19
; %bb.3:
	mov	w25, #0
Lloh16:
	adrp	x26, _EX_ADDR_H@GOTPAGE
Lloh17:
	ldr	x26, [x26, _EX_ADDR_H@GOTPAGEOFF]
Lloh18:
	adrp	x28, _FIRMWARE_BLOCK_SIZE@GOTPAGE
Lloh19:
	ldr	x28, [x28, _FIRMWARE_BLOCK_SIZE@GOTPAGEOFF]
Lloh20:
	adrp	x20, _EX_WDAT@GOTPAGE
Lloh21:
	ldr	x20, [x20, _EX_WDAT@GOTPAGEOFF]
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	cbz	w25, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #0
	bl	_i2c_smbus_write_byte_data
	cbnz	w0, LBB0_18
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x26]
	mov	x0, x19
	mov	w2, #0
	bl	_i2c_smbus_write_byte_data
	cbnz	w0, LBB0_18
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh24:
	adrp	x8, _EX_ADDR_L@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EX_ADDR_L@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_i2c_smbus_write_byte_data
	cbnz	w0, LBB0_18
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh27:
	adrp	x8, _COMMON_SETUP1@GOTPAGE
Lloh28:
	ldr	x8, [x8, _COMMON_SETUP1@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
Lloh30:
	adrp	x8, _COMMON_SETUP1_DEFAULT@GOTPAGE
Lloh31:
	ldr	x8, [x8, _COMMON_SETUP1_DEFAULT@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_i2c_smbus_write_byte_data
	cbnz	w0, LBB0_18
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [sp, #8]
	ldr	w22, [x8]
	cbz	w22, LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w27, #0
LBB0_11:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x28]
	mov	x1, x22
	bl	_min
	mov	x23, x0
	ldr	w1, [x20]
	ldr	x8, [sp, #8]
	ldr	x8, [x8, #8]
	add	x3, x8, w27, uxtw #2
	mov	x0, x19
	mov	x2, x23
	bl	_i2c_smbus_write_i2c_block_data
	cbnz	w0, LBB0_18
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=2
	add	w27, w23, w27
	subs	w22, w22, w23
	b.ne	LBB0_11
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh33:
	adrp	x8, _INT_STATUS@GOTPAGE
Lloh34:
	ldr	x8, [x8, _INT_STATUS@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_i2c_smbus_read_byte_data
	mov	x21, x0
	tbnz	w0, #31, LBB0_19
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
Lloh36:
	adrp	x8, _INT_CLEAR@GOTPAGE
Lloh37:
	ldr	x8, [x8, _INT_CLEAR@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #255
	bl	_i2c_smbus_write_byte_data
	cbnz	w0, LBB0_18
; %bb.15:                               ;   in Loop: Header=BB0_4 Depth=1
Lloh39:
	adrp	x8, _PROGRAM_LOAD_DONE@GOTPAGE
Lloh40:
	ldr	x8, [x8, _PROGRAM_LOAD_DONE@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	cmp	w21, w8
	b.eq	LBB0_21
; %bb.16:                               ;   in Loop: Header=BB0_4 Depth=1
	add	w25, w25, #1
Lloh42:
	adrp	x8, _FIRMWARE_RETRY_MAX@GOTPAGE
Lloh43:
	ldr	x8, [x8, _FIRMWARE_RETRY_MAX@GOTPAGEOFF]
Lloh44:
	ldr	w8, [x8]
	cmp	w25, w8
	b.ls	LBB0_4
; %bb.17:
Lloh45:
	adrp	x8, _EIO@GOTPAGE
Lloh46:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh47:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_19
LBB0_18:
	mov	x21, x0
LBB0_19:
	ldr	w1, [x24]
Lloh48:
	adrp	x8, _INT_ALL@GOTPAGE
Lloh49:
	ldr	x8, [x8, _INT_ALL@GOTPAGEOFF]
Lloh50:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_i2c_smbus_write_byte_data
	mov	x19, x0
	ldr	x0, [sp, #8]
	bl	_release_firmware
	cmp	w21, #0
	csel	w20, w19, w21, eq
LBB0_20:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_21:
	mov	w21, #0
	b	LBB0_19
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to retrieve firmware %s: %d\n"

	.comm	_INT_MASK,4,2                   ; @INT_MASK
	.comm	_COORD_UPDATE,4,2               ; @COORD_UPDATE
	.comm	_CALIBRATION_DONE,4,2           ; @CALIBRATION_DONE
	.comm	_SLEEP_IN,4,2                   ; @SLEEP_IN
	.comm	_SLEEP_OUT,4,2                  ; @SLEEP_OUT
l_.str.1:                               ; @.str.1
	.asciz	"retrying firmware load\n"

	.comm	_EX_WDAT,4,2                    ; @EX_WDAT
	.comm	_EX_ADDR_H,4,2                  ; @EX_ADDR_H
	.comm	_EX_ADDR_L,4,2                  ; @EX_ADDR_L
	.comm	_COMMON_SETUP1,4,2              ; @COMMON_SETUP1
	.comm	_COMMON_SETUP1_DEFAULT,4,2      ; @COMMON_SETUP1_DEFAULT
	.comm	_FIRMWARE_BLOCK_SIZE,4,2        ; @FIRMWARE_BLOCK_SIZE
	.comm	_INT_STATUS,4,2                 ; @INT_STATUS
	.comm	_INT_CLEAR,4,2                  ; @INT_CLEAR
	.comm	_PROGRAM_LOAD_DONE,4,2          ; @PROGRAM_LOAD_DONE
	.comm	_EIO,4,2                        ; @EIO
	.comm	_FIRMWARE_RETRY_MAX,4,2         ; @FIRMWARE_RETRY_MAX
	.comm	_INT_ALL,4,2                    ; @INT_ALL
	.no_dead_strip	_rohm_ts_load_firmware
.subsections_via_symbols
