#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(int);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
float iirOutTimer(float *, float *, float *, float *, int, int);
float nondet_float();
int /*<<< orphan*/ shiftL(float, float *, int);
int checkOverflow(void) {
  int i;
  int xsize = 16;
  int Na = 3;
  int Nb = 3;
  int k = 2;
  int l = 5;
  float max = 1.7;
  float min = -1.7;
  float y[xsize];
  float x[xsize];
  for (i = 0; i < xsize; ++i) {
    y[i] = 0;
    x[i] = nondet_float();
    __ESBMC_assume(x[i] >= min && x[i] <= max);
  }
  float yaux[Na];
  float xaux[Nb];
  for (i = 0; i < Na; ++i) {
    yaux[i] = 0;
  }
  for (i = 0; i < Nb; ++i) {
    xaux[i] = 0;
  }
  float a[Na];
  float b[Nb];
  a[0] = 1.0000;
  a[1] = -0.375;
  a[2] = 0.1875;
  b[0] = 0.21875;
  b[1] = 0.40625;
  b[2] = 0.21875;
  assert(0);
  for (i = 0; i < xsize; ++i) {
    shiftL(x[i], xaux, Nb);
    y[i] = iirOutTimer(yaux, xaux, a, b, Na, Nb);
    shiftL(y[i], yaux, Na);
  }
  return 0;
}


