	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function open_device
_open_device:                           ## @open_device
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	xorl	%edi, %edi
	callq	_ibv_get_device_list
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %r15
	testq	%r14, %r14
	je	LBB0_7
## %bb.2:
	movq	(%r15), %rdi
	xorl	%ebx, %ebx
	testq	%rdi, %rdi
	je	LBB0_8
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	callq	_ibv_get_device_name
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r15,%rbx,8), %rdi
	incq	%rbx
	testq	%rdi, %rdi
	jne	LBB0_3
LBB0_5:
	movl	%ebx, %ebx
	jmp	LBB0_8
LBB0_6:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_14
LBB0_7:
	xorl	%ebx, %ebx
LBB0_8:
	movq	(%r15,%rbx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.9:
	callq	_ibv_open_device
	movq	_ctx@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	testl	%eax, %eax
	je	LBB0_12
## %bb.10:
	movq	%r15, %rdi
	callq	_ibv_free_device_list
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_11:
	testq	%r14, %r14
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rdx
	cmovneq	%r14, %rdx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_13
LBB0_12:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	(%r15,%rbx,8), %rdi
	callq	_ibv_get_device_name
	leaq	L_.str.3(%rip), %rsi
	movl	%r14d, %edi
	movq	%rax, %rdx
LBB0_13:
	xorl	%eax, %eax
	callq	_fprintf
LBB0_14:
	movl	$-1, %eax
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to get IB devices list"

L_.str.1:                               ## @.str.1
	.asciz	"IB device %s not found\n"

L_.str.2:                               ## @.str.2
	.space	1

	.comm	_ctx,4,2                        ## @ctx
L_.str.3:                               ## @.str.3
	.asciz	"Couldn't get context for %s\n"

	.no_dead_strip	_open_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function open_device
_open_device:                           ; @open_device
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x0
	mov	x0, #0
	bl	_ibv_get_device_list
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
	cbz	x20, LBB0_7
; %bb.2:
	ldr	x0, [x19]
	cbz	x0, LBB0_7
; %bb.3:
	mov	x21, #0
	add	x22, x19, #8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	bl	_ibv_get_device_name
	mov	x1, x20
	bl	_strcmp
	cbz	w0, LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x21, #1
	ldr	x0, [x22, x21, lsl #3]
	mov	x21, x8
	cbnz	x0, LBB0_4
	b	LBB0_12
LBB0_6:
Lloh0:
	adrp	x8, _stderr@GOTPAGE
Lloh1:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_14
LBB0_7:
	mov	x21, #0
	ldr	x0, [x19, x21, lsl #3]
	cbz	x0, LBB0_13
LBB0_8:
	bl	_ibv_open_device
Lloh5:
	adrp	x8, _ctx@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ctx@GOTPAGEOFF]
Lloh7:
	str	w0, [x8]
	cbz	w0, LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_ibv_free_device_list
	mov	w0, #0
	b	LBB0_15
LBB0_10:
Lloh8:
	adrp	x8, _stderr@GOTPAGE
Lloh9:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh10:
	ldr	w20, [x8]
	ldr	x0, [x19, x21, lsl #3]
	bl	_ibv_get_device_name
	str	x0, [sp]
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	b	LBB0_14
LBB0_11:
	mov	x8, x21
LBB0_12:
	and	x21, x8, #0xffffffff
	ldr	x0, [x19, x21, lsl #3]
	cbnz	x0, LBB0_8
LBB0_13:
Lloh13:
	adrp	x8, _stderr@GOTPAGE
Lloh14:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x8, l_.str.2@PAGE
Lloh17:
	add	x8, x8, l_.str.2@PAGEOFF
	cmp	x20, #0
	csel	x8, x8, x20, eq
	str	x8, [sp]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_14:
	bl	_fprintf
	mov	w0, #-1
LBB0_15:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to get IB devices list"

l_.str.1:                               ; @.str.1
	.asciz	"IB device %s not found\n"

l_.str.2:                               ; @.str.2
	.space	1

	.comm	_ctx,4,2                        ; @ctx
l_.str.3:                               ; @.str.3
	.asciz	"Couldn't get context for %s\n"

	.no_dead_strip	_open_device
.subsections_via_symbols
