	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___ibv_query_gid                ## -- Begin function __ibv_query_gid
	.p2align	4, 0x90
___ibv_query_gid:                       ## @__ibv_query_gid
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movl	%edx, %r8d
	movl	%esi, %ecx
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	L_.str(%rip), %rdx
	leaq	-80(%rbp), %r14
	movq	%r14, %rdi
	movl	$24, %esi
	callq	_snprintf
	movq	(%rbx), %rax
	movl	(%rax), %edi
	leaq	-128(%rbp), %rbx
	movq	%r14, %rsi
	movq	%rbx, %rdx
	movl	$41, %ecx
	callq	_ibv_read_sysfs_file
	movl	$-1, %ecx
	testq	%rax, %rax
	js	LBB0_6
## %bb.1:
	xorl	%r14d, %r14d
	leaq	L_.str.1(%rip), %r12
	leaq	-132(%rbp), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r13, %rdx
	callq	_sscanf
	cmpl	$1, %eax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-132(%rbp), %eax
	sarl	$8, %eax
	movq	(%r15), %rcx
	movl	%eax, (%rcx,%r14,8)
	movzbl	-132(%rbp), %eax
	movq	(%r15), %rcx
	movl	%eax, 4(%rcx,%r14,8)
	incq	%r14
	addq	$5, %rbx
	cmpq	$8, %r14
	jne	LBB0_2
## %bb.5:
	xorl	%ecx, %ecx
	jmp	LBB0_6
LBB0_3:
	movl	$-1, %ecx
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movl	%ecx, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ports/%d/gids/%d"

L_.str.1:                               ## @.str.1
	.asciz	"%hx"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___ibv_query_gid                ; -- Begin function __ibv_query_gid
	.p2align	2
___ibv_query_gid:                       ; @__ibv_query_gid
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x19, x3
	mov	x4, x2
	mov	x3, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	add	x0, sp, #48
	mov	w1, #24
	bl	_snprintf
	ldr	x8, [x20]
	ldr	w0, [x8]
	add	x1, sp, #48
	add	x2, sp, #7
	mov	w3, #41
	bl	_ibv_read_sysfs_file
	tbnz	x0, #63, LBB0_10
; %bb.1:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x20, sp, #7
	add	x0, sp, #7
	mov	x2, sp
	bl	_sscanf
	cmp	w0, #1
	b.ne	LBB0_10
; %bb.2:
	ldr	w8, [sp]
	asr	w8, w8, #8
	ldr	x9, [x19]
	str	w8, [x9]
	ldrb	w8, [sp]
	ldr	x9, [x19]
	str	w8, [x9, #4]
	add	x0, x20, #5
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, sp
	bl	_sscanf
	cmp	w0, #1
	b.ne	LBB0_10
; %bb.3:
	ldr	w8, [sp]
	asr	w9, w8, #8
	ldr	x10, [x19]
	str	w9, [x10, #8]
	and	w8, w8, #0xff
	ldr	x9, [x19]
	str	w8, [x9, #12]
	add	x20, sp, #7
	add	x0, x20, #10
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, sp
	bl	_sscanf
	cmp	w0, #1
	b.ne	LBB0_10
; %bb.4:
	ldr	w8, [sp]
	asr	w9, w8, #8
	ldr	x10, [x19]
	str	w9, [x10, #16]
	and	w8, w8, #0xff
	ldr	x9, [x19]
	str	w8, [x9, #20]
	add	x0, x20, #15
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, sp
	bl	_sscanf
	cmp	w0, #1
	b.ne	LBB0_10
; %bb.5:
	ldr	w8, [sp]
	asr	w9, w8, #8
	ldr	x10, [x19]
	str	w9, [x10, #24]
	and	w8, w8, #0xff
	ldr	x9, [x19]
	str	w8, [x9, #28]
	add	x20, sp, #7
	add	x0, x20, #20
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, sp
	bl	_sscanf
	cmp	w0, #1
	b.ne	LBB0_10
; %bb.6:
	ldr	w8, [sp]
	asr	w9, w8, #8
	ldr	x10, [x19]
	str	w9, [x10, #32]
	and	w8, w8, #0xff
	ldr	x9, [x19]
	str	w8, [x9, #36]
	add	x0, x20, #25
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, sp
	bl	_sscanf
	cmp	w0, #1
	b.ne	LBB0_10
; %bb.7:
	ldr	w8, [sp]
	asr	w9, w8, #8
	ldr	x10, [x19]
	str	w9, [x10, #40]
	and	w8, w8, #0xff
	ldr	x9, [x19]
	str	w8, [x9, #44]
	add	x20, sp, #7
	add	x0, x20, #30
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, sp
	bl	_sscanf
	cmp	w0, #1
	b.ne	LBB0_10
; %bb.8:
	ldr	w8, [sp]
	asr	w9, w8, #8
	ldr	x10, [x19]
	str	w9, [x10, #48]
	and	w8, w8, #0xff
	ldr	x9, [x19]
	str	w8, [x9, #52]
	add	x0, x20, #35
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, sp
	bl	_sscanf
	cmp	w0, #1
	b.ne	LBB0_10
; %bb.9:
	mov	w0, #0
	ldr	w8, [sp]
	asr	w9, w8, #8
	ldr	x10, [x19]
	str	w9, [x10, #56]
	and	w8, w8, #0xff
	ldr	x9, [x19]
	str	w8, [x9, #60]
	b	LBB0_11
LBB0_10:
	mov	w0, #-1
LBB0_11:
	ldur	x8, [x29, #-24]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ports/%d/gids/%d"

l_.str.1:                               ; @.str.1
	.asciz	"%hx"

.subsections_via_symbols
