	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlxsw_i2c_write
_mlxsw_i2c_write:                       ## @mlxsw_i2c_write
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -88(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r15d
	movq	%rdx, -120(%rbp)                ## 8-byte Spill
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	callq	_to_i2c_client
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_i2c_get_clientdata
	movq	%rax, %r13
	movq	_MLXSW_I2C_TIMEOUT_MSECS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movl	8(%r13), %r14d
	movq	_MLXSW_I2C_PUSH_CMD_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_MLXSW_I2C_WRITE_MSG
	movq	%rax, -144(%rbp)
	movq	_MLXSW_I2C_ADDR_BUF_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r13), %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rdx
	movq	%rax, -136(%rbp)
	testl	%r15d, %r15d
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	jle	LBB0_12
## %bb.3:
	movl	%r14d, %esi
	movl	%r15d, %eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	_jiffies@GOTPCREL(%rip), %r12
	leaq	-144(%rbp), %r14
	xorl	%eax, %eax
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, -104(%rbp)                ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	addl	%eax, %esi
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	subq	%rax, %rcx
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	incq	%rax
	cmpq	-96(%rbp), %rax                 ## 8-byte Folded Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	-104(%rbp), %r13                ## 8-byte Reload
	je	LBB0_12
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
                                        ##       Child Loop BB0_6 Depth 3
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	(%r13), %rax
	cmpq	%rax, %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	cmovbq	%rcx, %rax
	movslq	%eax, %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	_MLXSW_I2C_ADDR_WIDTH@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	%rcx, %rax
	movq	%rax, -144(%rbp)
	movq	%r13, %r15
	movq	%rdx, %r13
	movq	%rdx, %rdi
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	callq	_mlxsw_i2c_set_slave_addr
	movq	_MLXSW_I2C_ADDR_BUF_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(,%rax,4), %rdi
	addq	%r13, %rdi
	movq	(%r15), %rax
	imulq	-80(%rbp), %rax                 ## 8-byte Folded Reload
	movq	-120(%rbp), %rcx                ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rsi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movq	(%r12), %r13
	addq	-112(%rbp), %r13                ## 8-byte Folded Reload
	xorl	%eax, %eax
LBB0_5:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_6 Depth 3
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ##     Parent Loop BB0_5 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movl	4(%rbx), %edi
	movq	%r14, %rsi
	movl	$1, %edx
	callq	_i2c_transfer
	cmpl	$1, %eax
	je	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=3
	movl	%eax, %r15d
	xorl	%eax, %eax
	callq	_cond_resched
	movq	(%r12), %rdi
	movq	%r13, %rsi
	callq	_time_before
	testq	%rax, %rax
	jne	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=2
	movq	-128(%rbp), %rdx                ## 8-byte Reload
	leal	1(%rdx), %eax
	movq	_MLXSW_I2C_RETRY@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edx
                                        ## kill: def $eax killed $eax def $rax
	jl	LBB0_5
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	testl	%r15d, %r15d
	jne	LBB0_11
## %bb.10:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_21
LBB0_12:
	movq	%rdx, %r15
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	_mlxsw_i2c_write_cmd
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_19:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_20
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_22
LBB0_14:
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	_mlxsw_i2c_wait_go_bit
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_20:
	movq	%r15, %rdi
LBB0_21:
	callq	_kfree
LBB0_22:
	movl	%r12d, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movl	(%r14), %edx
	testl	%edx, %edx
	je	LBB0_17
