	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fifolog_int_open_i
_fifolog_int_open_i:                    ## @fifolog_int_open_i
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rax
	movq	%rdi, %rbx
	testl	%edx, %edx
	jne	LBB0_1
## %bb.2:
	movq	_O_RDONLY@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_1:
	movq	_O_RDWR@GOTPCREL(%rip), %rcx
LBB0_3:
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_open
	movq	%rax, (%rbx)
	testq	%rax, %rax
	js	LBB0_4
## %bb.5:
	movq	_DIOCGSECTORSIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	8(%rbx), %r14
	movq	%rax, %rdi
	movq	%r14, %rdx
	callq	_ioctl
	testl	%eax, %eax
	je	LBB0_10
## %bb.6:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ENOTTY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.8:
	movq	(%rbx), %rdi
	leaq	-32(%rbp), %rsi
	callq	_fstat
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_assert
	movl	-28(%rbp), %edi
	callq	_S_ISREG
	testl	%eax, %eax
	je	LBB0_9
## %bb.15:
	movl	$512, 8(%rbx)                   ## imm = 0x200
	movl	-32(%rbp), %eax
	movl	%eax, 12(%rbx)
	jmp	LBB0_16
LBB0_4:
	leaq	L_.str(%rip), %rax
	jmp	LBB0_29
LBB0_10:
	cmpl	$64, (%r14)
	jge	LBB0_12
## %bb.11:
	leaq	L_.str.3(%rip), %rax
	jmp	LBB0_29
LBB0_7:
	leaq	L_.str.1(%rip), %rax
	jmp	LBB0_29
LBB0_12:
	movq	(%rbx), %rdi
	movq	_DIOCGMEDIASIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	12(%rbx), %rdx
	callq	_ioctl
	testl	%eax, %eax
	jns	LBB0_16
## %bb.13:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ENOTTY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_14
LBB0_16:
	movl	8(%rbx), %edi
	callq	_malloc
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	je	LBB0_17
## %bb.18:
	movq	(%rbx), %rdi
	movl	8(%rbx), %edx
	movq	%rax, %rsi
	xorl	%ecx, %ecx
	callq	_pread
	movl	%eax, %ecx
	leaq	L_.str.6(%rip), %rax
	testl	%ecx, %ecx
	js	LBB0_29
## %bb.19:
	cmpl	(%r14), %ecx
	jl	LBB0_29
## %bb.20:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	24(%rbx), %r14
	movq	_FIFOLOG_FMT_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	%r15d, %edi
	callq	_strlen
	leaq	1(%rax), %rdx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_22
## %bb.21:
	leaq	L_.str.7(%rip), %rax
	jmp	LBB0_29
LBB0_17:
	leaq	L_.str.5(%rip), %rax
	jmp	LBB0_29
LBB0_9:
	leaq	L_.str.2(%rip), %rax
	jmp	LBB0_29
LBB0_14:
	leaq	L_.str.4(%rip), %rax
	jmp	LBB0_29
LBB0_22:
	movq	_FIFOLOG_OFF_BS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rdi
	shlq	$2, %rdi
	addq	24(%rbx), %rdi
	callq	_be32dec
	cmpl	$64, %eax
	jge	LBB0_24
## %bb.23:
	leaq	L_.str.8(%rip), %rax
	jmp	LBB0_29
LBB0_24:
	movl	%eax, %ecx
	movl	12(%rbx), %eax
	cmpl	%eax, %ecx
	jge	LBB0_25
## %bb.26:
	movl	%ecx, 8(%rbx)
	cltd
	idivl	%ecx
	movl	%eax, 12(%rbx)
	cmpl	$10, %eax
	jge	LBB0_28
## %bb.27:
	leaq	L_.str.10(%rip), %rax
	jmp	LBB0_29
LBB0_25:
	leaq	L_.str.9(%rip), %rax
	jmp	LBB0_29
LBB0_28:
	decl	%eax
	movl	%eax, 12(%rbx)
	movl	$1, %edi
	movl	$4, %esi
	callq	_calloc
	movq	%rax, %rcx
	movq	%rax, 16(%rbx)
	xorl	%eax, %eax
	testq	%rcx, %rcx
	leaq	L_.str.11(%rip), %rcx
	cmoveq	%rcx, %rax
LBB0_29:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot open"

	.comm	_DIOCGSECTORSIZE,4,2            ## @DIOCGSECTORSIZE
	.comm	_errno,8,3                      ## @errno
	.comm	_ENOTTY,8,3                     ## @ENOTTY
