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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x15(%rbp)
jge    1163 <main+0x43>
cmpl   $0x270f,-0x8(%rbp)
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1137 <main+0x17>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     11c2 <main+0xa2>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
cvtsi2ssl -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%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    1175 <main+0x55>
movss  -0x14(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe23(%rip),%xmm0
ucomiss -0x14(%rbp),%xmm0
jbe    11f8 <main+0xd8>
lea    0xe19(%rip),%rdi
call   1030 <printf@plt>
jmp    1204 <main+0xe4>
lea    0xe0f(%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),%r8d
lea    0x9(%r8),%eax
cmp    $0x13,%eax
jb     11b1 <main+0x91>
xor    %eax,%eax
xorps  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
nop
movslq %r8d,%rdx
imul   $0x66666667,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rsi
lea    (%rsi,%rdi,1),%r8d
lea    (%r8,%r8,1),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%edx
xorps  %xmm1,%xmm1
cvtsi2ss %edx,%xmm1
addss  %xmm1,%xmm0
add    $0x1,%eax
lea    (%rsi,%rdi,1),%ecx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1150 <main+0x30>
mov    %r8d,0x4(%rsp)
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  0xe5d(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11b1 <main+0x91>
lea    0xe5e(%rip),%rdi
jmp    11b8 <main+0x98>
lea    0xe4f(%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 i32
%5 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %5
br label %6
6: ; preds = %14, %0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 9999
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br i1 %15, label %6, label %16
16: ; preds = %14
store i32 0, i32* %3
br label %17
17: ; preds = %30, %16
%18 = load i32, i32* %2
%19 = sdiv i32 %18, 10
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %33
21: ; preds = %17
%22 = load i32, i32* %2
%23 = srem i32 %22, 10
store i32 %23, i32* %4
%24 = load i32, i32* %4
%25 = sitofp i32 %24 to float
%26 = load float, float* %5
%27 = fadd float %26, %25
store float %27, float* %5
%28 = load i32, i32* %2
%29 = sdiv i32 %28, 10
store i32 %29, i32* %2
br label %30
30: ; preds = %21
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %17
33: ; preds = %17
%34 = load float, float* %5
%35 = load i32, i32* %3
%36 = sitofp i32 %35 to float
%37 = fdiv float %34, %36
store float %37, float* %5
%38 = load float, float* %5
%39 = fcmp olt float %38, 7.000000e+00
br i1 %39, label %40, label %42
40: ; preds = %33
%41 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %44
42: ; preds = %33
%43 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %44
44: ; preds = %42, %40
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 = add i32 %4, 9
%6 = icmp ult i32 %5, 19
br i1 %6, label %22, label %7
7: ; preds = %0, %7
%8 = phi float [ %14, %7 ], [ 0.000000e+00, %0 ]
%9 = phi i32 [ %15, %7 ], [ 0, %0 ]
%10 = phi i32 [ %11, %7 ], [ %4, %0 ]
%11 = sdiv i32 %10, 10
%12 = srem i32 %10, 10
%13 = sitofp i32 %12 to float
%14 = fadd float %8, %13
%15 = add nuw nsw i32 %9, 1
%16 = add nsw i32 %11, 9
%17 = icmp ult i32 %16, 19
br i1 %17, label %18, label %7
18: ; preds = %7
store i32 %11, i32* %1
%19 = sitofp i32 %15 to float
%20 = fdiv float %14, %19
%21 = fcmp olt 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 ([6 x i8], [6 x i8]* @str, i64 0, i64 0), %22 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0), %18 ]
%25 = call i32 @puts(i8* dereferenceable(1) %24)
ret i32 0
}