#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 a, i = 0;
  float avr = 0;
  do {
    scanf("%d", &a);
  } while (a <= 0 || a > 9999);
  while (a > 0) {
    avr = avr + a % 10;
    a = a / 10;
    i++;
  }
  if (avr / i < 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,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jle    116a <main+0x4a>
cmpl   $0x270f,-0x8(%rbp)
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    113e <main+0x1e>
jmp    117a <main+0x5a>
cmpl   $0x0,-0x8(%rbp)
jle    11bd <main+0x9d>
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%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    117a <main+0x5a>
movss  -0x10(%rbp),%xmm1
cvtsi2ssl -0xc(%rbp),%xmm0
divss  %xmm0,%xmm1
movss  0xe2d(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    11ed <main+0xcd>
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
jmp    11f9 <main+0xd9>
lea    0xe19(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed9(%rip),%r14
lea    0x4(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x2710(%rax),%ecx
cmp    $0xffffd8f1,%ecx
jb     1130 <main+0x10>
xor    %ecx,%ecx
xorps  %xmm0,%xmm0
mov    $0xcccccccd,%edx
nopw   0x0(%rax,%rax,1)
mov    %eax,%ebx
mov    %eax,%eax
imul   %rdx,%rax
shr    $0x23,%rax
lea    (%rax,%rax,1),%edi
lea    (%rdi,%rdi,4),%edi
mov    %ebx,%esi
sub    %edi,%esi
xorps  %xmm1,%xmm1
cvtsi2ss %esi,%xmm1
addss  %xmm1,%xmm0
add    $0x1,%ecx
cmp    $0x9,%ebx
ja     1160 <main+0x40>
mov    %eax,0x4(%rsp)
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
divss  %xmm1,%xmm0
movss  0xe60(%rip),%xmm1
ucomiss %xmm0,%xmm1
lea    0xe5d(%rip),%rax
lea    0xe5c(%rip),%rdi
cmova  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
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 float
store i32 0, i32* %1
store i32 0, i32* %3
store float 0.000000e+00, float* %4
br label %5
5: ; preds = %13, %0
%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 = %5
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 9999
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ true, %7 ], [ %12, %10 ]
br i1 %14, label %5, label %15
15: ; preds = %13
br label %16
16: ; preds = %19, %15
%17 = load i32, i32* %2
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %29
19: ; preds = %16
%20 = load float, float* %4
%21 = load i32, i32* %2
%22 = srem i32 %21, 10
%23 = sitofp i32 %22 to float
%24 = fadd float %20, %23
store float %24, float* %4
%25 = load i32, i32* %2
%26 = sdiv i32 %25, 10
store i32 %26, i32* %2
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %16
29: ; preds = %16
%30 = load float, float* %4
%31 = load i32, i32* %3
%32 = sitofp i32 %31 to float
%33 = fdiv float %30, %32
%34 = fcmp olt float %33, 7.000000e+00
br i1 %34, label %35, label %37
35: ; preds = %29
%36 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %39
37: ; preds = %29
%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*
br label %3
3: ; preds = %3, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add i32 %5, -10000
%7 = icmp ult i32 %6, -9999
br i1 %7, label %3, label %8
8: ; preds = %3, %8
%9 = phi float [ %14, %8 ], [ 0.000000e+00, %3 ]
%10 = phi i32 [ %16, %8 ], [ 0, %3 ]
%11 = phi i32 [ %15, %8 ], [ %5, %3 ]
%12 = urem i32 %11, 10
%13 = sitofp i32 %12 to float
%14 = fadd float %9, %13
%15 = udiv i32 %11, 10
%16 = add nuw nsw i32 %10, 1
%17 = icmp ult i32 %11, 10
br i1 %17, label %18, label %8
18: ; preds = %8
store i32 %15, i32* %1
%19 = sitofp i32 %16 to float
%20 = fdiv float %14, %19
%21 = fcmp olt float %20, 7.000000e+00
%22 = select i1 %21, 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)
%23 = call i32 @printf(i8* dereferenceable(1) %22)
ret i32 0
}