	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ehca_calc_ipd                  ## -- Begin function ehca_calc_ipd
	.p2align	4, 0x90
_ehca_calc_ipd:                         ## @ehca_calc_ipd
	.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	%rcx, %r14
	movl	%edx, %ebx
	movl	%esi, %r13d
	movq	%rdi, %r12
	movl	%edx, %edi
	callq	_ib_rate_to_mult
	movl	%eax, %r15d
	movq	_IB_RATE_PORT_CURRENT@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_2
## %bb.1:
	movl	$0, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_2:
	movl	%r15d, %edi
	shrl	$31, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_ehca_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_4:
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_ehca_query_port
	movl	%eax, %ebx
	movl	%eax, %edi
	shrl	$31, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_ehca_err
	jmp	LBB0_9
LBB0_6:
	movl	-44(%rbp), %edi
	callq	_ib_width_enum_to_int
	imull	-48(%rbp), %eax
	xorl	%ebx, %ebx
	movl	$0, %ecx
	cmpl	%eax, %r15d
	jge	LBB0_8
## %bb.7:
	movl	%r15d, %ecx
	sarl	%ecx
	addl	%ecx, %eax
	cltd
	idivl	%r15d
	movl	%eax, %ecx
	decl	%ecx
LBB0_8:
	movl	%ecx, (%r14)
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_RATE_PORT_CURRENT,4,2       ## @IB_RATE_PORT_CURRENT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid static rate! path_rate=%x"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Failed to query port  ret=%i"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ehca_calc_ipd                  ; -- Begin function ehca_calc_ipd
	.p2align	2
_ehca_calc_ipd:                         ; @ehca_calc_ipd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x3
	mov	x22, x2
	mov	x23, x1
	mov	x21, x0
	mov	x0, x2
	bl	_ib_rate_to_mult
Lloh0:
	adrp	x8, _IB_RATE_PORT_CURRENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IB_RATE_PORT_CURRENT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_2
; %bb.1:
	mov	w22, #0
	str	wzr, [x19]
	b	LBB0_10
LBB0_2:
	mov	x20, x0
	lsr	w0, w0, #31
	bl	_unlikely
	cbz	x0, LBB0_4
; %bb.3:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_ehca_err
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_10
LBB0_4:
	add	x2, sp, #8
	mov	x0, x21
	mov	x1, x23
	bl	_ehca_query_port
	mov	x22, x0
	lsr	w0, w0, #31
	bl	_unlikely
	cbz	x0, LBB0_6
; %bb.5:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_ehca_err
	b	LBB0_10
LBB0_6:
	ldr	w0, [sp, #12]
	bl	_ib_width_enum_to_int
	ldr	w8, [sp, #8]
	mul	w8, w8, w0
	cmp	w20, w8
	b.ge	LBB0_8
; %bb.7:
	add	w8, w8, w20, asr #1
	sdiv	w8, w8, w20
	sub	w8, w8, #1
	b	LBB0_9
LBB0_8:
	mov	w8, #0
LBB0_9:
	mov	w22, #0
	str	w8, [x19]
LBB0_10:
	mov	x0, x22
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_RATE_PORT_CURRENT,4,2       ; @IB_RATE_PORT_CURRENT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid static rate! path_rate=%x"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Failed to query port  ret=%i"

.subsections_via_symbols
