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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec7(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1179 <main+0x59>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1153 <main+0x33>
jmp    117e <main+0x5e>
cmpl   $0x0,-0xc(%rbp)
jle    11b4 <main+0x94>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    117e <main+0x5e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xe34(%rip),%xmm0
ucomiss -0x18(%rbp),%xmm0
jbe    11e7 <main+0xc7>
lea    0xe2a(%rip),%rdi
call   1030 <printf@plt>
jmp    11f3 <main+0xd3>
lea    0xe1f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
xor    %ecx,%ecx
test   %edx,%edx
jle    1196 <main+0x76>
mov    $0xcccccccd,%eax
mov    %edx,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %esi,%edi
imul   %rax,%rdi
shr    $0x23,%rdi
add    $0x1,%ecx
cmp    $0x9,%esi
mov    %edi,%esi
ja     1150 <main+0x30>
xor    %eax,%eax
test   %edx,%edx
jle    1198 <main+0x78>
mov    $0xcccccccd,%r8d
mov    %edx,%r9d
mov    %edx,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %r9d,%edi
sub    %esi,%edi
add    %edi,%eax
cmp    $0x9,%r9d
ja     1170 <main+0x50>
mov    %edx,0x4(%rsp)
jmp    1198 <main+0x78>
xor    %eax,%eax
xor    %edx,%edx
div    %ecx
cmp    $0x7,%eax
lea    0xe5d(%rip),%rax
lea    0xe5c(%rip),%rdi
cmovb  %rax,%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"light\00"
@.str.2 = [6 x i8] c"heavy\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 0, i32* %1
store i32 0, i32* %2
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
store i32 %8, i32* %4
store i32 0, i32* %5
br label %9
9: ; preds = %12, %0
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i32, i32* %4
%14 = sdiv i32 %13, 10
store i32 %14, i32* %4
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %9
17: ; preds = %9
br label %18
18: ; preds = %21, %17
%19 = load i32, i32* %3
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = srem i32 %23, 10
%25 = add nsw i32 %22, %24
store i32 %25, i32* %2
%26 = load i32, i32* %3
%27 = sdiv i32 %26, 10
store i32 %27, i32* %3
br label %18
28: ; preds = %18
%29 = load i32, i32* %2
%30 = load i32, i32* %5
%31 = sdiv i32 %29, %30
%32 = sitofp i32 %31 to float
store float %32, float* %6
%33 = load float, float* %6
%34 = fcmp olt float %33, 7.000000e+00
br i1 %34, label %35, label %37
35: ; preds = %28
%36 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %39
37: ; preds = %28
%38 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %39
39: ; preds = %37, %35
ret i32 0
}

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