	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function twl_request
_twl_request:                           ## @twl_request
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	callq	_gpiochip_get_data
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_mutex_lock
	movq	_TWL4030_GPIO_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%r14d, %eax
	jbe	LBB0_5
## %bb.1:
	cmpl	$0, 4(%r15)
	jne	LBB0_12
## %bb.2:
	movq	_MASK_GPIO_CTRL_GPIO_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	(%rbx), %edi
	callq	_dev_get_platdata
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movl	(%rax), %eax
	andl	$3, %eax
	orl	%eax, %r12d
LBB0_4:
	movq	_REG_GPIO_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r12d, %esi
	callq	_gpio_twl4030_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_17
	jmp	LBB0_12
LBB0_5:
	movq	_LEDEN_LEDAON@GOTPCREL(%rip), %rcx
	movq	_LEDEN_LEDAEXT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r12d
	orl	(%rcx), %r12d
	movq	_LEDEN_LEDAPWM@GOTPCREL(%rip), %rcx
	orl	(%rcx), %r12d
	movq	_LEDEN_PWM_LENGTHA@GOTPCREL(%rip), %rcx
	orl	(%rcx), %r12d
	subl	%eax, %r14d
	setne	%cl
	jne	LBB0_7
## %bb.6:
	movq	_TWL4030_PWMAON_REG@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_7:
	movq	_TWL4030_PWMBON_REG@GOTPCREL(%rip), %rax
LBB0_8:
	shll	%cl, %r12d
	movl	(%rax), %r13d
	movq	_TWL4030_MODULE_LED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leal	1(%r13), %edx
	movl	$127, %esi
	callq	_twl_i2c_write_u8
	testl	%eax, %eax
	js	LBB0_16
## %bb.9:
	movq	_TWL4030_MODULE_LED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$127, %esi
	movl	%r13d, %edx
	callq	_twl_i2c_write_u8
	testl	%eax, %eax
	js	LBB0_16
## %bb.10:
	movq	_TWL4030_MODULE_LED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_TWL4030_LED_LEDEN_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_cached_leden@GOTPCREL(%rip), %r13
	movq	%r13, %rsi
	callq	_twl_i2c_read_u8
	testl	%eax, %eax
	js	LBB0_16
## %bb.11:
	notl	%r12d
	andl	(%r13), %r12d
	movl	%r12d, (%r13)
	movq	_TWL4030_MODULE_LED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_TWL4030_LED_LEDEN_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r12d, %esi
	callq	_twl_i2c_write_u8
	testl	%eax, %eax
	js	LBB0_16
