	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mediatek_gpio_xlate
_mediatek_gpio_xlate:                   ## @mediatek_gpio_xlate
	.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	%rdx, %r14
	movq	%rsi, %rbx
	movq	(%rsi), %rax
	movl	(%rax), %r15d
	callq	_to_mediatek_gpio
	movl	(%rax), %edi
	movq	_MTK_BANK_WIDTH@GOTPCREL(%rip), %rsi
	movl	(%rsi), %ecx
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	cmpl	%eax, %edi
	jne	LBB0_1
## %bb.2:
	testq	%r14, %r14
	je	LBB0_4
## %bb.3:
	movq	(%rbx), %rax
	movl	4(%rax), %eax
	movl	%eax, (%r14)
	movl	(%rsi), %ecx
LBB0_4:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	jmp	LBB0_5
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTK_BANK_WIDTH,4,2             ## @MTK_BANK_WIDTH
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_mediatek_gpio_xlate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mediatek_gpio_xlate
_mediatek_gpio_xlate:                   ; @mediatek_gpio_xlate
	.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, x2
	mov	x20, x1
	ldr	x8, [x1]
	ldr	w21, [x8]
	bl	_to_mediatek_gpio
	ldr	w10, [x0]
Lloh0:
	adrp	x9, _MTK_BANK_WIDTH@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MTK_BANK_WIDTH@GOTPAGEOFF]
	ldr	w8, [x9]
	sdiv	w11, w21, w8
	cmp	w10, w11
	b.ne	LBB0_4
; %bb.1:
	cbz	x19, LBB0_3
; %bb.2:
	ldr	x8, [x20]
	ldr	w8, [x8, #4]
	str	w8, [x19]
	ldr	w8, [x9]
LBB0_3:
	sdiv	w9, w21, w8
	msub	w0, w9, w8, w21
	b	LBB0_5
LBB0_4:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_MTK_BANK_WIDTH,4,2             ; @MTK_BANK_WIDTH
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_mediatek_gpio_xlate
.subsections_via_symbols
