	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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, %rbx
	cmpl	$1, %edi
	jg	LBB0_2
## %bb.1:
	movq	(%rbx), %rsi
	leaq	L_.str(%rip), %rdi
	callq	_printf
	movl	$-1, %r14d
	jmp	LBB0_5
LBB0_2:
	movq	8(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_fopen
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	8(%rbx), %rsi
	leaq	L_.str.2(%rip), %rdi
	callq	_printf
LBB0_4:
	movq	_SEEK_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r14d, %r14d
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_fseek
	movq	%r13, %rdi
	callq	_ftell
	movq	%rax, %r12
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_fseek
	movq	%r12, %rdi
	callq	_malloc
	movq	%rax, %r15
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	callq	_assert
	movq	%r15, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	_fread
	cltq
	xorl	%edi, %edi
	cmpq	%rax, %r12
	sete	%dil
	callq	_assert
	movq	%r13, %rdi
	callq	_fclose
	xorl	%eax, %eax
	callq	_bcm_host_init
	leaq	-48(%rbp), %rdi
	callq	_setupOpenMaxJpegDecoder
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_assert
	movq	-48(%rbp), %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	_decodeImage
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_assert
	movq	-48(%rbp), %rdi
	callq	_cleanup
	movq	%r15, %rdi
	callq	_free
LBB0_5:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Usage: %s <filename>\n"

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

L_.str.2:                               ## @.str.2
	.asciz	"File %s not found.\n"

	.comm	_SEEK_END,4,2                   ## @SEEK_END
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x1
	cmp	w0, #1
	b.gt	LBB0_2
; %bb.1:
	ldr	x1, [x20]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	mov	w0, #-1
	b	LBB0_5
LBB0_2:
	ldr	x0, [x20, #8]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fopen
	mov	x19, x0
	cbnz	x0, LBB0_4
; %bb.3:
	ldr	x1, [x20, #8]
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printf
LBB0_4:
Lloh6:
	adrp	x8, _SEEK_END@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SEEK_END@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, #0
	bl	_fseek
	mov	x0, x19
	bl	_ftell
	mov	x21, x0
Lloh9:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, #0
	bl	_fseek
	mov	x0, x21
	bl	_malloc
	mov	x20, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
	mov	x0, x20
	mov	w1, #1
	mov	x2, x21
	mov	x3, x19
	bl	_fread
	cmp	x21, w0, sxtw
	cset	w0, eq
	bl	_assert
	mov	x0, x19
	bl	_fclose
	bl	_bcm_host_init
	add	x0, sp, #8
	bl	_setupOpenMaxJpegDecoder
	cmp	w0, #0
	cset	w0, eq
	bl	_assert
	ldr	x0, [sp, #8]
	mov	x1, x20
	mov	x2, x21
	bl	_decodeImage
	cmp	w0, #0
	cset	w0, eq
	bl	_assert
	ldr	x0, [sp, #8]
	bl	_cleanup
	mov	x0, x20
	bl	_free
	mov	w0, #0
LBB0_5:
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Usage: %s <filename>\n"

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

l_.str.2:                               ; @.str.2
	.asciz	"File %s not found.\n"

	.comm	_SEEK_END,4,2                   ; @SEEK_END
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
.subsections_via_symbols