LBB0_12:
	movl	%r14d, %edi
	callq	_BIT
	orl	%eax, 4(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_17
LBB0_16:
	movl	%eax, %ebx
LBB0_17:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TWL4030_GPIO_MAX,4,2           ## @TWL4030_GPIO_MAX
	.comm	_LEDEN_LEDAON,4,2               ## @LEDEN_LEDAON
	.comm	_LEDEN_LEDAEXT,4,2              ## @LEDEN_LEDAEXT
	.comm	_LEDEN_LEDAPWM,4,2              ## @LEDEN_LEDAPWM
	.comm	_LEDEN_PWM_LENGTHA,4,2          ## @LEDEN_PWM_LENGTHA
	.comm	_TWL4030_PWMAON_REG,4,2         ## @TWL4030_PWMAON_REG
	.comm	_TWL4030_PWMBON_REG,4,2         ## @TWL4030_PWMBON_REG
	.comm	_TWL4030_MODULE_LED,4,2         ## @TWL4030_MODULE_LED
	.comm	_cached_leden,4,2               ## @cached_leden
	.comm	_TWL4030_LED_LEDEN_REG,4,2      ## @TWL4030_LED_LEDEN_REG
	.comm	_MASK_GPIO_CTRL_GPIO_ON,4,2     ## @MASK_GPIO_CTRL_GPIO_ON
	.comm	_REG_GPIO_CTRL,4,2              ## @REG_GPIO_CTRL
	.no_dead_strip	_twl_request
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function twl_request
_twl_request:                           ; @twl_request
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x1
	mov	x22, x0
	bl	_gpiochip_get_data
	mov	x19, x0
	bl	_mutex_lock
Lloh0:
	adrp	x8, _TWL4030_GPIO_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TWL4030_GPIO_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ls	LBB0_5
; %bb.1:
	ldr	w8, [x19, #4]
	cbnz	w8, LBB0_9
; %bb.2:
Lloh3:
	adrp	x8, _MASK_GPIO_CTRL_GPIO_ON@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MASK_GPIO_CTRL_GPIO_ON@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	ldr	w0, [x22]
	bl	_dev_get_platdata
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w8, [x0]
	and	w8, w8, #0x3
	orr	w21, w8, w21
LBB0_4:
Lloh6:
	adrp	x8, _REG_GPIO_CTRL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REG_GPIO_CTRL@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_gpio_twl4030_write
	mov	x21, x0
	cbnz	w0, LBB0_11
	b	LBB0_9
LBB0_5:
Lloh9:
	adrp	x9, _LEDEN_LEDAON@GOTPAGE
Lloh10:
	ldr	x9, [x9, _LEDEN_LEDAON@GOTPAGEOFF]
Lloh11:
	ldr	w23, [x9]
Lloh12:
	adrp	x9, _LEDEN_LEDAEXT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _LEDEN_LEDAEXT@GOTPAGEOFF]
Lloh14:
	ldr	w24, [x9]
Lloh15:
	adrp	x9, _LEDEN_LEDAPWM@GOTPAGE
Lloh16:
	ldr	x9, [x9, _LEDEN_LEDAPWM@GOTPAGEOFF]
Lloh17:
	ldr	w25, [x9]
Lloh18:
	adrp	x9, _LEDEN_PWM_LENGTHA@GOTPAGE
Lloh19:
	ldr	x9, [x9, _LEDEN_PWM_LENGTHA@GOTPAGEOFF]
Lloh20:
	ldr	w26, [x9]
	subs	w20, w20, w8
	cset	w27, ne
Lloh21:
	adrp	x8, _TWL4030_PWMAON_REG@GOTPAGE
Lloh22:
	ldr	x8, [x8, _TWL4030_PWMAON_REG@GOTPAGEOFF]
Lloh23:
	adrp	x9, _TWL4030_PWMBON_REG@GOTPAGE
Lloh24:
	ldr	x9, [x9, _TWL4030_PWMBON_REG@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w22, [x8]
Lloh25:
	adrp	x28, _TWL4030_MODULE_LED@GOTPAGE
Lloh26:
	ldr	x28, [x28, _TWL4030_MODULE_LED@GOTPAGEOFF]
	ldr	w0, [x28]
	add	w2, w22, #1
	mov	w1, #127
	bl	_twl_i2c_write_u8
	tbnz	w0, #31, LBB0_10
; %bb.6:
	ldr	w0, [x28]
	mov	w1, #127
	mov	x2, x22
	bl	_twl_i2c_write_u8
	tbnz	w0, #31, LBB0_10
; %bb.7:
	ldr	w0, [x28]
Lloh27:
	adrp	x8, _TWL4030_LED_LEDEN_REG@GOTPAGE
Lloh28:
	ldr	x8, [x8, _TWL4030_LED_LEDEN_REG@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
Lloh30:
	adrp	x22, _cached_leden@GOTPAGE
Lloh31:
	ldr	x22, [x22, _cached_leden@GOTPAGEOFF]
	mov	x1, x22
	bl	_twl_i2c_read_u8
	tbnz	w0, #31, LBB0_10
; %bb.8:
	orr	w8, w24, w23
	orr	w8, w8, w25
	orr	w8, w8, w26
	lsl	w8, w8, w27
	ldr	w9, [x22]
	bic	w1, w9, w8
	str	w1, [x22]
	ldr	w0, [x28]
Lloh32:
	adrp	x8, _TWL4030_LED_LEDEN_REG@GOTPAGE
Lloh33:
	ldr	x8, [x8, _TWL4030_LED_LEDEN_REG@GOTPAGEOFF]
Lloh34:
	ldr	w2, [x8]
	bl	_twl_i2c_write_u8
	tbnz	w0, #31, LBB0_10
LBB0_9:
	mov	x0, x20
	bl	_BIT
	mov	w21, #0
	ldr	w8, [x19, #4]
	orr	w8, w8, w0
	str	w8, [x19, #4]
	b	LBB0_11
LBB0_10:
	mov	x21, x0
LBB0_11:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_TWL4030_GPIO_MAX,4,2           ; @TWL4030_GPIO_MAX
	.comm	_LEDEN_LEDAON,4,2               ; @LEDEN_LEDAON
	.comm	_LEDEN_LEDAEXT,4,2              ; @LEDEN_LEDAEXT
	.comm	_LEDEN_LEDAPWM,4,2              ; @LEDEN_LEDAPWM
	.comm	_LEDEN_PWM_LENGTHA,4,2          ; @LEDEN_PWM_LENGTHA
	.comm	_TWL4030_PWMAON_REG,4,2         ; @TWL4030_PWMAON_REG
	.comm	_TWL4030_PWMBON_REG,4,2         ; @TWL4030_PWMBON_REG
	.comm	_TWL4030_MODULE_LED,4,2         ; @TWL4030_MODULE_LED
	.comm	_cached_leden,4,2               ; @cached_leden
	.comm	_TWL4030_LED_LEDEN_REG,4,2      ; @TWL4030_LED_LEDEN_REG
	.comm	_MASK_GPIO_CTRL_GPIO_ON,4,2     ; @MASK_GPIO_CTRL_GPIO_ON
	.comm	_REG_GPIO_CTRL,4,2              ; @REG_GPIO_CTRL
	.no_dead_strip	_twl_request
.subsections_via_symbols
