	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function image_check
_image_check:                           ## @image_check
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	%edi, %r13d
	movq	_buflen@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	cmpl	$3, %ecx
	ja	LBB0_4
## %bb.1:
	movq	_buf@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ecx, %esi
	addq	(%r15), %rsi
	movl	$4, %edx
	subl	%ecx, %edx
	movl	%r13d, %edi
	callq	_read
	movl	(%rbx), %ecx
	testl	%eax, %eax
	jle	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	addl	%eax, %ecx
	movl	%ecx, (%rbx)
	cmpl	$4, %ecx
	jb	LBB0_2
	jmp	LBB0_4
LBB0_7:
	cmpl	$3, %ecx
	ja	LBB0_4
## %bb.8:
	movq	_stdout@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fprintf
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_4:
	movq	_buf@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movl	(%rax), %r15d
	movl	%r15d, %edi
	callq	_be32_to_cpu
	movq	_TRX_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.5:
	movq	_imageformat@GOTPCREL(%rip), %rax
	movl	$130, (%rax)
LBB0_6:
	movq	(%r12), %rdx
	movq	_buflen@GOTPCREL(%rip), %rcx
	movl	%r13d, %edi
	movq	%r14, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_trx_check                      ## TAILCALL
LBB0_9:
	movl	%r15d, %edi
	callq	_be32_to_cpu
	movq	_SEAMA_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.10:
	movq	_imageformat@GOTPCREL(%rip), %rax
	movl	$131, (%rax)
	movl	$1, %eax
	jmp	LBB0_16
LBB0_11:
	movl	%r15d, %edi
	callq	_le32_to_cpu
	movq	_WRG_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.12:
	movq	_imageformat@GOTPCREL(%rip), %rax
	movl	$129, (%rax)
	movl	$1, %eax
	jmp	LBB0_16
LBB0_13:
	movl	%r15d, %edi
	callq	_le32_to_cpu
	movq	_WRGG03_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.14:
	movq	_imageformat@GOTPCREL(%rip), %rax
	movl	$128, (%rax)
	movl	$1, %eax
	jmp	LBB0_16
LBB0_15:
	movq	_imageformat@GOTPCREL(%rip), %rcx
	movl	$1, %eax
	cmpl	$130, (%rcx)
	je	LBB0_6
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_buflen,4,2                     ## @buflen
	.comm	_buf,8,3                        ## @buf
	.comm	_stdout,4,2                     ## @stdout
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not get image magic\n"

	.comm	_TRX_MAGIC,8,3                  ## @TRX_MAGIC
	.comm	_imageformat,4,2                ## @imageformat
	.comm	_SEAMA_MAGIC,8,3                ## @SEAMA_MAGIC
	.comm	_WRG_MAGIC,8,3                  ## @WRG_MAGIC
	.comm	_WRGG03_MAGIC,8,3               ## @WRGG03_MAGIC
	.no_dead_strip	_image_check
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function image_check
_image_check:                           ; @image_check
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x21, _buflen@GOTPAGE
Lloh1:
	ldr	x21, [x21, _buflen@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh2:
	adrp	x22, _buf@GOTPAGE
Lloh3:
	ldr	x22, [x22, _buf@GOTPAGEOFF]
	cmp	w8, #3
	b.hi	LBB0_6
; %bb.1:
	mov	w23, #4
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x22]
	add	x1, x9, w8, uxtw
	sub	w2, w23, w8
	mov	x0, x20
	bl	_read
	ldr	w8, [x21]
	cmp	w0, #1
	b.lt	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w8, w8, w0
	str	w8, [x21]
	cmp	w8, #4
	b.lo	LBB0_2
	b	LBB0_6
LBB0_4:
	cmp	w8, #3
	b.hi	LBB0_6
; %bb.5:
Lloh4:
	adrp	x8, _stdout@GOTPAGE
Lloh5:
	ldr	x8, [x8, _stdout@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	mov	w0, #0
	b	LBB0_17
LBB0_6:
	ldr	x8, [x22]
	ldr	w21, [x8]
	mov	x0, x21
	bl	_be32_to_cpu
Lloh9:
	adrp	x8, _TRX_MAGIC@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TRX_MAGIC@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.7:
Lloh12:
	adrp	x8, _imageformat@GOTPAGE
Lloh13:
	ldr	x8, [x8, _imageformat@GOTPAGEOFF]
	mov	w9, #130
Lloh14:
	str	w9, [x8]
LBB0_8:
	ldr	x2, [x22]
Lloh15:
	adrp	x3, _buflen@GOTPAGE
Lloh16:
	ldr	x3, [x3, _buflen@GOTPAGEOFF]
	mov	x0, x20
	mov	x1, 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
	b	_trx_check
LBB0_9:
	mov	x0, x21
	bl	_be32_to_cpu
Lloh17:
	adrp	x8, _SEAMA_MAGIC@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SEAMA_MAGIC@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.10:
Lloh20:
	adrp	x8, _imageformat@GOTPAGE
Lloh21:
	ldr	x8, [x8, _imageformat@GOTPAGEOFF]
	mov	w9, #131
Lloh22:
	str	w9, [x8]
	b	LBB0_16
LBB0_11:
	mov	x0, x21
	bl	_le32_to_cpu
Lloh23:
	adrp	x8, _WRG_MAGIC@GOTPAGE
Lloh24:
	ldr	x8, [x8, _WRG_MAGIC@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_13
; %bb.12:
Lloh26:
	adrp	x8, _imageformat@GOTPAGE
Lloh27:
	ldr	x8, [x8, _imageformat@GOTPAGEOFF]
	mov	w9, #129
Lloh28:
	str	w9, [x8]
	b	LBB0_16
LBB0_13:
	mov	x0, x21
	bl	_le32_to_cpu
Lloh29:
	adrp	x8, _WRGG03_MAGIC@GOTPAGE
Lloh30:
	ldr	x8, [x8, _WRGG03_MAGIC@GOTPAGEOFF]
Lloh31:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_15
; %bb.14:
Lloh32:
	adrp	x8, _imageformat@GOTPAGE
Lloh33:
	ldr	x8, [x8, _imageformat@GOTPAGEOFF]
	mov	w9, #128
Lloh34:
	str	w9, [x8]
	b	LBB0_16
LBB0_15:
Lloh35:
	adrp	x8, _imageformat@GOTPAGE
Lloh36:
	ldr	x8, [x8, _imageformat@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	cmp	w8, #130
	b.eq	LBB0_8
LBB0_16:
	mov	w0, #1
LBB0_17:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotStr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotStr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotStr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotStr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_buflen,4,2                     ; @buflen
	.comm	_buf,8,3                        ; @buf
	.comm	_stdout,4,2                     ; @stdout
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not get image magic\n"

	.comm	_TRX_MAGIC,8,3                  ; @TRX_MAGIC
	.comm	_imageformat,4,2                ; @imageformat
	.comm	_SEAMA_MAGIC,8,3                ; @SEAMA_MAGIC
	.comm	_WRG_MAGIC,8,3                  ; @WRG_MAGIC
	.comm	_WRGG03_MAGIC,8,3               ; @WRGG03_MAGIC
	.no_dead_strip	_image_check
.subsections_via_symbols