L_.str.1:                               ## @.str.1
	.asciz	"ioctl(DIOCGSECTORSIZE) failed"

L_.str.2:                               ## @.str.2
	.asciz	"Neither disk nor regular file"

L_.str.3:                               ## @.str.3
	.asciz	"Disk device sectorsize smaller than 64"

	.comm	_DIOCGMEDIASIZE,4,2             ## @DIOCGMEDIASIZE
L_.str.4:                               ## @.str.4
	.asciz	"ioctl(DIOCGMEDIASIZE) failed"

L_.str.5:                               ## @.str.5
	.asciz	"Cannot malloc"

L_.str.6:                               ## @.str.6
	.asciz	"Read error, first sector"

	.comm	_FIFOLOG_FMT_MAGIC,4,2          ## @FIFOLOG_FMT_MAGIC
L_.str.7:                               ## @.str.7
	.asciz	"Wrong or missing magic string"

	.comm	_FIFOLOG_OFF_BS,4,2             ## @FIFOLOG_OFF_BS
L_.str.8:                               ## @.str.8
	.asciz	"Wrong record size in header (<64)"

L_.str.9:                               ## @.str.9
	.asciz	"Record size in header bigger than fifolog"

L_.str.10:                              ## @.str.10
	.asciz	"less than 10 records in fifolog"

L_.str.11:                              ## @.str.11
	.asciz	"cannot malloc"

	.no_dead_strip	_fifolog_int_open_i
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fifolog_int_open_i
_fifolog_int_open_i:                    ; @fifolog_int_open_i
	.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	x8, x1
	mov	x19, x0
Lloh0:
	adrp	x9, _O_RDWR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _O_RDWR@GOTPAGEOFF]
Lloh2:
	adrp	x10, _O_RDONLY@GOTPAGE
Lloh3:
	ldr	x10, [x10, _O_RDONLY@GOTPAGEOFF]
	cmp	w2, #0
	csel	x9, x10, x9, eq
	ldr	w1, [x9]
	mov	x0, x8
	bl	_open
	str	x0, [x19]
	tbnz	x0, #63, LBB0_5
; %bb.1:
Lloh4:
	adrp	x8, _DIOCGSECTORSIZE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _DIOCGSECTORSIZE@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	add	x20, x19, #8
	mov	x2, x20
	bl	_ioctl
	cbz	w0, LBB0_6
; %bb.2:
Lloh7:
	adrp	x8, _errno@GOTPAGE
Lloh8:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
Lloh10:
	adrp	x9, _ENOTTY@GOTPAGE
