	.file	"extr_otrx.c_otrx_create.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"No TRX file passed\n"
.LC1:
	.string	"w+"
.LC2:
	.string	"Couldn't open %s\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC3:
	.string	"Reached TRX partitions limit, no place for %s\n"
	.section	.rodata.str1.1
.LC4:
	.string	"Failed to append file %s\n"
.LC5:
	.string	"Failed to append zeros\n"
	.section	.rodata.str1.8
	.align 8
.LC6:
	.string	"Current TRX length is 0x%zx, can't pad it with zeros to 0x%lx\n"
	.section	.rodata.str1.1
.LC7:
	.string	"f:A:a:b:"
	.text
	.p2align 4
	.type	otrx_create, @function
otrx_create:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pxor	xmm0, xmm0
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	movaps	XMMWORD PTR [rsp], xmm0
	cmp	edi, 2
	jle	.L35
	mov	r12d, edi
	mov	rdi, QWORD PTR 16[rsi]
	mov	r13, rsi
	lea	rsi, .LC1[rip]
	mov	QWORD PTR trx_path[rip], rdi
	call	fopen@PLT
	mov	rbp, rax
	test	rax, rax
	je	.L36
	mov	esi, 16
	mov	rdi, rax
	mov	ebx, 16
	xor	r15d, r15d
	mov	edx, DWORD PTR SEEK_SET[rip]
	lea	r14, .LC7[rip]
	call	fseek@PLT
	mov	DWORD PTR optind[rip], 3
	.p2align 4,,10
	.p2align 3
.L27:
	mov	rdx, r14
	mov	rsi, r13
	mov	edi, r12d
	call	getopt@PLT
	cmp	eax, -1
	je	.L37
	cmp	eax, 98
	je	.L6
	jg	.L7
	cmp	eax, 65
	je	.L8
	cmp	eax, 97
	jne	.L27
	mov	rdi, QWORD PTR optarg[rip]
	xor	edx, edx
	xor	esi, esi
	call	strtol@PLT
	mov	rsi, rbx
	mov	rdi, rbp
	mov	edx, eax
	call	otrx_create_align@PLT
	test	rax, rax
	js	.L29
.L22:
	add	rbx, rax
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L7:
	cmp	eax, 102
	jne	.L27
	cmp	QWORD PTR TRX_MAX_PARTS[rip], r15
	mov	rsi, QWORD PTR optarg[rip]
	jbe	.L38
	mov	rdi, rbp
	call	otrx_create_append_file@PLT
	test	rax, rax
	js	.L33
	mov	rdx, QWORD PTR [rsp]
	mov	QWORD PTR [rdx+r15*8], rbx
	add	rbx, rax
	add	r15, 1
.L18:
	mov	edx, 4
	mov	rsi, rbx
	mov	rdi, rbp
	call	otrx_create_align@PLT
	test	rax, rax
	jns	.L22
.L29:
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC5[rip]
	xor	eax, eax
	call	fprintf@PLT
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rdi, QWORD PTR optarg[rip]
	xor	esi, esi
	xor	edx, edx
	call	strtol@PLT
	movsx	rsi, eax
	sub	rsi, rbx
	js	.L39
	mov	rdi, rbp
	call	otrx_create_append_zeros@PLT
	test	rax, rax
	jns	.L22
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rsi, QWORD PTR optarg[rip]
	mov	rdi, rbp
	call	otrx_create_append_file@PLT
	test	rax, rax
	js	.L33
	add	rbx, rax
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L33:
	mov	rdx, QWORD PTR optarg[rip]
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC4[rip]
	xor	eax, eax
	call	fprintf@PLT
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L39:
	mov	rdi, QWORD PTR optarg[rip]
	xor	edx, edx
	xor	esi, esi
	call	strtol@PLT
	mov	edi, DWORD PTR stderr[rip]
	mov	rdx, rbx
	lea	rsi, .LC6[rip]
	mov	ecx, eax
	xor	eax, eax
	call	fprintf@PLT
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L37:
	mov	edx, 4096
	mov	rsi, rbx
	mov	rdi, rbp
	call	otrx_create_align@PLT
	test	rax, rax
	js	.L40
	add	rbx, rax
