	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gmux_probe
_gmux_probe:                            ## @gmux_probe
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r13d, %r13d
	movq	_apple_gmux_data@GOTPCREL(%rip), %r12
	cmpq	$0, (%r12)
	je	LBB0_2
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_38
LBB0_2:
	movq	%rdi, %r15
	movq	_ENXIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$56, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r14
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_pnp_set_drvdata
	movq	_IORESOURCE_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_pnp_get_resource
	testq	%rax, %rax
	je	LBB0_5
## %bb.7:
	movq	(%rax), %rdi
	movq	%rdi, (%r14)
	movq	8(%rax), %rsi
	subq	%rdi, %rsi
	movq	%rsi, 8(%r14)
	movq	_GMUX_MIN_IO_LEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	cmpq	%rdx, %rsi
	jge	LBB0_9
## %bb.8:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_37
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_39
LBB0_5:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_6
LBB0_9:
	leaq	L_.str.2(%rip), %rdx
	callq	_request_region
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	movq	_GMUX_PORT_VERSION_MAJOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_gmux_read8
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_GMUX_PORT_VERSION_MINOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_gmux_read8
	movl	%eax, %ebx
	movq	_GMUX_PORT_VERSION_RELEASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_gmux_read8
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	cmpl	$255, %esi
	jne	LBB0_16
## %bb.12:
	cmpl	$255, %ebx
	jne	LBB0_16
## %bb.13:
	cmpl	$255, %eax
	jne	LBB0_16
## %bb.14:
	movq	%r14, %rdi
	callq	_gmux_is_indexed
	testq	%rax, %rax
	je	LBB0_40
## %bb.15:
	leaq	48(%r14), %rdi
	callq	_mutex_init
	movl	$1, 16(%r14)
	movq	_GMUX_PORT_VERSION_MAJOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_gmux_read32
	movq	%rax, %rcx
	movl	%ecx, %edx
	movzbl	%ch, %eax
	movl	%ecx, %esi
	shrl	$24, %esi
	shrl	$16, %edx
	movzbl	%dl, %ebx
LBB0_16:
	cmpl	$0, 16(%r14)
	leaq	L_.str.7(%rip), %rcx
	leaq	L_.str.6(%rip), %r8
	cmoveq	%rcx, %r8
	leaq	L_.str.5(%rip), %rdi
	movl	%ebx, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_pr_info
	leaq	-64(%rbp), %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	_BACKLIGHT_PLATFORM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	_GMUX_PORT_MAX_BRIGHTNESS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_gmux_read32
	movq	%rax, -64(%rbp)
	movq	_GMUX_MAX_BRIGHTNESS@GOTPCREL(%rip), %rbx
	xorl	%edi, %edi
	cmpq	%rax, (%rbx)
	setl	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:
	movq	(%rbx), %rax
	movq	%rax, -64(%rbp)
LBB0_18:
	leaq	L_.str.8(%rip), %rdi
	movq	_gmux_bl_ops@GOTPCREL(%rip), %rcx
	leaq	-64(%rbp), %r8
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_backlight_device_register
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_20
## %bb.19:
	movq	%rbx, %rdi
	callq	_PTR_ERR
	movl	%eax, %r13d
	jmp	LBB0_36
LBB0_10:
	leaq	L_.str.3(%rip), %rdi
LBB0_6:
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_37
LBB0_20:
	movq	%rbx, 40(%r14)
	movq	%rbx, %rdi
	callq	_gmux_get_brightness
	movl	%eax, (%rbx)
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_backlight_update_status
	movq	_acpi_backlight_vendor@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_acpi_video_set_dmi_backlight_type
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_apple_bl_unregister
	movq	_VGA_SWITCHEROO_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%r14)
	movq	%r15, %rdi
	callq	_ACPI_HANDLE
	movl	%eax, 28(%r14)
	testl	%eax, %eax
	je	LBB0_21
## %bb.22:
	leaq	L_.str.10(%rip), %rsi
	leaq	-72(%rbp), %rcx
	movl	%eax, %edi
	xorl	%edx, %edx
	callq	_acpi_evaluate_integer
	movl	%eax, %edi
	callq	_ACPI_SUCCESS
	testq	%rax, %rax
	je	LBB0_27
