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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1194 <main+0x74>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
movss  0xe8d(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    114e <main+0x2e>
cvtsi2ssl -0xc(%rbp),%xmm0
divss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  0xe50(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11ca <main+0xaa>
lea    0xe4b(%rip),%rdi
call   1030 <printf@plt>
jmp    11d6 <main+0xb6>
lea    0xe40(%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
je     11a0 <main+0x80>
xor    %ecx,%ecx
xorps  %xmm0,%xmm0
movss  0xeb9(%rip),%xmm1
nopw   0x0(%rax,%rax,1)
movslq %eax,%rdx
imul   $0x66666667,%rdx,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rax
add    %esi,%eax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edx,%edi
sub    %esi,%edi
add    %edi,%ecx
addss  %xmm1,%xmm0
add    $0x9,%edx
cmp    $0x12,%edx
ja     1150 <main+0x30>
mov    %eax,0x4(%rsp)
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
divss  %xmm0,%xmm1
ucomiss 0xe6f(%rip),%xmm1
jbe    11a0 <main+0x80>
lea    0xe6d(%rip),%rdi
jmp    11a7 <main+0x87>
lea    0xe6a(%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 i32
%5 = alloca float
store i32 0, i32* %1
store i32 0, i32* %3
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 ne i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i32, i32* %2
%12 = srem i32 %11, 10
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
store i32 %15, i32* %3
%16 = load float, float* %5
%17 = fadd float %16, 1.000000e+00
store float %17, float* %5
%18 = load i32, i32* %2
%19 = sdiv i32 %18, 10
store i32 %19, i32* %2
br label %7
20: ; preds = %7
%21 = load i32, i32* %3
%22 = sitofp i32 %21 to float
%23 = load float, float* %5
%24 = fdiv float %22, %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 = %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
%32 = load i32, i32* %1
ret i32 %32
}

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 eq i32 %4, 0
br i1 %5, label %20, label %6
6: ; preds = %0, %6
%7 = phi float [ %12, %6 ], [ 0.000000e+00, %0 ]
%8 = phi i32 [ %11, %6 ], [ 0, %0 ]
%9 = phi i32 [ %13, %6 ], [ %4, %0 ]
%10 = srem i32 %9, 10
%11 = add nsw i32 %8, %10
%12 = fadd float %7, 1.000000e+00
%13 = sdiv i32 %9, 10
%14 = add i32 %9, 9
%15 = icmp ult i32 %14, 19
br i1 %15, label %16, label %6
16: ; preds = %6
store i32 %13, i32* %1
%17 = sitofp i32 %11 to float
%18 = fdiv float %17, %12
%19 = fcmp ogt float %18, 7.000000e+00
br i1 %19, label %21, label %20
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
}