	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlxsw_core_resources_query     ## -- Begin function mlxsw_core_resources_query
	.p2align	4, 0x90
_mlxsw_core_resources_query:            ## @mlxsw_core_resources_query
	.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
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_mlxsw_cmd_mbox_zero
	movq	_MLXSW_CMD_QUERY_RESOURCES_MAX_QUERIES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_11
## %bb.3:
	xorl	%r12d, %r12d
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	incl	%r12d
	movq	_MLXSW_CMD_QUERY_RESOURCES_MAX_QUERIES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	jge	LBB0_11
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	callq	_mlxsw_cmd_query_resources
	testl	%eax, %eax
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movq	_MLXSW_CMD_QUERY_RESOURCES_PER_QUERY@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%r13d, %r13d
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_mlxsw_cmd_mbox_query_resource_id_get
	movq	%rax, %r12
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_mlxsw_cmd_mbox_query_resource_data_get
	movq	_MLXSW_CMD_QUERY_RESOURCES_TABLE_END_ID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %r12
	je	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_mlxsw_res_parse
	incl	%r15d
	movq	_MLXSW_CMD_QUERY_RESOURCES_PER_QUERY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jl	LBB0_8
	jmp	LBB0_10
LBB0_1:
	xorl	%r13d, %r13d
	jmp	LBB0_12
LBB0_11:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_12:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	%eax, %r13d
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_MLXSW_CMD_QUERY_RESOURCES_MAX_QUERIES,4,2 ## @MLXSW_CMD_QUERY_RESOURCES_MAX_QUERIES
	.comm	_MLXSW_CMD_QUERY_RESOURCES_PER_QUERY,4,2 ## @MLXSW_CMD_QUERY_RESOURCES_PER_QUERY
	.comm	_MLXSW_CMD_QUERY_RESOURCES_TABLE_END_ID,8,3 ## @MLXSW_CMD_QUERY_RESOURCES_TABLE_END_ID
	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlxsw_core_resources_query     ; -- Begin function mlxsw_core_resources_query
	.p2align	2
_mlxsw_core_resources_query:            ; @mlxsw_core_resources_query
	.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
	cbz	x2, LBB0_9
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	mov	x0, x1
	bl	_mlxsw_cmd_mbox_zero
Lloh0:
	adrp	x25, _MLXSW_CMD_QUERY_RESOURCES_MAX_QUERIES@GOTPAGE
Lloh1:
	ldr	x25, [x25, _MLXSW_CMD_QUERY_RESOURCES_MAX_QUERIES@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.2:
	mov	w22, #0
Lloh2:
	adrp	x26, _MLXSW_CMD_QUERY_RESOURCES_PER_QUERY@GOTPAGE
Lloh3:
	ldr	x26, [x26, _MLXSW_CMD_QUERY_RESOURCES_PER_QUERY@GOTPAGEOFF]
Lloh4:
	adrp	x27, _MLXSW_CMD_QUERY_RESOURCES_TABLE_END_ID@GOTPAGE
Lloh5:
	ldr	x27, [x27, _MLXSW_CMD_QUERY_RESOURCES_TABLE_END_ID@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w22, w22, #1
	ldr	w8, [x25]
	cmp	w22, w8
	b.ge	LBB0_10
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	mov	x0, x21
	mov	x1, x20
	mov	x2, x22
	bl	_mlxsw_cmd_query_resources
	cbnz	w0, LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x26]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w23, #0
LBB0_7:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x20
	mov	x1, x23
	bl	_mlxsw_cmd_mbox_query_resource_id_get
	mov	x24, x0
	mov	x0, x20
	mov	x1, x23
	bl	_mlxsw_cmd_mbox_query_resource_data_get
	ldr	x8, [x27]
	cmp	x24, x8
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	mov	x2, x0
	mov	x0, x19
	mov	x1, x24
	bl	_mlxsw_res_parse
	add	w23, w23, #1
	ldr	w8, [x26]
	cmp	w23, w8
	b.lt	LBB0_7
	b	LBB0_3
LBB0_9:
	mov	w0, #0
	b	LBB0_11
LBB0_10:
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MLXSW_CMD_QUERY_RESOURCES_MAX_QUERIES,4,2 ; @MLXSW_CMD_QUERY_RESOURCES_MAX_QUERIES
	.comm	_MLXSW_CMD_QUERY_RESOURCES_PER_QUERY,4,2 ; @MLXSW_CMD_QUERY_RESOURCES_PER_QUERY
	.comm	_MLXSW_CMD_QUERY_RESOURCES_TABLE_END_ID,8,3 ; @MLXSW_CMD_QUERY_RESOURCES_TABLE_END_ID
	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