## %bb.23:
	movl	-72(%rbp), %eax
	movl	%eax, 20(%r14)
	movl	28(%r14), %edi
	movq	_ACPI_DEVICE_NOTIFY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_gmux_notify_handler@GOTPCREL(%rip), %rdx
	movq	%r15, %rcx
	callq	_acpi_install_notify_handler
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_ACPI_FAILURE
	testq	%rax, %rax
	je	LBB0_25
## %bb.24:
	movl	%ebx, %edi
	callq	_acpi_format_exception
	leaq	L_.str.11(%rip), %rdi
	xorl	%r13d, %r13d
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_pr_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_35
LBB0_40:
	leaq	L_.str.4(%rip), %rdi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_pr_info
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_36
LBB0_21:
	movq	%r15, %rdi
	callq	_dev_name
	leaq	L_.str.9(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_pr_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, %r13d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_35
LBB0_27:
	leaq	L_.str.13(%rip), %rdi
	callq	_pr_warn
	movl	$-1, 20(%r14)
LBB0_28:
	movq	_is_thunderbolt@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_pci_bus_type@GOTPCREL(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_bus_for_each_dev
	xorl	%ecx, %ecx
	testl	%eax, %eax
	sete	%cl
	movl	%ecx, 24(%r14)
	je	LBB0_30
## %bb.29:
	movq	_GMUX_PORT_SWITCH_EXTERNAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$3, %edx
	callq	_gmux_write8
LBB0_30:
	movq	%r14, (%r12)
	movq	%r14, %rdi
	addq	$32, %rdi
	callq	_init_completion
	movq	%r14, %rdi
	callq	_gmux_enable_interrupts
	movq	%r14, %rdi
	callq	_gmux_read_switch_state
	cmpl	$0, 16(%r14)
	movq	_gmux_handler_indexed@GOTPCREL(%rip), %rdi
	cmoveq	_gmux_handler_classic@GOTPCREL(%rip), %rdi
	movq	_VGA_SWITCHEROO_NEEDS_EDP_CONFIG@GOTPCREL(%rip), %rax
	cmoveq	_VGA_SWITCHEROO_CAN_SWITCH_DDC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_vga_switcheroo_register_handler
	testl	%eax, %eax
	je	LBB0_39
## %bb.31:
	movl	%eax, %r13d
	leaq	L_.str.14(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_err
	movq	%r14, %rdi
	callq	_gmux_disable_interrupts
	movq	$0, (%r12)
	movl	20(%r14), %esi
	testl	%esi, %esi
	js	LBB0_33
## %bb.32:
	xorl	%edi, %edi
	callq	_acpi_disable_gpe
	jmp	LBB0_33
LBB0_25:
	movl	20(%r14), %esi
	xorl	%edi, %edi
	callq	_acpi_enable_gpe
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_ACPI_FAILURE
	testq	%rax, %rax
	je	LBB0_28
## %bb.26:
	movl	%ebx, %edi
	callq	_acpi_format_exception
	leaq	L_.str.12(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_pr_err
LBB0_33:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	cmpl	$0, 20(%r14)
	js	LBB0_35
## %bb.34:
	movl	28(%r14), %edi
	movq	_ACPI_DEVICE_NOTIFY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_gmux_notify_handler@GOTPCREL(%rip), %rdx
	callq	_acpi_remove_notify_handler
LBB0_35:
	movq	%rbx, %rdi
	callq	_backlight_device_unregister
LBB0_36:
	movq	(%r14), %rdi
	movq	8(%r14), %rsi
	callq	_release_region
LBB0_37:
	movq	%r14, %rdi
	callq	_kfree
LBB0_38:
	movl	%r13d, %ebx
LBB0_39:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_apple_gmux_data,8,3            ## @apple_gmux_data
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_IORESOURCE_IO,4,2              ## @IORESOURCE_IO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to find gmux I/O resource\n"

	.comm	_GMUX_MIN_IO_LEN,8,3            ## @GMUX_MIN_IO_LEN
L_.str.1:                               ## @.str.1
	.asciz	"gmux I/O region too small (%lu < %u)\n"

L_.str.2:                               ## @.str.2
	.asciz	"Apple gmux"

L_.str.3:                               ## @.str.3
	.asciz	"gmux I/O already in use\n"

	.comm	_GMUX_PORT_VERSION_MAJOR,4,2    ## @GMUX_PORT_VERSION_MAJOR
	.comm	_GMUX_PORT_VERSION_MINOR,4,2    ## @GMUX_PORT_VERSION_MINOR
	.comm	_GMUX_PORT_VERSION_RELEASE,4,2  ## @GMUX_PORT_VERSION_RELEASE
L_.str.4:                               ## @.str.4
	.asciz	"gmux device not present\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.5:                               ## @.str.5
	.asciz	"Found gmux version %d.%d.%d [%s]\n"

L_.str.6:                               ## @.str.6
	.asciz	"indexed"

L_.str.7:                               ## @.str.7
	.asciz	"classic"

	.comm	_BACKLIGHT_PLATFORM,4,2         ## @BACKLIGHT_PLATFORM
	.comm	_GMUX_PORT_MAX_BRIGHTNESS,4,2   ## @GMUX_PORT_MAX_BRIGHTNESS
	.comm	_GMUX_MAX_BRIGHTNESS,8,3        ## @GMUX_MAX_BRIGHTNESS
L_.str.8:                               ## @.str.8
	.asciz	"gmux_backlight"

	.comm	_gmux_bl_ops,4,2                ## @gmux_bl_ops
	.comm	_acpi_backlight_vendor,4,2      ## @acpi_backlight_vendor
	.comm	_VGA_SWITCHEROO_ON,4,2          ## @VGA_SWITCHEROO_ON
L_.str.9:                               ## @.str.9
	.asciz	"Cannot find acpi handle for pnp device %s\n"

L_.str.10:                              ## @.str.10
	.asciz	"GMGP"

	.comm	_ACPI_DEVICE_NOTIFY,4,2         ## @ACPI_DEVICE_NOTIFY
	.comm	_gmux_notify_handler,4,2        ## @gmux_notify_handler
L_.str.11:                              ## @.str.11
	.asciz	"Install notify handler failed: %s\n"

L_.str.12:                              ## @.str.12
	.asciz	"Cannot enable gpe: %s\n"

L_.str.13:                              ## @.str.13
	.asciz	"No GPE found for gmux\n"

	.comm	_pci_bus_type,4,2               ## @pci_bus_type
	.comm	_is_thunderbolt,4,2             ## @is_thunderbolt
	.comm	_GMUX_PORT_SWITCH_EXTERNAL,4,2  ## @GMUX_PORT_SWITCH_EXTERNAL
	.comm	_gmux_handler_indexed,4,2       ## @gmux_handler_indexed
	.comm	_VGA_SWITCHEROO_NEEDS_EDP_CONFIG,4,2 ## @VGA_SWITCHEROO_NEEDS_EDP_CONFIG
	.comm	_gmux_handler_classic,4,2       ## @gmux_handler_classic
	.comm	_VGA_SWITCHEROO_CAN_SWITCH_DDC,4,2 ## @VGA_SWITCHEROO_CAN_SWITCH_DDC
L_.str.14:                              ## @.str.14
	.asciz	"Failed to register vga_switcheroo handler\n"

	.no_dead_strip	_gmux_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gmux_probe
_gmux_probe:                            ; @gmux_probe
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
Lloh0:
	adrp	x24, _apple_gmux_data@GOTPAGE
Lloh1:
	ldr	x24, [x24, _apple_gmux_data@GOTPAGEOFF]
	ldr	x8, [x24]
	cbz	x8, LBB0_3
; %bb.1:
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_40
LBB0_3:
	mov	x21, x0
Lloh4:
	adrp	x8, _ENXIO@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh6:
	ldr	w20, [x8]
Lloh7:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	w0, #56
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.4:
	mov	x19, x0
	neg	w20, w20
	mov	x0, x21
	mov	x1, x19
	bl	_pnp_set_drvdata
Lloh10:
	adrp	x8, _IORESOURCE_IO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IORESOURCE_IO@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x21
	mov	w2, #0
	bl	_pnp_get_resource
	cbz	x0, LBB0_8
; %bb.5:
	mov	x8, x0
	ldr	x0, [x0]
	str	x0, [x19]
	ldr	x9, [x8, #8]
Lloh13:
	adrp	x8, _GMUX_MIN_IO_LEN@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GMUX_MIN_IO_LEN@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	sub	x1, x9, x0
	cmp	x1, x8
	str	x1, [x19, #8]
	b.ge	LBB0_9
; %bb.6:
	stp	x1, x8, [sp]
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	b	LBB0_39
LBB0_7:
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_2
LBB0_8:
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_39
LBB0_9:
Lloh22:
	adrp	x2, l_.str.2@PAGE
Lloh23:
	add	x2, x2, l_.str.2@PAGEOFF
	bl	_request_region
	cbz	w0, LBB0_19
; %bb.10:
Lloh24:
	adrp	x25, _GMUX_PORT_VERSION_MAJOR@GOTPAGE
Lloh25:
	ldr	x25, [x25, _GMUX_PORT_VERSION_MAJOR@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x19
	bl	_gmux_read8
	mov	x22, x0
Lloh26:
	adrp	x8, _GMUX_PORT_VERSION_MINOR@GOTPAGE
Lloh27:
	ldr	x8, [x8, _GMUX_PORT_VERSION_MINOR@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_gmux_read8
	mov	x23, x0
Lloh29:
	adrp	x8, _GMUX_PORT_VERSION_RELEASE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _GMUX_PORT_VERSION_RELEASE@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_gmux_read8
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w22, #255
	b.ne	LBB0_15
; %bb.11:
	cmp	w23, #255
	b.ne	LBB0_15
; %bb.12:
	cmp	w0, #255
	b.ne	LBB0_15
; %bb.13:
	mov	x0, x19
	bl	_gmux_is_indexed
	cbz	x0, LBB0_24
; %bb.14:
	add	x0, x19, #48
	bl	_mutex_init
	mov	w8, #1
	str	w8, [x19, #16]
	ldr	w1, [x25]
	mov	x0, x19
	bl	_gmux_read32
	ubfx	x22, x0, #24, #8
	ubfx	w23, w0, #16, #8
	ubfx	w0, w0, #8, #8
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
LBB0_15:
	ldr	w8, [x19, #16]
Lloh32:
	adrp	x9, l_.str.6@PAGE
Lloh33:
	add	x9, x9, l_.str.6@PAGEOFF
Lloh34:
	adrp	x10, l_.str.7@PAGE
Lloh35:
	add	x10, x10, l_.str.7@PAGEOFF
	cmp	w8, #0
	csel	x8, x10, x9, eq
	stp	x0, x8, [sp, #16]
	stp	x22, x23, [sp]
Lloh36:
	adrp	x0, l_.str.5@PAGE
Lloh37:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_pr_info
	add	x0, sp, #48
	mov	w1, #0
	mov	w2, #16
	bl	_memset
Lloh38:
	adrp	x8, _BACKLIGHT_PLATFORM@GOTPAGE
Lloh39:
	ldr	x8, [x8, _BACKLIGHT_PLATFORM@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	str	w8, [sp, #56]
Lloh41:
	adrp	x8, _GMUX_PORT_MAX_BRIGHTNESS@GOTPAGE
Lloh42:
	ldr	x8, [x8, _GMUX_PORT_MAX_BRIGHTNESS@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_gmux_read32
	str	x0, [sp, #48]
Lloh44:
	adrp	x22, _GMUX_MAX_BRIGHTNESS@GOTPAGE
Lloh45:
	ldr	x22, [x22, _GMUX_MAX_BRIGHTNESS@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x8, x0
	cset	w0, lt
	bl	_WARN_ON
	cbz	x0, LBB0_17
; %bb.16:
	ldr	x8, [x22]
	str	x8, [sp, #48]
LBB0_17:
Lloh46:
	adrp	x0, l_.str.8@PAGE
Lloh47:
	add	x0, x0, l_.str.8@PAGEOFF
Lloh48:
	adrp	x3, _gmux_bl_ops@GOTPAGE
Lloh49:
	ldr	x3, [x3, _gmux_bl_ops@GOTPAGEOFF]
	add	x4, sp, #48
	mov	x1, x21
	mov	x2, x19
	bl	_backlight_device_register
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_20
; %bb.18:
	mov	x0, x22
	bl	_PTR_ERR
	mov	x20, x0
	b	LBB0_38
LBB0_19:
Lloh50:
	adrp	x0, l_.str.3@PAGE
Lloh51:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_err
	b	LBB0_39
LBB0_20:
	str	x22, [x19, #40]
	mov	x0, x22
	bl	_gmux_get_brightness
	str	w0, [x22]
	mov	x0, x22
	bl	_backlight_update_status
Lloh52:
	adrp	x8, _acpi_backlight_vendor@GOTPAGE
Lloh53:
	ldr	x8, [x8, _acpi_backlight_vendor@GOTPAGEOFF]
Lloh54:
	ldr	w0, [x8]
	bl	_acpi_video_set_dmi_backlight_type
	bl	_apple_bl_unregister
Lloh55:
	adrp	x8, _VGA_SWITCHEROO_ON@GOTPAGE
Lloh56:
	ldr	x8, [x8, _VGA_SWITCHEROO_ON@GOTPAGEOFF]
Lloh57:
	ldr	w8, [x8]
	str	w8, [x19, #36]
	mov	x0, x21
	bl	_ACPI_HANDLE
	str	w0, [x19, #28]
	cbz	w0, LBB0_25
; %bb.21:
Lloh58:
	adrp	x1, l_.str.10@PAGE
Lloh59:
	add	x1, x1, l_.str.10@PAGEOFF
	add	x3, sp, #40
	mov	x2, #0
	bl	_acpi_evaluate_integer
	bl	_ACPI_SUCCESS
	cbz	x0, LBB0_27
; %bb.22:
	ldr	x8, [sp, #40]
	str	w8, [x19, #20]
	ldr	w0, [x19, #28]
Lloh60:
	adrp	x8, _ACPI_DEVICE_NOTIFY@GOTPAGE
Lloh61:
	ldr	x8, [x8, _ACPI_DEVICE_NOTIFY@GOTPAGEOFF]
Lloh62:
	ldr	w1, [x8]
Lloh63:
	adrp	x2, _gmux_notify_handler@GOTPAGE
Lloh64:
	ldr	x2, [x2, _gmux_notify_handler@GOTPAGEOFF]
	mov	x3, x21
	bl	_acpi_install_notify_handler
	mov	x21, x0
	bl	_ACPI_FAILURE
	cbz	x0, LBB0_33
; %bb.23:
	mov	x0, x21
	bl	_acpi_format_exception
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh65:
	adrp	x0, l_.str.11@PAGE
Lloh66:
	add	x0, x0, l_.str.11@PAGEOFF
	b	LBB0_26
LBB0_24:
Lloh67:
	adrp	x0, l_.str.4@PAGE
Lloh68:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_info
Lloh69:
	adrp	x8, _ENODEV@GOTPAGE
Lloh70:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh71:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_38
LBB0_25:
	mov	x0, x21
	bl	_dev_name
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh72:
	adrp	x0, l_.str.9@PAGE
Lloh73:
	add	x0, x0, l_.str.9@PAGEOFF
LBB0_26:
	bl	_pr_err
Lloh74:
	adrp	x8, _ENODEV@GOTPAGE
Lloh75:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh76:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_37
LBB0_27:
Lloh77:
	adrp	x0, l_.str.13@PAGE
Lloh78:
	add	x0, x0, l_.str.13@PAGEOFF
	bl	_pr_warn
	mov	w8, #-1
	str	w8, [x19, #20]
LBB0_28:
Lloh79:
	adrp	x8, _is_thunderbolt@GOTPAGE
Lloh80:
	ldr	x8, [x8, _is_thunderbolt@GOTPAGEOFF]
Lloh81:
	ldr	w3, [x8]
Lloh82:
	adrp	x0, _pci_bus_type@GOTPAGE
Lloh83:
	ldr	x0, [x0, _pci_bus_type@GOTPAGEOFF]
	mov	x1, #0
	mov	x2, #0
	bl	_bus_for_each_dev
	cmp	w0, #0
	cset	w8, eq
	str	w8, [x19, #24]
	cbz	w0, LBB0_30
; %bb.29:
Lloh84:
	adrp	x8, _GMUX_PORT_SWITCH_EXTERNAL@GOTPAGE
Lloh85:
	ldr	x8, [x8, _GMUX_PORT_SWITCH_EXTERNAL@GOTPAGEOFF]
Lloh86:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #3
	bl	_gmux_write8
LBB0_30:
	str	x19, [x24]
	add	x0, x19, #32
	bl	_init_completion
	mov	x0, x19
	bl	_gmux_enable_interrupts
	mov	x0, x19
	bl	_gmux_read_switch_state
	ldr	w8, [x19, #16]
Lloh87:
	adrp	x9, _gmux_handler_indexed@GOTPAGE
Lloh88:
	ldr	x9, [x9, _gmux_handler_indexed@GOTPAGEOFF]
Lloh89:
	adrp	x10, _gmux_handler_classic@GOTPAGE
Lloh90:
	ldr	x10, [x10, _gmux_handler_classic@GOTPAGEOFF]
	cmp	w8, #0
	csel	x0, x10, x9, eq
Lloh91:
	adrp	x8, _VGA_SWITCHEROO_CAN_SWITCH_DDC@GOTPAGE
Lloh92:
	ldr	x8, [x8, _VGA_SWITCHEROO_CAN_SWITCH_DDC@GOTPAGEOFF]
Lloh93:
	adrp	x9, _VGA_SWITCHEROO_NEEDS_EDP_CONFIG@GOTPAGE
Lloh94:
	ldr	x9, [x9, _VGA_SWITCHEROO_NEEDS_EDP_CONFIG@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w1, [x8]
	bl	_vga_switcheroo_register_handler
	mov	x20, x0
	cbz	w0, LBB0_40
; %bb.31:
Lloh95:
	adrp	x0, l_.str.14@PAGE
Lloh96:
	add	x0, x0, l_.str.14@PAGEOFF
	bl	_pr_err
	mov	x0, x19
	bl	_gmux_disable_interrupts
	str	xzr, [x24]
	ldr	w1, [x19, #20]
	tbnz	w1, #31, LBB0_35
; %bb.32:
	mov	x0, #0
	bl	_acpi_disable_gpe
	b	LBB0_35
LBB0_33:
	ldr	w1, [x19, #20]
	bl	_acpi_enable_gpe
	mov	x21, x0
	bl	_ACPI_FAILURE
	cbz	x0, LBB0_28
; %bb.34:
	mov	x0, x21
	bl	_acpi_format_exception
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh97:
	adrp	x0, l_.str.12@PAGE
Lloh98:
	add	x0, x0, l_.str.12@PAGEOFF
	bl	_pr_err
LBB0_35:
	ldr	w8, [x19, #20]
	tbnz	w8, #31, LBB0_37
; %bb.36:
	ldr	w0, [x19, #28]
Lloh99:
	adrp	x8, _ACPI_DEVICE_NOTIFY@GOTPAGE
Lloh100:
	ldr	x8, [x8, _ACPI_DEVICE_NOTIFY@GOTPAGEOFF]
Lloh101:
	ldr	w1, [x8]
Lloh102:
	adrp	x2, _gmux_notify_handler@GOTPAGE
Lloh103:
	ldr	x2, [x2, _gmux_notify_handler@GOTPAGEOFF]
	bl	_acpi_remove_notify_handler
LBB0_37:
	mov	x0, x22
	bl	_backlight_device_unregister
LBB0_38:
	ldp	x0, x1, [x19]
	bl	_release_region
LBB0_39:
	mov	x0, x19
	bl	_kfree
LBB0_40:
	mov	x0, x20
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh48, Lloh49
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpAdd	Lloh58, Lloh59
	.loh AdrpLdrGot	Lloh63, Lloh64
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.loh AdrpAdd	Lloh65, Lloh66
	.loh AdrpLdrGotLdr	Lloh69, Lloh70, Lloh71
	.loh AdrpAdd	Lloh67, Lloh68
	.loh AdrpAdd	Lloh72, Lloh73
	.loh AdrpLdrGotLdr	Lloh74, Lloh75, Lloh76
	.loh AdrpAdd	Lloh77, Lloh78
	.loh AdrpLdrGot	Lloh82, Lloh83
	.loh AdrpLdrGotLdr	Lloh79, Lloh80, Lloh81
	.loh AdrpLdrGotLdr	Lloh84, Lloh85, Lloh86
	.loh AdrpLdrGot	Lloh93, Lloh94
	.loh AdrpLdrGot	Lloh91, Lloh92
	.loh AdrpLdrGot	Lloh89, Lloh90
	.loh AdrpLdrGot	Lloh87, Lloh88
	.loh AdrpAdd	Lloh95, Lloh96
	.loh AdrpAdd	Lloh97, Lloh98
	.loh AdrpLdrGot	Lloh102, Lloh103
	.loh AdrpLdrGotLdr	Lloh99, Lloh100, Lloh101
	.cfi_endproc
                                        ; -- End function
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_apple_gmux_data,8,3            ; @apple_gmux_data
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_IORESOURCE_IO,4,2              ; @IORESOURCE_IO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to find gmux I/O resource\n"

	.comm	_GMUX_MIN_IO_LEN,8,3            ; @GMUX_MIN_IO_LEN
l_.str.1:                               ; @.str.1
	.asciz	"gmux I/O region too small (%lu < %u)\n"

l_.str.2:                               ; @.str.2
	.asciz	"Apple gmux"

l_.str.3:                               ; @.str.3
	.asciz	"gmux I/O already in use\n"

	.comm	_GMUX_PORT_VERSION_MAJOR,4,2    ; @GMUX_PORT_VERSION_MAJOR
	.comm	_GMUX_PORT_VERSION_MINOR,4,2    ; @GMUX_PORT_VERSION_MINOR
	.comm	_GMUX_PORT_VERSION_RELEASE,4,2  ; @GMUX_PORT_VERSION_RELEASE
l_.str.4:                               ; @.str.4
	.asciz	"gmux device not present\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.5:                               ; @.str.5
	.asciz	"Found gmux version %d.%d.%d [%s]\n"

l_.str.6:                               ; @.str.6
	.asciz	"indexed"

l_.str.7:                               ; @.str.7
	.asciz	"classic"

	.comm	_BACKLIGHT_PLATFORM,4,2         ; @BACKLIGHT_PLATFORM
	.comm	_GMUX_PORT_MAX_BRIGHTNESS,4,2   ; @GMUX_PORT_MAX_BRIGHTNESS
	.comm	_GMUX_MAX_BRIGHTNESS,8,3        ; @GMUX_MAX_BRIGHTNESS
l_.str.8:                               ; @.str.8
	.asciz	"gmux_backlight"

	.comm	_gmux_bl_ops,4,2                ; @gmux_bl_ops
	.comm	_acpi_backlight_vendor,4,2      ; @acpi_backlight_vendor
	.comm	_VGA_SWITCHEROO_ON,4,2          ; @VGA_SWITCHEROO_ON
l_.str.9:                               ; @.str.9
	.asciz	"Cannot find acpi handle for pnp device %s\n"

l_.str.10:                              ; @.str.10
	.asciz	"GMGP"

	.comm	_ACPI_DEVICE_NOTIFY,4,2         ; @ACPI_DEVICE_NOTIFY
	.comm	_gmux_notify_handler,4,2        ; @gmux_notify_handler
l_.str.11:                              ; @.str.11
	.asciz	"Install notify handler failed: %s\n"

l_.str.12:                              ; @.str.12
	.asciz	"Cannot enable gpe: %s\n"

l_.str.13:                              ; @.str.13
	.asciz	"No GPE found for gmux\n"

	.comm	_pci_bus_type,4,2               ; @pci_bus_type
	.comm	_is_thunderbolt,4,2             ; @is_thunderbolt
	.comm	_GMUX_PORT_SWITCH_EXTERNAL,4,2  ; @GMUX_PORT_SWITCH_EXTERNAL
	.comm	_gmux_handler_indexed,4,2       ; @gmux_handler_indexed
	.comm	_VGA_SWITCHEROO_NEEDS_EDP_CONFIG,4,2 ; @VGA_SWITCHEROO_NEEDS_EDP_CONFIG
	.comm	_gmux_handler_classic,4,2       ; @gmux_handler_classic
	.comm	_VGA_SWITCHEROO_CAN_SWITCH_DDC,4,2 ; @VGA_SWITCHEROO_CAN_SWITCH_DDC
l_.str.14:                              ; @.str.14
	.asciz	"Failed to register vga_switcheroo handler\n"

	.no_dead_strip	_gmux_probe
.subsections_via_symbols