## %bb.18:
	leaq	L_.str.2(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_19
LBB0_17:
	xorl	%r12d, %r12d
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_MLXSW_I2C_TIMEOUT_MSECS,4,2    ## @MLXSW_I2C_TIMEOUT_MSECS
	.comm	_MLXSW_I2C_PUSH_CMD_SIZE,4,2    ## @MLXSW_I2C_PUSH_CMD_SIZE
	.comm	_MLXSW_I2C_ADDR_BUF_SIZE,8,3    ## @MLXSW_I2C_ADDR_BUF_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MLXSW_I2C_ADDR_WIDTH,8,3       ## @MLXSW_I2C_ADDR_WIDTH
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_MLXSW_I2C_RETRY,4,2            ## @MLXSW_I2C_RETRY
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not start transaction"

L_.str.1:                               ## @.str.1
	.asciz	"HW semaphore is not released"

L_.str.2:                               ## @.str.2
	.asciz	"Bad transaction completion status %x\n"

	.no_dead_strip	_mlxsw_i2c_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlxsw_i2c_write
_mlxsw_i2c_write:                       ; @mlxsw_i2c_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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	x19, x4
	mov	x27, x3
	str	x2, [sp, #56]                   ; 8-byte Folded Spill
	mov	x24, x1
	bl	_to_i2c_client
	mov	x20, x0
	bl	_i2c_get_clientdata
	mov	x22, x0
Lloh0:
	adrp	x8, _MLXSW_I2C_TIMEOUT_MSECS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLXSW_I2C_TIMEOUT_MSECS@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	str	x0, [sp, #48]                   ; 8-byte Folded Spill
	ldr	w26, [x22, #8]
Lloh3:
	adrp	x8, _MLXSW_I2C_PUSH_CMD_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MLXSW_I2C_PUSH_CMD_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, #0
	bl	_MLXSW_I2C_WRITE_MSG
	str	x0, [sp, #64]
Lloh6:
	adrp	x9, _MLXSW_I2C_ADDR_BUF_SIZE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MLXSW_I2C_ADDR_BUF_SIZE@GOTPAGEOFF]
	ldr	x8, [x22]
Lloh8:
	ldr	x9, [x9]
	add	x0, x9, x8
Lloh9:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_13
; %bb.1:
	mov	x21, x0
	str	x19, [sp, #16]                  ; 8-byte Folded Spill
	str	x0, [sp, #72]
	cmp	w27, #1
	b.lt	LBB0_10
; %bb.2:
	mov	x23, #0
Lloh12:
	adrp	x25, _jiffies@GOTPAGE
Lloh13:
	ldr	x25, [x25, _jiffies@GOTPAGEOFF]
	mov	w8, w27
	stp	x8, x22, [sp, #24]              ; 16-byte Folded Spill
	str	x21, [sp, #40]                  ; 8-byte Folded Spill
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w26, w26, w27
	sub	x24, x24, x19
	add	x23, x23, #1
	ldp	x8, x22, [sp, #24]              ; 16-byte Folded Reload
	cmp	x23, x8
	ldr	x21, [sp, #40]                  ; 8-byte Folded Reload
	b.eq	LBB0_10
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	ldr	x8, [x22]
	cmp	x24, x8
	csel	x27, x24, x8, lo
Lloh14:
	adrp	x8, _MLXSW_I2C_ADDR_WIDTH@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MLXSW_I2C_ADDR_WIDTH@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	sxtw	x19, w27
	add	x8, x19, x8
	str	x8, [sp, #64]
	mov	x0, x21
	mov	x1, x26
	bl	_mlxsw_i2c_set_slave_addr
Lloh17:
	adrp	x8, _MLXSW_I2C_ADDR_BUF_SIZE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MLXSW_I2C_ADDR_BUF_SIZE@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	add	x0, x21, x8, lsl #2
	ldr	x8, [x22]
	mul	x8, x8, x23
	ldr	x9, [sp, #56]                   ; 8-byte Folded Reload
	add	x1, x9, x8, lsl #2
	mov	x2, x27
	bl	_memcpy
	mov	w22, #0
	ldr	x8, [x25]
	ldr	x9, [sp, #48]                   ; 8-byte Folded Reload
	add	x28, x8, x9
LBB0_5:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x20, #4]
	add	x1, sp, #64
	mov	w2, #1
	bl	_i2c_transfer
	cmp	w0, #1
	b.eq	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	x21, x0
	bl	_cond_resched
	ldr	x0, [x25]
	mov	x1, x28
	bl	_time_before
	cbnz	x0, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=2
	add	w8, w22, #1
Lloh20:
	adrp	x9, _MLXSW_I2C_RETRY@GOTPAGE
Lloh21:
	ldr	x9, [x9, _MLXSW_I2C_RETRY@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	cmp	w22, w9
	mov	x22, x8
	b.lt	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	cbnz	w21, LBB0_3
; %bb.9:
Lloh23:
	adrp	x8, _EIO@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w22, w8
	ldr	x21, [sp, #40]                  ; 8-byte Folded Reload
	b	LBB0_16
LBB0_10:
	mov	x0, x20
	mov	x1, x22
	mov	w2, #0
	bl	_mlxsw_i2c_write_cmd
	cbz	w0, LBB0_14
; %bb.11:
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
LBB0_12:
	mov	x0, x20
	bl	_dev_err
Lloh28:
	adrp	x8, _EIO@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_16
LBB0_13:
Lloh31:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_17
LBB0_14:
	mov	x0, x20
	mov	x1, x22
	ldr	x19, [sp, #16]                  ; 8-byte Folded Reload
	mov	x2, x19
	bl	_mlxsw_i2c_wait_go_bit
	cbz	w0, LBB0_18
; %bb.15:
	mov	x22, x0
Lloh34:
	adrp	x1, l_.str.1@PAGE
Lloh35:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_err
LBB0_16:
	mov	x0, x21
	bl	_kfree
LBB0_17:
	mov	x0, x22
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_18:
	ldr	w8, [x19]
	cbz	w8, LBB0_20
; %bb.19:
	str	x8, [sp]
Lloh36:
	adrp	x1, l_.str.2@PAGE
Lloh37:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_12
LBB0_20:
	mov	w22, #0
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_MLXSW_I2C_TIMEOUT_MSECS,4,2    ; @MLXSW_I2C_TIMEOUT_MSECS
	.comm	_MLXSW_I2C_PUSH_CMD_SIZE,4,2    ; @MLXSW_I2C_PUSH_CMD_SIZE
	.comm	_MLXSW_I2C_ADDR_BUF_SIZE,8,3    ; @MLXSW_I2C_ADDR_BUF_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MLXSW_I2C_ADDR_WIDTH,8,3       ; @MLXSW_I2C_ADDR_WIDTH
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_MLXSW_I2C_RETRY,4,2            ; @MLXSW_I2C_RETRY
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not start transaction"

l_.str.1:                               ; @.str.1
	.asciz	"HW semaphore is not released"

l_.str.2:                               ; @.str.2
	.asciz	"Bad transaction completion status %x\n"

	.no_dead_strip	_mlxsw_i2c_write
.subsections_via_symbols
