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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xeb1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1193 <main+0x73>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115c <main+0x3c>
cvtsi2ssl -0xc(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  0xe4d(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11cd <main+0xad>
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
jmp    11d9 <main+0xb9>
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xee4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11ae <main+0x8e>
pxor   %xmm0,%xmm0
mov    $0xcccccccd,%ecx
movaps 0xeae(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%edx
mov    %eax,%eax
imul   %rcx,%rax
shr    $0x23,%rax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edx,%edi
sub    %esi,%edi
movd   %edi,%xmm2
movaps %xmm1,%xmm3
movss  %xmm2,%xmm3
paddd  %xmm3,%xmm0
cmp    $0x9,%edx
ja     1160 <main+0x40>
mov    %eax,0x4(%rsp)
cvtdq2ps %xmm0,%xmm0
movaps %xmm0,%xmm1
shufps $0x55,%xmm0,%xmm1
divss  %xmm1,%xmm0
ucomiss 0xe6d(%rip),%xmm0
jbe    11ae <main+0x8e>
lea    0xe71(%rip),%rdi
jmp    11b5 <main+0x95>
lea    0xe62(%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 i32
%5 = alloca float
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store float 0.000000e+00, float* %5
%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 %19
10: ; preds = %7
%11 = load i32, i32* %2
%12 = srem i32 %11, 10
%13 = load i32, i32* %3
%14 = add nsw i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %2
%16 = sdiv i32 %15, 10
store i32 %16, i32* %2
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %7
19: ; preds = %7
%20 = load i32, i32* %3
%21 = sitofp i32 %20 to float
%22 = load i32, i32* %4
%23 = sitofp i32 %22 to float
%24 = fdiv float %21, %23
store float %24, float* %5
%25 = load float, float* %5
%26 = fcmp ogt float %25, 7.000000e+00
br i1 %26, label %27, label %29
27: ; preds = %19
%28 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %31
29: ; preds = %19
%30 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 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 = [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*
store i32 0, i32* %1
%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 [ %10, %6 ], [ %4, %0 ]
%8 = phi <2 x i32> [ %12, %6 ], [ zeroinitializer, %0 ]
%9 = urem i32 %7, 10
%10 = udiv i32 %7, 10
%11 = insertelement <2 x i32> <i32 poison, i32 1>, i32 %9, i64 0
%12 = add nuw nsw <2 x i32> %8, %11
%13 = icmp ult i32 %7, 10
br i1 %13, label %14, label %6
14: ; preds = %6
store i32 %10, i32* %1
%15 = sitofp <2 x i32> %12 to <2 x float>
%16 = extractelement <2 x float> %15, i64 0
%17 = extractelement <2 x float> %15, i64 1
%18 = fdiv float %16, %17
%19 = fcmp ogt float %18, 7.000000e+00
br i1 %19, label %21, label %20
20: ; preds = %0, %14
br label %21
21: ; preds = %14, %20
%22 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), %20 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0), %14 ]
%23 = call i32 @puts(i8* dereferenceable(1) %22)
ret i32 0
}