	.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
	movq	_gpio_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_TWL4030_GPIO_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%r14d, %eax
	jbe	LBB0_3
## %bb.1:
	movq	_gpio_usage_count@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	testl	%eax, %eax
	je	LBB0_10
LBB0_2:
	btsl	%r14d, %eax
	movl	%eax, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_3:
	movq	_LEDEN_LEDAON@GOTPCREL(%rip), %rcx
	movq	_LEDEN_LEDAEXT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r15d
	orl	(%rcx), %r15d
	movq	_LEDEN_LEDAPWM@GOTPCREL(%rip), %rcx
	orl	(%rcx), %r15d
	movq	_LEDEN_PWM_LENGTHA@GOTPCREL(%rip), %rcx
	orl	(%rcx), %r15d
	cmpl	%r14d, %eax
	setne	%cl
	jne	LBB0_5
## %bb.4:
	movq	_TWL4030_MODULE_PWMA@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_5:
	movq	_TWL4030_MODULE_PWMB@GOTPCREL(%rip), %rax
LBB0_6:
	shll	%cl, %r15d
	movl	(%rax), %r14d
	movq	_TWL4030_PWMx_PWMxOFF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	movl	$127, %esi
	callq	_twl4030_i2c_write_u8
	testl	%eax, %eax
	js	LBB0_14
## %bb.7:
	movq	_TWL4030_PWMx_PWMxON@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	movl	$127, %esi
	callq	_twl4030_i2c_write_u8
	testl	%eax, %eax
	js	LBB0_14
## %bb.8:
	movq	_TWL4030_MODULE_LED@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_TWL4030_LED_LEDEN@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	_cached_leden@GOTPCREL(%rip), %r12
	movl	%r14d, %edi
	movq	%r12, %rsi
	callq	_twl4030_i2c_read_u8
	testl	%eax, %eax
	js	LBB0_14
## %bb.9:
	notl	%r15d
	andl	(%r12), %r15d
	movl	%r15d, (%r12)
	movl	(%r13), %edx
	movl	%r14d, %edi
	movl	%r15d, %esi
	callq	_twl4030_i2c_write_u8
	movl	%eax, %ebx
	sarl	$31, %ebx
	andl	%eax, %ebx
	jmp	LBB0_15
LBB0_14:
	movl	%eax, %ebx
	jmp	LBB0_15
LBB0_10:
	movq	_MASK_GPIO_CTRL_GPIO_ON@GOTPCREL(%rip), %rax
	movq	(%rbx), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx), %esi
	andl	$3, %esi
	orl	(%rax), %esi
	movq	_REG_GPIO_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_gpio_twl4030_write
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_11
LBB0_15:
	movq	_gpio_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	(%r15), %eax
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_gpio_lock,4,2                  ## @gpio_lock
	.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_MODULE_PWMA,4,2        ## @TWL4030_MODULE_PWMA
	.comm	_TWL4030_MODULE_PWMB,4,2        ## @TWL4030_MODULE_PWMB
	.comm	_TWL4030_PWMx_PWMxOFF,4,2       ## @TWL4030_PWMx_PWMxOFF
	.comm	_TWL4030_PWMx_PWMxON,4,2        ## @TWL4030_PWMx_PWMxON
	.comm	_TWL4030_MODULE_LED,4,2         ## @TWL4030_MODULE_LED
	.comm	_cached_leden,4,2               ## @cached_leden
	.comm	_TWL4030_LED_LEDEN,4,2          ## @TWL4030_LED_LEDEN
	.comm	_gpio_usage_count,4,2           ## @gpio_usage_count
	.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	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x0, _gpio_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _gpio_lock@GOTPAGEOFF]
	bl	_mutex_lock
Lloh2:
	adrp	x8, _TWL4030_GPIO_MAX@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TWL4030_GPIO_MAX@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ls	LBB0_3
; %bb.1:
Lloh5:
	adrp	x21, _gpio_usage_count@GOTPAGE
Lloh6:
	ldr	x21, [x21, _gpio_usage_count@GOTPAGEOFF]
	ldr	w8, [x21]
	cbz	w8, LBB0_8
LBB0_2:
	mov	w20, #0
	mov	w9, #1
	lsl	w9, w9, w19
	orr	w8, w8, w9
	str	w8, [x21]
	b	LBB0_9
LBB0_3:
Lloh7:
	adrp	x9, _LEDEN_LEDAON@GOTPAGE
Lloh8:
	ldr	x9, [x9, _LEDEN_LEDAON@GOTPAGEOFF]
Lloh9:
	ldr	w22, [x9]
Lloh10:
	adrp	x9, _LEDEN_LEDAEXT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _LEDEN_LEDAEXT@GOTPAGEOFF]
Lloh12:
	ldr	w23, [x9]
Lloh13:
	adrp	x9, _LEDEN_LEDAPWM@GOTPAGE
