#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 bigN, i = 0, sumd = 0;
  float dels;
  scanf("%d", &bigN);
  while (bigN > 0) {
    dels = bigN % 10;
    sumd = sumd + dels;
    i++;
    bigN = bigN / 10;
  }
  dels = (float)sumd / i;
  if (dels > 7.0) {
    printf("\nheavy");
  } else {
    printf("\nlight");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1198 <main+0x78>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm0
movss  %xmm0,-0x14(%rbp)
cvtsi2ssl -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x2d>
cvtsi2ssl -0x10(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe44(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11d7 <main+0xb7>
lea    0xe3e(%rip),%rdi
call   1030 <printf@plt>
jmp    11e3 <main+0xc3>
lea    0xe34(%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    11a1 <main+0x81>
xor    %ecx,%ecx
xorps  %xmm0,%xmm0
mov    $0xcccccccd,%r8d
cs nopw 0x0(%rax,%rax,1)
nop
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  %xmm0,%xmm1
add    $0x1,%ecx
cvttps2dq %xmm1,%xmm0
cvtdq2ps %xmm0,%xmm0
cmp    $0x9,%edx
ja     1150 <main+0x30>
mov    %eax,0x4(%rsp)
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
divss  %xmm1,%xmm0
ucomiss 0xe6a(%rip),%xmm0
jbe    11a1 <main+0x81>
lea    0xe68(%rip),%rdi
jmp    11a8 <main+0x88>
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 = [7 x i8] c"\0Aheavy\00"
@.str.2 = [7 x i8] c"\0Alight\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* %3
store i32 0, i32* %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 %23
10: ; preds = %7
%11 = load i32, i32* %2
%12 = srem i32 %11, 10
%13 = sitofp i32 %12 to float
store float %13, float* %5
%14 = load i32, i32* %4
%15 = sitofp i32 %14 to float
%16 = load float, float* %5
%17 = fadd float %15, %16
%18 = fptosi float %17 to i32
store i32 %18, i32* %4
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
%21 = load i32, i32* %2
%22 = sdiv i32 %21, 10
store i32 %22, i32* %2
br label %7
23: ; preds = %7
%24 = load i32, i32* %4
%25 = sitofp i32 %24 to float
%26 = load i32, i32* %3
%27 = sitofp i32 %26 to float
%28 = fdiv float %25, %27
store float %28, float* %5
%29 = load float, float* %5
%30 = fpext float %29 to double
%31 = fcmp ogt double %30, 7.000000e+00
br i1 %31, label %32, label %34
32: ; preds = %23
%33 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %36
34: ; preds = %23
%35 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %36
36: ; preds = %34, %32
ret i32 0
}

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