	.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
	subq	$1048, %rsp                     ## imm = 0x418
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movl	%edi, %r14d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leal	-5(%r14), %eax
	cmpl	$-4, %eax
	ja	LBB0_2
## %bb.1:
	movq	(%rbx), %rdi
	callq	_print_help
LBB0_2:
	movq	8(%rbx), %rdi
	movq	_stdout@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	callq	_freopen
	movl	%eax, %r15d
	cmpl	$2, %r14d
	movq	%rbx, -1088(%rbp)               ## 8-byte Spill
	jle	LBB0_3
## %bb.4:
	movq	16(%rbx), %rdi
	callq	_atoi
	movl	%eax, %r12d
	testl	%eax, %eax
	jle	LBB0_5
## %bb.6:
	cmpl	$4, %r14d
	jb	LBB0_7
	jmp	LBB0_8
LBB0_3:
	movq	_DEFAULT_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_7:
	movq	_DEFAULT_HEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_10:
	leal	(%r12,%r12,2), %ebx
	movl	%ebx, %edi
	imull	%r13d, %edi
	callq	_malloc
	movq	_rgb_tab@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_wrap@GOTPCREL(%rip), %rcx
	movl	%ebx, (%rcx)
	movq	_width@GOTPCREL(%rip), %rcx
	movl	%r12d, (%rcx)
	movq	_height@GOTPCREL(%rip), %rcx
	movl	%r13d, (%rcx)
	movq	_DEFAULT_NB_PICT@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	jle	LBB0_17
## %bb.11:
	xorl	%ebx, %ebx
	movl	%r13d, -1076(%rbp)              ## 4-byte Spill
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	_rgb_tab@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%edi, %edi
LBB0_15:                                ##   in Loop: Header=BB0_12 Depth=1
	movl	%r12d, %esi
	movl	%r13d, %edx
	callq	_pgmyuv_save
	incl	%ebx
	cmpl	(%r14), %ebx
	jge	LBB0_16
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	movl	%r12d, %esi
	movl	%r13d, %edx
	callq	_gen_image
	testl	%r15d, %r15d
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	-1088(%rbp), %rax               ## 8-byte Reload
	movq	8(%rax), %rcx
	movq	%r12, %r13
	movq	%r14, %r12
	movl	%r15d, %r14d
	leaq	-1072(%rbp), %r15
	movq	%r15, %rdi
	movl	$1024, %esi                     ## imm = 0x400
	leaq	L_.str.1(%rip), %rdx
	movl	%ebx, %r8d
	callq	_snprintf
	movq	_rgb_tab@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	movl	%r14d, %r15d
	movq	%r12, %r14
	movq	%r13, %r12
	movl	-1076(%rbp), %r13d              ## 4-byte Reload
	jmp	LBB0_15
LBB0_16:
	movq	_rgb_tab@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_17:
	movl	%eax, %edi
	callq	_free
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_19
## %bb.18:
	xorl	%eax, %eax
	addq	$1048, %rsp                     ## imm = 0x418
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	(%rbx), %rdi
	callq	_print_help
	cmpl	$4, %r14d
	jb	LBB0_7
LBB0_8:
	movq	24(%rbx), %rdi
	callq	_atoi
	movl	%eax, %r13d
	testl	%eax, %eax
	jg	LBB0_10
## %bb.9:
	movq	(%rbx), %rdi
	callq	_print_help
	jmp	LBB0_10
LBB0_19:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wb"

	.comm	_stdout,4,2                     ## @stdout
	.comm	_DEFAULT_WIDTH,4,2              ## @DEFAULT_WIDTH
	.comm	_DEFAULT_HEIGHT,4,2             ## @DEFAULT_HEIGHT
	.comm	_rgb_tab,4,2                    ## @rgb_tab
	.comm	_wrap,4,2                       ## @wrap
	.comm	_width,4,2                      ## @width
	.comm	_height,4,2                     ## @height
	.comm	_DEFAULT_NB_PICT,4,2            ## @DEFAULT_NB_PICT
L_.str.1:                               ## @.str.1
	.asciz	"%s%02d.pgm"

.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:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #1040
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	sub	w8, w0, #5
	cmn	w8, #4
	b.hi	LBB0_2
; %bb.1:
	ldr	x0, [x19]
	bl	_print_help
