	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ecpg_auto_prepare              ## -- Begin function ecpg_auto_prepare
	.p2align	4, 0x90
_ecpg_auto_prepare:                     ## @ecpg_auto_prepare
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r15
	movq	%rcx, %r12
	movl	%edx, %r13d
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movl	%edi, %r14d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%r8, %rdi
	callq	_SearchStmtCache
	testl	%eax, %eax
	je	LBB0_4
## %bb.1:
	movl	%eax, %ebx
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_ecpg_log
	movq	_stmtCacheEntries@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%ebx, %r12
	movq	%r12, %rcx
	shlq	$4, %rcx
	movq	(%rax,%rcx), %r13
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_ecpg_get_connection
	movq	%rax, %rbx
	movq	%r13, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_ecpg_find_prepared_statement
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	movl	%r14d, %edi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	movq	%r15, %rcx
	callq	_prepare_common
	xorl	%ecx, %ecx
	testl	%eax, %eax
	je	LBB0_9
LBB0_3:
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_ecpg_strdup
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	jmp	LBB0_8
LBB0_4:
	movl	%r13d, -56(%rbp)                ## 4-byte Spill
	movq	%rsp, %r13
	movq	_STMTID_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_ecpg_log
	movq	_nextStmtID@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leal	1(%rdx), %ecx
	movl	%ecx, (%rax)
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_sprintf
	movl	%r14d, %edi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	xorl	%edx, %edx
	movq	%rbx, %rcx
	movq	%r15, %r8
	callq	_ECPGprepare
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%r14d, %edi
	movq	%rbx, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	movq	%r15, %r8
	callq	_AddStmtToCache
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movl	%eax, %r15d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_ecpg_strdup
	movq	%rax, (%r12)
	movq	%r13, %rsp
	movl	%r15d, %r12d
LBB0_8:
	movq	_stmtCacheEntries@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	shlq	$4, %r12
	incl	8(%rax,%r12)
	movl	$1, %ecx
	jmp	LBB0_9
LBB0_6:
	movq	%r13, %rsp
	xorl	%ecx, %ecx
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	movl	%ecx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ecpg_auto_prepare on line %d: statement found in cache; entry %d\n"

	.comm	_stmtCacheEntries,8,3           ## @stmtCacheEntries
	.comm	_STMTID_SIZE,4,2                ## @STMTID_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"ecpg_auto_prepare on line %d: statement not in cache; inserting\n"

L_.str.2:                               ## @.str.2
	.asciz	"ecpg%d"

	.comm	_nextStmtID,4,2                 ## @nextStmtID
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ecpg_auto_prepare              ; -- Begin function ecpg_auto_prepare
	.p2align	2
_ecpg_auto_prepare:                     ; @ecpg_auto_prepare
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	sub	sp, sp, #16
	mov	x21, x4
	mov	x19, x3
	mov	x23, x2
	mov	x22, 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, #-72]
	mov	x0, x4
	bl	_SearchStmtCache
Lloh3:
	adrp	x25, _stmtCacheEntries@GOTPAGE
Lloh4:
	ldr	x25, [x25, _stmtCacheEntries@GOTPAGEOFF]
	cbz	w0, LBB0_4
; %bb.1:
	mov	x24, x0
	str	x24, [sp, #-16]!
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_ecpg_log
	add	sp, sp, #16
	ldr	x8, [x25]
	sbfiz	x9, x24, #4, #32
	ldr	x23, [x8, x9]
	mov	x0, x22
	bl	_ecpg_get_connection
	mov	x22, x0
	mov	x0, x23
	mov	x1, x22
	mov	x2, #0
	bl	_ecpg_find_prepared_statement
	cbnz	x0, LBB0_3
; %bb.2:
	mov	x0, x20
	mov	x1, x22
	mov	x2, x23
	mov	x3, x21
	bl	_prepare_common
	cbz	w0, LBB0_9
LBB0_3:
	sxtw	x21, w24
	mov	x0, x23
	mov	x1, x20
	bl	_ecpg_strdup
	str	x0, [x19]
	b	LBB0_7
LBB0_4:
	mov	x26, sp
Lloh7:
	adrp	x8, _STMTID_SIZE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _STMTID_SIZE@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	mov	x9, x8
Lloh10:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh11:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x24, x9, x8
	mov	sp, x24
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_ecpg_log
Lloh14:
	adrp	x8, _nextStmtID@GOTPAGE
Lloh15:
	ldr	x8, [x8, _nextStmtID@GOTPAGEOFF]
	ldr	w2, [x8]
	add	w9, w2, #1
	str	w9, [x8]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x24
	bl	_sprintf
	mov	x0, x20
	mov	x1, x22
	mov	w2, #0
	mov	x3, x24
	mov	x4, x21
	bl	_ECPGprepare
	cbz	w0, LBB0_8
; %bb.5:
	mov	x0, x20
	mov	x1, x24
	mov	x2, x22
	mov	x3, x23
	mov	x4, x21
	bl	_AddStmtToCache
	tbnz	w0, #31, LBB0_8
; %bb.6:
	mov	x21, x0
	mov	x0, x24
	mov	x1, x20
	bl	_ecpg_strdup
	str	x0, [x19]
	mov	sp, x26
	mov	w21, w21
LBB0_7:
	ldr	x8, [x25]
	add	x8, x8, x21, lsl #4
	ldr	w9, [x8, #8]
	add	w9, w9, #1
	str	w9, [x8, #8]
	mov	w0, #1
	b	LBB0_9
LBB0_8:
	mov	sp, x26
	mov	w0, #0
LBB0_9:
	ldur	x8, [x29, #-72]
Lloh18:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh19:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ecpg_auto_prepare on line %d: statement found in cache; entry %d\n"

	.comm	_stmtCacheEntries,8,3           ; @stmtCacheEntries
	.comm	_STMTID_SIZE,4,2                ; @STMTID_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"ecpg_auto_prepare on line %d: statement not in cache; inserting\n"

l_.str.2:                               ; @.str.2
	.asciz	"ecpg%d"

	.comm	_nextStmtID,4,2                 ; @nextStmtID
.subsections_via_symbols
