#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 radka, s, t, i;
  i = 0;
  s = 0;
  float avr;
  scanf("%d", &t);
  while (t != 0) {
    i = i + 1;
    radka = t % 10;
    s = s + radka;
    t = t / 10;
  }
  avr = s / i;
  if (avr <= 7) {
    printf("light");
  } else {
    printf("heavy");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x10(%rbp)
je     118a <main+0x6a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
jmp    114d <main+0x2d>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xe5e(%rip),%xmm0
ucomiss -0x18(%rbp),%xmm0
jb     11bd <main+0x9d>
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
jmp    11c9 <main+0xa9>
lea    0xe49(%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
je     118e <main+0x6e>
xor    %eax,%eax
xor    %esi,%esi
xchg   %ax,%ax
add    $0x1,%esi
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),%r8d
mov    %edx,%edi
sub    %r8d,%edi
add    %edi,%eax
add    $0x9,%edx
cmp    $0x12,%edx
ja     1140 <main+0x20>
mov    %ecx,0x4(%rsp)
cltd
idiv   %esi
cmp    $0x8,%eax
lea    0xe82(%rip),%rax
lea    0xe81(%rip),%rdi
cmovl  %rax,%rdi
jmp    1195 <main+0x75>
lea    0xe6e(%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"light\00"
@.str.2 = [6 x i8] c"heavy\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 0, i32* %1
store i32 0, i32* %5
store i32 0, i32* %3
%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 = %11, %0
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
%14 = load i32, i32* %4
%15 = srem i32 %14, 10
store i32 %15, i32* %2
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = add nsw i32 %16, %17
store i32 %18, i32* %3
%19 = load i32, i32* %4
%20 = sdiv i32 %19, 10
store i32 %20, i32* %4
br label %8
21: ; preds = %8
%22 = load i32, i32* %3
%23 = load i32, i32* %5
%24 = sdiv i32 %22, %23
%25 = sitofp i32 %24 to float
store float %25, float* %6
%26 = load float, float* %6
%27 = fcmp ole float %26, 7.000000e+00
br i1 %27, label %28, label %30
28: ; preds = %21
%29 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %32
30: ; preds = %21
%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"light\00"
@.str.2 = [6 x i8] c"heavy\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 eq i32 %4, 0
br i1 %5, label %20, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %12, %6 ], [ 0, %0 ]
%8 = phi i32 [ %10, %6 ], [ 0, %0 ]
%9 = phi i32 [ %13, %6 ], [ %4, %0 ]
%10 = add nuw nsw i32 %8, 1
%11 = srem i32 %9, 10
%12 = add nsw i32 %7, %11
%13 = sdiv i32 %9, 10
%14 = add i32 %9, 9
%15 = icmp ult i32 %14, 19
br i1 %15, label %16, label %6
16: ; preds = %6
store i32 %13, i32* %1
%17 = sdiv i32 %12, %10
%18 = icmp slt i32 %17, 8
%19 = select i1 %18, 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 %20
20: ; preds = %16, %0
%21 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %0 ], [ %19, %16 ]
%22 = call i32 @printf(i8* dereferenceable(1) %21)
ret i32 0
}