	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lem_evaluate
_lem_evaluate:                          ## @lem_evaluate
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$0, 32(%rsi)
	je	LBB0_22
## %bb.1:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	16(%rsi), %r12
	movl	(%rsi), %edi
	movq	_PL_LINK_ERR_CTR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_PLC
	movl	%eax, %edi
	callq	_inpw
                                        ## kill: def $eax killed $eax def $rax
	movl	24(%rbx), %ecx
	leal	(%rax,%rcx), %edx
	movl	%edx, 24(%rbx)
	addl	%eax, (%r12)
	addl	%ecx, %eax
	je	LBB0_2
## %bb.3:
	movl	$9, %r15d
	cmpl	$10, %eax
	jl	LBB0_12
## %bb.4:
	movl	$8, %r15d
	cmpl	$100, %eax
	jb	LBB0_12
## %bb.5:
	movl	$7, %r15d
	cmpl	$1000, %eax                     ## imm = 0x3E8
	jb	LBB0_12
## %bb.6:
	movl	$6, %r15d
	cmpl	$10000, %eax                    ## imm = 0x2710
	jb	LBB0_12
## %bb.7:
	movl	$5, %r15d
	cmpl	$100000, %eax                   ## imm = 0x186A0
	jb	LBB0_12
## %bb.8:
	movl	$4, %r15d
	cmpl	$1000000, %eax                  ## imm = 0xF4240
	jb	LBB0_12
## %bb.9:
	movl	$3, %r15d
	cmpl	$10000000, %eax                 ## imm = 0x989680
	jb	LBB0_12
## %bb.10:
	movl	$2, %r15d
	cmpl	$100000000, %eax                ## imm = 0x5F5E100
	jb	LBB0_12
## %bb.11:
	xorl	%r15d, %r15d
	cmpl	$1000000000, %eax               ## imm = 0x3B9ACA00
	setb	%r15b
	jmp	LBB0_12
LBB0_2:
	movl	$15, %r15d
LBB0_12:
	movl	28(%rbx), %ecx
	leal	(,%rcx,8), %edx
	subl	%ecx, %edx
	imull	$300, %r15d, %ecx               ## imm = 0x12C
	addl	%edx, %ecx
	movslq	%ecx, %rcx
	imulq	$1717986919, %rcx, %rdx         ## imm = 0x66666667
	movq	%rdx, %rsi
	shrq	$63, %rsi
	sarq	$34, %rdx
	addl	%esi, %edx
	movl	%edx, 28(%rbx)
	movl	$4, %edx
	cmpl	$4000, %ecx                     ## imm = 0xFA0
	jl	LBB0_14
## %bb.13:
	imulq	$274877907, %rcx, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rcx
	shrq	$63, %rcx
	sarq	$38, %rdx
	addl	%ecx, %edx
LBB0_14:
	movl	%edx, 4(%r12)
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	movq	(%rbx), %rax
	movq	_PB@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	sete	%dl
	addl	$65, %edx
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_DB_PCMN
	movsbl	24(%rbx), %edx
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_DB_PCMN
	movsbl	(%r12), %edx
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_DB_PCMN
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_DB_PCMN
	movsbl	28(%rbx), %edx
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_DB_PCMN
	movsbl	4(%r12), %edx
	leaq	L_.str.5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_DB_PCMN
	movl	4(%r12), %edx
LBB0_16:
	movl	$0, 24(%rbx)
	cmpl	8(%r12), %edx
	jle	LBB0_17
## %bb.18:
	movq	_FALSE@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_17:
	movq	_TRUE@GOTPCREL(%rip), %rax
LBB0_19:
	movl	(%rax), %ecx
	cmpl	%ecx, 12(%r12)
	je	LBB0_21
## %bb.20:
	movq	_SMT_COND_PORT_LER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_INDEX_PORT@GOTPCREL(%rip), %rax
	movl	(%rbx), %edx
	addl	(%rax), %edx
	movq	%r14, %rdi
	callq	_smt_srf_event
	movl	4(%r12), %edx
LBB0_21:
	cmpl	16(%r12), %edx
	jle	LBB0_23
