#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, b, c, i = 0, d;
  scanf("%d", &a);
  b = a;
  while (b > 0) {
    c = b % 10;
    b = b / 10;
    d = d + c;
    i++;
  }
  d = d / i;
  if (d > 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,-0x14(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1189 <main+0x69>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <main+0x2c>
mov    -0x18(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,-0x18(%rbp)
cmpl   $0x7,-0x18(%rbp)
jle    11ae <main+0x8e>
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
jmp    11ba <main+0x9a>
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ecx
test   %ecx,%ecx
jle    118c <main+0x6c>
xor    %r9d,%r9d
mov    $0xcccccccd,%r8d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ecx,%edi
imul   %r8,%rdi
shr    $0x23,%rdi
lea    (%rdi,%rdi,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %ecx,%edx
sub    %esi,%edx
add    %edx,%eax
add    $0x1,%r9d
cmp    $0x9,%ecx
mov    %edi,%ecx
ja     1150 <main+0x30>
cltd
idiv   %r9d
cmp    $0x8,%eax
lea    0xe84(%rip),%rax
lea    0xe83(%rip),%rdi
cmovge %rax,%rdi
jmp    1193 <main+0x73>
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
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
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
store i32 %8, i32* %3
br label %9
9: ; preds = %12, %0
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load i32, i32* %3
%14 = srem i32 %13, 10
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = sdiv i32 %15, 10
store i32 %16, i32* %3
%17 = load i32, i32* %6
%18 = load i32, i32* %4
%19 = add nsw i32 %17, %18
store i32 %19, i32* %6
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %9
22: ; preds = %9
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = sdiv i32 %23, %24
store i32 %25, i32* %6
%26 = load i32, i32* %6
%27 = icmp sgt i32 %26, 7
br i1 %27, label %28, label %30
28: ; preds = %22
%29 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %32
30: ; preds = %22
%31 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %32
32: ; preds = %30, %28
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*
%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 sgt i32 %4, 0
br i1 %5, label %6, label %19
6: ; preds = %0, %6
%7 = phi i32 [ %12, %6 ], [ undef, %0 ]
%8 = phi i32 [ %13, %6 ], [ 0, %0 ]
%9 = phi i32 [ %11, %6 ], [ %4, %0 ]
%10 = urem i32 %9, 10
%11 = udiv i32 %9, 10
%12 = add nsw i32 %7, %10
%13 = add nuw nsw i32 %8, 1
%14 = icmp ult i32 %9, 10
br i1 %14, label %15, label %6
15: ; preds = %6
%16 = sdiv i32 %12, %13
%17 = icmp sgt i32 %16, 7
%18 = select i1 %17, 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)
br label %19
19: ; preds = %15, %0
%20 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %0 ], [ %18, %15 ]
%21 = call i32 @printf(i8* dereferenceable(1) %20)
ret i32 0
}