struct seiseki {
  char name[20];
  int kokugo;
  int sugaku;
  int eigo;
  int goukei;
  float heikin;
} main() {
  struct seiseki it2801;
  printf("名前: ");
  scanf("%s", &it2801.name);
  printf("国語: ");
  scanf("%d", &it2801.kokugo);
  printf("数学: ");
  scanf("%d", &it2801.sugaku);
  printf("英語: ");
  scanf("%d", &it2801.eigo);
  it2801.goukei = it2801.kokugo + it2801.sugaku + it2801.eigo;
  it2801.heikin = (float)it2801.goukei / 3.0;
  printf("合計は%d点で、平均は%.1f点です。\n", it2801.goukei, it2801.heikin);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x30(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x28(%rbp),%rsi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x28(%rbp),%rsi
add    $0x14,%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x28(%rbp),%rsi
add    $0x18,%rsi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x28(%rbp),%rsi
add    $0x1c,%rsi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe2b(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
mov    -0x8(%rbp),%esi
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe3d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%r14
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x14(%rsp),%rsi
lea    0xeb6(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xea8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe94(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x18(%rsp),%esi
add    0x14(%rsp),%esi
add    0x1c(%rsp),%esi
mov    %esi,0x20(%rsp)
cvtsi2ss %esi,%xmm0
divss  0xe3d(%rip),%xmm0
movss  %xmm0,0x24(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xe5a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    %r14,%rax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.seiseki = type { [20 x i8], i32, i32, i32, i32, float }
@.str = [9 x i8] c"\E5\90\8D\E5\89\8D: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [9 x i8] c"\E5\9B\BD\E8\AA\9E: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [9 x i8] c"\E6\95\B0\E5\AD\A6: \00"
@.str.5 = [9 x i8] c"\E8\8B\B1\E8\AA\9E: \00"
@.str.6 = [47 x i8] c"\E5\90\88\E8\A8\88\E3\81\AF%d\E7\82\B9\E3\81\A7\E3\80\81\E5\B9\B3\E5\9D\87\E3\81\AF%.1f\E7\82\B9\E3\81\A7\E3\81\99\E3\80\82\0A\00"
define void @main(%struct.seiseki* noalias sret(%struct.seiseki) align 4 %0) {
%2 = alloca %struct.seiseki
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i32 0, i32 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), [20 x i8]* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%7 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i32 0, i32 1
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%10 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i32 0, i32 2
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%13 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i32 0, i32 3
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %13)
%15 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i32 0, i32 1
%16 = load i32, i32* %15
%17 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i32 0, i32 2
%18 = load i32, i32* %17
%19 = add nsw i32 %16, %18
%20 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i32 0, i32 3
%21 = load i32, i32* %20
%22 = add nsw i32 %19, %21
%23 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i32 0, i32 4
store i32 %22, i32* %23
%24 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i32 0, i32 4
%25 = load i32, i32* %24
%26 = sitofp i32 %25 to float
%27 = fpext float %26 to double
%28 = fdiv double %27, 3.000000e+00
%29 = fptrunc double %28 to float
%30 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i32 0, i32 5
store float %29, float* %30
%31 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i32 0, i32 4
%32 = load i32, i32* %31
%33 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i32 0, i32 5
%34 = load float, float* %33
%35 = fpext float %34 to double
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0), i32 %32, double %35)
ret void
}

LLVM IR (-O2):
%struct.seiseki = type { [20 x i8], i32, i32, i32, i32, float }
@.str = [9 x i8] c"\E5\90\8D\E5\89\8D: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [9 x i8] c"\E5\9B\BD\E8\AA\9E: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [9 x i8] c"\E6\95\B0\E5\AD\A6: \00"
@.str.5 = [9 x i8] c"\E8\8B\B1\E8\AA\9E: \00"
@.str.6 = [47 x i8] c"\E5\90\88\E8\A8\88\E3\81\AF%d\E7\82\B9\E3\81\A7\E3\80\81\E5\B9\B3\E5\9D\87\E3\81\AF%.1f\E7\82\B9\E3\81\A7\E3\81\99\E3\80\82\0A\00"
define void @main(%struct.seiseki* noalias nocapture readnone sret(%struct.seiseki) align 4 %0) {
%2 = alloca %struct.seiseki
%3 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i64 0, i32 0, i64 0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i64 0, i32 0
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), [20 x i8]* %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%8 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i64 0, i32 1
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%11 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i64 0, i32 2
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %11)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%14 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i64 0, i32 3
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %14)
%16 = load i32, i32* %8
%17 = load i32, i32* %11
%18 = add nsw i32 %17, %16
%19 = load i32, i32* %14
%20 = add nsw i32 %18, %19
%21 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i64 0, i32 4
store i32 %20, i32* %21
%22 = sitofp i32 %20 to float
%23 = fdiv float %22, 3.000000e+00
%24 = getelementptr inbounds %struct.seiseki, %struct.seiseki* %2, i64 0, i32 5
store float %23, float* %24
%25 = fpext float %23 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0), i32 %20, double %25)
ret void
}