	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function firebird_fetch_blob
_firebird_fetch_blob:                   ## @firebird_fetch_blob
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movq	%rdx, -128(%rbp)                ## 8-byte Spill
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %r12
	movq	8(%r12), %r13
	movq	_PDO_FIREBIRD_HANDLE_INITIALIZER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -88(%rbp)
	movq	_isc_info_blob_total_length@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	%al, -81(%rbp)
	movq	$0, (%rcx)
	movq	(%r13), %rdi
	leaq	20(%r13), %rsi
	leaq	16(%r13), %rdx
	leaq	-88(%rbp), %rcx
	callq	_isc_open_blob
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	jmp	LBB0_28
LBB0_2:
	movq	%r12, -144(%rbp)                ## 8-byte Spill
	movl	%r15d, -108(%rbp)               ## 4-byte Spill
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	movq	%r13, -120(%rbp)                ## 8-byte Spill
	movq	(%r13), %rbx
	leaq	-81(%rbp), %rdi
	callq	_const_cast
	leaq	-88(%rbp), %rsi
	leaq	-80(%rbp), %r9
	movq	%rbx, %rdi
	movl	$1, %edx
	movl	%eax, %ecx
	movl	$20, %r8d
	callq	_isc_blob_info
	testq	%rax, %rax
	je	LBB0_3
## %bb.31:
	movq	%r14, %r12
	movq	%r14, %rdi
	callq	_RECORD_ERROR
	xorl	%r15d, %r15d
	movq	-120(%rbp), %r14                ## 8-byte Reload
	jmp	LBB0_26
LBB0_3:
	movq	%r14, -136(%rbp)                ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	-120(%rbp), %r14                ## 8-byte Reload
	movq	_isc_info_blob_total_length@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movzwl	%bx, %eax
	movzbl	-80(%rbp,%rax), %r12d
	movq	_isc_info_end@GOTPCREL(%rip), %rax
	cmpb	(%rax), %r12b
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_isc_info_truncated@GOTPCREL(%rip), %rax
	cmpb	(%rax), %r12b
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_isc_info_error@GOTPCREL(%rip), %rax
	cmpb	(%rax), %r12b
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpw	$19, %bx
	jae	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	leal	1(%rbx), %eax
	movzwl	%ax, %r15d
	leaq	(%r15,%rbp), %rdi
	addq	$-80, %rdi
	movl	$2, %esi
	callq	_isc_vax_integer
	cmpb	(%r13), %r12b
	je	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	addl	%eax, %ebx
	addl	$3, %ebx
	cmpw	$20, %bx
	jb	LBB0_4
## %bb.12:
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movq	(%rax), %rsi
	jmp	LBB0_13
LBB0_8:
	leaq	L_.str(%rip), %rax
	movq	%rax, 8(%r14)
	xorl	%r15d, %r15d
	movq	-136(%rbp), %r12                ## 8-byte Reload
	jmp	LBB0_26
LBB0_10:
	leaq	-80(%rbp), %rcx
	leaq	(%r15,%rcx), %rdi
	addq	$2, %rdi
	movzwl	%ax, %esi
	callq	_isc_vax_integer
	movq	%rax, %rsi
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movq	%rsi, (%rax)
LBB0_13:
	movl	-108(%rbp), %edx                ## 4-byte Reload
	movq	-144(%rbp), %rcx                ## 8-byte Reload
	movl	$1, %r15d
	testq	%rsi, %rsi
	movq	-136(%rbp), %r12                ## 8-byte Reload
	je	LBB0_26
## %bb.14:
	movq	%r12, %r14
	movq	(%rcx), %rax
	movslq	%edx, %rbx
	movq	(%rax,%rbx,8), %rdi
	incq	%rsi
	movq	%rcx, %r12
	callq	_erealloc
	movq	(%r12), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	-128(%rbp), %rcx                ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	jle	LBB0_15
## %bb.16:
	xorl	%ebx, %ebx
	movq	_USHRT_MAX@GOTPCREL(%rip), %r13
	movq	%r14, %r12
	movq	-120(%rbp), %r14                ## 8-byte Reload
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_18 Depth=1
	movzwl	-90(%rbp), %ecx
	addq	%rcx, %rbx
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	movq	(%rcx), %rcx
	cmpq	%rbx, %rcx
	jle	LBB0_21
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	subq	%rbx, %rcx
	movq	(%r13), %rax
	cmpq	%rax, %rcx
	cmovgeq	%rax, %rcx
	movq	(%r14), %rdi
	movq	-128(%rbp), %rax                ## 8-byte Reload
	movq	(%rax), %r8
	addq	%rbx, %r8
	movzwl	%cx, %ecx
	leaq	-88(%rbp), %rsi
	leaq	-90(%rbp), %rdx
	callq	_isc_get_segment
	testq	%rax, %rax
	setne	%dl
	je	LBB0_17
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	movq	_isc_segment@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_17
## %bb.20:
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	movq	(%rcx), %rcx
	jmp	LBB0_21