Lloh14:
	ldr	x9, [x9, _LEDEN_LEDAPWM@GOTPAGEOFF]
Lloh15:
	ldr	w24, [x9]
Lloh16:
	adrp	x9, _LEDEN_PWM_LENGTHA@GOTPAGE
Lloh17:
	ldr	x9, [x9, _LEDEN_PWM_LENGTHA@GOTPAGEOFF]
Lloh18:
	ldr	w25, [x9]
	cmp	w8, w19
Lloh19:
	adrp	x8, _TWL4030_MODULE_PWMA@GOTPAGE
Lloh20:
	ldr	x8, [x8, _TWL4030_MODULE_PWMA@GOTPAGEOFF]
Lloh21:
	adrp	x9, _TWL4030_MODULE_PWMB@GOTPAGE
Lloh22:
	ldr	x9, [x9, _TWL4030_MODULE_PWMB@GOTPAGEOFF]
	cset	w26, ne
	csel	x8, x8, x9, eq
	ldr	w19, [x8]
Lloh23:
	adrp	x8, _TWL4030_PWMx_PWMxOFF@GOTPAGE
Lloh24:
	ldr	x8, [x8, _TWL4030_PWMx_PWMxOFF@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #127
	bl	_twl4030_i2c_write_u8
	tbnz	w0, #31, LBB0_7
; %bb.4:
Lloh26:
	adrp	x8, _TWL4030_PWMx_PWMxON@GOTPAGE
Lloh27:
	ldr	x8, [x8, _TWL4030_PWMx_PWMxON@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #127
	bl	_twl4030_i2c_write_u8
	tbnz	w0, #31, LBB0_7
; %bb.5:
Lloh29:
	adrp	x8, _TWL4030_MODULE_LED@GOTPAGE
Lloh30:
	ldr	x8, [x8, _TWL4030_MODULE_LED@GOTPAGEOFF]
Lloh31:
	ldr	w19, [x8]
Lloh32:
	adrp	x27, _TWL4030_LED_LEDEN@GOTPAGE
Lloh33:
	ldr	x27, [x27, _TWL4030_LED_LEDEN@GOTPAGEOFF]
	ldr	w2, [x27]
Lloh34:
	adrp	x21, _cached_leden@GOTPAGE
Lloh35:
	ldr	x21, [x21, _cached_leden@GOTPAGEOFF]
	mov	x0, x19
	mov	x1, x21
	bl	_twl4030_i2c_read_u8
	tbnz	w0, #31, LBB0_7
; %bb.6:
	orr	w8, w23, w22
	orr	w8, w8, w24
	orr	w8, w8, w25
	lsl	w8, w8, w26
	ldr	w9, [x21]
	bic	w1, w9, w8
	str	w1, [x21]
	ldr	w2, [x27]
	mov	x0, x19
	bl	_twl4030_i2c_write_u8
	cmp	w0, #0
	csel	w20, w0, wzr, lt
	b	LBB0_9
LBB0_7:
	mov	x20, x0
	b	LBB0_9
LBB0_8:
Lloh36:
	adrp	x8, _MASK_GPIO_CTRL_GPIO_ON@GOTPAGE
Lloh37:
	ldr	x8, [x8, _MASK_GPIO_CTRL_GPIO_ON@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	ldr	x9, [x20]
	ldr	x9, [x9]
	ldr	w9, [x9]
	and	w9, w9, #0x3
	orr	w1, w9, w8
Lloh39:
	adrp	x8, _REG_GPIO_CTRL@GOTPAGE
Lloh40:
	ldr	x8, [x8, _REG_GPIO_CTRL@GOTPAGEOFF]
Lloh41:
	ldr	w0, [x8]
	bl	_gpio_twl4030_write
	mov	x20, x0
	cbz	w0, LBB0_10
LBB0_9:
Lloh42:
	adrp	x0, _gpio_lock@GOTPAGE
Lloh43:
	ldr	x0, [x0, _gpio_lock@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	x0, x20
	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
LBB0_10:
	ldr	w8, [x21]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_gpio_lock,4,2                  ; @gpio_lock
	.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_MODULE_PWMA,4,2        ; @TWL4030_MODULE_PWMA
	.comm	_TWL4030_MODULE_PWMB,4,2        ; @TWL4030_MODULE_PWMB
	.comm	_TWL4030_PWMx_PWMxOFF,4,2       ; @TWL4030_PWMx_PWMxOFF
	.comm	_TWL4030_PWMx_PWMxON,4,2        ; @TWL4030_PWMx_PWMxON
	.comm	_TWL4030_MODULE_LED,4,2         ; @TWL4030_MODULE_LED
	.comm	_cached_leden,4,2               ; @cached_leden
	.comm	_TWL4030_LED_LEDEN,4,2          ; @TWL4030_LED_LEDEN
	.comm	_gpio_usage_count,4,2           ; @gpio_usage_count
	.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
