	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mgag200_i2c_create             ## -- Begin function mgag200_i2c_create
	.p2align	4, 0x90
_mgag200_i2c_create:                    ## @mgag200_i2c_create
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rbx
	movq	_MGA1064_GEN_IO_CTL2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	callq	_WREG_DAC
	movq	_MGA1064_GEN_IO_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$255, %esi
	callq	_WREG_DAC
	movq	_MGA1064_GEN_IO_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG_DAC
	movl	(%rbx), %eax
	addl	$-128, %eax
	cmpl	$7, %eax
	ja	LBB0_1
## %bb.2:
	cltq
	leaq	l_switch.table.mgag200_i2c_create(%rip), %rcx
	movl	(%rcx,%rax,4), %r15d
	leaq	l_switch.table.mgag200_i2c_create.1(%rip), %rcx
	movl	(%rcx,%rax,4), %r12d
	jmp	LBB0_3
LBB0_1:
	movl	$8, %r12d
	movl	$2, %r15d
LBB0_3:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$80, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	%rax, %rbx
	movl	%r15d, (%rax)
	movl	%r12d, 4(%rax)
	movq	_THIS_MODULE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	8(%rbx), %r15
	movl	%eax, 36(%rbx)
	movq	_I2C_CLASS_DDC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	(%r14), %rax
	movq	%rax, 24(%rbx)
	movq	%r14, 72(%rbx)
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_i2c_set_adapdata
	movl	16(%rbx), %edi
	leaq	L_.str(%rip), %rdx
	movl	$4, %esi
	callq	_snprintf
	movq	%rbx, %rax
	addq	$40, %rax
	movq	%rax, 8(%rbx)
	movabsq	$8589934602, %rax               ## imm = 0x20000000A
	movq	%rax, 40(%rbx)
	movq	%rbx, 64(%rbx)
	movq	_mga_gpio_setsda@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 60(%rbx)
	movq	_mga_gpio_setscl@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%rbx)
	movq	_mga_gpio_getsda@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%rbx)
	movq	_mga_gpio_getscl@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movq	%r15, %rdi
	callq	_i2c_bit_add_bus
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_6:
	xorl	%ebx, %ebx
LBB0_7:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MGA1064_GEN_IO_CTL2,4,2        ## @MGA1064_GEN_IO_CTL2
	.comm	_MGA1064_GEN_IO_DATA,4,2        ## @MGA1064_GEN_IO_DATA
	.comm	_MGA1064_GEN_IO_CTL,4,2         ## @MGA1064_GEN_IO_CTL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_THIS_MODULE,4,2                ## @THIS_MODULE
	.comm	_I2C_CLASS_DDC,4,2              ## @I2C_CLASS_DDC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mga i2c"

	.comm	_mga_gpio_setsda,4,2            ## @mga_gpio_setsda
	.comm	_mga_gpio_setscl,4,2            ## @mga_gpio_setscl
	.comm	_mga_gpio_getsda,4,2            ## @mga_gpio_getsda
	.comm	_mga_gpio_getscl,4,2            ## @mga_gpio_getscl
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.mgag200_i2c_create
l_switch.table.mgag200_i2c_create:
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	2                               ## 0x2
	.long	2                               ## 0x2

	.p2align	2                               ## @switch.table.mgag200_i2c_create.1
l_switch.table.mgag200_i2c_create.1:
	.long	2                               ## 0x2
	.long	2                               ## 0x2
	.long	2                               ## 0x2
	.long	2                               ## 0x2
	.long	2                               ## 0x2
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function mgag200_i2c_create
lCPI0_0:
	.long	10                              ; 0xa
	.long	2                               ; 0x2
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_mgag200_i2c_create
	.p2align	2
