	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cros_ec_usb_get_role
_cros_ec_usb_get_role:                  ## @cros_ec_usb_get_role
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -24
	movq	%rsi, %rbx
	movl	(%rdi), %eax
	movl	%eax, -28(%rbp)
	movq	_USB_PD_CTRL_ROLE_NO_CHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -32(%rbp)
	movq	_USB_PD_CTRL_MUX_NO_CHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	movq	_USB_PD_CTRL_SWAP_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	_EC_CMD_USB_PD_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$12, (%rsp)
	leaq	-40(%rbp), %rcx
	leaq	-24(%rbp), %r9
	movl	$1, %edx
	movl	$16, %r8d
	callq	_cros_ec_pd_command
	testl	%eax, %eax
	js	LBB0_4
## %bb.1:
	movq	_PD_CTRL_RESP_ENABLED_CONNECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -24(%rbp)
	je	LBB0_2
## %bb.3:
	movl	-20(%rbp), %eax
	movl	%eax, (%rbx)
	movl	-16(%rbp), %eax
	jmp	LBB0_4
LBB0_2:
	movq	_ENOTCONN@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	addq	$40, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_USB_PD_CTRL_ROLE_NO_CHANGE,4,2 ## @USB_PD_CTRL_ROLE_NO_CHANGE
	.comm	_USB_PD_CTRL_MUX_NO_CHANGE,4,2  ## @USB_PD_CTRL_MUX_NO_CHANGE
	.comm	_USB_PD_CTRL_SWAP_NONE,4,2      ## @USB_PD_CTRL_SWAP_NONE
	.comm	_EC_CMD_USB_PD_CONTROL,4,2      ## @EC_CMD_USB_PD_CONTROL
	.comm	_PD_CTRL_RESP_ENABLED_CONNECTED,4,2 ## @PD_CTRL_RESP_ENABLED_CONNECTED
	.comm	_ENOTCONN,4,2                   ## @ENOTCONN
	.no_dead_strip	_cros_ec_usb_get_role
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cros_ec_usb_get_role
_cros_ec_usb_get_role:                  ; @cros_ec_usb_get_role
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x1
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _USB_PD_CTRL_ROLE_NO_CHANGE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _USB_PD_CTRL_ROLE_NO_CHANGE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #24]
Lloh3:
	adrp	x8, _USB_PD_CTRL_MUX_NO_CHANGE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _USB_PD_CTRL_MUX_NO_CHANGE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _USB_PD_CTRL_SWAP_NONE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _USB_PD_CTRL_SWAP_NONE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #16]
Lloh9:
	adrp	x8, _EC_CMD_USB_PD_CONTROL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EC_CMD_USB_PD_CONTROL@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x3, sp, #16
	mov	x5, sp
	mov	w2, #1
	mov	w4, #16
	mov	w6, #12
	bl	_cros_ec_pd_command
	tbnz	w0, #31, LBB0_4
; %bb.1:
	ldr	w8, [sp]
Lloh12:
	adrp	x9, _PD_CTRL_RESP_ENABLED_CONNECTED@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PD_CTRL_RESP_ENABLED_CONNECTED@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	ldp	w8, w0, [sp, #4]
	str	w8, [x19]
	b	LBB0_4
LBB0_3:
Lloh15:
	adrp	x8, _ENOTCONN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOTCONN@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_USB_PD_CTRL_ROLE_NO_CHANGE,4,2 ; @USB_PD_CTRL_ROLE_NO_CHANGE
	.comm	_USB_PD_CTRL_MUX_NO_CHANGE,4,2  ; @USB_PD_CTRL_MUX_NO_CHANGE
	.comm	_USB_PD_CTRL_SWAP_NONE,4,2      ; @USB_PD_CTRL_SWAP_NONE
	.comm	_EC_CMD_USB_PD_CONTROL,4,2      ; @EC_CMD_USB_PD_CONTROL
	.comm	_PD_CTRL_RESP_ENABLED_CONNECTED,4,2 ; @PD_CTRL_RESP_ENABLED_CONNECTED
	.comm	_ENOTCONN,4,2                   ; @ENOTCONN
	.no_dead_strip	_cros_ec_usb_get_role
.subsections_via_symbols
