	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mad_build_pkt                  ## -- Begin function mad_build_pkt
	.p2align	4, 0x90
_mad_build_pkt:                         ## @mad_build_pkt
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movzbl	(%rsi), %r12d
	movq	_IB_SMI_DIRECT_CLASS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r12d
	sete	%r9b
	movq	_IB_SMI_CLASS@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %r12d
	movq	%rcx, %r15
	movq	%rdx, %rbx
	movq	%rdi, %r13
	sete	%r14b
	orb	%r9b, %r14b
	cmpb	$1, %r14b
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jne	LBB0_9
## %bb.1:
	cmpl	%eax, %r12d
	jne	LBB0_2
## %bb.3:
	cmpl	$65535, 4(%rbx)                 ## imm = 0xFFFF
	je	LBB0_6
## %bb.4:
	movl	(%rbx), %esi
	testl	%esi, %esi
	jle	LBB0_6
## %bb.5:
	movq	%r13, %rdi
	jmp	LBB0_7
LBB0_9:
	movl	(%rbx), %esi
	movl	24(%rbx), %edx
	movl	32(%rbx), %ecx
	movl	28(%rbx), %r8d
	movq	%r13, %rdi
	callq	_umad_set_addr
	cmpq	$0, 16(%rbx)
	je	LBB0_11
## %bb.10:
	movl	$1, -104(%rbp)
	movl	12(%rbx), %esi
	movl	$16, %edx
	callq	_memcpy
	movl	$255, -100(%rbp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, -96(%rbp)
	leaq	-104(%rbp), %rsi
	movq	%r13, %rdi
	jmp	LBB0_12
LBB0_2:
	movl	(%rbx), %esi
	movl	24(%rbx), %edx
	movq	%r13, %rdi
	jmp	LBB0_8
LBB0_11:
	movq	%r13, %rdi
	xorl	%esi, %esi
LBB0_12:
	callq	_umad_set_grh
	movl	8(%rbx), %r15d
	jmp	LBB0_13
LBB0_6:
	movq	%r13, %rdi
	movl	$65535, %esi                    ## imm = 0xFFFF
LBB0_7:
	xorl	%edx, %edx
LBB0_8:
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_umad_set_addr
	xorl	%r15d, %r15d
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_umad_set_grh
LBB0_13:
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_umad_set_pkey
	movq	%r13, %rdi
	callq	_umad_get_mad
	movq	%rax, %r13
	addq	$4, %rbx
	xorl	%edx, %edx
	cmpl	-44(%rbp), %r12d                ## 4-byte Folded Reload
	cmoveq	%rbx, %rdx
	movq	%rax, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	callq	_mad_encode
	testq	%rax, %rax
	je	LBB0_14
## %bb.15:
	movq	%rax, %rbx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	testq	%r15, %r15
	sete	%al
	orb	%r14b, %al
	jne	LBB0_17
## %bb.16:
	movq	_IB_SA_RMPP_VERS_F@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$1, %ecx
	callq	_mad_set_field
	movq	_IB_SA_RMPP_TYPE_F@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r15), %ecx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_mad_set_field
	movq	_IB_SA_RMPP_RESP_F@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$63, %ecx
	callq	_mad_set_field
	movq	_IB_SA_RMPP_FLAGS_F@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	4(%r15), %ecx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_mad_set_field
	movq	_IB_SA_RMPP_STATUS_F@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	8(%r15), %ecx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_mad_set_field
	movq	_IB_SA_RMPP_D1_F@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	16(%r15), %ecx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_mad_set_field
	movq	_IB_SA_RMPP_D2_F@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	12(%r15), %ecx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_mad_set_field
LBB0_17:
	subq	%r13, %rbx
	shrq	$2, %rbx
	jmp	LBB0_18
LBB0_14:
	movl	$-1, %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_SMI_DIRECT_CLASS,4,2        ## @IB_SMI_DIRECT_CLASS
	.comm	_IB_SMI_CLASS,4,2               ## @IB_SMI_CLASS
	.comm	_IB_SA_RMPP_VERS_F,4,2          ## @IB_SA_RMPP_VERS_F
	.comm	_IB_SA_RMPP_TYPE_F,4,2          ## @IB_SA_RMPP_TYPE_F
	.comm	_IB_SA_RMPP_RESP_F,4,2          ## @IB_SA_RMPP_RESP_F
	.comm	_IB_SA_RMPP_FLAGS_F,4,2         ## @IB_SA_RMPP_FLAGS_F
	.comm	_IB_SA_RMPP_STATUS_F,4,2        ## @IB_SA_RMPP_STATUS_F
	.comm	_IB_SA_RMPP_D1_F,4,2            ## @IB_SA_RMPP_D1_F
	.comm	_IB_SA_RMPP_D2_F,4,2            ## @IB_SA_RMPP_D2_F
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function mad_build_pkt
lCPI0_0:
	.long	1                               ; 0x1
	.long	255                             ; 0xff
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_mad_build_pkt
	.p2align	2
_mad_build_pkt:                         ; @mad_build_pkt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x20, x4
	mov	x19, x3
	mov	x22, x2
	mov	x21, x1
	mov	x23, x0
	ldrb	w25, [x1]
Lloh0:
	adrp	x8, _IB_SMI_DIRECT_CLASS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IB_SMI_DIRECT_CLASS@GOTPAGEOFF]
Lloh2:
	ldr	w26, [x8]
Lloh3:
	adrp	x8, _IB_SMI_CLASS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IB_SMI_CLASS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w25, w8
	ccmp	w25, w26, #4, ne
	cset	w24, eq
	b.ne	LBB0_5
