	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_query_mad_ifc_port        ## -- Begin function mlx5_query_mad_ifc_port
	.p2align	4, 0x90
_mlx5_query_mad_ifc_port:               ## @mlx5_query_mad_ifc_port
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	callq	_to_mdev
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	(%rax), %r14
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	$24, %edi
	callq	_kzalloc
	movq	%rax, %r15
	movl	(%rbx), %esi
	movl	$24, %edi
	callq	_kmalloc
	movq	%rax, %rbx
	testq	%r15, %r15
	je	LBB0_23
## %bb.1:
	testq	%rbx, %rbx
	je	LBB0_23
## %bb.2:
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_init_query_mad
	movq	_IB_SMP_ATTR_PORT_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r15)
	movq	%r15, %r12
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edi
	callq	_cpu_to_be32
	movq	%rax, 8(%r12)
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$1, %edx
	movl	%r15d, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	%rbx
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	pushq	%r12
	callq	_mlx5_MAD_IFC
	addq	$16, %rsp
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r12d
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_mlx5_ib_warn
	movq	-56(%rbp), %r15                 ## 8-byte Reload
LBB0_23:
	movq	%r15, %rdi
	callq	_kfree
	movq	%rbx, %rdi
	callq	_kfree
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	(%rbx), %rdi
	addq	$64, %rdi
	callq	_be16_to_cpup
	movq	%rax, 96(%r13)
	movq	(%rbx), %rdi
	movl	136(%rdi), %eax
	andl	$7, %eax
	movl	%eax, (%r13)
	addq	$72, %rdi
	callq	_be16_to_cpup
	movq	%rax, 88(%r13)
	movq	(%rbx), %rdi
	movl	144(%rdi), %eax
	andl	$15, %eax
	movl	%eax, 4(%r13)
	movl	128(%rdi), %eax
	andl	$15, %eax
	movl	%eax, 8(%r13)
	movl	132(%rdi), %eax
	sarl	$4, %eax
	movl	%eax, 12(%r13)
	addq	$80, %rdi
	callq	_be32_to_cpup
	movl	%eax, 16(%r13)
	movq	(%rbx), %rax
	movl	200(%rax), %eax
	movl	%eax, 20(%r13)
	movq	_log_max_msg@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_MLX5_CAP_GEN
	movl	%eax, %ecx
	movl	$1, %eax
	shll	%cl, %eax
	movl	%eax, 24(%r13)
	movq	(%r14), %rax
	movslq	%r15d, %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movl	-4(%rax,%rcx,8), %eax
	movl	%eax, 80(%r13)
	movl	$184, %edi
	addq	(%rbx), %rdi
	callq	_be16_to_cpup
	movq	%rax, 72(%r13)
	movl	$192, %edi
	addq	(%rbx), %rdi
	callq	_be16_to_cpup
	movq	%rax, 64(%r13)
	movq	(%rbx), %rdi
	movl	124(%rdi), %eax
	andl	$15, %eax
	movl	%eax, 28(%r13)
	movl	140(%rdi), %eax
	sarl	$4, %eax
	movl	%eax, 32(%r13)
	movl	164(%rdi), %eax
	andl	$15, %eax
	movl	%eax, 36(%r13)
	movl	144(%rdi), %eax
	sarl	$4, %eax
	movl	%eax, 40(%r13)
	movl	204(%rdi), %eax
	andl	$31, %eax
	movl	%eax, 44(%r13)
	movl	148(%rdi), %eax
	sarl	$4, %eax
	movl	%eax, 48(%r13)
	movl	164(%rdi), %eax
	sarl	$4, %eax
	movl	%eax, 52(%r13)
	movq	_IB_PORT_CAP_MASK2_SUP@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, 16(%r13)
	je	LBB0_7
## %bb.5:
	addq	$240, %rdi
	callq	_be16_to_cpup
	movl	%eax, 56(%r13)
	movq	_IB_PORT_LINK_WIDTH_2X_SUP@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.6:
	movq	(%rbx), %rax
	movl	124(%rax), %eax
	andl	$31, %eax
	movl	%eax, 28(%r13)
