#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, i, sum;
  float avr;
  i = 0;
  sum = 0;
  do {
    scanf("%d", &n);
  } while (n < 1 || n > 9999);
  while (n > 0) {
    sum = sum + n % 10;
    i++;
    n = n / 10;
  }
  avr = (float)sum / i;
  if (avr > 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>
cmpl   $0x0,-0x8(%rbp)
jle    11b8 <main+0x98>
mov    -0x10(%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,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1179 <main+0x59>
cvtsi2ssl -0x10(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  0xe28(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11f2 <main+0xd2>
lea    0xe1f(%rip),%rdi
call   1030 <printf@plt>
jmp    11fe <main+0xde>
lea    0xe14(%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>
pxor   %xmm0,%xmm0
mov    $0xcccccccd,%ecx
movaps 0xea3(%rip),%xmm1
nopl   (%rax)
mov    %eax,%edx
mov    %eax,%eax
imul   %rcx,%rax
shr    $0x23,%rax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edx,%edi
sub    %esi,%edi
movd   %edi,%xmm2
movaps %xmm1,%xmm3
movss  %xmm2,%xmm3
paddd  %xmm3,%xmm0
cmp    $0x9,%edx
ja     1160 <main+0x40>
mov    %eax,0x4(%rsp)
cvtdq2ps %xmm0,%xmm0
movaps %xmm0,%xmm1
shufps $0x55,%xmm0,%xmm1
divss  %xmm1,%xmm0
ucomiss 0xe6d(%rip),%xmm0
lea    0xe6d(%rip),%rax
lea    0xe6c(%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"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 = %20, %16
%18 = load i32, i32* %2
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %29
20: ; preds = %17
%21 = load i32, i32* %4
%22 = load i32, i32* %2
%23 = srem i32 %22, 10
%24 = add nsw i32 %21, %23
store i32 %24, i32* %4
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
%27 = load i32, i32* %2
%28 = sdiv i32 %27, 10
store i32 %28, i32* %2
br label %17
29: ; preds = %17
%30 = load i32, i32* %4
%31 = sitofp i32 %30 to float
%32 = load i32, i32* %3
%33 = sitofp i32 %32 to float
%34 = fdiv float %31, %33
store float %34, float* %5
%35 = load float, float* %5
%36 = fcmp ogt float %35, 7.000000e+00
br i1 %36, label %37, label %39
37: ; preds = %29
%38 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %41
39: ; preds = %29
%40 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %41
41: ; preds = %39, %37
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 [ %14, %8 ], [ %5, %3 ]
%10 = phi <2 x i32> [ %13, %8 ], [ zeroinitializer, %3 ]
%11 = urem i32 %9, 10
%12 = insertelement <2 x i32> <i32 poison, i32 1>, i32 %11, i64 0
%13 = add nuw nsw <2 x i32> %10, %12
%14 = udiv i32 %9, 10
%15 = icmp ult i32 %9, 10
br i1 %15, label %16, label %8
16: ; preds = %8
store i32 %14, i32* %1
%17 = sitofp <2 x i32> %13 to <2 x float>
%18 = extractelement <2 x float> %17, i64 0
%19 = extractelement <2 x float> %17, i64 1
%20 = fdiv float %18, %19
%21 = fcmp ogt 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
}