	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iwl_eeprom_acquire_semaphore
_iwl_eeprom_acquire_semaphore:          ## @iwl_eeprom_acquire_semaphore
	.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
	movq	_EEPROM_SEM_RETRY_LIMIT@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jle	LBB0_1
## %bb.2:
	movq	%rdi, %r14
	movl	$1, %r15d
	movq	_CSR_HW_IF_CONFIG_REG@GOTPCREL(%rip), %r13
	movq	_CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movl	(%r12), %edx
	movq	%r14, %rdi
	callq	_iwl_set_bit
	movl	(%r13), %esi
	movl	(%r12), %ecx
	movq	_EEPROM_SEM_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r14, %rdi
	movl	%ecx, %edx
	callq	_iwl_poll_bit
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	1(%r15), %rax
	movq	_EEPROM_SEM_RETRY_LIMIT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %r15
	movq	%rax, %r15
	jl	LBB0_3
	jmp	LBB0_6
LBB0_1:
                                        ## implicit-def: $ebx
	jmp	LBB0_6
LBB0_4:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdx
	callq	_IWL_DEBUG_EEPROM
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EEPROM_SEM_RETRY_LIMIT,8,3     ## @EEPROM_SEM_RETRY_LIMIT
	.comm	_CSR_HW_IF_CONFIG_REG,4,2       ## @CSR_HW_IF_CONFIG_REG
	.comm	_CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM,4,2 ## @CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM
	.comm	_EEPROM_SEM_TIMEOUT,4,2         ## @EEPROM_SEM_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Acquired semaphore after %d tries.\n"

	.no_dead_strip	_iwl_eeprom_acquire_semaphore
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iwl_eeprom_acquire_semaphore
_iwl_eeprom_acquire_semaphore:          ; @iwl_eeprom_acquire_semaphore
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x22, _EEPROM_SEM_RETRY_LIMIT@GOTPAGE
Lloh1:
	ldr	x22, [x22, _EEPROM_SEM_RETRY_LIMIT@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x19, x0
	mov	w20, #1
Lloh2:
	adrp	x23, _CSR_HW_IF_CONFIG_REG@GOTPAGE
Lloh3:
	ldr	x23, [x23, _CSR_HW_IF_CONFIG_REG@GOTPAGEOFF]
Lloh4:
	adrp	x24, _CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM@GOTPAGE
Lloh5:
	ldr	x24, [x24, _CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM@GOTPAGEOFF]
Lloh6:
	adrp	x25, _EEPROM_SEM_TIMEOUT@GOTPAGE
Lloh7:
	ldr	x25, [x25, _EEPROM_SEM_TIMEOUT@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	ldr	w2, [x24]
	mov	x0, x19
	bl	_iwl_set_bit
	ldr	w1, [x23]
	ldr	w2, [x24]
	ldr	w4, [x25]
	mov	x0, x19
	mov	x3, x2
	bl	_iwl_poll_bit
	mov	x21, x0
	tbz	w0, #31, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x22]
	add	x9, x20, #1
	cmp	x20, x8
	mov	x20, x9
	b.lt	LBB0_2
	b	LBB0_6
LBB0_4:
                                        ; implicit-def: $w21
	b	LBB0_6
LBB0_5:
	ldr	w0, [x19]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_IWL_DEBUG_EEPROM
LBB0_6:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EEPROM_SEM_RETRY_LIMIT,8,3     ; @EEPROM_SEM_RETRY_LIMIT
	.comm	_CSR_HW_IF_CONFIG_REG,4,2       ; @CSR_HW_IF_CONFIG_REG
	.comm	_CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM,4,2 ; @CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM
	.comm	_EEPROM_SEM_TIMEOUT,4,2         ; @EEPROM_SEM_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Acquired semaphore after %d tries.\n"

	.no_dead_strip	_iwl_eeprom_acquire_semaphore
.subsections_via_symbols
