#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*/ printf(char *, char *, float);
void avcour1(char (*pcourse)[10], float *pscore) {
  int i;
  float sum, average1;
  sum = 0.0;
  for (i = 0; i < 4; i++)
    sum += *(pscore + 5 * i);
  average1 = sum / 4;
  printf("course 1:%s average score:%7.2f\n", *pcourse, average1);
}


x86 assembly (clang, -O0):
<avcour1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1161 <avcour1+0x51>
mov    -0x10(%rbp),%rax
imul   $0x5,-0x14(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <avcour1+0x1f>
movss  -0x18(%rbp),%xmm0
movss  0xe92(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rsi
movss  -0x1c(%rbp),%xmm0
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avcour1>:
xorps  %xmm0,%xmm0
addss  (%rsi),%xmm0
addss  0x14(%rsi),%xmm0
addss  0x28(%rsi),%xmm0
addss  0x3c(%rsi),%xmm0
mov    %rdi,%rsi
mulss  0xecf(%rip),%xmm0
lea    0xecc(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"course 1:%s average score:%7.2f\0A\00"
define void @avcour1([10 x i8]* %0, float* %1) {
%3 = alloca [10 x i8]*
%4 = alloca float*
%5 = alloca i32
%6 = alloca float
%7 = alloca float
store [10 x i8]* %0, [10 x i8]** %3
store float* %1, float** %4
store float 0.000000e+00, float* %6
store i32 0, i32* %5
br label %8
8: ; preds = %20, %2
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 4
br i1 %10, label %11, label %23
11: ; preds = %8
%12 = load float*, float** %4
%13 = load i32, i32* %5
%14 = mul nsw i32 5, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds float, float* %12, i64 %15
%17 = load float, float* %16
%18 = load float, float* %6
%19 = fadd float %18, %17
store float %19, float* %6
br label %20
20: ; preds = %11
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %8
23: ; preds = %8
%24 = load float, float* %6
%25 = fdiv float %24, 4.000000e+00
store float %25, float* %7
%26 = load [10 x i8]*, [10 x i8]** %3
%27 = getelementptr inbounds [10 x i8], [10 x i8]* %26, i64 0, i64 0
%28 = load float, float* %7
%29 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %27, float %28)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"course 1:%s average score:%7.2f\0A\00"
define void @avcour1([10 x i8]* %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fadd float %3, 0.000000e+00
%5 = getelementptr inbounds float, float* %1, i64 5
%6 = load float, float* %5
%7 = fadd float %4, %6
%8 = getelementptr inbounds float, float* %1, i64 10
%9 = load float, float* %8
%10 = fadd float %7, %9
%11 = getelementptr inbounds float, float* %1, i64 15
%12 = load float, float* %11
%13 = fadd float %10, %12
%14 = fmul float %13, 2.500000e-01
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %0, i64 0, i64 0
%16 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %15, float %14)
ret void
}