Lloh11:
	ldr	x9, [x9, _ENOTTY@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.3:
	ldr	x0, [x19]
	add	x1, sp, #8
	bl	_fstat
	cmp	w0, #0
	cset	w0, eq
	bl	_assert
	ldr	w0, [sp, #12]
	bl	_S_ISREG
	cbz	w0, LBB0_16
; %bb.4:
	mov	w8, #512
	ldr	w9, [sp, #8]
	stp	w8, w9, [x19, #8]
	b	LBB0_11
LBB0_5:
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_27
LBB0_6:
	ldr	w8, [x20]
	cmp	w8, #64
	b.ge	LBB0_9
; %bb.7:
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_27
LBB0_8:
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_27
LBB0_9:
	mov	x2, x19
	ldr	x0, [x2], #12
Lloh19:
	adrp	x8, _DIOCGMEDIASIZE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DIOCGMEDIASIZE@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	bl	_ioctl
	tbz	w0, #31, LBB0_11
; %bb.10:
Lloh22:
	adrp	x8, _errno@GOTPAGE
Lloh23:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
Lloh25:
	adrp	x9, _ENOTTY@GOTPAGE
Lloh26:
	ldr	x9, [x9, _ENOTTY@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_19
LBB0_11:
	ldr	w0, [x19, #8]
	bl	_malloc
	str	x0, [x19, #24]
	cbz	x0, LBB0_15
; %bb.12:
	mov	x1, x0
	ldr	x0, [x19]
	ldr	w2, [x19, #8]
	mov	w3, #0
	bl	_pread
	tbnz	w0, #31, LBB0_14
; %bb.13:
	ldr	w8, [x20]
	cmp	w0, w8
	b.ge	LBB0_17
LBB0_14:
Lloh28:
	adrp	x0, l_.str.6@PAGE
Lloh29:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_27
LBB0_15:
Lloh30:
	adrp	x0, l_.str.5@PAGE
Lloh31:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_27
LBB0_16:
Lloh32:
	adrp	x0, l_.str.2@PAGE
Lloh33:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_27
LBB0_17:
Lloh34:
	adrp	x8, _errno@GOTPAGE
Lloh35:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh36:
	str	xzr, [x8]
	ldr	x20, [x19, #24]
Lloh37:
	adrp	x8, _FIFOLOG_FMT_MAGIC@GOTPAGE
Lloh38:
	ldr	x8, [x8, _FIFOLOG_FMT_MAGIC@GOTPAGEOFF]
Lloh39:
	ldr	w21, [x8]
	mov	x0, x21
	bl	_strlen
	add	x2, x0, #1
	mov	x0, x20
	mov	x1, x21
	bl	_memcmp
	cbz	x0, LBB0_20
; %bb.18:
Lloh40:
	adrp	x0, l_.str.7@PAGE
Lloh41:
	add	x0, x0, l_.str.7@PAGEOFF
	b	LBB0_27
LBB0_19:
Lloh42:
	adrp	x0, l_.str.4@PAGE
Lloh43:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_27
LBB0_20:
	ldr	x8, [x19, #24]
Lloh44:
	adrp	x9, _FIFOLOG_OFF_BS@GOTPAGE
Lloh45:
	ldr	x9, [x9, _FIFOLOG_OFF_BS@GOTPAGEOFF]
Lloh46:
	ldrsw	x9, [x9]
	add	x0, x8, x9, lsl #2
	bl	_be32dec
	cmp	w0, #64
	b.ge	LBB0_22
; %bb.21:
Lloh47:
	adrp	x0, l_.str.8@PAGE
Lloh48:
	add	x0, x0, l_.str.8@PAGEOFF
	b	LBB0_27
LBB0_22:
	ldr	w8, [x19, #12]
	cmp	w0, w8
	b.ge	LBB0_25
; %bb.23:
	sdiv	w8, w8, w0
	stp	w0, w8, [x19, #8]
	cmp	w8, #10
	b.ge	LBB0_26
; %bb.24:
Lloh49:
	adrp	x0, l_.str.10@PAGE
Lloh50:
	add	x0, x0, l_.str.10@PAGEOFF
	b	LBB0_27
LBB0_25:
Lloh51:
	adrp	x0, l_.str.9@PAGE
Lloh52:
	add	x0, x0, l_.str.9@PAGEOFF
	b	LBB0_27
LBB0_26:
	sub	w8, w8, #1
	str	w8, [x19, #12]
	mov	w0, #1
	mov	w1, #4
	bl	_calloc
	str	x0, [x19, #16]
Lloh53:
	adrp	x8, l_.str.11@PAGE
Lloh54:
	add	x8, x8, l_.str.11@PAGEOFF
	cmp	x0, #0
	csel	x0, x8, xzr, eq
LBB0_27:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotStr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpAdd	Lloh49, Lloh50
	.loh AdrpAdd	Lloh51, Lloh52
	.loh AdrpAdd	Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot open"

	.comm	_DIOCGSECTORSIZE,4,2            ; @DIOCGSECTORSIZE
	.comm	_errno,8,3                      ; @errno
	.comm	_ENOTTY,8,3                     ; @ENOTTY
l_.str.1:                               ; @.str.1
	.asciz	"ioctl(DIOCGSECTORSIZE) failed"

l_.str.2:                               ; @.str.2
	.asciz	"Neither disk nor regular file"

l_.str.3:                               ; @.str.3
	.asciz	"Disk device sectorsize smaller than 64"

	.comm	_DIOCGMEDIASIZE,4,2             ; @DIOCGMEDIASIZE
l_.str.4:                               ; @.str.4
	.asciz	"ioctl(DIOCGMEDIASIZE) failed"

l_.str.5:                               ; @.str.5
	.asciz	"Cannot malloc"

l_.str.6:                               ; @.str.6
	.asciz	"Read error, first sector"

	.comm	_FIFOLOG_FMT_MAGIC,4,2          ; @FIFOLOG_FMT_MAGIC
l_.str.7:                               ; @.str.7
	.asciz	"Wrong or missing magic string"

	.comm	_FIFOLOG_OFF_BS,4,2             ; @FIFOLOG_OFF_BS
l_.str.8:                               ; @.str.8
	.asciz	"Wrong record size in header (<64)"

l_.str.9:                               ; @.str.9
	.asciz	"Record size in header bigger than fifolog"

l_.str.10:                              ; @.str.10
	.asciz	"less than 10 records in fifolog"

l_.str.11:                              ; @.str.11
	.asciz	"cannot malloc"

	.no_dead_strip	_fifolog_int_open_i
.subsections_via_symbols