_mgag200_i2c_create:                    ; @mgag200_i2c_create
	.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	x20, [x0, #8]
Lloh0:
	adrp	x8, _MGA1064_GEN_IO_CTL2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MGA1064_GEN_IO_CTL2@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	w1, #1
	bl	_WREG_DAC
Lloh3:
	adrp	x8, _MGA1064_GEN_IO_DATA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MGA1064_GEN_IO_DATA@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	w1, #255
	bl	_WREG_DAC
Lloh6:
	adrp	x8, _MGA1064_GEN_IO_CTL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MGA1064_GEN_IO_CTL@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_WREG_DAC
	ldr	w8, [x20]
	sub	w8, w8, #128
	cmp	w8, #7
	b.hi	LBB0_2
; %bb.1:
	sbfiz	x8, x8, #2, #32
Lloh9:
	adrp	x9, l_switch.table.mgag200_i2c_create@PAGE
Lloh10:
	add	x9, x9, l_switch.table.mgag200_i2c_create@PAGEOFF
	ldr	w21, [x9, x8]
Lloh11:
	adrp	x9, l_switch.table.mgag200_i2c_create.1@PAGE
Lloh12:
	add	x9, x9, l_switch.table.mgag200_i2c_create.1@PAGEOFF
	ldr	w22, [x9, x8]
	b	LBB0_3
LBB0_2:
	mov	w22, #8
	mov	w21, #2
LBB0_3:
Lloh13:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	w0, #80
	bl	_kzalloc
	mov	x20, x0
	cbz	x0, LBB0_6
; %bb.4:
	stp	w21, w22, [x20]
Lloh16:
	adrp	x8, _THIS_MODULE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _THIS_MODULE@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	add	x21, x20, #8
Lloh19:
	adrp	x9, _I2C_CLASS_DDC@GOTPAGE
Lloh20:
	ldr	x9, [x9, _I2C_CLASS_DDC@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #32]
	ldr	x8, [x19]
	str	x8, [x20, #24]
	str	x19, [x20, #72]
	mov	x0, x21
	mov	x1, x20
	bl	_i2c_set_adapdata
	ldr	w0, [x20, #16]
Lloh22:
	adrp	x2, l_.str@PAGE
Lloh23:
	add	x2, x2, l_.str@PAGEOFF
	mov	w1, #4
	bl	_snprintf
Lloh24:
	adrp	x8, lCPI0_0@PAGE
Lloh25:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	mov	x8, x20
	str	d0, [x8, #40]!
	str	x8, [x20, #8]
	str	x20, [x20, #64]
Lloh26:
	adrp	x8, _mga_gpio_setsda@GOTPAGE
Lloh27:
	ldr	x8, [x8, _mga_gpio_setsda@GOTPAGEOFF]
Lloh28:
	adrp	x9, _mga_gpio_setscl@GOTPAGE
Lloh29:
	ldr	x9, [x9, _mga_gpio_setscl@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
Lloh31:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #56]
Lloh32:
	adrp	x8, _mga_gpio_getsda@GOTPAGE
Lloh33:
	ldr	x8, [x8, _mga_gpio_getsda@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
Lloh35:
	adrp	x9, _mga_gpio_getscl@GOTPAGE
Lloh36:
	ldr	x9, [x9, _mga_gpio_getscl@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #48]
	mov	x0, x21
	bl	_i2c_bit_add_bus
	cbz	w0, LBB0_6
; %bb.5:
	mov	x0, x20
	bl	_kfree
	mov	x20, #0
LBB0_6:
	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	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh30
	.loh AdrpLdr	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_MGA1064_GEN_IO_CTL2,4,2        ; @MGA1064_GEN_IO_CTL2
	.comm	_MGA1064_GEN_IO_DATA,4,2        ; @MGA1064_GEN_IO_DATA
	.comm	_MGA1064_GEN_IO_CTL,4,2         ; @MGA1064_GEN_IO_CTL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_THIS_MODULE,4,2                ; @THIS_MODULE
	.comm	_I2C_CLASS_DDC,4,2              ; @I2C_CLASS_DDC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mga i2c"

	.comm	_mga_gpio_setsda,4,2            ; @mga_gpio_setsda
	.comm	_mga_gpio_setscl,4,2            ; @mga_gpio_setscl
	.comm	_mga_gpio_getsda,4,2            ; @mga_gpio_getsda
	.comm	_mga_gpio_getscl,4,2            ; @mga_gpio_getscl
	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.mgag200_i2c_create
l_switch.table.mgag200_i2c_create:
	.long	1                               ; 0x1
	.long	1                               ; 0x1
	.long	1                               ; 0x1
	.long	1                               ; 0x1
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	2                               ; 0x2
	.long	2                               ; 0x2

	.p2align	2                               ; @switch.table.mgag200_i2c_create.1
l_switch.table.mgag200_i2c_create.1:
	.long	2                               ; 0x2
	.long	2                               ; 0x2
	.long	2                               ; 0x2
	.long	2                               ; 0x2
	.long	2                               ; 0x2
	.long	1                               ; 0x1
	.long	1                               ; 0x1
	.long	1                               ; 0x1

.subsections_via_symbols
