	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mc_generate_bin_item
_mc_generate_bin_item:                  ## @mc_generate_bin_item
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	$0, (%rsi)
	movq	_mcset_bin_out_is_unicode@GOTPCREL(%rip), %rax
	cmpl	$1, (%rax)
	jne	LBB0_12
## %bb.1:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r14
	movq	%r14, %rdi
	callq	_unichar_len
                                        ## kill: def $eax killed $eax def $rax
	movq	_mcset_automatic_null_termination@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_8
## %bb.2:
	testl	%eax, %eax
	je	LBB0_8
## %bb.3:
	jle	LBB0_8
## %bb.4:
	movl	%eax, %eax
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	-4(%r14,%rax,4), %ecx
	decl	%ecx
	cmpl	$30, %ecx
	ja	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$0, -4(%r14,%rax,4)
	decq	%rax
	leaq	1(%rax), %rcx
	cmpq	$1, %rcx
	ja	LBB0_5
## %bb.7:
	xorl	%eax, %eax
LBB0_8:
	movq	_BIN_MESSAGETABLE_ITEM_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leal	(%rcx,%rax,4), %r13d
	addl	$4, %r13d
	leal	(%rcx,%rax,4), %r12d
	addl	$7, %r12d
	andl	$-4, %r12d
	movl	%r12d, %edi
	callq	_res_alloc
	movq	%rax, %r15
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	%r12d, %edx
	callq	_memset
	movq	16(%r15), %rdi
	movl	%r12d, %esi
	callq	_target_put_16
	movq	8(%r15), %rdi
	movq	_MESSAGE_RESOURCE_UNICODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_target_put_16
	movl	(%r14), %esi
	testl	%esi, %esi
	je	LBB0_21
## %bb.9:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	addq	%rbx, %rdi
	callq	_target_put_16
	movl	4(%r14,%rbx,2), %esi
	addq	$2, %rbx
	testl	%esi, %esi
	jne	LBB0_10
LBB0_21:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_22
LBB0_12:
	movq	(%rdi), %rsi
	movq	8(%rdi), %rax
	movl	(%rax), %ecx
	leaq	-60(%rbp), %rdi
	leaq	-48(%rbp), %rdx
	callq	_codepage_from_unicode
	movq	-48(%rbp), %rdi
	testq	%rdi, %rdi
	jne	LBB0_14
## %bb.13:
	leaq	L_.str(%rip), %rdi
	callq	_fatal
	movq	-48(%rbp), %rdi
LBB0_14:
	callq	_strlen
                                        ## kill: def $eax killed $eax def $rax
	movq	_mcset_automatic_null_termination@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_20
## %bb.15:
	testl	%eax, %eax
	jle	LBB0_20
## %bb.16:
	movl	%eax, %eax
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rcx
	movzbl	-1(%rcx,%rax), %edx
	decb	%dl
	cmpb	$30, %dl
	ja	LBB0_20
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	movb	$0, -1(%rcx,%rax)
	decq	%rax
	leaq	1(%rax), %rcx
	cmpq	$1, %rcx
	ja	LBB0_17
## %bb.19:
	xorl	%eax, %eax
LBB0_20:
	movq	_BIN_MESSAGETABLE_ITEM_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leal	(%rcx,%rax), %r13d
	incl	%r13d
	leal	(%rcx,%rax), %ebx
	addl	$4, %ebx
	andl	$-4, %ebx
	movl	%ebx, %edi
	callq	_res_alloc
	movq	%rax, %r15
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	callq	_memset
	movq	16(%r15), %rdi
	movl	%ebx, %esi
	callq	_target_put_16
	movq	8(%r15), %rdi
	xorl	%esi, %esi
	callq	_target_put_16
	movq	(%r15), %rdi
	movq	-48(%rbp), %rsi
	callq	_strcpy
LBB0_22:
	addl	$3, %r13d
	andl	$-4, %r13d
	movl	%r13d, (%r14)
	movq	%r15, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mcset_bin_out_is_unicode,4,2   ## @mcset_bin_out_is_unicode
	.comm	_mcset_automatic_null_termination,8,3 ## @mcset_automatic_null_termination
	.comm	_BIN_MESSAGETABLE_ITEM_SIZE,4,2 ## @BIN_MESSAGETABLE_ITEM_SIZE
	.comm	_MESSAGE_RESOURCE_UNICODE,4,2   ## @MESSAGE_RESOURCE_UNICODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to convert message to language codepage.\n"

	.no_dead_strip	_mc_generate_bin_item
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mc_generate_bin_item
_mc_generate_bin_item:                  ; @mc_generate_bin_item
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x1
	str	wzr, [x1]
