	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gb_control_mode_switch_operation ## -- Begin function gb_control_mode_switch_operation
	.p2align	4, 0x90
_gb_control_mode_switch_operation:      ## @gb_control_mode_switch_operation
	.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
	movl	4(%rdi), %edi
	movq	_GB_CONTROL_TYPE_MODE_SWITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GB_OPERATION_FLAG_UNIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_gb_operation_create_core
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_gb_operation_request_send_sync
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_dev_err
LBB0_4:
	movq	%r15, %rdi
	callq	_gb_operation_put
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GB_CONTROL_TYPE_MODE_SWITCH,4,2 ## @GB_CONTROL_TYPE_MODE_SWITCH
	.comm	_GB_OPERATION_FLAG_UNIDIRECTIONAL,4,2 ## @GB_OPERATION_FLAG_UNIDIRECTIONAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to send mode switch: %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gb_control_mode_switch_operation ; -- Begin function gb_control_mode_switch_operation
	.p2align	2
_gb_control_mode_switch_operation:      ; @gb_control_mode_switch_operation
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x0
	ldr	w0, [x0, #4]
Lloh0:
	adrp	x8, _GB_CONTROL_TYPE_MODE_SWITCH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GB_CONTROL_TYPE_MODE_SWITCH@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _GB_OPERATION_FLAG_UNIDIRECTIONAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GB_OPERATION_FLAG_UNIDIRECTIONAL@GOTPAGEOFF]
Lloh5:
	ldr	w4, [x8]
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w5, [x8]
	mov	w2, #0
	mov	w3, #0
	bl	_gb_operation_create_core
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x0
	bl	_gb_operation_request_send_sync
	mov	x20, x0
	cbz	w0, LBB0_3
; %bb.2:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_dev_err
LBB0_3:
	mov	x0, x21
	bl	_gb_operation_put
	b	LBB0_5
LBB0_4:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_5:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_GB_CONTROL_TYPE_MODE_SWITCH,4,2 ; @GB_CONTROL_TYPE_MODE_SWITCH
	.comm	_GB_OPERATION_FLAG_UNIDIRECTIONAL,4,2 ; @GB_OPERATION_FLAG_UNIDIRECTIONAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to send mode switch: %d\n"

.subsections_via_symbols
