	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lochnagar2_get_gpio_chan
_lochnagar2_get_gpio_chan:              ## @lochnagar2_get_gpio_chan
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_LN2_NUM_GPIO_CHANNELS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_9
## %bb.1:
	movl	%esi, %r14d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rax
	movq	(%rax), %r12
	movl	$-1, %ebx
	xorl	%r15d, %r15d
	leaq	-44(%rbp), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_LOCHNAGAR2_GPIO_CHANNEL1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r15, %rsi
	movq	%r12, %rdi
	movq	%r13, %rdx
	callq	_regmap_read
	testl	%eax, %eax
	jne	LBB0_10
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %eax
	movq	_LOCHNAGAR2_GPIO_CHANNEL_SRC_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	%eax, -44(%rbp)
	cmpl	%r14d, %eax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%eax, %eax
	movl	%r15d, %eax
	cmovnel	%ebx, %eax
	testl	%ebx, %ebx
	cmovsl	%eax, %ebx
	incq	%r15
	movq	_LN2_NUM_GPIO_CHANNELS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r15
	jl	LBB0_2
## %bb.6:
	testl	%ebx, %ebx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	js	LBB0_9
## %bb.7:
	movl	%ebx, %esi
	movq	_LOCHNAGAR2_GPIO_CHANNEL1@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	movq	_LOCHNAGAR2_GPIO_CHANNEL_SRC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	%r14d, %ecx
	callq	_regmap_update_bits
	testl	%eax, %eax
	jne	LBB0_10
## %bb.8:
	incl	%ebx
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	movl	%r14d, %ecx
	callq	_dev_dbg
	movl	%ebx, %eax
	jmp	LBB0_10
LBB0_9:
	movq	_ENOSPC@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
LBB0_4:
	incl	%r15d
	movl	%r15d, %eax
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LN2_NUM_GPIO_CHANNELS,4,2      ## @LN2_NUM_GPIO_CHANNELS
	.comm	_LOCHNAGAR2_GPIO_CHANNEL1,8,3   ## @LOCHNAGAR2_GPIO_CHANNEL1
	.comm	_LOCHNAGAR2_GPIO_CHANNEL_SRC_MASK,4,2 ## @LOCHNAGAR2_GPIO_CHANNEL_SRC_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Set channel %d to 0x%x\n"

	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.no_dead_strip	_lochnagar2_get_gpio_chan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lochnagar2_get_gpio_chan
_lochnagar2_get_gpio_chan:              ; @lochnagar2_get_gpio_chan
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
Lloh0:
	adrp	x24, _LN2_NUM_GPIO_CHANNELS@GOTPAGE
Lloh1:
	ldr	x24, [x24, _LN2_NUM_GPIO_CHANNELS@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	mov	x25, #0
	ldr	x8, [x0, #8]
	ldr	x21, [x8]
	mov	w28, #-1
Lloh2:
	adrp	x26, _LOCHNAGAR2_GPIO_CHANNEL1@GOTPAGE
Lloh3:
	ldr	x26, [x26, _LOCHNAGAR2_GPIO_CHANNEL1@GOTPAGEOFF]
Lloh4:
	adrp	x27, _LOCHNAGAR2_GPIO_CHANNEL_SRC_MASK@GOTPAGE
Lloh5:
	ldr	x27, [x27, _LOCHNAGAR2_GPIO_CHANNEL_SRC_MASK@GOTPAGEOFF]
	mov	w23, #-1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x26]
	add	x1, x25, x8
	add	x2, sp, #12
	mov	x0, x21
	bl	_regmap_read
	cbnz	w0, LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x27]
	ldr	w9, [sp, #12]
	and	w8, w9, w8
	str	w8, [sp, #12]
	cmp	w8, w19
	b.eq	LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w8, #0
	ccmp	w23, w28, #0, eq
	csel	w23, w23, w25, gt
	add	x25, x25, #1
	ldrsw	x8, [x24]
	cmp	x25, x8
	b.lt	LBB0_2
; %bb.5:
	tbnz	w23, #31, LBB0_8
; %bb.6:
	ldr	x8, [x26]
	add	x1, x8, w23, uxtw
	ldr	w2, [x27]
	mov	x0, x21
	mov	x3, x19
	bl	_regmap_update_bits
	mov	x22, x0
	cbnz	w0, LBB0_11
; %bb.7:
	add	w22, w23, #1
	ldr	w0, [x20]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	mov	x3, x19
	bl	_dev_dbg
	b	LBB0_11
LBB0_8:
Lloh8:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_11
LBB0_9:
	mov	x22, x0
	b	LBB0_11
LBB0_10:
	add	w22, w25, #1
LBB0_11:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_LN2_NUM_GPIO_CHANNELS,4,2      ; @LN2_NUM_GPIO_CHANNELS
	.comm	_LOCHNAGAR2_GPIO_CHANNEL1,8,3   ; @LOCHNAGAR2_GPIO_CHANNEL1
	.comm	_LOCHNAGAR2_GPIO_CHANNEL_SRC_MASK,4,2 ; @LOCHNAGAR2_GPIO_CHANNEL_SRC_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Set channel %d to 0x%x\n"

	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.no_dead_strip	_lochnagar2_get_gpio_chan
.subsections_via_symbols
