#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 num, sum = 0, j = 0;
  do {
    scanf("%d", &num);
  } while (num <= 0 || num >= 10000);
  while (num != 0) {
    sum = sum + num % 10;
    num = num / 10;
    j++;
  }
  if (sum / j > 7) {
    printf("heavy");
  } else {
    printf("light");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jle    1169 <main+0x49>
cmpl   $0x2710,-0x8(%rbp)
setge  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    113d <main+0x1d>
jmp    1179 <main+0x59>
cmpl   $0x0,-0x8(%rbp)
je     11b8 <main+0x98>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%eax
add    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1179 <main+0x59>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x7,%eax
jle    11d9 <main+0xb9>
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
jmp    11e5 <main+0xc5>
lea    0xe29(%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    0xed5(%rip),%r14
lea    0x4(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ecx
lea    -0x2710(%rcx),%eax
cmp    $0xffffd8f1,%eax
jb     1130 <main+0x10>
xor    %esi,%esi
xor    %eax,%eax
movslq %ecx,%rdx
imul   $0x66666667,%rdx,%rcx
mov    %rcx,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rcx
add    %edi,%ecx
lea    (%rcx,%rcx,1),%edi
lea    (%rdi,%rdi,4),%edi
mov    %edx,%ebx
sub    %edi,%ebx
add    %ebx,%eax
add    $0x1,%esi
add    $0x9,%edx
cmp    $0x12,%edx
ja     1150 <main+0x30>
mov    %ecx,0x4(%rsp)
cltd
idiv   %esi
cmp    $0x8,%eax
lea    0xe74(%rip),%rax
lea    0xe73(%rip),%rdi
cmovge %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"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
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %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 sge i32 %11, 10000
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 ne i32 %17, 0
br i1 %18, label %19, label %28
19: ; preds = %16
%20 = load i32, i32* %3
%21 = load i32, i32* %2
%22 = srem i32 %21, 10
%23 = add nsw i32 %20, %22
store i32 %23, i32* %3
%24 = load i32, i32* %2
%25 = sdiv i32 %24, 10
store i32 %25, i32* %2
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %16
28: ; preds = %16
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = sdiv i32 %29, %30
%32 = icmp sgt i32 %31, 7
br i1 %32, label %33, label %35
33: ; preds = %28
%34 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %37
35: ; preds = %28
%36 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %37
37: ; preds = %35, %33
ret i32 0
}

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*
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 i32 [ %15, %8 ], [ 0, %3 ]
%10 = phi i32 [ %13, %8 ], [ 0, %3 ]
%11 = phi i32 [ %14, %8 ], [ %5, %3 ]
%12 = srem i32 %11, 10
%13 = add nsw i32 %10, %12
%14 = sdiv i32 %11, 10
%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 %8
18: ; preds = %8
store i32 %14, i32* %1
%19 = sdiv i32 %13, %15
%20 = icmp sgt i32 %19, 7
%21 = select i1 %20, 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)
%22 = call i32 @printf(i8* dereferenceable(1) %21)
ret i32 0
}