	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_SET_PORT                  ## -- Begin function mlx4_SET_PORT
	.p2align	4, 0x90
_mlx4_SET_PORT:                         ## @mlx4_SET_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movq	(%rax,%rsi,8), %rax
	movq	_MLX4_PORT_TYPE_ETH@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	je	LBB0_9
## %bb.1:
	movl	%edx, %r12d
	movq	%rsi, %r14
	movq	%rdi, %r13
	callq	_mlx4_alloc_cmd_mailbox
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_2
## %bb.10:
	movq	%r15, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_2:
	movq	16(%r13), %rax
	movl	(%rax,%r14,4), %eax
	movq	8(%r15), %rcx
	movl	%eax, 4(%rcx)
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	testl	%r12d, %r12d
	js	LBB0_5
## %bb.3:
	movq	%r13, %rdi
	callq	_mlx4_is_master
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movl	%r12d, %edi
	callq	_cpu_to_be16
	movq	8(%r15), %rcx
	movl	%eax, 80(%rcx)
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_5:
	movl	$8, %r12d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	_MLX4_CHANGE_PORT_VL_CAP@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	movl	$1, %eax
	shll	%cl, %eax
	movq	_MLX4_CHANGE_PORT_PKEY_TBL_SZ@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	shll	%cl, %edx
	movq	_MLX4_CHANGE_PORT_MTU_CAP@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %esi
	movq	8(%r13), %rcx
	movl	(%rcx,%r14,4), %ebx
	movq	_MLX4_SET_PORT_MTU_CAP@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	shll	%cl, %ebx
	btsl	%esi, %eax
	orl	%edx, %ebx
	orl	%eax, %ebx
	movq	_MLX4_SET_PORT_VL_CAP@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	movl	%r12d, %edi
	shll	%cl, %edi
	orl	%ebx, %edi
	callq	_cpu_to_be32
	movq	8(%r15), %rcx
	movl	%eax, (%rcx)
	movl	(%r15), %esi
	movq	_MLX4_SET_PORT_IB_OPCODE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_MLX4_CMD_SET_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_MLX4_CMD_TIME_CLASS_B@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_MLX4_CMD_WRAPPED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movq	%r13, %rdi
	movq	%r14, %rdx
	callq	_mlx4_cmd
	movl	%eax, %ebx
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	%r12d, %eax
	shrl	%eax
	cmpl	$1, %r12d
	movl	%eax, %r12d
	ja	LBB0_6
LBB0_8:
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_mlx4_free_cmd_mailbox
LBB0_9:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX4_PORT_TYPE_ETH,8,3         ## @MLX4_PORT_TYPE_ETH
	.comm	_MLX4_CHANGE_PORT_MTU_CAP,4,2   ## @MLX4_CHANGE_PORT_MTU_CAP
	.comm	_MLX4_CHANGE_PORT_VL_CAP,4,2    ## @MLX4_CHANGE_PORT_VL_CAP
	.comm	_MLX4_CHANGE_PORT_PKEY_TBL_SZ,4,2 ## @MLX4_CHANGE_PORT_PKEY_TBL_SZ
	.comm	_MLX4_SET_PORT_MTU_CAP,4,2      ## @MLX4_SET_PORT_MTU_CAP
	.comm	_MLX4_SET_PORT_VL_CAP,4,2       ## @MLX4_SET_PORT_VL_CAP
	.comm	_MLX4_SET_PORT_IB_OPCODE,4,2    ## @MLX4_SET_PORT_IB_OPCODE
	.comm	_MLX4_CMD_SET_PORT,4,2          ## @MLX4_CMD_SET_PORT
	.comm	_MLX4_CMD_TIME_CLASS_B,4,2      ## @MLX4_CMD_TIME_CLASS_B
	.comm	_MLX4_CMD_WRAPPED,4,2           ## @MLX4_CMD_WRAPPED
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_SET_PORT                  ; -- Begin function mlx4_SET_PORT
	.p2align	2
