	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function otrx_extract
_otrx_extract:                          ## @otrx_extract
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$2, %edi
	jg	LBB0_2
## %bb.1:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_fprintf
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_21
LBB0_2:
	movq	16(%rsi), %rax
	movq	_trx_path@GOTPCREL(%rip), %rbx
	movq	%rax, (%rbx)
	movq	_optind@GOTPCREL(%rip), %rax
	movl	$3, (%rax)
	callq	_otrx_extract_parse_options
	movq	(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r15
	movq	_trx_offset@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_fseek
	leaq	-72(%rbp), %rdi
	movl	$1, %esi
	movl	$16, %edx
	movq	%r15, %rcx
	callq	_fread
	cmpq	$16, %rax
	jne	LBB0_5
## %bb.6:
	movl	-60(%rbp), %ebx
	movl	%ebx, %edi
	callq	_le32_to_cpu
	movq	_TRX_MAGIC@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_9
## %bb.7:
	movq	_TRX_MAX_PARTS@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	testl	%eax, %eax
	jle	LBB0_8
## %bb.10:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %r14
	movl	-64(%rbp), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	xorl	%r12d, %r12d
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_11 Depth=1
	callq	_le32_to_cpu
	movl	%eax, %ebx
	movl	(%r14,%r12,4), %edi
	callq	_le32_to_cpu
	subl	%eax, %ebx
	movslq	%ebx, %r13
	movq	_trx_offset@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	(%r14,%r12,4), %edi
	callq	_le32_to_cpu
	addl	%eax, %ebx
	movq	_partition@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r12,8), %rcx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	movq	%r13, %rdx
	callq	_otrx_extract_copy
	movq	_TRX_MAX_PARTS@GOTPCREL(%rip), %rbx
LBB0_18:                                ##   in Loop: Header=BB0_11 Depth=1
	movslq	(%rbx), %rax
	movq	%r15, %r12
	cmpq	%rax, %r15
	jge	LBB0_19
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	_partition@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx,%r12,8), %rdx
	testq	%rdx, %rdx
	je	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	leaq	1(%r12), %r15
	cmpl	$0, (%r14,%r12,4)
	je	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_11 Depth=1
	cltq
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	cmpq	%rax, %r15
	jge	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	4(%r14,%r12,4), %edi
	testl	%edi, %edi
	cmovel	-44(%rbp), %edi                 ## 4-byte Folded Reload
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%r12
	movq	%r12, %r15
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=1
	leaq	L_.str.5(%rip), %rdi
	movl	%r15d, %esi
	callq	_printf
	jmp	LBB0_18
LBB0_3:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%rbx), %rdx
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_fprintf
	movq	_EACCES@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_21