LBB0_15:
	xorl	%eax, %eax
	xorl	%edx, %edx
	movq	%r14, %r12
	movq	-120(%rbp), %r14                ## 8-byte Reload
LBB0_21:
	movq	-128(%rbp), %rsi                ## 8-byte Reload
	movq	(%rsi), %rsi
	movb	$0, (%rsi,%rcx)
	movq	(%r14), %rcx
	cmpl	$1, (%rcx)
	jne	LBB0_26
## %bb.22:
	testb	%dl, %dl
	je	LBB0_26
## %bb.23:
	movq	_isc_segstr_eof@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_26
## %bb.24:
	movq	_isc_segment@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_26
## %bb.25:
	leaq	L_.str.1(%rip), %rax
	movq	%rax, 8(%r14)
	xorl	%r15d, %r15d
LBB0_26:
	movq	(%r14), %rdi
	leaq	-88(%rbp), %rsi
	callq	_isc_close_blob
	testq	%rax, %rax
	je	LBB0_29
## %bb.27:
	movq	%r12, %rdi
LBB0_28:
	callq	_RECORD_ERROR
	xorl	%r15d, %r15d
LBB0_29:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_32
## %bb.30:
	movl	%r15d, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_32:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PDO_FIREBIRD_HANDLE_INITIALIZER,4,2 ## @PDO_FIREBIRD_HANDLE_INITIALIZER
	.comm	_isc_info_blob_total_length,1,0 ## @isc_info_blob_total_length
	.comm	_isc_info_end,1,0               ## @isc_info_end
	.comm	_isc_info_truncated,1,0         ## @isc_info_truncated
	.comm	_isc_info_error,1,0             ## @isc_info_error
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't determine BLOB size"

	.comm	_isc_segment,8,3                ## @isc_segment
	.comm	_USHRT_MAX,8,3                  ## @USHRT_MAX
	.comm	_isc_segstr_eof,8,3             ## @isc_segstr_eof