.L25:
	mov	rsi, rsp
	mov	rdi, rbp
	mov	QWORD PTR 8[rsp], rbx
	xor	r12d, r12d
	call	otrx_create_write_hdr@PLT
.L12:
	mov	rdi, rbp
	call	fclose@PLT
.L3:
	endbr64
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L41
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L35:
	.cfi_restore_state
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	call	fprintf@PLT
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L38:
	mov	r12d, DWORD PTR ENOSPC[rip]
	mov	edi, DWORD PTR stderr[rip]
	mov	rdx, rsi
	xor	eax, eax
	lea	rsi, .LC3[rip]
	neg	r12d
	call	fprintf@PLT
	jmp	.L12
.L36:
	mov	rdx, QWORD PTR trx_path[rip]
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC2[rip]
	xor	eax, eax
	call	fprintf@PLT
	mov	r12d, DWORD PTR EACCES[rip]
	neg	r12d
	jmp	.L1
.L40:
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC5[rip]
	xor	eax, eax
	call	fprintf@PLT
	jmp	.L25
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	otrx_create, .-otrx_create
	.comm	trx_path,8,8
	.comm	stderr,4,4
	.comm	optind,4,4
	.comm	optarg,8,8
	.comm	TRX_MAX_PARTS,8,8
	.comm	SEEK_SET,4,4
	.comm	ENOSPC,4,4
	.comm	EINVAL,4,4
	.comm	EACCES,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_otrx.c_otrx_create.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"No TRX file passed\012\000"
	.align	2
.LC1:
	.ascii	"w+\000"
	.align	2
.LC2:
	.ascii	"Couldn't open %s\012\000"
	.align	2
.LC3:
	.ascii	"Reached TRX partitions limit, no place for %s\012\000"
	.align	2
.LC4:
	.ascii	"Failed to append file %s\012\000"
	.align	2
.LC5:
	.ascii	"Failed to append zeros\012\000"
	.align	2
.LC6:
	.ascii	"Current TRX length is 0x%zx, can't pad it with zero"
	.ascii	"s to 0x%lx\012\000"
	.align	2
.LC7:
	.ascii	"f:A:a:b:\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	otrx_create, %function
