#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 *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b;
  float sum, count;
  scanf("%d", &a);
  int clone = a;
  int i = 0;
  for (; i < a; i++) {
    b = clone % 10;
    sum += b;
    a /= 10;
    count += 1;
  }
  sum = sum / count;
  if (sum >= 7.00)
    printf("heavy\n");
  else
    printf("light\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11a3 <main+0x83>
mov    -0x18(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
movss  0xe7d(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114c <main+0x2c>
movss  -0x10(%rbp),%xmm0
divss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe3d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11de <main+0xbe>
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
jmp    11ea <main+0xca>
lea    0xe31(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    1196 <main+0x76>
mov    %eax,%ecx
mov    $0xcccccccd,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,4),%ecx
mov    %eax,%edx
sub    %ecx,%edx
cvtsi2ss %edx,%xmm1
xor    %ecx,%ecx
movss  0xea0(%rip),%xmm3
addss  %xmm1,%xmm0
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
addss  %xmm3,%xmm2
add    $0x1,%ecx
cmp    %eax,%ecx
jl     1160 <main+0x40>
mov    %eax,0x4(%rsp)
divss  %xmm2,%xmm0
ucomiss 0xe70(%rip),%xmm0
jae    119f <main+0x7f>
lea    0xe6e(%rip),%rdi
jmp    11a6 <main+0x86>
lea    0xe6b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"heavy\0A\00"
@.str.2 = [7 x i8] c"light\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
store i32 %9, i32* %6
store i32 0, i32* %7
br label %10
10: ; preds = %25, %0
%11 = load i32, i32* %7
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %28
14: ; preds = %10
%15 = load i32, i32* %6
%16 = srem i32 %15, 10
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = sitofp i32 %17 to float
%19 = load float, float* %4
%20 = fadd float %19, %18
store float %20, float* %4
%21 = load i32, i32* %2
%22 = sdiv i32 %21, 10
store i32 %22, i32* %2
%23 = load float, float* %5
%24 = fadd float %23, 1.000000e+00
store float %24, float* %5
br label %25
25: ; preds = %14
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
store i32 %27, i32* %7
br label %10
28: ; preds = %10
%29 = load float, float* %4
%30 = load float, float* %5
%31 = fdiv float %29, %30
store float %31, float* %4
%32 = load float, float* %4
%33 = fpext float %32 to double
%34 = fcmp oge double %33, 7.000000e+00
br i1 %34, label %35, label %37
35: ; preds = %28
%36 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %39
37: ; preds = %28
%38 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %39
39: ; preds = %37, %35
%40 = load i32, i32* %1
ret i32 %40
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [6 x i8] c"light\00"
@str.3 = [6 x i8] c"heavy\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %22
6: ; preds = %0
%7 = urem i32 %4, 10
%8 = sitofp i32 %7 to float
br label %9
9: ; preds = %6, %9
%10 = phi i32 [ 0, %6 ], [ %17, %9 ]
%11 = phi float [ undef, %6 ], [ %14, %9 ]
%12 = phi float [ undef, %6 ], [ %16, %9 ]
%13 = phi i32 [ %4, %6 ], [ %15, %9 ]
%14 = fadd float %11, %8
%15 = sdiv i32 %13, 10
%16 = fadd float %12, 1.000000e+00
%17 = add nuw nsw i32 %10, 1
%18 = icmp slt i32 %17, %15
br i1 %18, label %9, label %19
19: ; preds = %9
store i32 %15, i32* %1
%20 = fdiv float %14, %16
%21 = fcmp ult float %20, 7.000000e+00
br i1 %21, label %22, label %23
22: ; preds = %0, %19
br label %23
23: ; preds = %19, %22
%24 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), %22 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0), %19 ]
%25 = call i32 @puts(i8* dereferenceable(1) %24)
ret i32 0
}