_mlx4_SET_PORT:                         ; @mlx4_SET_PORT
	.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
	ldr	x8, [x0]
	ldr	x8, [x8, x1, lsl #3]
Lloh0:
	adrp	x9, _MLX4_PORT_TYPE_ETH@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MLX4_PORT_TYPE_ETH@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	w22, #0
	b	LBB0_12
LBB0_2:
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
	bl	_mlx4_alloc_cmd_mailbox
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x21
	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
	b	_PTR_ERR
LBB0_4:
	ldr	x8, [x19, #16]
	ldr	w8, [x8, x20, lsl #2]
	ldr	x9, [x21, #8]
	str	w8, [x9, #4]
	tbnz	w22, #31, LBB0_7
; %bb.5:
	mov	x0, x19
	bl	_mlx4_is_master
	cbz	x0, LBB0_7
; %bb.6:
	mov	x0, x22
	bl	_cpu_to_be16
	ldr	x8, [x21, #8]
	str	w0, [x8, #80]
	mov	w23, #1
	b	LBB0_8
LBB0_7:
	mov	w23, #0
LBB0_8:
	mov	w24, #8
	mov	w26, #1
Lloh3:
	adrp	x27, _MLX4_CMD_TIME_CLASS_B@GOTPAGE
Lloh4:
	ldr	x27, [x27, _MLX4_CMD_TIME_CLASS_B@GOTPAGEOFF]
Lloh5:
	adrp	x28, _MLX4_CMD_WRAPPED@GOTPAGE
Lloh6:
	ldr	x28, [x28, _MLX4_CMD_WRAPPED@GOTPAGEOFF]
Lloh7:
	adrp	x25, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x25, [x25, _ENOMEM@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
Lloh9:
	adrp	x8, _MLX4_CHANGE_PORT_MTU_CAP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MLX4_CHANGE_PORT_MTU_CAP@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	lsl	w8, w26, w8
Lloh12:
	adrp	x9, _MLX4_CHANGE_PORT_VL_CAP@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MLX4_CHANGE_PORT_VL_CAP@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	lsl	w9, w26, w9
	orr	w8, w9, w8
Lloh15:
	adrp	x9, _MLX4_CHANGE_PORT_PKEY_TBL_SZ@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MLX4_CHANGE_PORT_PKEY_TBL_SZ@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	lsl	w9, w23, w9
	orr	w8, w8, w9
	ldr	x9, [x19, #8]
	ldr	w9, [x9, x20, lsl #2]
Lloh18:
	adrp	x10, _MLX4_SET_PORT_MTU_CAP@GOTPAGE
Lloh19:
	ldr	x10, [x10, _MLX4_SET_PORT_MTU_CAP@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w8, w9
Lloh21:
	adrp	x9, _MLX4_SET_PORT_VL_CAP@GOTPAGE
Lloh22:
	ldr	x9, [x9, _MLX4_SET_PORT_VL_CAP@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	lsl	w9, w24, w9
	orr	w0, w8, w9
	bl	_cpu_to_be32
	ldr	x8, [x21, #8]
	str	w0, [x8]
	ldr	w1, [x21]
Lloh24:
	adrp	x8, _MLX4_SET_PORT_IB_OPCODE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MLX4_SET_PORT_IB_OPCODE@GOTPAGEOFF]
Lloh26:
	ldr	w3, [x8]
Lloh27:
	adrp	x8, _MLX4_CMD_SET_PORT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MLX4_CMD_SET_PORT@GOTPAGEOFF]
Lloh29:
	ldr	w4, [x8]
	ldr	w5, [x27]
	ldr	w6, [x28]
	mov	x0, x19
	mov	x2, x20
	bl	_mlx4_cmd
	mov	x22, x0
	ldr	w8, [x25]
	cmn	w0, w8
	b.ne	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	lsr	w8, w24, #1
	cmp	w24, #1
	mov	x24, x8
	b.hi	LBB0_9
LBB0_11:
	mov	x0, x19
	mov	x1, x21
	bl	_mlx4_free_cmd_mailbox
LBB0_12:
	mov	x0, x22
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX4_PORT_TYPE_ETH,8,3         ; @MLX4_PORT_TYPE_ETH
	.comm	_MLX4_CHANGE_PORT_MTU_CAP,4,2   ; @MLX4_CHANGE_PORT_MTU_CAP
	.comm	_MLX4_CHANGE_PORT_VL_CAP,4,2    ; @MLX4_CHANGE_PORT_VL_CAP
	.comm	_MLX4_CHANGE_PORT_PKEY_TBL_SZ,4,2 ; @MLX4_CHANGE_PORT_PKEY_TBL_SZ
	.comm	_MLX4_SET_PORT_MTU_CAP,4,2      ; @MLX4_SET_PORT_MTU_CAP
	.comm	_MLX4_SET_PORT_VL_CAP,4,2       ; @MLX4_SET_PORT_VL_CAP
	.comm	_MLX4_SET_PORT_IB_OPCODE,4,2    ; @MLX4_SET_PORT_IB_OPCODE
	.comm	_MLX4_CMD_SET_PORT,4,2          ; @MLX4_CMD_SET_PORT
	.comm	_MLX4_CMD_TIME_CLASS_B,4,2      ; @MLX4_CMD_TIME_CLASS_B
	.comm	_MLX4_CMD_WRAPPED,4,2           ; @MLX4_CMD_WRAPPED
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
