#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*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
float heikin(int *, int);
int /*<<< orphan*/ jyuni(float *, int *, int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int n = 10;
  int m = 6;
  int i, j, k, data[n][m];
  int T[5], B[n];
  float A[5];
  FILE *fp;
  fp = fopen("tensuu", "r");
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      fscanf(fp, "%d", &data[i][j]);
    }
    k = 0;
    for (j = 1; j < m; j++) {
      T[k] = data[i][j];
      k++;
    }
    A[i] = heikin(T, 5);
  }
  jyuni(A, B, n);
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      printf("%3d", data[i][j]);
    }
    printf("%5.1f", A[i]);
    printf("%3d", B[i]);
  }
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
mov    %rax,-0x90(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,%rdx
imul   %rax,%rdx
lea    0xf(,%rdx,4),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x88(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x8(%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,-0x58(%rbp)
lea    0xe18(%rip),%rdi
lea    0xe18(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x78(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12e7 <main+0x187>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1264 <main+0x104>
mov    -0x88(%rbp),%rdx
mov    -0x90(%rbp),%rcx
mov    -0x78(%rbp),%rdi
movslq -0x10(%rbp),%rax
imul   %rcx,%rax
shl    $0x2,%rax
add    %rax,%rdx
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xdb8(%rip),%rsi
call   1050 <fscanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1212 <main+0xb2>
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12c1 <main+0x161>
mov    -0x88(%rbp),%rax
mov    -0x90(%rbp),%rdx
movslq -0x10(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0x18(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1272 <main+0x112>
lea    -0x50(%rbp),%rdi
mov    $0x5,%esi
call   1070 <heikin@plt>
movslq -0x10(%rbp),%rax
movss  %xmm0,-0x70(%rbp,%rax,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11ff <main+0x9f>
mov    -0x80(%rbp),%rsi
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%edx
call   1060 <jyuni@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1396 <main+0x236>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    135b <main+0x1fb>
mov    -0x88(%rbp),%rax
mov    -0x90(%rbp),%rdx
movslq -0x10(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xcc4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1311 <main+0x1b1>
movslq -0x10(%rbp),%rax
cvttss2si -0x70(%rbp,%rax,4),%esi
lea    0xca4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x80(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xc89(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12fe <main+0x19e>
mov    -0x78(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x168,%rsp
lea    0xe88(%rip),%rdi
lea    0xe88(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%r12
mov    %rsp,%rbx
xor    %ebp,%ebp
lea    0xe76(%rip),%r14
lea    0x20(%rsp),%r15
nopl   0x0(%rax,%rax,1)
lea    (%rsp,%rbp,1),%rdx
add    $0x70,%rdx
lea    (%rsp,%rbp,1),%r13
add    $0x74,%r13
mov    %r12,%rdi
mov    %r14,%rsi
call   1050 <fscanf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
call   1050 <fscanf@plt>
lea    (%rsp,%rbp,1),%rdx
add    $0x78,%rdx
mov    %r12,%rdi
mov    %r14,%rsi
call   1050 <fscanf@plt>
lea    (%rsp,%rbp,1),%rdx
add    $0x7c,%rdx
mov    %r12,%rdi
mov    %r14,%rsi
call   1050 <fscanf@plt>
lea    (%rsp,%rbp,1),%rdx
add    $0x80,%rdx
mov    %r12,%rdi
mov    %r14,%rsi
call   1050 <fscanf@plt>
lea    (%rsp,%rbp,1),%rdx
add    $0x84,%rdx
mov    %r12,%rdi
mov    %r14,%rsi
call   1050 <fscanf@plt>
movups 0x74(%rsp,%rbp,1),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0x84(%rsp,%rbp,1),%eax
mov    %eax,0x30(%rsp)
mov    %r15,%rdi
mov    $0x5,%esi
call   1070 <heikin@plt>
movss  %xmm0,(%rbx)
add    $0x4,%rbx
add    $0x18,%rbp
cmp    $0xf0,%rbp
jne    11a0 <main+0x40>
mov    %rsp,%rdi
lea    0x40(%rsp),%rsi
mov    $0xa,%edx
call   1060 <jyuni@plt>
lea    0x84(%rsp),%rbp
xor    %ebx,%ebx
lea    0xd93(%rip),%r15
lea    0xd90(%rip),%r14
mov    -0x14(%rbp),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
mov    0x0(%rbp),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
cvttss2si (%rsp,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
mov    0x40(%rsp,%rbx,4),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
add    $0x18,%rbp
cmp    $0xa,%rbx
jne    1280 <main+0x120>
mov    %r12,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x168,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"tensuu\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"%3d\00"
@.str.4 = [6 x i8] c"%5.1f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca [5 x i32]
%11 = alloca i64
%12 = alloca [5 x float]
%13 = alloca i32*
store i32 0, i32* %1
store i32 10, i32* %2
store i32 6, i32* %3
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %3
%17 = zext i32 %16 to i64
%18 = call i8* @llvm.stacksave()
store i8* %18, i8** %7
%19 = mul nuw i64 %15, %17
%20 = alloca i32, i64 %19
store i64 %15, i64* %8
store i64 %17, i64* %9
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
%23 = alloca i32, i64 %22
store i64 %22, i64* %11
%24 = call i32* @fopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %24, i32** %13
store i32 0, i32* %4
br label %25
25: ; preds = %75, %0
%26 = load i32, i32* %4
%27 = load i32, i32* %2
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %78
29: ; preds = %25
store i32 0, i32* %5
br label %30
30: ; preds = %44, %29
%31 = load i32, i32* %5
%32 = load i32, i32* %3
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %47
34: ; preds = %30
%35 = load i32*, i32** %13
%36 = load i32, i32* %4
%37 = sext i32 %36 to i64
%38 = mul nsw i64 %37, %17
%39 = getelementptr inbounds i32, i32* %20, i64 %38
%40 = load i32, i32* %5
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %39, i64 %41
%43 = call i32 @fscanf(i32* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %42)
br label %44
44: ; preds = %34
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 1
store i32 %46, i32* %5
br label %30
47: ; preds = %30
store i32 0, i32* %6
store i32 1, i32* %5
br label %48
48: ; preds = %66, %47
%49 = load i32, i32* %5
%50 = load i32, i32* %3
%51 = icmp slt i32 %49, %50
br i1 %51, label %52, label %69
52: ; preds = %48
%53 = load i32, i32* %4
%54 = sext i32 %53 to i64
%55 = mul nsw i64 %54, %17
%56 = getelementptr inbounds i32, i32* %20, i64 %55
%57 = load i32, i32* %5
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i32, i32* %56, i64 %58
%60 = load i32, i32* %59
%61 = load i32, i32* %6
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [5 x i32], [5 x i32]* %10, i64 0, i64 %62
store i32 %60, i32* %63
%64 = load i32, i32* %6
%65 = add nsw i32 %64, 1
store i32 %65, i32* %6
br label %66
66: ; preds = %52
%67 = load i32, i32* %5
%68 = add nsw i32 %67, 1
store i32 %68, i32* %5
br label %48
69: ; preds = %48
%70 = getelementptr inbounds [5 x i32], [5 x i32]* %10, i64 0, i64 0
%71 = call float @heikin(i32* %70, i32 5)
%72 = load i32, i32* %4
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [5 x float], [5 x float]* %12, i64 0, i64 %73
store float %71, float* %74
br label %75
75: ; preds = %69
%76 = load i32, i32* %4
%77 = add nsw i32 %76, 1
store i32 %77, i32* %4
br label %25
78: ; preds = %25
%79 = getelementptr inbounds [5 x float], [5 x float]* %12, i64 0, i64 0
%80 = load i32, i32* %2
%81 = call i32 @jyuni(float* %79, i32* %23, i32 %80)
store i32 0, i32* %4
br label %82
82: ; preds = %116, %78
%83 = load i32, i32* %4
%84 = load i32, i32* %2
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %119
86: ; preds = %82
store i32 0, i32* %5
br label %87
87: ; preds = %101, %86
%88 = load i32, i32* %5
%89 = load i32, i32* %3
%90 = icmp slt i32 %88, %89
br i1 %90, label %91, label %104
91: ; preds = %87
%92 = load i32, i32* %4
%93 = sext i32 %92 to i64
%94 = mul nsw i64 %93, %17
%95 = getelementptr inbounds i32, i32* %20, i64 %94
%96 = load i32, i32* %5
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds i32, i32* %95, i64 %97
%99 = load i32, i32* %98
%100 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %99)
br label %101
101: ; preds = %91
%102 = load i32, i32* %5
%103 = add nsw i32 %102, 1
store i32 %103, i32* %5
br label %87
104: ; preds = %87
%105 = load i32, i32* %4
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds [5 x float], [5 x float]* %12, i64 0, i64 %106
%108 = load float, float* %107
%109 = fptosi float %108 to i32
%110 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %109)
%111 = load i32, i32* %4
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i32, i32* %23, i64 %112
%114 = load i32, i32* %113
%115 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %114)
br label %116
116: ; preds = %104
%117 = load i32, i32* %4
%118 = add nsw i32 %117, 1
store i32 %118, i32* %4
br label %82
119: ; preds = %82
%120 = load i32*, i32** %13
%121 = call i32 @fclose(i32* %120)
%122 = load i8*, i8** %7
%123 = load i32, i32* %1
ret i32 %123
}

LLVM IR (-O2):
@.str = [7 x i8] c"tensuu\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"%3d\00"
@.str.4 = [6 x i8] c"%5.1f\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = alloca [5 x float]
%4 = alloca [60 x i32]
%5 = alloca [10 x i32]
%6 = bitcast [5 x float]* %3 to i8*
%7 = tail call i32* @fopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
br label %9
9: ; preds = %0, %9
%10 = phi i64 [ 0, %0 ], [ %29, %9 ]
%11 = mul nuw nsw i64 %10, 6
%12 = or i64 %11, 1
%13 = getelementptr [60 x i32], [60 x i32]* %4, i64 0, i64 %12
%14 = bitcast i32* %13 to i8*
%15 = getelementptr inbounds [60 x i32], [60 x i32]* %4, i64 0, i64 %11
%16 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %15)
%17 = getelementptr inbounds i32, i32* %15, i64 1
%18 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %17)
%19 = getelementptr inbounds i32, i32* %15, i64 2
%20 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %19)
%21 = getelementptr inbounds i32, i32* %15, i64 3
%22 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %21)
%23 = getelementptr inbounds i32, i32* %15, i64 4
%24 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %23)
%25 = getelementptr inbounds i32, i32* %15, i64 5
%26 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %25)
%27 = call float @heikin(i32* %8, i32 5)
%28 = getelementptr inbounds [5 x float], [5 x float]* %3, i64 0, i64 %10
store float %27, float* %28
%29 = add nuw nsw i64 %10, 1
%30 = icmp eq i64 %29, 10
br i1 %30, label %31, label %9
31: ; preds = %9
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
%33 = getelementptr inbounds [5 x float], [5 x float]* %3, i64 0, i64 0
%34 = call i32 @jyuni(float* %33, i32* %32, i32 10)
br label %35
35: ; preds = %31, %35
%36 = phi i64 [ 0, %31 ], [ %63, %35 ]
%37 = mul nuw nsw i64 %36, 6
%38 = getelementptr inbounds [60 x i32], [60 x i32]* %4, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %39)
%41 = getelementptr inbounds i32, i32* %38, i64 1
%42 = load i32, i32* %41
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds i32, i32* %38, i64 2
%45 = load i32, i32* %44
%46 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds i32, i32* %38, i64 3
%48 = load i32, i32* %47
%49 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %48)
%50 = getelementptr inbounds i32, i32* %38, i64 4
%51 = load i32, i32* %50
%52 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %51)
%53 = getelementptr inbounds i32, i32* %38, i64 5
%54 = load i32, i32* %53
%55 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %54)
%56 = getelementptr inbounds [5 x float], [5 x float]* %3, i64 0, i64 %36
%57 = load float, float* %56
%58 = fptosi float %57 to i32
%59 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %58)
%60 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %36
%61 = load i32, i32* %60
%62 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %61)
%63 = add nuw nsw i64 %36, 1
%64 = icmp eq i64 %63, 10
br i1 %64, label %65, label %35
65: ; preds = %35
%66 = call i32 @fclose(i32* %7)
ret i32 0
}