	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function attach_thermostat
_attach_thermostat:                     ## @attach_thermostat
	.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
	movq	(%rdi), %rdi
	leaq	L_.str(%rip), %rsi
	movl	$5, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_2
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_6
LBB0_2:
	movq	(%r14), %rdi
	addq	$6, %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	$10, %edx
	callq	_simple_strtoul
	movq	_therm_bus@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.3:
	leaq	-32(%rbp), %r15
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movl	-28(%rbp), %edi
	movq	_I2C_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	callq	_strlcpy
	movq	_therm_address@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -32(%rbp)
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_i2c_new_device
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	movq	_thermostat_driver@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	callq	_list_add_tail
	jmp	LBB0_7
LBB0_5:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_6:
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"uni-n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_therm_bus,8,3                  ## @therm_bus
L_.str.1:                               ## @.str.1
	.asciz	"therm_adt746x"

	.comm	_I2C_NAME_SIZE,4,2              ## @I2C_NAME_SIZE
	.comm	_therm_address,4,2              ## @therm_address
	.comm	_thermostat_driver,4,2          ## @thermostat_driver
	.no_dead_strip	_attach_thermostat
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function attach_thermostat
_attach_thermostat:                     ; @attach_thermostat
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldr	x0, [x0]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #5
	bl	_strncmp
	cbnz	x0, LBB0_4
; %bb.1:
	ldr	x8, [x19]
	add	x0, x8, #6
	mov	x1, #0
	mov	w2, #10
	bl	_simple_strtoul
Lloh2:
	adrp	x8, _therm_bus@GOTPAGE
Lloh3:
	ldr	x8, [x8, _therm_bus@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.2:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	w0, [sp, #12]
Lloh5:
	adrp	x8, _I2C_NAME_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _I2C_NAME_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_strlcpy
Lloh10:
	adrp	x8, _therm_address@GOTPAGE
Lloh11:
	ldr	x8, [x8, _therm_address@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [sp, #8]
	add	x1, sp, #8
	mov	x0, x19
	bl	_i2c_new_device
	cbz	x0, LBB0_4
; %bb.3:
Lloh13:
	adrp	x1, _thermostat_driver@GOTPAGE
Lloh14:
	ldr	x1, [x1, _thermostat_driver@GOTPAGEOFF]
	bl	_list_add_tail
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh15:
	adrp	x8, _ENODEV@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"uni-n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_therm_bus,8,3                  ; @therm_bus
l_.str.1:                               ; @.str.1
	.asciz	"therm_adt746x"

	.comm	_I2C_NAME_SIZE,4,2              ; @I2C_NAME_SIZE
	.comm	_therm_address,4,2              ; @therm_address
	.comm	_thermostat_driver,4,2          ; @thermostat_driver
	.no_dead_strip	_attach_thermostat
.subsections_via_symbols
