	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gb_connection_recv             ## -- Begin function gb_connection_recv
	.p2align	4, 0x90
_gb_connection_recv:                    ## @gb_connection_recv
	.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	%rdx, %r12
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	16(%rdi), %r14
	movq	_GB_CONNECTION_STATE_DISABLED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_9
## %bb.1:
	movq	%rsi, %r15
	movq	%rbx, %rdi
	callq	_gb_connection_is_offloaded
	testq	%rax, %rax
	je	LBB0_2
LBB0_9:
	movl	8(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movq	%r12, %rcx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_warn_ratelimited           ## TAILCALL
LBB0_2:
	cmpq	$11, %r12
	ja	LBB0_3
## %bb.10:
	movl	8(%rbx), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err_ratelimited            ## TAILCALL
LBB0_3:
	leaq	-56(%rbp), %rdi
	movq	%r15, %rsi
	movl	$12, %edx
	callq	_memcpy
	movl	-48(%rbp), %edi
	callq	_le16_to_cpu
	movq	%rax, %r13
	cmpq	%r12, %rax
	jbe	LBB0_5
## %bb.4:
	movl	8(%rbx), %ebx
	movl	-52(%rbp), %edi
	callq	_le16_to_cpu
	movl	-56(%rbp), %r8d
	movq	%r13, (%rsp)
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	movq	%rax, %rcx
	movq	%r12, %r9
	xorl	%eax, %eax
	callq	_dev_err_ratelimited
	jmp	LBB0_8
LBB0_5:
	movq	_GB_MESSAGE_TYPE_RESPONSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -56(%rbp)
	je	LBB0_7
## %bb.6:
	leaq	-56(%rbp), %rsi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	movq	%r13, %rcx
	callq	_gb_connection_recv_response
	jmp	LBB0_8
LBB0_7:
	leaq	-56(%rbp), %rsi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	movq	%r13, %rcx
	callq	_gb_connection_recv_request
LBB0_8:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GB_CONNECTION_STATE_DISABLED,8,3 ## @GB_CONNECTION_STATE_DISABLED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: dropping %zu received bytes\n"

L_.str.1:                               ## @.str.1
	.asciz	"%s: short message received\n"

L_.str.2:                               ## @.str.2
	.asciz	"%s: incomplete message 0x%04x of type 0x%02x received (%zu < %zu)\n"

	.comm	_GB_MESSAGE_TYPE_RESPONSE,4,2   ## @GB_MESSAGE_TYPE_RESPONSE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gb_connection_recv             ; -- Begin function gb_connection_recv
	.p2align	2
_gb_connection_recv:                    ; @gb_connection_recv
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x20, x2
	mov	x21, x0
	ldr	x19, [x0, #16]
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _GB_CONNECTION_STATE_DISABLED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _GB_CONNECTION_STATE_DISABLED@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_2
; %bb.1:
	mov	x22, x1
	mov	x0, x21
	bl	_gb_connection_is_offloaded
	cbz	x0, LBB0_3
LBB0_2:
	ldr	w2, [x21, #8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x3, x20
	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
	add	sp, sp, #112
	b	_dev_warn_ratelimited
LBB0_3:
	cmp	x20, #11
	b.hi	LBB0_5
; %bb.4:
	ldr	w2, [x21, #8]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	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
	add	sp, sp, #112
	b	_dev_err_ratelimited
LBB0_5:
	add	x0, sp, #32
	mov	x1, x22
	mov	w2, #12
	bl	_memcpy
	ldr	w0, [sp, #40]
	bl	_le16_to_cpu
	mov	x23, x0
	cmp	x0, x20
	b.ls	LBB0_7
; %bb.6:
	ldr	w21, [x21, #8]
	ldr	w0, [sp, #36]
	bl	_le16_to_cpu
	ldr	w8, [sp, #32]
	stp	x20, x23, [sp, #16]
	stp	x0, x8, [sp]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_dev_err_ratelimited
	b	LBB0_10
LBB0_7:
	ldr	w8, [sp, #32]
Lloh9:
	adrp	x9, _GB_MESSAGE_TYPE_RESPONSE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _GB_MESSAGE_TYPE_RESPONSE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	add	x1, sp, #32
	mov	x0, x21
	mov	x2, x22
	mov	x3, x23
	tst	w9, w8
	b.eq	LBB0_9
; %bb.8:
	bl	_gb_connection_recv_response
	b	LBB0_10
LBB0_9:
	bl	_gb_connection_recv_request
LBB0_10:
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_GB_CONNECTION_STATE_DISABLED,8,3 ; @GB_CONNECTION_STATE_DISABLED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: dropping %zu received bytes\n"

l_.str.1:                               ; @.str.1
	.asciz	"%s: short message received\n"

l_.str.2:                               ; @.str.2
	.asciz	"%s: incomplete message 0x%04x of type 0x%02x received (%zu < %zu)\n"

	.comm	_GB_MESSAGE_TYPE_RESPONSE,4,2   ; @GB_MESSAGE_TYPE_RESPONSE
.subsections_via_symbols