LBB0_22:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rbx)
	incl	20(%r12)
	addl	$200, 28(%rbx)
	movq	_EVENT_PCM@GOTPCREL(%rip), %rax
	movl	(%rbx), %esi
	addl	(%rax), %esi
	movq	_PC_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_queue_event                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PL_LINK_ERR_CTR,4,2            ## @PL_LINK_ERR_CTR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LEM %c :"

	.comm	_PB,8,3                         ## @PB
L_.str.1:                               ## @.str.1
	.asciz	"errors      : %ld"

L_.str.2:                               ## @.str.2
	.asciz	"sum_errors  : %ld"

L_.str.3:                               ## @.str.3
	.asciz	"current BER : 10E-%d"

L_.str.4:                               ## @.str.4
	.asciz	"float BER   : 10E-(%d/100)"

L_.str.5:                               ## @.str.5
	.asciz	"avg. BER    : 10E-%d"

	.comm	_TRUE,8,3                       ## @TRUE
	.comm	_FALSE,8,3                      ## @FALSE
	.comm	_SMT_COND_PORT_LER,4,2          ## @SMT_COND_PORT_LER
	.comm	_INDEX_PORT,8,3                 ## @INDEX_PORT
	.comm	_EVENT_PCM,8,3                  ## @EVENT_PCM
	.comm	_PC_START,4,2                   ## @PC_START
	.no_dead_strip	_lem_evaluate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lem_evaluate