LBB0_2:
	ldr	x0, [x19, #8]
Lloh3:
	adrp	x8, _stdout@GOTPAGE
Lloh4:
	ldr	x8, [x8, _stdout@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_freopen
	mov	x20, x0
	cmp	w22, #2
	b.le	LBB0_5
; %bb.3:
	ldr	x0, [x19, #16]
	bl	_atoi
	mov	x21, x0
	cmp	w0, #0
	b.le	LBB0_16
; %bb.4:
	cmp	w22, #4
	b.lo	LBB0_6
	b	LBB0_17
LBB0_5:
Lloh8:
	adrp	x8, _DEFAULT_WIDTH@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DEFAULT_WIDTH@GOTPAGEOFF]
Lloh10:
	ldr	w21, [x8]
LBB0_6:
Lloh11:
	adrp	x8, _DEFAULT_HEIGHT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DEFAULT_HEIGHT@GOTPAGEOFF]
Lloh13:
	ldr	w22, [x8]
LBB0_7:
	add	w23, w21, w21, lsl #1
	mul	w0, w23, w22
	bl	_malloc
Lloh14:
	adrp	x25, _rgb_tab@GOTPAGE
Lloh15:
	ldr	x25, [x25, _rgb_tab@GOTPAGEOFF]
Lloh16:
	adrp	x8, _wrap@GOTPAGE
Lloh17:
	ldr	x8, [x8, _wrap@GOTPAGEOFF]
	str	w0, [x25]
Lloh18:
	str	w23, [x8]
Lloh19:
	adrp	x8, _width@GOTPAGE
Lloh20:
	ldr	x8, [x8, _width@GOTPAGEOFF]
Lloh21:
	adrp	x9, _height@GOTPAGE
Lloh22:
	ldr	x9, [x9, _height@GOTPAGEOFF]
Lloh23:
	str	w21, [x8]
Lloh24:
	str	w22, [x9]
Lloh25:
	adrp	x26, _DEFAULT_NB_PICT@GOTPAGE
Lloh26:
	ldr	x26, [x26, _DEFAULT_NB_PICT@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.8:
	mov	w23, #0
Lloh27:
	adrp	x24, l_.str.1@PAGE
Lloh28:
	add	x24, x24, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	ldr	w3, [x25]
	mov	x0, #0
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	mov	x1, x21
	mov	x2, x22
	bl	_pgmyuv_save
	add	w23, w23, #1
	ldr	w8, [x26]
	cmp	w23, w8
	b.ge	LBB0_13
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	mov	x1, x21
	mov	x2, x22
	bl	_gen_image
	cbnz	w20, LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x3, [x19, #8]
	add	x0, sp, #8
	mov	w1, #1024
	mov	x2, x24
	mov	x4, x23
	bl	_snprintf
	ldr	w3, [x25]
	add	x0, sp, #8
	b	LBB0_10
LBB0_13:
	ldr	w0, [x25]
LBB0_14:
	bl	_free
	ldur	x8, [x29, #-88]
Lloh29:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh30:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.15:
	mov	w0, #0
	add	sp, sp, #1040
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_16:
	ldr	x0, [x19]
	bl	_print_help
	cmp	w22, #4
	b.lo	LBB0_6
LBB0_17:
	ldr	x0, [x19, #24]
	bl	_atoi
	mov	x22, x0
	cmp	w0, #0
	b.gt	LBB0_7
; %bb.18:
	ldr	x0, [x19]
	bl	_print_help
	b	LBB0_7
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh24
	.loh AdrpLdrGotStr	Lloh19, Lloh20, Lloh23
	.loh AdrpLdrGotStr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wb"

	.comm	_stdout,4,2                     ; @stdout
	.comm	_DEFAULT_WIDTH,4,2              ; @DEFAULT_WIDTH
	.comm	_DEFAULT_HEIGHT,4,2             ; @DEFAULT_HEIGHT
	.comm	_rgb_tab,4,2                    ; @rgb_tab
	.comm	_wrap,4,2                       ; @wrap
	.comm	_width,4,2                      ; @width
	.comm	_height,4,2                     ; @height
	.comm	_DEFAULT_NB_PICT,4,2            ; @DEFAULT_NB_PICT
l_.str.1:                               ; @.str.1
	.asciz	"%s%02d.pgm"

.subsections_via_symbols
