	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_get_wine_loader_name           ## -- Begin function get_wine_loader_name
	.p2align	4, 0x90
_get_wine_loader_name:                  ## @get_wine_loader_name
	.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	_get_wine_loader_name.loader(%rip), %r15
	testq	%r15, %r15
	jne	LBB0_8
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_getenv
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%rax, %r14
	movq	_CP_UNIXCP@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	xorl	%esi, %esi
	movq	%rax, %rdx
	movl	$-1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_MultiByteToWideChar
                                        ## kill: def $eax killed $eax def $rax
	leal	2(%rax), %ebx
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movl	%ebx, %edx
	callq	_HeapAlloc
	movq	%rax, %r15
	movl	(%r12), %edi
	xorl	%esi, %esi
	movq	%r14, %rdx
	movl	$-1, %ecx
	movq	%rax, %r8
	movl	%ebx, %r9d
	callq	_MultiByteToWideChar
	jmp	LBB0_4
LBB0_3:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movl	$7, %edx
	callq	_HeapAlloc
	movq	%rax, %r15
	leaq	_get_wine_loader_name.wineW(%rip), %rsi
	movq	%rax, %rdi
	callq	_strcpyW
LBB0_4:
	movq	%r15, %rdi
	callq	_strlenW
	movslq	%eax, %rbx
	addq	%r15, %rbx
	leaq	_get_wine_loader_name.suffixW(%rip), %rdi
	callq	_strlenW
	cltq
	subq	%rax, %rbx
	cmpq	%r15, %rbx
	jbe	LBB0_6
## %bb.5:
	leaq	_get_wine_loader_name.suffixW(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmpW
	testl	%eax, %eax
	je	LBB0_7
LBB0_6:
	leaq	_get_wine_loader_name.suffixW(%rip), %rsi
	movq	%r15, %rdi
	callq	_strcatW
LBB0_7:
	movq	%r15, %rdi
	callq	_debugstr_w
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_TRACE
	movq	%r15, _get_wine_loader_name.loader(%rip)
LBB0_8:
	movq	%r15, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
_get_wine_loader_name.wineW:            ## @get_wine_loader_name.wineW
	.asciz	"wine"

_get_wine_loader_name.suffixW:          ## @get_wine_loader_name.suffixW
	.asciz	"64"

.zerofill __DATA,__bss,_get_wine_loader_name.loader,8,3 ## @get_wine_loader_name.loader
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"WINELOADER"

	.comm	_CP_UNIXCP,4,2                  ## @CP_UNIXCP
L_.str.1:                               ## @.str.1
	.asciz	"returning %s\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_get_wine_loader_name           ; -- Begin function get_wine_loader_name
	.p2align	2
_get_wine_loader_name:                  ; @get_wine_loader_name
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	adrp	x22, _get_wine_loader_name.loader@PAGE
	ldr	x19, [x22, _get_wine_loader_name.loader@PAGEOFF]
	cbnz	x19, LBB0_8
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_getenv
	cbz	x0, LBB0_3
; %bb.2:
	mov	x20, x0
Lloh2:
	adrp	x23, _CP_UNIXCP@GOTPAGE
Lloh3:
	ldr	x23, [x23, _CP_UNIXCP@GOTPAGEOFF]
	ldr	w0, [x23]
	mov	w1, #0
	mov	x2, x20
	mov	w3, #-1
	mov	x4, #0
	mov	w5, #0
	bl	_MultiByteToWideChar
	add	w21, w0, #2
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x21
	bl	_HeapAlloc
	mov	x19, x0
	ldr	w0, [x23]
	mov	w1, #0
	mov	x2, x20
	mov	w3, #-1
	mov	x4, x19
	mov	x5, x21
	bl	_MultiByteToWideChar
	b	LBB0_4
LBB0_3:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	w2, #7
	bl	_HeapAlloc
	mov	x19, x0
Lloh4:
	adrp	x1, _get_wine_loader_name.wineW@PAGE
Lloh5:
	add	x1, x1, _get_wine_loader_name.wineW@PAGEOFF
	bl	_strcpyW
LBB0_4:
	mov	x0, x19
	bl	_strlenW
	add	x20, x19, w0, sxtw
Lloh6:
	adrp	x0, _get_wine_loader_name.suffixW@PAGE
Lloh7:
	add	x0, x0, _get_wine_loader_name.suffixW@PAGEOFF
	bl	_strlenW
	sub	x0, x20, w0, sxtw
	cmp	x0, x19
	b.ls	LBB0_6
; %bb.5:
Lloh8:
	adrp	x1, _get_wine_loader_name.suffixW@PAGE
Lloh9:
	add	x1, x1, _get_wine_loader_name.suffixW@PAGEOFF
	bl	_strcmpW
	cbz	w0, LBB0_7
LBB0_6:
Lloh10:
	adrp	x1, _get_wine_loader_name.suffixW@PAGE
Lloh11:
	add	x1, x1, _get_wine_loader_name.suffixW@PAGEOFF
	mov	x0, x19
	bl	_strcatW
LBB0_7:
	mov	x0, x19
	bl	_debugstr_w
	mov	x1, x0
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
	str	x19, [x22, _get_wine_loader_name.loader@PAGEOFF]
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
_get_wine_loader_name.wineW:            ; @get_wine_loader_name.wineW
	.asciz	"wine"

_get_wine_loader_name.suffixW:          ; @get_wine_loader_name.suffixW
	.asciz	"64"

.zerofill __DATA,__bss,_get_wine_loader_name.loader,8,3 ; @get_wine_loader_name.loader
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WINELOADER"

	.comm	_CP_UNIXCP,4,2                  ; @CP_UNIXCP
l_.str.1:                               ; @.str.1
	.asciz	"returning %s\n"

.subsections_via_symbols
