	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kworld_sbtvd_gate_ctrl
_kworld_sbtvd_gate_ctrl:                ## @kworld_sbtvd_gate_ctrl
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %r14d
	movq	(%rdi), %rax
	movq	(%rax), %rbx
	movw	$-26811, -22(%rbp)              ## imm = 0x9745
	movw	$-16059, -20(%rbp)              ## imm = 0xC145
	movw	$-32443, -18(%rbp)              ## imm = 0x8145
	movl	$75, -48(%rbp)
	leaq	-22(%rbp), %rax
	movq	%rax, -40(%rbp)
	movq	$2, -32(%rbp)
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_i2c_transfer
	cmpl	$1, %eax
	jne	LBB0_1
## %bb.2:
	testl	%r14d, %r14d
	leaq	-18(%rbp), %rax
	leaq	-20(%rbp), %rcx
	cmoveq	%rax, %rcx
	movq	%rcx, -40(%rbp)
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_i2c_transfer
	cmpl	$1, %eax
	jne	LBB0_1
## %bb.3:
	movl	$20, %edi
	callq	_msleep
	xorl	%eax, %eax
	jmp	LBB0_4
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_warn
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not access the I2C gate\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_kworld_sbtvd_gate_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function kworld_sbtvd_gate_ctrl
lCPI0_0:
	.long	2                               ; 0x2
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_kworld_sbtvd_gate_ctrl:                ; @kworld_sbtvd_gate_ctrl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	ldr	x8, [x0]
	ldr	x19, [x8]
	mov	w8, #38725
	sturh	w8, [x29, #-18]
	mov	w8, #49477
	sturh	w8, [x29, #-20]
	mov	w8, #33093
	sturh	w8, [x29, #-22]
	mov	w8, #75
	str	w8, [sp]
	sub	x8, x29, #18
	str	x8, [sp, #8]
Lloh0:
	adrp	x8, lCPI0_0@PAGE
Lloh1:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [sp, #16]
	mov	x1, sp
	mov	x0, x19
	mov	w2, #1
	bl	_i2c_transfer
	cmp	w0, #1
	b.ne	LBB0_3
; %bb.1:
	cmp	w20, #0
	sub	x8, x29, #20
	sub	x9, x29, #22
	csel	x8, x9, x8, eq
	str	x8, [sp, #8]
	mov	x1, sp
	mov	x0, x19
	mov	w2, #1
	bl	_i2c_transfer
	cmp	w0, #1
	b.ne	LBB0_3
; %bb.2:
	mov	w0, #20
	bl	_msleep
	mov	w0, #0
	b	LBB0_4
LBB0_3:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
Lloh4:
	adrp	x8, _EIO@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdr	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not access the I2C gate\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_kworld_sbtvd_gate_ctrl
.subsections_via_symbols
