#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, b = 0, i = 0;
  float a;
  do {
    scanf("%d", &n);
  } while (n < 1 || n > 9999);
  while (n % 10 != 0) {
    b = b + n % 10;
    i++;
    n = n / 10;
  }
  a = (float)b / i;
  if (a > 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    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x15(%rbp)
jl     1169 <main+0x49>
cmpl   $0x270f,-0x8(%rbp)
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    113d <main+0x1d>
jmp    1179 <main+0x59>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11c2 <main+0xa2>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%eax
add    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1179 <main+0x59>
cvtsi2ssl -0xc(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  0xe1e(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11fc <main+0xdc>
lea    0xe15(%rip),%rdi
call   1030 <printf@plt>
jmp    1208 <main+0xe8>
lea    0xe0a(%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    0xee9(%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>
movzwl %ax,%ecx
imul   $0xcccd,%ecx,%edx
shr    $0x12,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%edx
sub    %dx,%cx
je     11e9 <main+0xc9>
movzwl %cx,%ecx
pxor   %xmm0,%xmm0
movaps 0xe8a(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
movd   %ecx,%xmm2
movaps %xmm1,%xmm3
movss  %xmm2,%xmm3
paddd  %xmm3,%xmm0
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdx
add    %esi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ecx
jne    1180 <main+0x60>
mov    %eax,0x4(%rsp)
cvtdq2ps %xmm0,%xmm0
movaps %xmm0,%xmm1
shufps $0x55,%xmm0,%xmm1
divss  %xmm1,%xmm0
ucomiss 0xe32(%rip),%xmm0
jbe    11e9 <main+0xc9>
lea    0xe30(%rip),%rdi
jmp    11f0 <main+0xd0>
lea    0xe2d(%rip),%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 float
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
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 %14, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%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 = %21, %16
%18 = load i32, i32* %2
%19 = srem i32 %18, 10
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %30
21: ; preds = %17
%22 = load i32, i32* %3
%23 = load i32, i32* %2
%24 = srem i32 %23, 10
%25 = add nsw i32 %22, %24
store i32 %25, i32* %3
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
%28 = load i32, i32* %2
%29 = sdiv i32 %28, 10
store i32 %29, i32* %2
br label %17
30: ; preds = %17
%31 = load i32, i32* %3
%32 = sitofp i32 %31 to float
%33 = load i32, i32* %4
%34 = sitofp i32 %33 to float
%35 = fdiv float %32, %34
store float %35, float* %5
%36 = load float, float* %5
%37 = fcmp ogt float %36, 7.000000e+00
br i1 %37, label %38, label %40
38: ; preds = %30
%39 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %42
40: ; preds = %30
%41 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %42
42: ; preds = %40, %38
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
%9 = trunc i32 %5 to i16
%10 = urem i16 %9, 10
%11 = icmp eq i16 %10, 0
br i1 %11, label %29, label %12
12: ; preds = %8
%13 = zext i16 %10 to i32
br label %14
14: ; preds = %12, %14
%15 = phi i32 [ %21, %14 ], [ %13, %12 ]
%16 = phi i32 [ %20, %14 ], [ %5, %12 ]
%17 = phi <2 x i32> [ %19, %14 ], [ zeroinitializer, %12 ]
%18 = insertelement <2 x i32> <i32 poison, i32 1>, i32 %15, i64 0
%19 = add nsw <2 x i32> %17, %18
%20 = sdiv i32 %16, 10
%21 = srem i32 %20, 10
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %14
23: ; preds = %14
store i32 %20, i32* %1
%24 = sitofp <2 x i32> %19 to <2 x float>
%25 = extractelement <2 x float> %24, i64 0
%26 = extractelement <2 x float> %24, i64 1
%27 = fdiv float %25, %26
%28 = fcmp ogt float %27, 7.000000e+00
br i1 %28, label %30, label %29
29: ; preds = %8, %23
br label %30
30: ; preds = %23, %29
%31 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %29 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %23 ]
%32 = call i32 @printf(i8* dereferenceable(1) %31)
ret i32 0
}