#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 i, j = 0, number, sum = 0;
  do {
    scanf("%d", &number);
  } while (number < 1 || number > 9999);
  while (number > 0) {
    i = number % 10;
    sum += i;
    number /= 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,-0x14(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x1,-0x10(%rbp)
mov    %al,-0x15(%rbp)
jl     1169 <main+0x49>
cmpl   $0x270f,-0x10(%rbp)
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    113d <main+0x1d>
jmp    1179 <main+0x59>
cmpl   $0x0,-0x10(%rbp)
jle    11b6 <main+0x96>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1179 <main+0x59>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x7,%eax
jl     11d7 <main+0xb7>
lea    0xe36(%rip),%rdi
call   1030 <printf@plt>
jmp    11e3 <main+0xc3>
lea    0xe2b(%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    %eax,%eax
mov    $0xcccccccd,%r8d
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
mov    %ecx,%edx
mov    %ecx,%ecx
imul   %r8,%rcx
shr    $0x23,%rcx
lea    (%rcx,%rcx,1),%ebx
lea    (%rbx,%rbx,4),%ebx
mov    %edx,%edi
sub    %ebx,%edi
add    %edi,%eax
add    $0x1,%esi
cmp    $0x9,%edx
ja     1160 <main+0x40>
mov    %ecx,0x4(%rsp)
xor    %edx,%edx
div    %esi
cmp    $0x7,%eax
lea    0xe71(%rip),%rax
lea    0xe70(%rip),%rdi
cmovae %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
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %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* %4)
br label %8
8: ; preds = %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 1
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %4
%13 = icmp sgt i32 %12, 9999
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ true, %8 ], [ %13, %11 ]
br i1 %15, label %6, label %16
16: ; preds = %14
br label %17
17: ; preds = %20, %16
%18 = load i32, i32* %4
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %30
20: ; preds = %17
%21 = load i32, i32* %4
%22 = srem i32 %21, 10
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = load i32, i32* %5
%25 = add nsw i32 %24, %23
store i32 %25, i32* %5
%26 = load i32, i32* %4
%27 = sdiv i32 %26, 10
store i32 %27, i32* %4
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %17
30: ; preds = %17
%31 = load i32, i32* %5
%32 = load i32, i32* %3
%33 = sdiv i32 %31, %32
%34 = icmp sge i32 %33, 7
br i1 %34, label %35, label %37
35: ; preds = %30
%36 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %39
37: ; preds = %30
%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"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 [ %13, %8 ], [ 0, %3 ]
%10 = phi i32 [ %15, %8 ], [ 0, %3 ]
%11 = phi i32 [ %14, %8 ], [ %5, %3 ]
%12 = urem i32 %11, 10
%13 = add nuw nsw i32 %9, %12
%14 = udiv i32 %11, 10
%15 = add nuw nsw i32 %10, 1
%16 = icmp ult i32 %11, 10
br i1 %16, label %17, label %8
17: ; preds = %8
store i32 %14, i32* %1
%18 = udiv i32 %13, %15
%19 = icmp ugt i32 %18, 6
%20 = select i1 %19, 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)
%21 = call i32 @printf(i8* dereferenceable(1) %20)
ret i32 0
}