; %bb.1:
	cmp	w25, w26
	b.ne	LBB0_7
; %bb.2:
	ldr	w8, [x22, #4]
	mov	w9, #65535
	cmp	w8, w9
	b.eq	LBB0_10
; %bb.3:
	ldr	w1, [x22]
	cmp	w1, #1
	b.lt	LBB0_10
; %bb.4:
	mov	x0, x23
	b	LBB0_11
LBB0_5:
	ldr	w1, [x22]
	ldp	w4, w3, [x22, #28]
	ldr	w2, [x22, #24]
	mov	x0, x23
	bl	_umad_set_addr
	ldr	x8, [x22, #16]
	cbz	x8, LBB0_8
; %bb.6:
	ldr	w1, [x22, #12]
	mov	w2, #16
	bl	_memcpy
Lloh6:
	adrp	x8, lCPI0_0@PAGE
Lloh7:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [sp]
	stp	xzr, xzr, [sp, #8]
	mov	x1, sp
	mov	x0, x23
	b	LBB0_9
LBB0_7:
	ldr	w1, [x22]
	ldr	w2, [x22, #24]
	mov	x0, x23
	b	LBB0_12
LBB0_8:
	mov	x0, x23
	mov	x1, #0
LBB0_9:
	bl	_umad_set_grh
	ldr	w1, [x22, #8]
	b	LBB0_13
LBB0_10:
	mov	x0, x23
	mov	w1, #65535
LBB0_11:
	mov	w2, #0
LBB0_12:
	mov	w3, #0
	mov	w4, #0
	bl	_umad_set_addr
	mov	x0, x23
	mov	x1, #0
	bl	_umad_set_grh
	mov	w1, #0
LBB0_13:
	mov	x0, x23
	bl	_umad_set_pkey
	mov	x0, x23
	bl	_umad_get_mad
	mov	x23, x0
	add	x8, x22, #4
	cmp	w25, w26
	csel	x2, x8, xzr, eq
	mov	x1, x21
	mov	x3, x20
	bl	_mad_encode
	cbz	x0, LBB0_17
; %bb.14:
	mov	x20, x0
	cmp	x19, #0
	cset	w8, eq
	orr	w8, w8, w24
	tbnz	w8, #0, LBB0_16
; %bb.15:
Lloh8:
	adrp	x8, _IB_SA_RMPP_VERS_F@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IB_SA_RMPP_VERS_F@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x23
	mov	w1, #0
	mov	w3, #1
	bl	_mad_set_field
Lloh11:
	adrp	x8, _IB_SA_RMPP_TYPE_F@GOTPAGE
Lloh12:
	ldr	x8, [x8, _IB_SA_RMPP_TYPE_F@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	ldr	w3, [x19]
	mov	x0, x23
	mov	w1, #0
	bl	_mad_set_field
Lloh14:
	adrp	x8, _IB_SA_RMPP_RESP_F@GOTPAGE
Lloh15:
	ldr	x8, [x8, _IB_SA_RMPP_RESP_F@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x0, x23
	mov	w1, #0
	mov	w3, #63
	bl	_mad_set_field
Lloh17:
	adrp	x8, _IB_SA_RMPP_FLAGS_F@GOTPAGE
Lloh18:
	ldr	x8, [x8, _IB_SA_RMPP_FLAGS_F@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	ldr	w3, [x19, #4]
	mov	x0, x23
	mov	w1, #0
	bl	_mad_set_field
Lloh20:
	adrp	x8, _IB_SA_RMPP_STATUS_F@GOTPAGE
Lloh21:
	ldr	x8, [x8, _IB_SA_RMPP_STATUS_F@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	ldr	w3, [x19, #8]
	mov	x0, x23
	mov	w1, #0
	bl	_mad_set_field
Lloh23:
	adrp	x8, _IB_SA_RMPP_D1_F@GOTPAGE
Lloh24:
	ldr	x8, [x8, _IB_SA_RMPP_D1_F@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	ldr	w3, [x19, #16]
	mov	x0, x23
	mov	w1, #0
	bl	_mad_set_field
Lloh26:
	adrp	x8, _IB_SA_RMPP_D2_F@GOTPAGE
Lloh27:
	ldr	x8, [x8, _IB_SA_RMPP_D2_F@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	ldr	w3, [x19, #12]
	mov	x0, x23
	mov	w1, #0
	bl	_mad_set_field
LBB0_16:
	sub	x8, x20, x23
	lsr	x0, x8, #2
	b	LBB0_18
LBB0_17:
	mov	w0, #-1
LBB0_18:
                                        ; kill: def $w0 killed $w0 killed $x0
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdr	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_SMI_DIRECT_CLASS,4,2        ; @IB_SMI_DIRECT_CLASS
	.comm	_IB_SMI_CLASS,4,2               ; @IB_SMI_CLASS
	.comm	_IB_SA_RMPP_VERS_F,4,2          ; @IB_SA_RMPP_VERS_F
	.comm	_IB_SA_RMPP_TYPE_F,4,2          ; @IB_SA_RMPP_TYPE_F
	.comm	_IB_SA_RMPP_RESP_F,4,2          ; @IB_SA_RMPP_RESP_F
	.comm	_IB_SA_RMPP_FLAGS_F,4,2         ; @IB_SA_RMPP_FLAGS_F
	.comm	_IB_SA_RMPP_STATUS_F,4,2        ; @IB_SA_RMPP_STATUS_F
	.comm	_IB_SA_RMPP_D1_F,4,2            ; @IB_SA_RMPP_D1_F
	.comm	_IB_SA_RMPP_D2_F,4,2            ; @IB_SA_RMPP_D2_F
.subsections_via_symbols
