	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_IMG_TAPE_Create                ## -- Begin function IMG_TAPE_Create
	.p2align	4, 0x90
_IMG_TAPE_Create:                       ## @IMG_TAPE_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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	leaq	L_.str(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	movq	%rax, %r12
	movq	%r14, %rdi
	callq	_strlen
	movl	%eax, %r15d
	movslq	%eax, %rbx
	leaq	-56(%rbp), %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movb	%r15b, -56(%rbp)
	shrq	$8, %rbx
	movq	%rbx, -40(%rbp)
	leaq	L_.str.1(%rip), %rdi
	movl	$1, %esi
	movl	$4, %edx
	movq	%r12, %rcx
	callq	_fwrite
	cmpl	$4, %eax
	jne	LBB0_9
## %bb.2:
	leaq	-56(%rbp), %rdi
	movl	$1, %esi
	movl	$4, %edx
	movq	%r12, %rcx
	callq	_fwrite
	cmpl	$4, %eax
	jne	LBB0_9
## %bb.3:
	movq	%r14, %rdi
	movl	$1, %esi
	movl	%r15d, %edx
	movq	%r12, %rcx
	callq	_fwrite
	cmpl	%r15d, %eax
	jne	LBB0_9
## %bb.4:
	leaq	-56(%rbp), %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	_DEFAULT_BAUDRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movzbl	%al, %ecx
	movl	%ecx, -52(%rbp)
	sarl	$8, %eax
	movl	%eax, -48(%rbp)
	leaq	L_.str.2(%rip), %rdi
	movl	$1, %esi
	movl	$4, %edx
	movq	%r12, %rcx
	callq	_fwrite
	cmpl	$4, %eax
	jne	LBB0_9
## %bb.5:
	leaq	-56(%rbp), %rdi
	movl	$1, %esi
	movl	$4, %edx
	movq	%r12, %rcx
	callq	_fwrite
	cmpl	$4, %eax
	jne	LBB0_9
## %bb.6:
	movl	$104, %edi
	callq	_Util_malloc
	movq	%rax, %r15
	movq	%r12, 96(%rax)
	testq	%r14, %r14
	je	LBB0_8
## %bb.7:
	movl	88(%r15), %edi
	movq	_CASSETTE_DESCRIPTION_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rsi
	callq	_Util_strlcpy
LBB0_8:
	movq	_TRUE@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	%rax, 80(%r15)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%r15)
	movups	%xmm0, 48(%r15)
	movups	%xmm0, 64(%r15)
	movq	%r14, %rdi
	callq	_strlen
	addl	$16, %eax
	movq	(%r15), %rcx
	movl	%eax, (%rcx)
	movq	_DEFAULT_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, 8(%r15)
	shll	$3, %edi
	callq	_Util_malloc
	movq	%rax, 24(%r15)
	movq	(%rbx), %rax
	movq	%rax, 16(%r15)
	jmp	LBB0_11
LBB0_9:
	movq	%r12, %rdi
	callq	_fclose
LBB0_10:
	xorl	%r15d, %r15d
LBB0_11:
	movq	%r15, %rax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wb+"

L_.str.1:                               ## @.str.1
	.asciz	"FUJI"

	.comm	_DEFAULT_BAUDRATE,4,2           ## @DEFAULT_BAUDRATE
L_.str.2:                               ## @.str.2
	.asciz	"baud"

	.comm	_CASSETTE_DESCRIPTION_MAX,4,2   ## @CASSETTE_DESCRIPTION_MAX
	.comm	_TRUE,8,3                       ## @TRUE
	.comm	_DEFAULT_BUFFER_SIZE,4,2        ## @DEFAULT_BUFFER_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_IMG_TAPE_Create                ; -- Begin function IMG_TAPE_Create
	.p2align	2
_IMG_TAPE_Create:                       ; @IMG_TAPE_Create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x1
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_10
; %bb.1:
	mov	x20, x0
	mov	x0, x19
	bl	_strlen
	mov	x21, x0
	sxtw	x22, w21
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	strb	w21, [sp, #8]
	lsr	x8, x22, #8
	str	x8, [sp, #24]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	w1, #1
	mov	w2, #4
	mov	x3, x20
	bl	_fwrite
	cmp	w0, #4
	b.ne	LBB0_9
; %bb.2:
	add	x0, sp, #8
	mov	w1, #1
	mov	w2, #4
	mov	x3, x20
	bl	_fwrite
	cmp	w0, #4
	b.ne	LBB0_9
; %bb.3:
	mov	x0, x19
	mov	w1, #1
	mov	x2, x21
	mov	x3, x20
	bl	_fwrite
	cmp	w0, w21
	b.ne	LBB0_9
; %bb.4:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #24
	bl	_memset
Lloh4:
	adrp	x8, _DEFAULT_BAUDRATE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _DEFAULT_BAUDRATE@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	and	w9, w8, #0xff
	asr	w8, w8, #8
	stp	w9, w8, [sp, #12]
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	w1, #1
	mov	w2, #4
	mov	x3, x20
	bl	_fwrite
	cmp	w0, #4
	b.ne	LBB0_9
; %bb.5:
	add	x0, sp, #8
	mov	w1, #1
	mov	w2, #4
	mov	x3, x20
	bl	_fwrite
	cmp	w0, #4
	b.ne	LBB0_9
; %bb.6:
	mov	w0, #104
	bl	_Util_malloc
	mov	x21, x0
	str	x20, [x0, #96]
	cbz	x19, LBB0_8
; %bb.7:
	ldr	w0, [x21, #88]
Lloh9:
	adrp	x8, _CASSETTE_DESCRIPTION_MAX@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CASSETTE_DESCRIPTION_MAX@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x1, x19
	bl	_Util_strlcpy
LBB0_8:
Lloh12:
	adrp	x20, _TRUE@GOTPAGE
Lloh13:
	ldr	x20, [x20, _TRUE@GOTPAGEOFF]
	ldr	x8, [x20]
	str	x8, [x21, #80]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x21, #32]
	str	q0, [x21, #64]
	mov	x0, x19
	bl	_strlen
	add	w8, w0, #16
	ldr	x9, [x21]
	str	w8, [x9]
Lloh14:
	adrp	x8, _DEFAULT_BUFFER_SIZE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DEFAULT_BUFFER_SIZE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [x21, #8]
	lsl	w0, w8, #3
	bl	_Util_malloc
	ldr	x8, [x20]
	stp	x8, x0, [x21, #16]
	b	LBB0_11
LBB0_9:
	mov	x0, x20
	bl	_fclose
LBB0_10:
	mov	x21, #0
LBB0_11:
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wb+"

l_.str.1:                               ; @.str.1
	.asciz	"FUJI"

	.comm	_DEFAULT_BAUDRATE,4,2           ; @DEFAULT_BAUDRATE
l_.str.2:                               ; @.str.2
	.asciz	"baud"

	.comm	_CASSETTE_DESCRIPTION_MAX,4,2   ; @CASSETTE_DESCRIPTION_MAX
	.comm	_TRUE,8,3                       ; @TRUE
	.comm	_DEFAULT_BUFFER_SIZE,4,2        ; @DEFAULT_BUFFER_SIZE
.subsections_via_symbols
