	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function extract_firmware
_extract_firmware:                      ## @extract_firmware
	.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	%rbx
	subq	$408, %rsp                      ## imm = 0x198
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	leaq	-416(%rbp), %rdi
	movl	$384, %esi                      ## imm = 0x180
	callq	___bzero
	leaq	-424(%rbp), %rsi
	movq	%r14, %rdi
	callq	_stat
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movl	$1, %edi
	movq	%r14, %rcx
	xorl	%eax, %eax
	callq	_error
LBB0_2:
	leaq	-424(%rbp), %rsi
	movq	%r15, %rdi
	callq	_stat
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movl	$1, %edi
	movq	%r15, %rcx
	xorl	%eax, %eax
	callq	_error
LBB0_4:
	movq	_S_IFMT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-424(%rbp), %eax
	movq	_S_IFDIR@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_6
## %bb.5:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	movl	$1, %edi
	movq	%r15, %rcx
	xorl	%eax, %eax
	callq	_error
LBB0_6:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	_fopen
	movq	%rax, %r14
	leaq	-416(%rbp), %rdx
	movl	$4116, %esi                     ## imm = 0x1014
	movq	%rax, %rdi
	movl	$16, %ecx
	xorl	%r8d, %r8d
	callq	_read_partition_table
	testq	%rax, %rax
	je	LBB0_7
## %bb.15:
	leaq	L_.str.4(%rip), %rdx
	movl	$1, %edi
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_error
LBB0_7:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, -400(%rbp,%rbx)
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	cmpq	$0, -416(%rbp,%rbx)
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpq	$0, -408(%rbp,%rbx)
	je	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	leaq	(%rbx,%rbp), %rdx
	addq	$-416, %rdx                     ## imm = 0xFE60
	movl	$4116, %esi                     ## imm = 0x1014
	movq	%r14, %rdi
	movq	%r15, %rcx
	callq	_extract_firmware_partition
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	addq	$24, %rbx
	cmpq	$384, %rbx                      ## imm = 0x180
	jne	LBB0_8
## %bb.13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_14
## %bb.16:
	xorl	%eax, %eax
	addq	$408, %rsp                      ## imm = 0x198
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,4,2                      ## @errno
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can not read input firmware %s"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to stat output directory %s"

	.comm	_S_IFMT,4,2                     ## @S_IFMT
	.comm	_S_IFDIR,4,2                    ## @S_IFDIR
L_.str.2:                               ## @.str.2
	.asciz	"Given output directory is not a directory %s"

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

L_.str.4:                               ## @.str.4
	.asciz	"Error can not read the partition table (fwup-ptn)"

	.no_dead_strip	_extract_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function extract_firmware
_extract_firmware:                      ; @extract_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #480
	.cfi_def_cfa_offset 480
	stp	x28, x27, [sp, #416]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #432]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #448]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #464]            ; 16-byte Folded Spill
	add	x29, sp, #464
	.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 w27, -56
	.cfi_offset w28, -64
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	add	x8, sp, #16
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x8, #352]
	stp	q0, q0, [x8, #320]
	stp	q0, q0, [x8, #288]
	stp	q0, q0, [x8, #256]
	stp	q0, q0, [x8, #224]
	stp	q0, q0, [x8, #192]
	stp	q0, q0, [x8, #160]
	stp	q0, q0, [x8, #128]
	stp	q0, q0, [sp, #112]
	stp	q0, q0, [sp, #80]
	stp	q0, q0, [sp, #48]
	stp	q0, q0, [sp, #16]
	add	x1, sp, #8
	bl	_stat
Lloh3:
	adrp	x21, _errno@GOTPAGE
Lloh4:
	ldr	x21, [x21, _errno@GOTPAGEOFF]
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w1, [x21]
	str	x20, [sp]
Lloh5:
	adrp	x2, l_.str@PAGE
Lloh6:
	add	x2, x2, l_.str@PAGEOFF
	mov	w0, #1
	bl	_error
LBB0_2:
	add	x1, sp, #8
	mov	x0, x19
	bl	_stat
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w1, [x21]
	str	x19, [sp]
Lloh7:
	adrp	x2, l_.str.1@PAGE
Lloh8:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_error
LBB0_4:
	ldr	w8, [sp, #8]
Lloh9:
	adrp	x9, _S_IFMT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _S_IFMT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh12:
	adrp	x9, _S_IFDIR@GOTPAGE
Lloh13:
	ldr	x9, [x9, _S_IFDIR@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_6
; %bb.5:
	ldr	w1, [x21]
	str	x19, [sp]
Lloh15:
	adrp	x2, l_.str.2@PAGE
Lloh16:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_error
LBB0_6:
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_fopen
	mov	x20, x0
	add	x21, sp, #16
	add	x2, sp, #16
	mov	w1, #4116
	mov	w3, #16
	mov	w4, #0
	bl	_read_partition_table
	cbz	x0, LBB0_8
; %bb.7:
Lloh19:
	adrp	x2, l_.str.4@PAGE
Lloh20:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	w0, #1
	mov	w1, #0
	bl	_error
LBB0_8:
	mov	x22, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, x21, x22
	ldr	x8, [x2, #16]
	cbnz	x8, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x21, x22]
	cbnz	x8, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x8, x21, x22
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x20
	mov	w1, #4116
	mov	x3, x19
	bl	_extract_firmware_partition
LBB0_13:                                ;   in Loop: Header=BB0_9 Depth=1
	add	x22, x22, #24
	cmp	x22, #384
	b.ne	LBB0_9
; %bb.14:
	ldur	x8, [x29, #-56]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.15:
	mov	w0, #0
	ldp	x29, x30, [sp, #464]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #448]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #432]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #416]            ; 16-byte Folded Reload
	add	sp, sp, #480
	ret
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,4,2                      ; @errno
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can not read input firmware %s"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to stat output directory %s"

	.comm	_S_IFMT,4,2                     ; @S_IFMT
	.comm	_S_IFDIR,4,2                    ; @S_IFDIR
l_.str.2:                               ; @.str.2
	.asciz	"Given output directory is not a directory %s"

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

l_.str.4:                               ; @.str.4
	.asciz	"Error can not read the partition table (fwup-ptn)"

	.no_dead_strip	_extract_firmware
.subsections_via_symbols
