#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 n, i;
  float sum = 0, avg;
  scanf("%d", &n);
  while (n > 0) {
    sum = sum + n % 10;
    n = n / 10;
    i++;
  }
  avg = sum / i;
  if (avg >= 7) {
    printf("heavy");
  } else {
    printf("light");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    118a <main+0x6a>
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <main+0x27>
movss  -0x10(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  0xe56(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     11c4 <main+0xa4>
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
jmp    11d0 <main+0xb0>
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    1191 <main+0x71>
xorps  %xmm0,%xmm0
mov    $0xcccccccd,%r8d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edx
mov    %eax,%eax
imul   %r8,%rax
shr    $0x23,%rax
lea    (%rax,%rax,1),%edi
lea    (%rdi,%rdi,4),%edi
mov    %edx,%esi
sub    %edi,%esi
xorps  %xmm1,%xmm1
cvtsi2ss %esi,%xmm1
addss  %xmm1,%xmm0
add    $0x1,%ecx
cmp    $0x9,%edx
ja     1150 <main+0x30>
mov    %eax,0x4(%rsp)
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
divss  %xmm1,%xmm0
ucomiss 0xe71(%rip),%xmm0
jae    119a <main+0x7a>
lea    0xe75(%rip),%rdi
jmp    11a1 <main+0x81>
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"heavy\00"
@.str.2 = [6 x i8] c"light\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 %20
6: ; preds = %0, %6
%7 = phi i32 [ %14, %6 ], [ undef, %0 ]
%8 = phi float [ %12, %6 ], [ 0.000000e+00, %0 ]
%9 = phi i32 [ %13, %6 ], [ %4, %0 ]
%10 = urem i32 %9, 10
%11 = sitofp i32 %10 to float
%12 = fadd float %8, %11
%13 = udiv i32 %9, 10
%14 = add nsw i32 %7, 1
%15 = icmp ult i32 %9, 10
br i1 %15, label %16, label %6
16: ; preds = %6
store i32 %13, i32* %1
%17 = sitofp i32 %14 to float
%18 = fdiv float %12, %17
%19 = fcmp ult float %18, 7.000000e+00
br i1 %19, label %20, label %21
20: ; preds = %0, %16
br label %21
21: ; preds = %16, %20
%22 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %20 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %16 ]
%23 = call i32 @printf(i8* dereferenceable(1) %22)
ret i32 0
}