_lem_evaluate:                          ; @lem_evaluate
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	w8, [x1, #32]
	cbz	w8, LBB0_25
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	ldr	x22, [x1, #16]
	ldr	w0, [x1]
Lloh0:
	adrp	x8, _PL_LINK_ERR_CTR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PL_LINK_ERR_CTR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_PLC
	bl	_inpw
	ldr	w8, [x20, #24]
	ldr	w9, [x22]
	add	w9, w9, w0
	str	w9, [x22]
	adds	w8, w8, w0
	str	w8, [x20, #24]
	b.eq	LBB0_4
; %bb.2:
	cmp	w8, #10
	b.ge	LBB0_5
; %bb.3:
	mov	w21, #9
	b	LBB0_20
LBB0_4:
	mov	w21, #15
	b	LBB0_20
LBB0_5:
	cmp	w8, #100
	b.hs	LBB0_7
; %bb.6:
	mov	w21, #8
	b	LBB0_20
LBB0_7:
	cmp	w8, #1000
	b.hs	LBB0_9
; %bb.8:
	mov	w21, #7
	b	LBB0_20
LBB0_9:
	lsr	w9, w8, #4
	cmp	w9, #625
	b.hs	LBB0_11
; %bb.10:
	mov	w21, #6
	b	LBB0_20
LBB0_11:
	lsr	w9, w8, #5
	cmp	w9, #3125
	b.hs	LBB0_13
; %bb.12:
	mov	w21, #5
	b	LBB0_20
LBB0_13:
	mov	w9, #16960
	movk	w9, #15, lsl #16
	cmp	w8, w9
	b.hs	LBB0_15
; %bb.14:
	mov	w21, #4
	b	LBB0_20
LBB0_15:
	mov	w9, #38528
	movk	w9, #152, lsl #16
	cmp	w8, w9
	b.hs	LBB0_17
; %bb.16:
	mov	w21, #3
	b	LBB0_20
LBB0_17:
	mov	w9, #57600
	movk	w9, #1525, lsl #16
	cmp	w8, w9
	b.hs	LBB0_19
; %bb.18:
	mov	w21, #2
	b	LBB0_20
LBB0_19:
	mov	w9, #51712
	movk	w9, #15258, lsl #16
	cmp	w8, w9
	cset	w21, lo
LBB0_20:
	ldr	w9, [x20, #28]
	lsl	w10, w9, #3
	sub	w9, w10, w9
	mov	w10, #300
	madd	w9, w21, w10, w9
	mov	w10, #26215
	movk	w10, #26214, lsl #16
	smull	x10, w9, w10
	lsr	x11, x10, #63
	asr	x10, x10, #34
	add	w10, w10, w11
	str	w10, [x20, #28]
	mov	w10, #19923
	movk	w10, #4194, lsl #16
	smull	x10, w9, w10
	lsr	x11, x10, #63
	asr	x10, x10, #38
	add	w10, w10, w11
	mov	w11, #4
	cmp	w9, #4000
	csel	w9, w11, w10, lt
	str	w9, [x22, #4]
	cbz	w8, LBB0_22
; %bb.21:
	ldr	x8, [x20]
Lloh3:
	adrp	x9, _PB@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PB@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	mov	w8, #65
	cinc	w2, w8, eq
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_DB_PCMN
	ldrsb	w2, [x20, #24]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_DB_PCMN
	ldrsb	w2, [x22]
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_DB_PCMN
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	mov	x2, x21
	bl	_DB_PCMN
	ldrsb	w2, [x20, #28]
Lloh14:
	adrp	x1, l_.str.4@PAGE
Lloh15:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_DB_PCMN
	ldrsb	w2, [x22, #4]
Lloh16:
	adrp	x1, l_.str.5@PAGE
Lloh17:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w0, #1
	bl	_DB_PCMN
	ldr	w9, [x22, #4]
LBB0_22:
	str	wzr, [x20, #24]
Lloh18:
	adrp	x21, _TRUE@GOTPAGE
Lloh19:
	ldr	x21, [x21, _TRUE@GOTPAGEOFF]
Lloh20:
	adrp	x8, _FALSE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
	ldp	w10, w11, [x22, #8]
	cmp	w9, w10
	csel	x8, x8, x21, gt
	ldr	w3, [x8]
	cmp	w11, w3
	b.eq	LBB0_24
; %bb.23:
Lloh22:
	adrp	x8, _SMT_COND_PORT_LER@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SMT_COND_PORT_LER@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x8, _INDEX_PORT@GOTPAGE
Lloh26:
	ldr	x8, [x8, _INDEX_PORT@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	ldr	w9, [x20]
	add	w2, w9, w8
	mov	x0, x19
	bl	_smt_srf_event
	ldr	w9, [x22, #4]
LBB0_24:
	ldr	w8, [x22, #16]
	cmp	w9, w8
	b.le	LBB0_26
LBB0_25:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_26:
	ldr	x8, [x21]
	str	x8, [x20, #8]
	ldr	w8, [x22, #20]
	add	w8, w8, #1
	str	w8, [x22, #20]
	ldr	w8, [x20, #28]
	add	w8, w8, #200
	str	w8, [x20, #28]
Lloh28:
	adrp	x8, _EVENT_PCM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EVENT_PCM@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	ldr	w9, [x20]
	add	w1, w9, w8
Lloh31:
	adrp	x8, _PC_START@GOTPAGE
Lloh32:
	ldr	x8, [x8, _PC_START@GOTPAGEOFF]
Lloh33:
	ldr	w2, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_queue_event
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_PL_LINK_ERR_CTR,4,2            ; @PL_LINK_ERR_CTR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LEM %c :"

	.comm	_PB,8,3                         ; @PB
l_.str.1:                               ; @.str.1
	.asciz	"errors      : %ld"

l_.str.2:                               ; @.str.2
	.asciz	"sum_errors  : %ld"

l_.str.3:                               ; @.str.3
	.asciz	"current BER : 10E-%d"

l_.str.4:                               ; @.str.4
	.asciz	"float BER   : 10E-(%d/100)"

l_.str.5:                               ; @.str.5
	.asciz	"avg. BER    : 10E-%d"

	.comm	_TRUE,8,3                       ; @TRUE
	.comm	_FALSE,8,3                      ; @FALSE
	.comm	_SMT_COND_PORT_LER,4,2          ; @SMT_COND_PORT_LER
	.comm	_INDEX_PORT,8,3                 ; @INDEX_PORT
	.comm	_EVENT_PCM,8,3                  ; @EVENT_PCM
	.comm	_PC_START,4,2                   ; @PC_START
	.no_dead_strip	_lem_evaluate
.subsections_via_symbols