Lloh0:
	adrp	x8, _mcset_bin_out_is_unicode@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mcset_bin_out_is_unicode@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.ne	LBB0_9
; %bb.1:
	ldr	x21, [x0]
	mov	x0, x21
	bl	_unichar_len
                                        ; kill: def $w0 killed $w0 def $x0
Lloh3:
	adrp	x8, _mcset_automatic_null_termination@GOTPAGE
Lloh4:
	ldr	x8, [x8, _mcset_automatic_null_termination@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, #0
	ccmp	w0, #0, #4, ne
	ccmp	w0, #1, #8, ne
	b.lt	LBB0_6
; %bb.2:
	mov	w0, w0
	sub	x8, x21, #4
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x8, x0, lsl #2]
	sub	w9, w9, #1
	cmp	w9, #30
	b.hi	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	str	wzr, [x8, x0, lsl #2]
	sub	x0, x0, #1
	add	x9, x0, #1
	cmp	x9, #1
	b.hi	LBB0_3
; %bb.5:
	mov	w0, #0
LBB0_6:
Lloh6:
	adrp	x8, _BIN_MESSAGETABLE_ITEM_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BIN_MESSAGETABLE_ITEM_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	add	w8, w8, w0, lsl #2
	add	w23, w8, #4
	add	w8, w8, #7
	and	w22, w8, #0xfffffffc
	mov	x0, x22
	bl	_res_alloc
	mov	x20, x0
	mov	w1, #0
	mov	x2, x22
	bl	_memset
	ldr	x0, [x20, #16]
	mov	x1, x22
	bl	_target_put_16
	ldr	x0, [x20, #8]
Lloh9:
	adrp	x8, _MESSAGE_RESOURCE_UNICODE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MESSAGE_RESOURCE_UNICODE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_target_put_16
	ldr	w1, [x21]
	cbz	w1, LBB0_17
; %bb.7:
	mov	x22, #0
	add	x21, x21, #4
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	add	x0, x22, x8
	bl	_target_put_16
	add	x22, x22, #2
	ldr	w1, [x21], #4
	cbnz	w1, LBB0_8
	b	LBB0_17
LBB0_9:
	ldp	x1, x8, [x0]
	ldr	w3, [x8]
	add	x0, sp, #12
	mov	x2, sp
	bl	_codepage_from_unicode
	ldr	x0, [sp]
	cbnz	x0, LBB0_11
; %bb.10:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_fatal
	ldr	x0, [sp]
LBB0_11:
	bl	_strlen
                                        ; kill: def $w0 killed $w0 def $x0
Lloh14:
	adrp	x8, _mcset_automatic_null_termination@GOTPAGE
Lloh15:
	ldr	x8, [x8, _mcset_automatic_null_termination@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cmp	x8, #0
	ccmp	w0, #1, #8, ne
	b.lt	LBB0_16
; %bb.12:
	mov	w0, w0
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [sp]
	add	x8, x8, x0
	ldurb	w9, [x8, #-1]
	sub	w9, w9, #1
	cmp	w9, #30
	b.hi	LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	sub	x0, x0, #1
	sturb	wzr, [x8, #-1]
	add	x8, x0, #1
	cmp	x8, #1
	b.hi	LBB0_13
; %bb.15:
	mov	w0, #0
LBB0_16:
Lloh17:
	adrp	x8, _BIN_MESSAGETABLE_ITEM_SIZE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BIN_MESSAGETABLE_ITEM_SIZE@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	add	w8, w8, w0
	add	w23, w8, #1
	add	w8, w8, #4
	and	w21, w8, #0xfffffffc
	mov	x0, x21
	bl	_res_alloc
	mov	x20, x0
	mov	w1, #0
	mov	x2, x21
	bl	_memset
	ldr	x0, [x20, #16]
	mov	x1, x21
	bl	_target_put_16
	ldr	x0, [x20, #8]
	mov	w1, #0
	bl	_target_put_16
	ldr	x0, [x20]
	ldr	x1, [sp]
	bl	_strcpy
LBB0_17:
	add	w8, w23, #3
	and	w8, w8, #0xfffffffc
	str	w8, [x19]
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_mcset_bin_out_is_unicode,4,2   ; @mcset_bin_out_is_unicode
	.comm	_mcset_automatic_null_termination,8,3 ; @mcset_automatic_null_termination
	.comm	_BIN_MESSAGETABLE_ITEM_SIZE,4,2 ; @BIN_MESSAGETABLE_ITEM_SIZE
	.comm	_MESSAGE_RESOURCE_UNICODE,4,2   ; @MESSAGE_RESOURCE_UNICODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to convert message to language codepage.\n"

	.no_dead_strip	_mc_generate_bin_item
.subsections_via_symbols