L_.str.1:                               ## @.str.1
	.asciz	"Error reading from BLOB"

	.no_dead_strip	_firebird_fetch_blob
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function firebird_fetch_blob
_firebird_fetch_blob:                   ; @firebird_fetch_blob
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	mov	x21, x3
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	ldr	x25, [x0]
Lloh3:
	adrp	x8, _PDO_FIREBIRD_HANDLE_INITIALIZER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PDO_FIREBIRD_HANDLE_INITIALIZER@GOTPAGEOFF]
	ldr	x24, [x25, #8]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp, #32]
Lloh6:
	adrp	x26, _isc_info_blob_total_length@GOTPAGE
Lloh7:
	ldr	x26, [x26, _isc_info_blob_total_length@GOTPAGEOFF]
	ldrb	w8, [x26]
	strb	w8, [sp, #31]
	str	xzr, [x3]
	mov	x2, x24
	ldr	x0, [x2], #16
	add	x1, x24, #20
	add	x3, sp, #32
	bl	_isc_open_blob
	cbnz	x0, LBB0_22
; %bb.1:
	ldr	x23, [x24]
	add	x0, sp, #31
	bl	_const_cast
	mov	x3, x0
	add	x27, sp, #36
	add	x1, sp, #32
	add	x5, sp, #36
	mov	x0, x23
	mov	w2, #1
	mov	w4, #20
	bl	_isc_blob_info
	cbz	x0, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_RECORD_ERROR
	mov	w20, #0
	b	LBB0_21
LBB0_3:
	stp	x20, x22, [sp, #8]              ; 16-byte Folded Spill
	mov	w23, #0
Lloh8:
	adrp	x28, _isc_info_end@GOTPAGE
Lloh9:
	ldr	x28, [x28, _isc_info_end@GOTPAGEOFF]
Lloh10:
	adrp	x20, _isc_info_truncated@GOTPAGE
Lloh11:
	ldr	x20, [x20, _isc_info_truncated@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	and	x8, x23, #0xffff
	ldrb	w22, [x27, x8]
	ldrb	w8, [x28]
	ldrb	w9, [x20]
	cmp	w22, w8
	ccmp	w22, w9, #4, ne
	b.eq	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh12:
	adrp	x8, _isc_info_error@GOTPAGE
Lloh13:
	ldr	x8, [x8, _isc_info_error@GOTPAGEOFF]
	ldrb	w8, [x8]
	cmp	w22, w8
	and	w8, w23, #0xffff
	ccmp	w8, #19, #2, ne
	b.hs	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w8, w23, #1
	add	x0, x27, w8, uxth
	mov	w1, #2
	bl	_isc_vax_integer
	ldrb	w8, [x26]
	cmp	w22, w8
	b.eq	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w8, w23, w0
	add	w23, w8, #3
	and	w8, w23, #0xffff
	cmp	w8, #20
	b.lo	LBB0_4
; %bb.8:
	ldr	x0, [x21]
	ldr	x9, [sp, #16]                   ; 8-byte Folded Reload
	cbnz	x0, LBB0_11
	b	LBB0_18
LBB0_9:
	mov	w20, #0
Lloh14:
	adrp	x8, l_.str@PAGE
Lloh15:
	add	x8, x8, l_.str@PAGEOFF
	b	LBB0_20
LBB0_10:
	add	x8, sp, #36
	add	x8, x8, w23, uxth
	add	x8, x8, #3
	and	w1, w0, #0xffff
	mov	x0, x8
	bl	_isc_vax_integer
	str	x0, [x21]
	ldr	x9, [sp, #16]                   ; 8-byte Folded Reload
	cbz	x0, LBB0_18
LBB0_11:
	ldr	x8, [x25]
	sbfiz	x20, x9, #3, #32
	ldr	x8, [x8, x20]
	add	x1, x0, #1
	mov	x0, x8
	bl	_erealloc
	ldr	x8, [x25]
	str	x0, [x8, x20]
	ldr	x20, [sp, #8]                   ; 8-byte Folded Reload
	str	x0, [x20]
	ldr	x8, [x21]
Lloh16:
	adrp	x22, _isc_segment@GOTPAGE
Lloh17:
	ldr	x22, [x22, _isc_segment@GOTPAGEOFF]
	cmp	x8, #1
	b.lt	LBB0_15
; %bb.12:
	mov	x23, #0
Lloh18:
	adrp	x25, _USHRT_MAX@GOTPAGE
Lloh19:
	ldr	x25, [x25, _USHRT_MAX@GOTPAGEOFF]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x25]
	sub	x8, x8, x23
	cmp	x8, x9
	csel	x8, x8, x9, lt
	ldr	x0, [x24]
	ldr	x9, [x20]
	add	x4, x9, x23
	and	w3, w8, #0xffff
	add	x1, sp, #32
	add	x2, sp, #28
	bl	_isc_get_segment
	cmp	x0, #0
	cset	w9, ne
	ldr	x8, [x22]
	ccmp	x0, x8, #4, ne
	b.ne	LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldrh	w10, [sp, #28]
	ldr	x8, [x21]
	add	x23, x23, x10
	cmp	x8, x23
	b.gt	LBB0_13
	b	LBB0_17
LBB0_15:
	mov	x0, #0
	mov	w9, #0
	b	LBB0_17
LBB0_16:
	ldr	x8, [x21]
LBB0_17:
	ldr	x10, [x20]
	strb	wzr, [x10, x8]
	ldr	x8, [x24]
	ldr	w8, [x8]
Lloh20:
	adrp	x10, _isc_segstr_eof@GOTPAGE
Lloh21:
	ldr	x10, [x10, _isc_segstr_eof@GOTPAGEOFF]
Lloh22:
	ldr	x10, [x10]
	ldr	x11, [x22]
	cmp	w8, #1
	ccmp	w9, #0, #4, eq
	ccmp	x0, x10, #4, ne
	ccmp	x0, x11, #4, ne
	b.ne	LBB0_19
LBB0_18:
	mov	w20, #1
	b	LBB0_21
LBB0_19:
	mov	w20, #0
Lloh23:
	adrp	x8, l_.str.1@PAGE
Lloh24:
	add	x8, x8, l_.str.1@PAGEOFF
LBB0_20:
	str	x8, [x24, #8]
LBB0_21:
	ldr	x0, [x24]
	add	x1, sp, #32
	bl	_isc_close_blob
	cbz	x0, LBB0_23
LBB0_22:
	mov	x0, x19
	bl	_RECORD_ERROR
	mov	w20, #0
LBB0_23:
	ldr	x8, [sp, #56]
Lloh25:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh26:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_25
; %bb.24:
	mov	x0, x20
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_25:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_PDO_FIREBIRD_HANDLE_INITIALIZER,4,2 ; @PDO_FIREBIRD_HANDLE_INITIALIZER
	.comm	_isc_info_blob_total_length,1,0 ; @isc_info_blob_total_length
	.comm	_isc_info_end,1,0               ; @isc_info_end
	.comm	_isc_info_truncated,1,0         ; @isc_info_truncated
	.comm	_isc_info_error,1,0             ; @isc_info_error
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't determine BLOB size"

	.comm	_isc_segment,8,3                ; @isc_segment
	.comm	_USHRT_MAX,8,3                  ; @USHRT_MAX
	.comm	_isc_segstr_eof,8,3             ; @isc_segstr_eof
l_.str.1:                               ; @.str.1
	.asciz	"Error reading from BLOB"

	.no_dead_strip	_firebird_fetch_blob
.subsections_via_symbols