otrx_create:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r10, #0
	ldr	r3, .L42
	sub	sp, sp, #28
	cmp	r0, #2
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	str	r10, [sp, #12]
	str	r10, [sp, #16]
	ble	.L35
	mov	r6, r0
	ldr	r4, .L42+4
	ldr	r0, [r1, #8]
	mov	r7, r1
	ldr	r1, .L42+8
	str	r0, [r4]
	bl	fopen
	subs	r5, r0, #0
	beq	.L36
	ldr	r3, .L42+12
	mov	r1, #8
	ldr	r2, [r3]
	bl	fseek
	mov	r2, #3
	mov	r4, #8
	ldr	r3, .L42+16
	ldr	r8, .L42+20
	ldr	r9, .L42+24
	ldr	fp, .L42+28
	str	r2, [r3]
.L27:
	mov	r2, r8
	mov	r1, r7
	mov	r0, r6
	bl	getopt
	cmn	r0, #1
	beq	.L37
	cmp	r0, #98
	beq	.L6
	bgt	.L7
	cmp	r0, #65
	beq	.L8
	cmp	r0, #97
	bne	.L27
	mov	r2, #0
	ldr	r0, [r9]
	mov	r1, r2
	bl	strtol
	mov	r2, r0
.L31:
	mov	r1, r4
	mov	r0, r5
	bl	otrx_create_align
	cmp	r0, #0
	blt	.L29
.L22:
	add	r4, r4, r0
	b	.L27
.L7:
	cmp	r0, #102
	bne	.L27
	ldr	r3, [fp]
	ldr	r1, [r9]
	cmp	r3, r10
	bls	.L38
	mov	r0, r5
	bl	otrx_create_append_file
	cmp	r0, #0
	blt	.L33
	ldr	r3, [sp, #12]
	str	r4, [r3, r10, lsl #2]
	add	r4, r4, r0
	add	r10, r10, #1
.L18:
	mov	r2, #4
	b	.L31
.L6:
	mov	r2, #0
	ldr	r0, [r9]
	mov	r1, r2
	bl	strtol
	subs	r1, r0, r4
	bmi	.L39
	mov	r0, r5
	bl	otrx_create_append_zeros
	cmp	r0, #0
	bge	.L22
.L29:
	ldr	r3, .L42+32
	ldr	r1, .L42+36
	ldr	r0, [r3]
	bl	fprintf
	b	.L27
.L8:
	mov	r0, r5
	ldr	r1, [r9]
	bl	otrx_create_append_file
	cmp	r0, #0
	addge	r4, r4, r0
	bge	.L18
.L33:
	ldr	r3, .L42+32
	ldr	r2, [r9]
	ldr	r1, .L42+40
	ldr	r0, [r3]
	bl	fprintf
	b	.L18
.L39:
	mov	r2, #0
	ldr	r3, .L42+32
	mov	r1, r2
	ldr	r3, [r3]
	ldr	r0, [r9]
	str	r3, [sp, #4]
	bl	strtol
	mov	r2, r4
	mov	r3, r0
	ldr	r1, .L42+44
	ldr	r0, [sp, #4]
	bl	fprintf
	b	.L27
.L37:
	mov	r1, r4
	mov	r2, #4096
	mov	r0, r5
	bl	otrx_create_align
	cmp	r0, #0
	addge	r4, r4, r0
	blt	.L40
.L25:
	mov	r0, r5
	add	r1, sp, #12
	str	r4, [sp, #16]
	mov	r4, #0
	bl	otrx_create_write_hdr
.L12:
	mov	r0, r5
	bl	fclose
.L3:
.L1:
	ldr	r3, .L42
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L41
	mov	r0, r4
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L35:
	ldr	r3, .L42+32
	ldr	r1, .L42+48
	ldr	r0, [r3]
	bl	fprintf
	ldr	r3, .L42+52
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L1
.L38:
	ldr	r2, .L42+56
	ldr	r3, .L42+32
	ldr	r4, [r2]
	ldr	r0, [r3]
	mov	r2, r1
	ldr	r1, .L42+60
	rsb	r4, r4, #0
	bl	fprintf
	b	.L12
.L36:
	ldr	r3, .L42+32
	ldr	r2, [r4]
	ldr	r0, [r3]
	ldr	r1, .L42+64
	bl	fprintf
	ldr	r3, .L42+68
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L1
.L40:
	ldr	r3, .L42+32
	ldr	r1, .L42+36
	ldr	r0, [r3]
	bl	fprintf
	b	.L25
.L41:
	bl	__stack_chk_fail
.L43:
	.align	2
.L42:
	.word	.LC8
	.word	trx_path
	.word	.LC1
	.word	SEEK_SET
	.word	optind
	.word	.LC7
	.word	optarg
	.word	TRX_MAX_PARTS
	.word	stderr
	.word	.LC5
	.word	.LC4
	.word	.LC6
	.word	.LC0
	.word	EINVAL
	.word	ENOSPC
	.word	.LC3
	.word	.LC2
	.word	EACCES
	.size	otrx_create, .-otrx_create
	.comm	trx_path,4,4
	.comm	stderr,4,4
	.comm	optind,4,4
	.comm	optarg,4,4
	.comm	TRX_MAX_PARTS,4,4
	.comm	SEEK_SET,4,4
	.comm	ENOSPC,4,4
	.comm	EINVAL,4,4
	.comm	EACCES,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