LBB0_7:
	movl	16(%r13), %eax
	movq	_IB_PORT_EXTENDED_SPEEDS_SUP@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_16
## %bb.8:
	movq	(%rbx), %rcx
	movl	248(%rcx), %ecx
	sarl	$4, %ecx
	cmpl	$4, %ecx
	je	LBB0_13
## %bb.9:
	cmpl	$2, %ecx
	je	LBB0_12
## %bb.10:
	cmpl	$1, %ecx
	jne	LBB0_16
## %bb.11:
	movl	$16, 32(%r13)
	jmp	LBB0_22
LBB0_13:
	testl	%eax, (%r12)
	je	LBB0_16
## %bb.14:
	movq	_IB_PORT_LINK_SPEED_HDR_SUP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 56(%r13)
	je	LBB0_16
## %bb.15:
	movq	_IB_SPEED_HDR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r13)
	jmp	LBB0_17
LBB0_16:
	movl	32(%r13), %eax
LBB0_17:
	xorl	%r12d, %r12d
	cmpl	$4, %eax
	jne	LBB0_23
## %bb.18:
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	decq	%rdx
	movq	(%r14), %rax
	movq	_MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax,%rdx,8)
	je	LBB0_23
## %bb.19:
	movq	%r15, %rdi
	callq	_init_query_mad
	movq	_MLX5_ATTR_EXTENDED_PORT_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r15)
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %edi
	callq	_cpu_to_be32
	movq	%rax, 8(%r15)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	$1, %esi
	movl	$1, %edx
	movl	%r14d, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	%rbx
	pushq	%r15
	callq	_mlx5_MAD_IFC
	addq	$16, %rsp
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_23
## %bb.20:
	movq	(%rbx), %rax
	testb	$1, 60(%rax)
	je	LBB0_22
## %bb.21:
	movl	$8, 32(%r13)
	jmp	LBB0_22
LBB0_12:
	movl	$32, 32(%r13)
LBB0_22:
	xorl	%r12d, %r12d
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_IB_SMP_ATTR_PORT_INFO,4,2      ## @IB_SMP_ATTR_PORT_INFO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"err %d\n"

	.comm	_log_max_msg,4,2                ## @log_max_msg
	.comm	_IB_PORT_CAP_MASK2_SUP,4,2      ## @IB_PORT_CAP_MASK2_SUP
	.comm	_IB_PORT_LINK_WIDTH_2X_SUP,4,2  ## @IB_PORT_LINK_WIDTH_2X_SUP
	.comm	_IB_PORT_EXTENDED_SPEEDS_SUP,4,2 ## @IB_PORT_EXTENDED_SPEEDS_SUP
	.comm	_IB_PORT_LINK_SPEED_HDR_SUP,4,2 ## @IB_PORT_LINK_SPEED_HDR_SUP
	.comm	_IB_SPEED_HDR,4,2               ## @IB_SPEED_HDR
	.comm	_MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO,4,2 ## @MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO
	.comm	_MLX5_ATTR_EXTENDED_PORT_INFO,4,2 ## @MLX5_ATTR_EXTENDED_PORT_INFO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_query_mad_ifc_port        ; -- Begin function mlx5_query_mad_ifc_port
	.p2align	2