x86 assembly (clang, -O0):
<checkOverflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x10,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x5,-0x18(%rbp)
movl   $0x3fd9999a,-0x1c(%rbp)
movl   $0xbfd9999a,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1258 <checkOverflow+0x108>
mov    -0x68(%rbp),%rax
movslq -0x4(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    $0x0,%al
call   1050 <nondet_float@plt>
mov    -0x60(%rbp),%rax
movslq -0x4(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movslq -0x4(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
xor    %eax,%eax
ucomiss -0x20(%rbp),%xmm0
mov    %al,-0x69(%rbp)
jb     123d <checkOverflow+0xed>
mov    -0x60(%rbp),%rax
movslq -0x4(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
movss  -0x1c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
mov    %al,-0x69(%rbp)
mov    -0x69(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__ESBMC_assume@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11da <checkOverflow+0x8a>
mov    -0xc(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x80(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12c9 <checkOverflow+0x179>
mov    -0x80(%rbp),%rax
movslq -0x4(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    129f <checkOverflow+0x14f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    12fa <checkOverflow+0x1aa>
mov    -0x78(%rbp),%rax
movslq -0x4(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    12d0 <checkOverflow+0x180>
mov    -0xc(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x90(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%edx
lea    0xf(,%rdx,4),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rax
sub    %rsi,%rax
mov    %rax,-0x88(%rbp)
mov    %rax,%rsp
mov    %rdx,-0x58(%rbp)
movss  0xcc6(%rip),%xmm0
movss  %xmm0,(%rcx)
movss  0xcb6(%rip),%xmm0
movss  %xmm0,0x4(%rcx)
movss  0xca5(%rip),%xmm0
movss  %xmm0,0x8(%rcx)
movss  0xc90(%rip),%xmm0
movss  %xmm0,(%rax)
movss  0xc88(%rip),%xmm0
movss  %xmm0,0x4(%rax)
movss  0xc77(%rip),%xmm0
movss  %xmm0,0x8(%rax)
xor    %edi,%edi
call   1070 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1414 <checkOverflow+0x2c4>
mov    -0x78(%rbp),%rdi
mov    -0x60(%rbp),%rax
movslq -0x4(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x10(%rbp),%esi
call   1060 <shiftL@plt>
mov    -0x78(%rbp),%rsi
mov    -0x90(%rbp),%rdx
mov    -0x88(%rbp),%rcx
mov    -0x80(%rbp),%rdi
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
call   1040 <iirOutTimer@plt>
mov    -0x68(%rbp),%rax
mov    -0x80(%rbp),%rdi
movslq -0x4(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movslq -0x4(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0xc(%rbp),%esi
call   1060 <shiftL@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    139c <checkOverflow+0x24c>
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkOverflow>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1050 <nondet_float@plt>
ucomiss 0xe82(%rip),%xmm0
setae  %al
movss  0xe7b(%rip),%xmm1
ucomiss %xmm0,%xmm1
movss  %xmm0,-0x70(%rbp,%rbx,4)
setae  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <__ESBMC_assume@plt>
add    $0x1,%rbx
cmp    $0x10,%rbx
jne    1170 <checkOverflow+0x20>
mov    %rsp,%rax
lea    -0x10(%rax),%r14
mov    %r14,%rsp
mov    %rsp,%rcx
lea    -0x10(%rcx),%r13
mov    %r13,%rsp
movl   $0x0,-0x8(%rax)
movq   $0x0,-0x10(%rax)
movl   $0x0,-0x8(%rcx)
movq   $0x0,-0x10(%rcx)
mov    %rsp,%rax
lea    -0x10(%rax),%r15
mov    %r15,%rsp
mov    %rsp,%rcx
lea    -0x10(%rcx),%r12
mov    %r12,%rsp
movabs $0xbec000003f800000,%rdx
mov    %rdx,-0x10(%rax)
movl   $0x3e400000,-0x8(%rax)
movabs $0x3ed000003e600000,%rax
mov    %rax,-0x10(%rcx)
movl   $0x3e600000,-0x8(%rcx)
xor    %ebx,%ebx
xor    %edi,%edi
call   1070 <assert@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  -0x70(%rbp,%rbx,4),%xmm0
mov    %r13,%rdi
mov    $0x3,%esi
call   1060 <shiftL@plt>
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
mov    $0x3,%r8d
mov    $0x3,%r9d
call   1040 <iirOutTimer@plt>
mov    %r14,%rdi
mov    $0x3,%esi
call   1060 <shiftL@plt>
add    $0x1,%rbx
cmp    $0x10,%rbx
jne    1230 <checkOverflow+0xe0>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @checkOverflow() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
store i32 16, i32* %2
store i32 3, i32* %3
store i32 3, i32* %4
store i32 2, i32* %5
store i32 5, i32* %6
store float 0x3FFB333340000000, float* %7
store float 0xBFFB333340000000, float* %8
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
%18 = call i8* @llvm.stacksave()
store i8* %18, i8** %9
%19 = alloca float, i64 %17
store i64 %17, i64* %10
%20 = load i32, i32* %2
%21 = zext i32 %20 to i64
%22 = alloca float, i64 %21
store i64 %21, i64* %11
store i32 0, i32* %1
br label %23
23: ; preds = %52, %0
%24 = load i32, i32* %1
%25 = load i32, i32* %2
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %55
27: ; preds = %23
%28 = load i32, i32* %1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds float, float* %19, i64 %29
store float 0.000000e+00, float* %30
%31 = call float (...) @nondet_float()
%32 = load i32, i32* %1
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds float, float* %22, i64 %33
store float %31, float* %34
%35 = load i32, i32* %1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds float, float* %22, i64 %36
%38 = load float, float* %37
%39 = load float, float* %8
%40 = fcmp oge float %38, %39
br i1 %40, label %41, label %48
41: ; preds = %27
%42 = load i32, i32* %1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds float, float* %22, i64 %43
%45 = load float, float* %44
%46 = load float, float* %7
%47 = fcmp ole float %45, %46
br label %48
48: ; preds = %41, %27
%49 = phi i1 [ false, %27 ], [ %47, %41 ]
%50 = zext i1 %49 to i32
%51 = call i32 @__ESBMC_assume(i32 %50)
br label %52
52: ; preds = %48
%53 = load i32, i32* %1
%54 = add nsw i32 %53, 1
store i32 %54, i32* %1
br label %23
55: ; preds = %23
%56 = load i32, i32* %3
%57 = zext i32 %56 to i64
%58 = alloca float, i64 %57
store i64 %57, i64* %12
%59 = load i32, i32* %4
%60 = zext i32 %59 to i64
%61 = alloca float, i64 %60
store i64 %60, i64* %13
store i32 0, i32* %1
br label %62
62: ; preds = %70, %55
%63 = load i32, i32* %1
%64 = load i32, i32* %3
%65 = icmp slt i32 %63, %64
br i1 %65, label %66, label %73
66: ; preds = %62
%67 = load i32, i32* %1
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds float, float* %58, i64 %68
store float 0.000000e+00, float* %69
br label %70
70: ; preds = %66
%71 = load i32, i32* %1
%72 = add nsw i32 %71, 1
store i32 %72, i32* %1
br label %62
73: ; preds = %62
store i32 0, i32* %1
br label %74
74: ; preds = %82, %73
%75 = load i32, i32* %1
%76 = load i32, i32* %4
%77 = icmp slt i32 %75, %76
br i1 %77, label %78, label %85
78: ; preds = %74
%79 = load i32, i32* %1
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds float, float* %61, i64 %80
store float 0.000000e+00, float* %81
br label %82
82: ; preds = %78
%83 = load i32, i32* %1
%84 = add nsw i32 %83, 1
store i32 %84, i32* %1
br label %74
85: ; preds = %74
%86 = load i32, i32* %3
%87 = zext i32 %86 to i64
%88 = alloca float, i64 %87
store i64 %87, i64* %14
%89 = load i32, i32* %4
%90 = zext i32 %89 to i64
%91 = alloca float, i64 %90
store i64 %90, i64* %15
%92 = getelementptr inbounds float, float* %88, i64 0
store float 1.000000e+00, float* %92
%93 = getelementptr inbounds float, float* %88, i64 1
store float -3.750000e-01, float* %93
%94 = getelementptr inbounds float, float* %88, i64 2
store float 1.875000e-01, float* %94
%95 = getelementptr inbounds float, float* %91, i64 0
store float 2.187500e-01, float* %95
%96 = getelementptr inbounds float, float* %91, i64 1
store float 4.062500e-01, float* %96
%97 = getelementptr inbounds float, float* %91, i64 2
store float 2.187500e-01, float* %97
%98 = call i32 @assert(i32 0)
store i32 0, i32* %1
br label %99
99: ; preds = %122, %85
%100 = load i32, i32* %1
%101 = load i32, i32* %2
%102 = icmp slt i32 %100, %101
br i1 %102, label %103, label %125
103: ; preds = %99
%104 = load i32, i32* %1
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds float, float* %22, i64 %105
%107 = load float, float* %106
%108 = load i32, i32* %4
%109 = call i32 @shiftL(float %107, float* %61, i32 %108)
%110 = load i32, i32* %3
%111 = load i32, i32* %4
%112 = call float @iirOutTimer(float* %58, float* %61, float* %88, float* %91, i32 %110, i32 %111)
%113 = load i32, i32* %1
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds float, float* %19, i64 %114
store float %112, float* %115
%116 = load i32, i32* %1
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds float, float* %19, i64 %117
%119 = load float, float* %118
%120 = load i32, i32* %3
%121 = call i32 @shiftL(float %119, float* %58, i32 %120)
br label %122
122: ; preds = %103
%123 = load i32, i32* %1
%124 = add nsw i32 %123, 1
store i32 %124, i32* %1
br label %99
125: ; preds = %99
%126 = load i8*, i8** %9
ret i32 0
}

LLVM IR (-O2):
define i32 @checkOverflow() {
%1 = alloca [16 x float]
br label %2
2: ; preds = %0, %2
%3 = phi i64 [ 0, %0 ], [ %11, %2 ]
%4 = tail call float (...) @nondet_float()
%5 = getelementptr inbounds [16 x float], [16 x float]* %1, i64 0, i64 %3
store float %4, float* %5
%6 = fcmp oge float %4, 0xBFFB333340000000
%7 = fcmp ole float %4, 0x3FFB333340000000
%8 = and i1 %6, %7
%9 = zext i1 %8 to i32
%10 = tail call i32 @__ESBMC_assume(i32 %9)
%11 = add nuw nsw i64 %3, 1
%12 = icmp eq i64 %11, 16
br i1 %12, label %13, label %2
13: ; preds = %2
%14 = alloca [3 x float]
%15 = bitcast [3 x float]* %14 to i8*
%16 = alloca [3 x float]
%17 = bitcast [3 x float]* %16 to i8*
%18 = getelementptr inbounds [3 x float], [3 x float]* %16, i64 0, i64 0
%19 = getelementptr inbounds [3 x float], [3 x float]* %14, i64 0, i64 0
%20 = alloca [3 x float]
%21 = alloca [3 x float]
%22 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 0, i64 0
%23 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 0
store float 1.000000e+00, float* %23
%24 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 1
store float -3.750000e-01, float* %24
%25 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 2
store float 1.875000e-01, float* %25
store float 2.187500e-01, float* %22
%26 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 0, i64 1
store float 4.062500e-01, float* %26
%27 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 0, i64 2
store float 2.187500e-01, float* %27
%28 = tail call i32 @assert(i32 0)
br label %29
29: ; preds = %13, %29
%30 = phi i64 [ 0, %13 ], [ %36, %29 ]
%31 = getelementptr inbounds [16 x float], [16 x float]* %1, i64 0, i64 %30
%32 = load float, float* %31
%33 = call i32 @shiftL(float %32, float* %18, i32 3)
%34 = call float @iirOutTimer(float* %19, float* %18, float* %23, float* %22, i32 3, i32 3)
%35 = call i32 @shiftL(float %34, float* %19, i32 3)
%36 = add nuw nsw i64 %30, 1
%37 = icmp eq i64 %36, 16
br i1 %37, label %38, label %29
38: ; preds = %29
ret i32 0
}