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


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    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1191 <main+0x71>
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%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    114e <main+0x2e>
movss  -0x14(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe54(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jb     11c7 <main+0xa7>
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
jmp    11ee <main+0xce>
movss  -0x10(%rbp),%xmm0
movss  0xe2c(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11e9 <main+0xc9>
lea    0xe2a(%rip),%rdi
call   1030 <printf@plt>
jmp    11ee <main+0xce>
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
je     11b1 <main+0x91>
xor    %ecx,%ecx
xorps  %xmm0,%xmm0
nop
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
xorps  %xmm1,%xmm1
cvtsi2ss %edi,%xmm1
addss  %xmm1,%xmm0
add    $0x1,%ecx
add    $0x9,%edx
cmp    $0x12,%edx
ja     1140 <main+0x20>
mov    %eax,0x4(%rsp)
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
divss  %xmm1,%xmm0
movss  0xe72(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11a5 <main+0x85>
ucomiss 0xe66(%rip),%xmm0
jbe    11b1 <main+0x91>
lea    0xe64(%rip),%rdi
jmp    11ac <main+0x8c>
lea    0xe61(%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"light\0A\00"
@.str.2 = [7 x i8] c"heavy\0A\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 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 float, float* %5
%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* %5
%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* %5
%22 = load i32, i32* %3
%23 = sitofp i32 %22 to float
%24 = fdiv float %21, %23
store float %24, float* %4
%25 = load float, float* %4
%26 = fcmp ole float %25, 7.000000e+00
br i1 %26, label %27, label %29
27: ; preds = %20
%28 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %35
29: ; preds = %20
%30 = load float, float* %4
%31 = fcmp ogt float %30, 7.000000e+00
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %34
34: ; preds = %32, %29
br label %35
35: ; preds = %34, %27
ret i32 0
}

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