#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 */
typedef int /*<<< orphan*/ BufX;

/* Variables and functions */
int /*<<< orphan*/ poly2reg(float *, float *, float *, int);
int test_1(void) {
  float BufX[] = {1, 2, 3, 4, 5, 6, 7};
  float BufY[] = {0.38, 1.15, 2.71, 3.92, 5.93, 8.56, 11.24};
  float Coeff[3];
  int _Coeff[3];
  poly2reg(Coeff, BufX, BufY, (sizeof(BufX) / sizeof(BufX[0])));
  _Coeff[0] = Coeff[0] * 10000;
  _Coeff[1] = Coeff[1] * 10000;
  _Coeff[2] = Coeff[2] * 10000;
  if ((_Coeff[0] == 1964) && (_Coeff[1] == 2364) && (_Coeff[2] == -328)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0xef1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xee9(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xee7(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xee4(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xee1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x28(%rbp)
lea    -0x4c(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x7,%ecx
call   1030 <poly2reg@plt>
movss  0xe76(%rip),%xmm0
mulss  -0x4c(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x58(%rbp)
movss  0xe62(%rip),%xmm0
mulss  -0x48(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x54(%rbp)
movss  0xe4e(%rip),%xmm0
mulss  -0x44(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x50(%rbp)
cmpl   $0x7ac,-0x58(%rbp)
jne    11f1 <test_1+0xe1>
cmpl   $0x93c,-0x54(%rbp)
jne    11f1 <test_1+0xe1>
cmpl   $0xfffffeb8,-0x50(%rbp)
jne    11f1 <test_1+0xe1>
movl   $0x1,-0x4(%rbp)
jmp    11f8 <test_1+0xe8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1>:
sub    $0x58,%rsp
movups 0xf21(%rip),%xmm0
movups %xmm0,0x3c(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movups 0xf29(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xf11(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %rsp,%rdi
lea    0x30(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    $0x7,%ecx
call   1030 <poly2reg@plt>
movsd  (%rsp),%xmm0
mulps  0xe99(%rip),%xmm0
cvttps2dq %xmm0,%xmm0
movss  0x8(%rsp),%xmm1
mulss  0xea7(%rip),%xmm1
cvttss2si %xmm1,%eax
pcmpeqd 0xe8b(%rip),%xmm0
pshufd $0x50,%xmm0,%xmm0
movmskpd %xmm0,%ecx
cmp    $0x3,%cl
sete   %cl
cmp    $0xfffffeb8,%eax
sete   %al
and    %cl,%al
movzbl %al,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.test_1.BufX = [7 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00]
@__const.test_1.BufY = [7 x float] [float 0x3FD851EB80000000, float 0x3FF2666660000000, float 0x4005AE1480000000, float 0x400F5C2900000000, float 0x4017B851E0000000, float 0x40211EB860000000, float 0x40267AE140000000]
define i32 @test_1() {
%1 = alloca i32
%2 = alloca [7 x float]
%3 = alloca [7 x float]
%4 = alloca [3 x float]
%5 = alloca [3 x i32]
%6 = bitcast [7 x float]* %2 to i8*
%7 = bitcast [7 x float]* %3 to i8*
%8 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 0
%9 = getelementptr inbounds [7 x float], [7 x float]* %2, i64 0, i64 0
%10 = getelementptr inbounds [7 x float], [7 x float]* %3, i64 0, i64 0
%11 = call i32 @poly2reg(float* %8, float* %9, float* %10, i32 7)
%12 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 0
%13 = load float, float* %12
%14 = fmul float %13, 1.000000e+04
%15 = fptosi float %14 to i32
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
store i32 %15, i32* %16
%17 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 1
%18 = load float, float* %17
%19 = fmul float %18, 1.000000e+04
%20 = fptosi float %19 to i32
%21 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
store i32 %20, i32* %21
%22 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 2
%23 = load float, float* %22
%24 = fmul float %23, 1.000000e+04
%25 = fptosi float %24 to i32
%26 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
store i32 %25, i32* %26
%27 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%28 = load i32, i32* %27
%29 = icmp eq i32 %28, 1964
br i1 %29, label %30, label %39
30: ; preds = %0
%31 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
%32 = load i32, i32* %31
%33 = icmp eq i32 %32, 2364
br i1 %33, label %34, label %39
34: ; preds = %30
%35 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
%36 = load i32, i32* %35
%37 = icmp eq i32 %36, -328
br i1 %37, label %38, label %39
38: ; preds = %34
store i32 1, i32* %1
br label %40
39: ; preds = %34, %30, %0
store i32 0, i32* %1
br label %40
40: ; preds = %39, %38
%41 = load i32, i32* %1
ret i32 %41
}

LLVM IR (-O2):
@__const.test_1.BufX = [7 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00]
@__const.test_1.BufY = [7 x float] [float 0x3FD851EB80000000, float 0x3FF2666660000000, float 0x4005AE1480000000, float 0x400F5C2900000000, float 0x4017B851E0000000, float 0x40211EB860000000, float 0x40267AE140000000]
define i32 @test_1() {
%1 = alloca [7 x float]
%2 = alloca [7 x float]
%3 = alloca [3 x float]
%4 = bitcast [7 x float]* %1 to i8*
%5 = bitcast [7 x float]* %2 to i8*
%6 = bitcast [3 x float]* %3 to i8*
%7 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%8 = getelementptr inbounds [7 x float], [7 x float]* %1, i64 0, i64 0
%9 = getelementptr inbounds [7 x float], [7 x float]* %2, i64 0, i64 0
%10 = call i32 @poly2reg(float* %7, float* %8, float* %9, i32 7)
%11 = bitcast [3 x float]* %3 to <2 x float>*
%12 = load <2 x float>, <2 x float>* %11
%13 = fmul <2 x float> %12, <float 1.000000e+04, float 1.000000e+04>
%14 = fptosi <2 x float> %13 to <2 x i32>
%15 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 2
%16 = load float, float* %15
%17 = fmul float %16, 1.000000e+04
%18 = fptosi float %17 to i32
%19 = icmp eq <2 x i32> %14, <i32 1964, i32 2364>
%20 = extractelement <2 x i1> %19, i64 0
%21 = extractelement <2 x i1> %19, i64 1
%22 = select i1 %20, i1 %21, i1 false
%23 = icmp eq i32 %18, -328
%24 = select i1 %22, i1 %23, i1 false
%25 = zext i1 %24 to i32
ret i32 %25
}