	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function camera_buffer_callback
_camera_buffer_callback:                ## @camera_buffer_callback
	.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
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	16(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_17
## %bb.1:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	24(%rbx), %r15
	movq	%r13, %r14
	movl	(%r13), %r13d
	xorl	%eax, %eax
	callq	_get_microseconds64
	cltq
	imulq	$1125899907, %rax, %r12         ## imm = 0x431BDE83
	movq	%r12, %rbx
	shrq	$63, %rbx
	sarq	$50, %r12
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	cmpq	$0, 80(%r15)
	je	LBB0_3
## %bb.2:
	movl	(%r14), %edi
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	(%rax), %rax
	movl	4(%rax), %esi
	imull	(%rax), %esi
	callq	_vcos_min
	movl	%eax, %r13d
LBB0_3:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %r14
	addl	%ebx, %r14d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	48(%rbx), %edi
	callq	_vcos_assert
	testl	%r13d, %r13d
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_11
## %bb.4:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_mmal_buffer_header_mem_lock
	movl	16(%r14), %edi
	movl	48(%rbx), %ecx
	movl	$1, %esi
	movl	%r13d, %edx
	callq	_fwrite
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_mmal_buffer_header_mem_unlock
	cmpl	%r13d, %r12d
	je	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %esi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_vcos_log_error
	movl	$1, (%rbx)
LBB0_6:
	movq	40(%rbx), %rdi
	testq	%rdi, %rdi
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_11
## %bb.7:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	_MMAL_TIME_UNKNOWN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.8:
	cmpq	$0, (%r15)
	jne	LBB0_10
## %bb.9:
	movq	%rax, 8(%r15)
LBB0_10:
	movq	%rax, 8(%rbx)
	subl	16(%rbx), %eax
	movslq	%eax, %rcx
	imulq	$274877907, %rcx, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$38, %rdx
	addl	%eax, %edx
	imull	$1000, %edx, %eax               ## imm = 0x3E8
	subl	%eax, %ecx
	leaq	L_.str.1(%rip), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_fprintf
	incl	32(%rbx)
LBB0_11:
	cmpl	_camera_buffer_callback.last_second(%rip), %r14d
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_18
## %bb.12:
	movl	24(%r15), %esi
	movq	_ANNOTATE_APP_TEXT@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_15
## %bb.13:
	cmpq	$0, 72(%r15)
	je	LBB0_15
## %bb.14:
	xorl	%eax, %eax
	callq	_raspi_gps_location_string
	movq	%rax, %rbx
	movl	64(%r15), %edi
	movl	60(%r15), %ecx
	movl	56(%r15), %r8d
	movl	52(%r15), %r9d
	movl	48(%r15), %r10d
	movl	44(%r15), %r11d
	movl	24(%r15), %esi
	movl	40(%r15), %eax
	subq	$8, %rsp
	movq	%rbx, %rdx
	pushq	%rax
	pushq	%r11
	pushq	%r10
	callq	_raspicamcontrol_set_annotate
	addq	$32, %rsp
	movq	%rbx, %rdi
	callq	_free
	jmp	LBB0_16
LBB0_17:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_vcos_log_error
	jmp	LBB0_18
LBB0_15:
	movl	64(%r15), %edi
	movq	32(%r15), %rdx
	movl	60(%r15), %ecx
	movl	56(%r15), %r8d
	movl	52(%r15), %r9d
	movl	48(%r15), %r10d
	movl	44(%r15), %ebx
	movl	40(%r15), %eax
	subq	$8, %rsp
	pushq	%rax
	pushq	%rbx
	pushq	%r10
	callq	_raspicamcontrol_set_annotate
	addq	$32, %rsp
LBB0_16:
	movl	%r14d, _camera_buffer_callback.last_second(%rip)
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_18:
	movq	%r13, %rdi
	callq	_mmal_buffer_header_release
	cmpq	$0, (%r12)
	je	LBB0_21
## %bb.19:
	movq	24(%rbx), %rax
	movq	16(%rax), %rax
	movl	(%rax), %edi
	callq	_mmal_queue_get
	testq	%rax, %rax
	je	LBB0_22
## %bb.20:
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_mmal_port_send_buffer
	movq	_MMAL_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_22
LBB0_21:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vcos_log_error                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__DATA,__data
	.p2align	2                               ## @camera_buffer_callback.last_second
_camera_buffer_callback.last_second:
	.long	4294967295                      ## 0xffffffff

	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to write buffer data (%d from %d)- aborting"

	.comm	_MMAL_TIME_UNKNOWN,8,3          ## @MMAL_TIME_UNKNOWN
L_.str.1:                               ## @.str.1
	.asciz	"%lld.%03lld\n"

	.comm	_ANNOTATE_APP_TEXT,4,2          ## @ANNOTATE_APP_TEXT
L_.str.2:                               ## @.str.2
	.asciz	"Received a camera buffer callback with no state"

	.comm	_MMAL_SUCCESS,8,3               ## @MMAL_SUCCESS
L_.str.3:                               ## @.str.3
	.asciz	"Unable to return a buffer to the camera port"

	.no_dead_strip	_camera_buffer_callback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function camera_buffer_callback
_camera_buffer_callback:                ; @camera_buffer_callback
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	x23, [x0, #16]
	cbz	x23, LBB0_15
; %bb.1:
	ldr	x24, [x23, #24]
	ldr	w21, [x20]
	bl	_get_microseconds64
	mov	w8, #56963
	movk	w8, #17179, lsl #16
	smull	x8, w0, w8
	lsr	x22, x8, #63
	asr	x25, x8, #50
	ldr	x8, [x24, #80]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	w0, [x20]
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldp	w9, w8, [x8]
	mul	w1, w8, w9
	bl	_vcos_min
	mov	x21, x0
LBB0_3:
	add	w25, w25, w22
	ldr	w0, [x23, #48]
	bl	_vcos_assert
	cbz	w21, LBB0_11
; %bb.4:
	mov	x0, x20
	bl	_mmal_buffer_header_mem_lock
	ldr	w0, [x20, #16]
	ldr	w3, [x23, #48]
	mov	w26, #1
	mov	w1, #1
	mov	x2, x21
	bl	_fwrite
	mov	x22, x0
	mov	x0, x20
	bl	_mmal_buffer_header_mem_unlock
	cmp	w22, w21
	b.eq	LBB0_6
; %bb.5:
	stp	x22, x21, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_vcos_log_error
	str	w26, [x23]
LBB0_6:
	ldr	x0, [x23, #40]
	cbz	x0, LBB0_11
; %bb.7:
	ldr	x8, [x20, #8]
Lloh2:
	adrp	x9, _MMAL_TIME_UNKNOWN@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MMAL_TIME_UNKNOWN@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_11
; %bb.8:
	ldr	x9, [x24]
	cbnz	x9, LBB0_10
; %bb.9:
	str	x8, [x24, #8]
LBB0_10:
	str	x8, [x23, #8]
	ldr	w9, [x23, #16]
	sub	w8, w8, w9
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x9, w8, w9
	lsr	x10, x9, #32
	lsr	x9, x9, #63
	add	w2, w9, w10, asr #6
	mov	w9, #1000
	msub	w3, w2, w9, w8
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fprintf
	ldr	w8, [x23, #32]
	add	w8, w8, #1
	str	w8, [x23, #32]
LBB0_11:
	adrp	x22, _camera_buffer_callback.last_second@PAGE
	ldr	w8, [x22, _camera_buffer_callback.last_second@PAGEOFF]
	cmp	w25, w8
	b.eq	LBB0_18
; %bb.12:
	ldr	w1, [x24, #24]
Lloh7:
	adrp	x8, _ANNOTATE_APP_TEXT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ANNOTATE_APP_TEXT@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	tst	w8, w1
	b.eq	LBB0_16
; %bb.13:
	ldr	x8, [x24, #72]
	cbz	x8, LBB0_16
; %bb.14:
	bl	_raspi_gps_location_string
	mov	x21, x0
	ldp	w3, w0, [x24, #60]
	ldr	w1, [x24, #24]
	ldp	w5, w4, [x24, #52]
	ldp	w7, w6, [x24, #44]
	ldr	w8, [x24, #40]
	str	w8, [sp]
	mov	x2, x21
	bl	_raspicamcontrol_set_annotate
	mov	x0, x21
	bl	_free
	b	LBB0_17
LBB0_15:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_vcos_log_error
	b	LBB0_18
LBB0_16:
	ldp	w3, w0, [x24, #60]
	ldr	x2, [x24, #32]
	ldp	w5, w4, [x24, #52]
	ldp	w7, w6, [x24, #44]
	ldr	w8, [x24, #40]
	str	w8, [sp]
	bl	_raspicamcontrol_set_annotate
LBB0_17:
	str	w25, [x22, _camera_buffer_callback.last_second@PAGEOFF]
LBB0_18:
	mov	x0, x20
	bl	_mmal_buffer_header_release
	ldr	x8, [x19]
	cbz	x8, LBB0_21
; %bb.19:
	ldr	x8, [x23, #24]
	ldr	x8, [x8, #16]
	ldr	w0, [x8]
	bl	_mmal_queue_get
	cbz	x0, LBB0_22
; %bb.20:
	mov	x1, x0
	mov	x0, x19
	bl	_mmal_port_send_buffer
Lloh12:
	adrp	x8, _MMAL_SUCCESS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MMAL_SUCCESS@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_22
LBB0_21:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_22:
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_vcos_log_error
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__DATA,__data
	.p2align	2                               ; @camera_buffer_callback.last_second
_camera_buffer_callback.last_second:
	.long	4294967295                      ; 0xffffffff

	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to write buffer data (%d from %d)- aborting"

	.comm	_MMAL_TIME_UNKNOWN,8,3          ; @MMAL_TIME_UNKNOWN
l_.str.1:                               ; @.str.1
	.asciz	"%lld.%03lld\n"

	.comm	_ANNOTATE_APP_TEXT,4,2          ; @ANNOTATE_APP_TEXT
l_.str.2:                               ; @.str.2
	.asciz	"Received a camera buffer callback with no state"

	.comm	_MMAL_SUCCESS,8,3               ; @MMAL_SUCCESS
l_.str.3:                               ; @.str.3
	.asciz	"Unable to return a buffer to the camera port"

	.no_dead_strip	_camera_buffer_callback
.subsections_via_symbols