_mlx5_query_mad_ifc_port:               ; @mlx5_query_mad_ifc_port
	.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
	mov	x21, x2
	mov	x22, x1
	bl	_to_mdev
	mov	x23, x0
	ldr	x24, [x0]
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w25, [x8]
Lloh3:
	adrp	x20, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x20, [x20, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	w0, #24
	bl	_kzalloc
	mov	x19, x0
	ldr	w1, [x20]
	mov	w0, #24
	bl	_kmalloc
	mov	x20, x0
	cmp	x19, #0
	ccmp	x0, #0, #4, ne
	b.ne	LBB0_2
; %bb.1:
	neg	w25, w25
	b	LBB0_24
LBB0_2:
	mov	x0, x19
	bl	_init_query_mad
Lloh5:
	adrp	x8, _IB_SMP_ATTR_PORT_INFO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IB_SMP_ATTR_PORT_INFO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	mov	x0, x22
	bl	_cpu_to_be32
	str	x0, [x19, #8]
	mov	w26, #1
	mov	x0, x23
	mov	w1, #1
	mov	w2, #1
	mov	x3, x22
	mov	x4, #0
	mov	x5, #0
	mov	x6, x19
	mov	x7, x20
	bl	_mlx5_MAD_IFC
	cbz	w0, LBB0_4
; %bb.3:
	mov	x25, x0
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	mov	x2, x25
	bl	_mlx5_ib_warn
	b	LBB0_24
LBB0_4:
	ldr	x8, [x20]
	add	x0, x8, #64
	bl	_be16_to_cpup
	str	x0, [x21, #96]
	ldr	x8, [x20]
	ldr	w9, [x8, #136]
	and	w9, w9, #0x7
	str	w9, [x21]
	add	x0, x8, #72
	bl	_be16_to_cpup
	str	x0, [x21, #88]
	ldr	x8, [x20]
	ldr	w9, [x8, #144]
	and	w9, w9, #0xf
	str	w9, [x21, #4]
	ldr	w9, [x8, #128]
	and	w9, w9, #0xf
	str	w9, [x21, #8]
	ldr	w9, [x8, #132]
	asr	w9, w9, #4
	str	w9, [x21, #12]
	add	x0, x8, #80
	bl	_be32_to_cpup
	str	w0, [x21, #16]
	ldr	x8, [x20]
	ldr	w8, [x8, #200]
	str	w8, [x21, #20]
Lloh10:
	adrp	x8, _log_max_msg@GOTPAGE
Lloh11:
	ldr	x8, [x8, _log_max_msg@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_MLX5_CAP_GEN
	lsl	w8, w26, w0
	str	w8, [x21, #24]
	ldr	x8, [x24]
	sxtw	x9, w22
	sub	x25, x9, #1
	add	x8, x8, x25, lsl #3
	ldr	w8, [x8, #4]
	str	w8, [x21, #80]
	ldr	x8, [x20]
	add	x0, x8, #184
	bl	_be16_to_cpup
	str	x0, [x21, #72]
	ldr	x8, [x20]
	add	x0, x8, #192
	bl	_be16_to_cpup
	str	x0, [x21, #64]
	ldr	x8, [x20]
	ldr	w9, [x8, #124]
	and	w9, w9, #0xf
	str	w9, [x21, #28]
	ldr	w9, [x8, #140]
	asr	w9, w9, #4
	str	w9, [x21, #32]
	ldr	w9, [x8, #164]
	and	w9, w9, #0xf
	str	w9, [x21, #36]
	ldr	w9, [x8, #144]
	asr	w9, w9, #4
	str	w9, [x21, #40]
	ldr	w9, [x8, #204]
	and	w9, w9, #0x1f
	str	w9, [x21, #44]
	ldr	w9, [x8, #148]
	asr	w9, w9, #4
	str	w9, [x21, #48]
	ldr	w9, [x8, #164]
	asr	w9, w9, #4
	str	w9, [x21, #52]
	ldr	w9, [x21, #16]
Lloh13:
	adrp	x26, _IB_PORT_CAP_MASK2_SUP@GOTPAGE
Lloh14:
	ldr	x26, [x26, _IB_PORT_CAP_MASK2_SUP@GOTPAGEOFF]
	ldr	w10, [x26]
	tst	w10, w9
	b.eq	LBB0_7
; %bb.5:
	add	x0, x8, #240
	bl	_be16_to_cpup
	str	w0, [x21, #56]
Lloh15:
	adrp	x8, _IB_PORT_LINK_WIDTH_2X_SUP@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IB_PORT_LINK_WIDTH_2X_SUP@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.6:
	ldr	x8, [x20]
	ldr	w8, [x8, #124]
	and	w8, w8, #0x1f
	str	w8, [x21, #28]
LBB0_7:
	ldr	w8, [x21, #16]
Lloh18:
	adrp	x9, _IB_PORT_EXTENDED_SPEEDS_SUP@GOTPAGE
Lloh19:
	ldr	x9, [x9, _IB_PORT_EXTENDED_SPEEDS_SUP@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.8:
	ldr	x9, [x20]
	ldr	w9, [x9, #248]
	asr	w9, w9, #4
	cmp	w9, #4
	b.eq	LBB0_12
; %bb.9:
	cmp	w9, #2
	b.eq	LBB0_21
; %bb.10:
	cmp	w9, #1
	b.ne	LBB0_15
; %bb.11:
	mov	w25, #0
	mov	w8, #16
	b	LBB0_23
LBB0_12:
	ldr	w9, [x26]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.13:
	ldr	w8, [x21, #56]
Lloh21:
	adrp	x9, _IB_PORT_LINK_SPEED_HDR_SUP@GOTPAGE
Lloh22:
	ldr	x9, [x9, _IB_PORT_LINK_SPEED_HDR_SUP@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.14:
Lloh24:
	adrp	x8, _IB_SPEED_HDR@GOTPAGE
Lloh25:
	ldr	x8, [x8, _IB_SPEED_HDR@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	w8, [x21, #32]
	b	LBB0_16
LBB0_15:
	ldr	w8, [x21, #32]
LBB0_16:
	cmp	w8, #4
	b.ne	LBB0_20
; %bb.17:
	ldr	x8, [x24]
	lsl	x9, x25, #3
	ldr	w8, [x8, x9]
Lloh27:
	adrp	x9, _MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO@GOTPAGE
Lloh28:
	ldr	x9, [x9, _MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_20
; %bb.18:
	mov	x0, x19
	bl	_init_query_mad
Lloh30:
	adrp	x8, _MLX5_ATTR_EXTENDED_PORT_INFO@GOTPAGE
Lloh31:
	ldr	x8, [x8, _MLX5_ATTR_EXTENDED_PORT_INFO@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	mov	x0, x22
	bl	_cpu_to_be32
	str	x0, [x19, #8]
	mov	x0, x23
	mov	w1, #1
	mov	w2, #1
	mov	x3, x22
	mov	x4, #0
	mov	x5, #0
	mov	x6, x19
	mov	x7, x20
	bl	_mlx5_MAD_IFC
	mov	x25, x0
	cbnz	w0, LBB0_24
; %bb.19:
	ldr	x8, [x20]
	ldrb	w8, [x8, #60]
	tbnz	w8, #0, LBB0_22
LBB0_20:
	mov	w25, #0
	b	LBB0_24
LBB0_21:
	mov	w25, #0
	mov	w8, #32
	b	LBB0_23
LBB0_22:
	mov	w25, #0
	mov	w8, #8
LBB0_23:
	str	w8, [x21, #32]
LBB0_24:
	mov	x0, x19
	bl	_kfree
	mov	x0, x20
	bl	_kfree
	mov	x0, x25
	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	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_IB_SMP_ATTR_PORT_INFO,4,2      ; @IB_SMP_ATTR_PORT_INFO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"err %d\n"

	.comm	_log_max_msg,4,2                ; @log_max_msg
	.comm	_IB_PORT_CAP_MASK2_SUP,4,2      ; @IB_PORT_CAP_MASK2_SUP
	.comm	_IB_PORT_LINK_WIDTH_2X_SUP,4,2  ; @IB_PORT_LINK_WIDTH_2X_SUP
	.comm	_IB_PORT_EXTENDED_SPEEDS_SUP,4,2 ; @IB_PORT_EXTENDED_SPEEDS_SUP
	.comm	_IB_PORT_LINK_SPEED_HDR_SUP,4,2 ; @IB_PORT_LINK_SPEED_HDR_SUP
	.comm	_IB_SPEED_HDR,4,2               ; @IB_SPEED_HDR
	.comm	_MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO,4,2 ; @MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO
	.comm	_MLX5_ATTR_EXTENDED_PORT_INFO,4,2 ; @MLX5_ATTR_EXTENDED_PORT_INFO
.subsections_via_symbols
