#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *, ...);
int /*<<< orphan*/ nrerror(char *);
double plgndr(int, int, float);
int /*<<< orphan*/ printf(char *, ...);
float sqrt(float);
scalar_t__ strncmp(char *, char *, int);
int main(void) {
  char txt[80];
  int i, j, m, n, nval;
  float fac, val, x;
  FILE *fp;
  if ((fp = fopen("fncval.dat", "r")) == NULL)
    nrerror("Data file fncval.dat not found\n");
  fgets(txt, 80, fp);
  while (strncmp(txt, "Legendre Polynomials", 20)) {
    fgets(txt, 80, fp);
    if (feof(fp))
      nrerror("Data not found in fncval.dat\n");
  }
  fscanf(fp, "%d %*s", &nval);
  printf("\n%s\n", txt);
  printf("%4s %4s %10s %17s %24s\n", "n", "m", "x", "actual", "plgndr(n,m,x)");
  for (i = 1; i <= nval; i++) {
    fscanf(fp, "%d %d %f %f", &n, &m, &x, &val);
    fac = 1.0;
    if (m > 0)
      for (j = n - m + 1; j <= n + m; j++)
        fac *= j;
    fac *= 2.0 / (2.0 * n + 1.0);
    val *= sqrt(fac);
    printf("%4d %4d %13.6f %19.6e %19.6e\n", n, m, x, val, plgndr(n, m, x));
  }
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe5f(%rip),%rdi
lea    0xe63(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x88(%rbp)
cmp    $0x0,%rax
jne    11e2 <main+0x42>
lea    0xe48(%rip),%rdi
call   1040 <nrerror@plt>
lea    -0x60(%rbp),%rdi
mov    -0x88(%rbp),%rdx
mov    $0x50,%esi
call   1080 <fgets@plt>
lea    -0x60(%rbp),%rdi
lea    0xe43(%rip),%rsi
mov    $0x14,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1252 <main+0xb2>
lea    -0x60(%rbp),%rdi
mov    -0x88(%rbp),%rdx
mov    $0x50,%esi
call   1080 <fgets@plt>
mov    -0x88(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%rax
je     124d <main+0xad>
lea    0xe12(%rip),%rdi
call   1040 <nrerror@plt>
jmp    11f7 <main+0x57>
mov    -0x88(%rbp),%rdi
lea    0xe18(%rip),%rsi
lea    -0x74(%rbp),%rdx
mov    $0x0,%al
call   1070 <fscanf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe00(%rip),%rdi
lea    0xe11(%rip),%rsi
lea    0xe0c(%rip),%rdx
lea    0xe07(%rip),%rcx
lea    0xe02(%rip),%r8
lea    0xe02(%rip),%r9
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x74(%rbp),%eax
jg     1406 <main+0x266>
mov    -0x88(%rbp),%rdi
lea    0xde8(%rip),%rsi
lea    -0x70(%rbp),%rdx
lea    -0x6c(%rbp),%rcx
lea    -0x80(%rbp),%r8
lea    -0x7c(%rbp),%r9
mov    $0x0,%al
call   1070 <fscanf@plt>
movss  0xd12(%rip),%xmm0
movss  %xmm0,-0x78(%rbp)
cmpl   $0x0,-0x6c(%rbp)
jle    133c <main+0x19c>
mov    -0x70(%rbp),%eax
sub    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
mov    -0x68(%rbp),%eax
mov    -0x70(%rbp),%ecx
add    -0x6c(%rbp),%ecx
cmp    %ecx,%eax
jg     1337 <main+0x197>
cvtsi2ssl -0x68(%rbp),%xmm0
mulss  -0x78(%rbp),%xmm0
movss  %xmm0,-0x78(%rbp)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1309 <main+0x169>
jmp    133c <main+0x19c>
cvtsi2sdl -0x70(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xcc3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xcaf(%rip),%xmm1
divsd  %xmm0,%xmm1
movss  -0x78(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x78(%rbp)
movss  -0x78(%rbp),%xmm0
call   10b0 <sqrt@plt>
mulss  -0x7c(%rbp),%xmm0
movss  %xmm0,-0x7c(%rbp)
mov    -0x70(%rbp),%eax
mov    %eax,-0xa0(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x9c(%rbp)
movss  -0x80(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movss  -0x7c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x70(%rbp),%edi
mov    -0x6c(%rbp),%esi
movss  -0x80(%rbp),%xmm0
call   10c0 <plgndr@plt>
mov    -0xa0(%rbp),%esi
mov    -0x9c(%rbp),%edx
movsd  -0x98(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x90(%rbp),%xmm0
ff
lea    0xcd2(%rip),%rdi
mov    $0x3,%al
call   1060 <printf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    12b5 <main+0x115>
mov    -0x88(%rbp),%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
lea    0xe60(%rip),%rdi
lea    0xe64(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    11d8 <main+0x38>
lea    0xe52(%rip),%rdi
call   1040 <nrerror@plt>
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x50,%esi
mov    %rbx,%rdx
call   1080 <fgets@plt>
lea    0xe51(%rip),%rsi
mov    %rbp,%rdi
mov    $0x14,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     125c <main+0xbc>
lea    0x30(%rsp),%rbp
lea    0xe33(%rip),%r14
lea    0xe41(%rip),%r15
jmp    1235 <main+0x95>
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %r14,%rsi
mov    $0x14,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     125c <main+0xbc>
mov    %rbp,%rdi
mov    $0x50,%esi
mov    %rbx,%rdx
call   1080 <fgets@plt>
mov    %rbx,%rdi
call   1090 <feof@plt>
test   %rax,%rax
je     1220 <main+0x80>
mov    %r15,%rdi
call   1040 <nrerror@plt>
jmp    1220 <main+0x80>
lea    0xe15(%rip),%rsi
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <fscanf@plt>
lea    0xe06(%rip),%rdi
lea    0x30(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xdf8(%rip),%rdi
lea    0xe09(%rip),%rsi
lea    0xe04(%rip),%rdx
lea    0xdff(%rip),%rcx
lea    0xdfa(%rip),%r8
lea    0xdfa(%rip),%r9
xor    %eax,%eax
call   1060 <printf@plt>
cmpl   $0x0,0x10(%rsp)
jle    14b1 <main+0x311>
mov    $0x1,%r13d
lea    0xc(%rsp),%rbp
lea    0xdf0(%rip),%r14
jmp    1357 <main+0x1b7>
nopl   0x0(%rax,%rax,1)
call   10b0 <sqrt@plt>
mulss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    0x14(%rsp),%r15d
mov    0x18(%rsp),%r12d
movss  0x1c(%rsp),%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm1,%xmm2
movsd  %xmm2,0x28(%rsp)
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x20(%rsp)
mov    %r15d,%edi
mov    %r12d,%esi
movaps %xmm1,%xmm0
call   10c0 <plgndr@plt>
movaps %xmm0,%xmm2
mov    %r14,%rdi
mov    %r15d,%esi
mov    %r12d,%edx
movsd  0x28(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mov    $0x3,%al
call   1060 <printf@plt>
lea    0x1(%r13),%eax
cmp    0x10(%rsp),%r13d
mov    %eax,%r13d
jge    14b1 <main+0x311>
mov    %rbx,%rdi
lea    0xd56(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x1c(%rsp),%r8
mov    %rbp,%r9
xor    %eax,%eax
call   1070 <fscanf@plt>
mov    0x18(%rsp),%esi
mov    0x14(%rsp),%eax
movss  0xc76(%rip),%xmm0
test   %esi,%esi
jle    1470 <main+0x2d0>
mov    %eax,%ecx
sub    %esi,%ecx
lea    (%rax,%rsi,1),%edx
movss  0xc5f(%rip),%xmm0
cmp    %edx,%ecx
jge    1470 <main+0x2d0>
lea    (%rsi,%rsi,1),%edi
movss  0xc4c(%rip),%xmm0
and    $0x6,%edi
je     13d3 <main+0x233>
nopl   0x0(%rax)
add    $0x1,%ecx
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
mulss  %xmm1,%xmm0
add    $0xffffffff,%edi
jne    13c0 <main+0x220>
add    %esi,%esi
add    $0xffffffff,%esi
cmp    $0x7,%esi
jb     1470 <main+0x2d0>
neg    %edx
add    $0x8,%ecx
cs nopw 0x0(%rax,%rax,1)
lea    -0x7(%rcx),%esi
xorps  %xmm1,%xmm1
cvtsi2ss %esi,%xmm1
mulss  %xmm0,%xmm1
lea    -0x6(%rcx),%esi
xorps  %xmm0,%xmm0
cvtsi2ss %esi,%xmm0
mulss  %xmm1,%xmm0
lea    -0x5(%rcx),%esi
xorps  %xmm1,%xmm1
cvtsi2ss %esi,%xmm1
lea    -0x4(%rcx),%esi
xorps  %xmm2,%xmm2
cvtsi2ss %esi,%xmm2
lea    -0x3(%rcx),%esi
xorps  %xmm3,%xmm3
cvtsi2ss %esi,%xmm3
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm2
mulss  %xmm2,%xmm3
lea    -0x2(%rcx),%esi
xorps  %xmm0,%xmm0
cvtsi2ss %esi,%xmm0
mulss  %xmm3,%xmm0
lea    -0x1(%rcx),%esi
xorps  %xmm1,%xmm1
cvtsi2ss %esi,%xmm1
mulss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
mulss  %xmm1,%xmm0
lea    (%rdx,%rcx,1),%esi
add    $0x8,%esi
add    $0x8,%ecx
cmp    $0x8,%esi
jne    13f0 <main+0x250>
nopl   0x0(%rax,%rax,1)
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm1
addsd  0xb85(%rip),%xmm1
movsd  0xb85(%rip),%xmm2
divsd  %xmm1,%xmm2
cvtss2sd %xmm0,%xmm0
mulsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
ucomiss 0xb62(%rip),%xmm0
jb     12e0 <main+0x140>
sqrtss %xmm0,%xmm0
jmp    12e5 <main+0x145>
mov    %rbx,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"fncval.dat\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [32 x i8] c"Data file fncval.dat not found\0A\00"
@.str.3 = [21 x i8] c"Legendre Polynomials\00"
@.str.4 = [30 x i8] c"Data not found in fncval.dat\0A\00"
@.str.5 = [7 x i8] c"%d %*s\00"
@.str.6 = [5 x i8] c"\0A%s\0A\00"
@.str.7 = [24 x i8] c"%4s %4s %10s %17s %24s\0A\00"
@.str.8 = [2 x i8] c"n\00"
@.str.9 = [2 x i8] c"m\00"
@.str.10 = [2 x i8] c"x\00"
@.str.11 = [7 x i8] c"actual\00"
@.str.12 = [14 x i8] c"plgndr(n,m,x)\00"
@.str.13 = [12 x i8] c"%d %d %f %f\00"
@.str.14 = [30 x i8] c"%4d %4d %13.6f %19.6e %19.6e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca i32*
store i32 0, i32* %1
%12 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %12, i32** %11
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %14, %0
%17 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%18 = load i32*, i32** %11
%19 = call i32 @fgets(i8* %17, i32 80, i32* %18)
br label %20
20: ; preds = %33, %16
%21 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%22 = call i64 @strncmp(i8* %21, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 20)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %34
24: ; preds = %20
%25 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%26 = load i32*, i32** %11
%27 = call i32 @fgets(i8* %25, i32 80, i32* %26)
%28 = load i32*, i32** %11
%29 = call i64 @feof(i32* %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %24
%32 = call i32 @nrerror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
br label %33
33: ; preds = %31, %24
br label %20
34: ; preds = %20
%35 = load i32*, i32** %11
%36 = call i32 (i32*, i8*, i32*, ...) @fscanf(i32* %35, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32* %7)
%37 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* %37)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0))
store i32 1, i32* %3
br label %40
40: ; preds = %93, %34
%41 = load i32, i32* %3
%42 = load i32, i32* %7
%43 = icmp sle i32 %41, %42
br i1 %43, label %44, label %96
44: ; preds = %40
%45 = load i32*, i32** %11
%46 = call i32 (i32*, i8*, i32*, ...) @fscanf(i32* %45, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0), i32* %6, i32* %5, float* %10, float* %9)
store float 1.000000e+00, float* %8
%47 = load i32, i32* %5
%48 = icmp sgt i32 %47, 0
br i1 %48, label %49, label %69
49: ; preds = %44
%50 = load i32, i32* %6
%51 = load i32, i32* %5
%52 = sub nsw i32 %50, %51
%53 = add nsw i32 %52, 1
store i32 %53, i32* %4
br label %54
54: ; preds = %65, %49
%55 = load i32, i32* %4
%56 = load i32, i32* %6
%57 = load i32, i32* %5
%58 = add nsw i32 %56, %57
%59 = icmp sle i32 %55, %58
br i1 %59, label %60, label %68
60: ; preds = %54
%61 = load i32, i32* %4
%62 = sitofp i32 %61 to float
%63 = load float, float* %8
%64 = fmul float %63, %62
store float %64, float* %8
br label %65
65: ; preds = %60
%66 = load i32, i32* %4
%67 = add nsw i32 %66, 1
store i32 %67, i32* %4
br label %54
68: ; preds = %54
br label %69
69: ; preds = %68, %44
%70 = load i32, i32* %6
%71 = sitofp i32 %70 to double
%72 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %71, double 1.000000e+00)
%73 = fdiv double 2.000000e+00, %72
%74 = load float, float* %8
%75 = fpext float %74 to double
%76 = fmul double %75, %73
%77 = fptrunc double %76 to float
store float %77, float* %8
%78 = load float, float* %8
%79 = call float @sqrt(float %78)
%80 = load float, float* %9
%81 = fmul float %80, %79
store float %81, float* %9
%82 = load i32, i32* %6
%83 = load i32, i32* %5
%84 = load float, float* %10
%85 = fpext float %84 to double
%86 = load float, float* %9
%87 = fpext float %86 to double
%88 = load i32, i32* %6
%89 = load i32, i32* %5
%90 = load float, float* %10
%91 = call double @plgndr(i32 %88, i32 %89, float %90)
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), i32 %82, i32 %83, double %85, double %87, double %91)
br label %93
93: ; preds = %69
%94 = load i32, i32* %3
%95 = add nsw i32 %94, 1
store i32 %95, i32* %3
br label %40
96: ; preds = %40
%97 = load i32*, i32** %11
%98 = call i32 @fclose(i32* %97)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"fncval.dat\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [32 x i8] c"Data file fncval.dat not found\0A\00"
@.str.3 = [21 x i8] c"Legendre Polynomials\00"
@.str.4 = [30 x i8] c"Data not found in fncval.dat\0A\00"
@.str.5 = [7 x i8] c"%d %*s\00"
@.str.6 = [5 x i8] c"\0A%s\0A\00"
@.str.7 = [24 x i8] c"%4s %4s %10s %17s %24s\0A\00"
@.str.8 = [2 x i8] c"n\00"
@.str.9 = [2 x i8] c"m\00"
@.str.10 = [2 x i8] c"x\00"
@.str.11 = [7 x i8] c"actual\00"
@.str.12 = [14 x i8] c"plgndr(n,m,x)\00"
@.str.13 = [12 x i8] c"%d %d %f %f\00"
@.str.14 = [30 x i8] c"%4d %4d %13.6f %19.6e %19.6e\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast float* %5 to i8*
%12 = bitcast float* %6 to i8*
%13 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %0
%18 = call i32 @fgets(i8* %7, i32 80, i32* %13)
%19 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 20)
%20 = icmp eq i64 %19, 0
br i1 %20, label %30, label %21
21: ; preds = %17, %27
%22 = call i32 @fgets(i8* %7, i32 80, i32* %13)
%23 = call i64 @feof(i32* %13)
%24 = icmp eq i64 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %21
%26 = call i32 @nrerror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
br label %27
27: ; preds = %25, %21
%28 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 20)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %21
30: ; preds = %27, %17
%31 = call i32 (i32*, i8*, i32*, ...) @fscanf(i32* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32* %4)
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* %7)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0))
%34 = load i32, i32* %4
%35 = icmp slt i32 %34, 1
br i1 %35, label %114, label %36
36: ; preds = %30, %93
%37 = phi i32 [ %111, %93 ], [ 1, %30 ]
%38 = call i32 (i32*, i8*, i32*, ...) @fscanf(i32* %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0), i32* %3, i32* %2, float* %6, float* %5)
%39 = load i32, i32* %2
%40 = icmp sgt i32 %39, 0
%41 = load i32, i32* %3
br i1 %40, label %42, label %93
42: ; preds = %36
%43 = sub nsw i32 %41, %39
%44 = add i32 %41, %39
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %93
46: ; preds = %42
%47 = shl i32 %39, 1
%48 = add i32 %47, -1
%49 = and i32 %47, 6
%50 = icmp eq i32 %49, 0
br i1 %50, label %60, label %51
51: ; preds = %46, %51
%52 = phi i32 [ %55, %51 ], [ %43, %46 ]
%53 = phi float [ %57, %51 ], [ 1.000000e+00, %46 ]
%54 = phi i32 [ %58, %51 ], [ 0, %46 ]
%55 = add nsw i32 %52, 1
%56 = sitofp i32 %55 to float
%57 = fmul float %53, %56
%58 = add i32 %54, 1
%59 = icmp eq i32 %58, %49
br i1 %59, label %60, label %51
60: ; preds = %51, %46
%61 = phi float [ undef, %46 ], [ %57, %51 ]
%62 = phi i32 [ %43, %46 ], [ %55, %51 ]
%63 = phi float [ 1.000000e+00, %46 ], [ %57, %51 ]
%64 = icmp ult i32 %48, 7
br i1 %64, label %93, label %65
65: ; preds = %60, %65
%66 = phi i32 [ %89, %65 ], [ %62, %60 ]
%67 = phi float [ %91, %65 ], [ %63, %60 ]
%68 = add nsw i32 %66, 1
%69 = sitofp i32 %68 to float
%70 = fmul float %67, %69
%71 = add nsw i32 %66, 2
%72 = sitofp i32 %71 to float
%73 = fmul float %70, %72
%74 = add nsw i32 %66, 3
%75 = sitofp i32 %74 to float
%76 = fmul float %73, %75
%77 = add nsw i32 %66, 4
%78 = sitofp i32 %77 to float
%79 = fmul float %76, %78
%80 = add nsw i32 %66, 5
%81 = sitofp i32 %80 to float
%82 = fmul float %79, %81
%83 = add nsw i32 %66, 6
%84 = sitofp i32 %83 to float
%85 = fmul float %82, %84
%86 = add nsw i32 %66, 7
%87 = sitofp i32 %86 to float
%88 = fmul float %85, %87
%89 = add nsw i32 %66, 8
%90 = sitofp i32 %89 to float
%91 = fmul float %88, %90
%92 = icmp eq i32 %89, %44
br i1 %92, label %93, label %65
93: ; preds = %60, %65, %36, %42
%94 = phi float [ 1.000000e+00, %42 ], [ 1.000000e+00, %36 ], [ %61, %60 ], [ %91, %65 ]
%95 = sitofp i32 %41 to double
%96 = call double @llvm.fmuladd.f64(double %95, double 2.000000e+00, double 1.000000e+00)
%97 = fdiv double 2.000000e+00, %96
%98 = fpext float %94 to double
%99 = fmul double %97, %98
%100 = fptrunc double %99 to float
%101 = call float @sqrt(float %100)
%102 = load float, float* %5
%103 = fmul float %101, %102
store float %103, float* %5
%104 = load i32, i32* %3
%105 = load i32, i32* %2
%106 = load float, float* %6
%107 = fpext float %106 to double
%108 = fpext float %103 to double
%109 = call double @plgndr(i32 %104, i32 %105, float %106)
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), i32 %104, i32 %105, double %107, double %108, double %109)
%111 = add nuw nsw i32 %37, 1
%112 = load i32, i32* %4
%113 = icmp slt i32 %37, %112
br i1 %113, label %36, label %114
114: ; preds = %93, %30
%115 = call i32 @fclose(i32* %13)
ret i32 0
}