LBB0_5:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%rbx), %rdx
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_fprintf
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_20
LBB0_9:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%ebx, %edi
	callq	_le32_to_cpu
	leaq	L_.str.4(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%r14d, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fprintf
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_20
LBB0_19:
	xorl	%ebx, %ebx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_20
LBB0_8:
	xorl	%ebx, %ebx
LBB0_20:
	movq	%r15, %rdi
	callq	_fclose
LBB0_21:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No TRX file passed\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_trx_path,8,3                   ## @trx_path
	.comm	_optind,4,2                     ## @optind
L_.str.1:                               ## @.str.1
	.asciz	"r"

L_.str.2:                               ## @.str.2
	.asciz	"Couldn't open %s\n"

	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_trx_offset,4,2                 ## @trx_offset
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.3:                               ## @.str.3
	.asciz	"Couldn't read %s header\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_TRX_MAGIC,4,2                  ## @TRX_MAGIC
L_.str.4:                               ## @.str.4
	.asciz	"Invalid TRX magic: 0x%08x\n"

	.comm	_TRX_MAX_PARTS,4,2              ## @TRX_MAX_PARTS
	.comm	_partition,8,3                  ## @partition
L_.str.5:                               ## @.str.5
	.asciz	"TRX doesn't contain partition %d, can't extract %s\n"

	.no_dead_strip	_otrx_extract
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function otrx_extract
_otrx_extract:                          ; @otrx_extract
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	cmp	w0, #2
	b.gt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _stderr@GOTPAGE
Lloh1:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_16
LBB0_2:
Lloh7:
	adrp	x20, _trx_path@GOTPAGE
Lloh8:
	ldr	x20, [x20, _trx_path@GOTPAGEOFF]
	ldr	x8, [x1, #16]
	str	x8, [x20]
Lloh9:
	adrp	x8, _optind@GOTPAGE
Lloh10:
	ldr	x8, [x8, _optind@GOTPAGEOFF]
	mov	w9, #3
Lloh11:
	str	w9, [x8]
	bl	_otrx_extract_parse_options
	ldr	x0, [x20]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_15
; %bb.3:
	mov	x19, x0
Lloh14:
	adrp	x23, _trx_offset@GOTPAGE
Lloh15:
	ldr	x23, [x23, _trx_offset@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh16:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	bl	_fseek
	add	x0, sp, #16
	mov	w1, #1
	mov	w2, #16
	mov	x3, x19
	bl	_fread
	cmp	x0, #16
	b.ne	LBB0_17
; %bb.4:
	ldr	w20, [sp, #28]
	mov	x0, x20
	bl	_le32_to_cpu
Lloh19:
	adrp	x8, _TRX_MAGIC@GOTPAGE
Lloh20:
	ldr	x8, [x8, _TRX_MAGIC@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_18
; %bb.5:
Lloh22:
	adrp	x26, _TRX_MAX_PARTS@GOTPAGE
Lloh23:
	ldr	x26, [x26, _TRX_MAX_PARTS@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.6:
	mov	x28, #0
	ldr	x25, [sp, #16]
	ldr	w9, [sp, #24]
	str	w9, [sp, #12]                   ; 4-byte Folded Spill
Lloh24:
	adrp	x27, _partition@GOTPAGE
Lloh25:
	ldr	x27, [x27, _partition@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	bl	_le32_to_cpu
	mov	x22, x0
	lsl	x20, x28, #2
	ldr	w0, [x25, x20]
	bl	_le32_to_cpu
	sub	w8, w22, w0
	sxtw	x22, w8
	ldr	w24, [x23]
	ldr	w0, [x25, x20]
	bl	_le32_to_cpu
	add	w1, w0, w24
	ldr	x8, [x27]
	ldr	x3, [x8, x28, lsl #3]
	mov	x0, x19
	mov	x2, x22
	bl	_otrx_extract_copy
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldrsw	x8, [x26]
	mov	x28, x21
	cmp	x21, x8
	b.ge	LBB0_20
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x27]
	ldr	x2, [x9, x28, lsl #3]
	cbz	x2, LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w9, [x25, x28, lsl #2]
	add	x21, x28, #1
	cbz	w9, LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	x21, w8, sxtw
	ldr	w0, [sp, #12]                   ; 4-byte Folded Reload
	b.ge	LBB0_7
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [x25, x21, lsl #2]
	cmp	w8, #0
	ldr	w9, [sp, #12]                   ; 4-byte Folded Reload
	csel	w0, w9, w8, eq
	b	LBB0_7
LBB0_13:                                ;   in Loop: Header=BB0_9 Depth=1
	add	x21, x28, #1
	b	LBB0_8
LBB0_14:                                ;   in Loop: Header=BB0_9 Depth=1
Lloh26:
	adrp	x0, l_.str.5@PAGE
Lloh27:
	add	x0, x0, l_.str.5@PAGEOFF
	mov	x1, x21
	bl	_printf
	b	LBB0_8
LBB0_15:
Lloh28:
	adrp	x8, _stderr@GOTPAGE
Lloh29:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	ldr	x8, [x20]
	str	x8, [sp]
Lloh31:
	adrp	x1, l_.str.2@PAGE
Lloh32:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fprintf
Lloh33:
	adrp	x8, _EACCES@GOTPAGE
Lloh34:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
LBB0_16:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_22
LBB0_17:
Lloh35:
	adrp	x8, _stderr@GOTPAGE
Lloh36:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh37:
	ldr	w0, [x8]
	ldr	x8, [x20]
	str	x8, [sp]
Lloh38:
	adrp	x1, l_.str.3@PAGE
Lloh39:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_fprintf
Lloh40:
	adrp	x8, _EIO@GOTPAGE
Lloh41:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_19
LBB0_18:
Lloh42:
	adrp	x8, _stderr@GOTPAGE
Lloh43:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh44:
	ldr	w21, [x8]
	mov	x0, x20
	bl	_le32_to_cpu
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh45:
	adrp	x1, l_.str.4@PAGE
Lloh46:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	bl	_fprintf
Lloh47:
	adrp	x8, _EINVAL@GOTPAGE
Lloh48:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_19:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_21
LBB0_20:
	mov	w20, #0
LBB0_21:
	mov	x0, x19
	bl	_fclose
LBB0_22:
	mov	x0, x20
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotStr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No TRX file passed\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_trx_path,8,3                   ; @trx_path
	.comm	_optind,4,2                     ; @optind
l_.str.1:                               ; @.str.1
	.asciz	"r"

l_.str.2:                               ; @.str.2
	.asciz	"Couldn't open %s\n"

	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_trx_offset,4,2                 ; @trx_offset
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.3:                               ; @.str.3
	.asciz	"Couldn't read %s header\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_TRX_MAGIC,4,2                  ; @TRX_MAGIC
l_.str.4:                               ; @.str.4
	.asciz	"Invalid TRX magic: 0x%08x\n"

	.comm	_TRX_MAX_PARTS,4,2              ; @TRX_MAX_PARTS
	.comm	_partition,8,3                  ; @partition
l_.str.5:                               ; @.str.5
	.asciz	"TRX doesn't contain partition %d, can't extract %s\n"

	.no_dead_strip	_otrx_extract
.subsections_via_symbols
