#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, n;
  float sum;
  i = 0;
  sum = 0;
  float avr;
  avr = 0.00;
  float a[80];
  scanf("%d/n", &n);
  for (; n != 0; i++) {
    a[i] = n % 10;
    sum = sum + a[i];
    n = n / 10;
  }
  avr = sum / i;
  if (avr >= 7) {
    printf("heavy");
  } else {
    printf("light");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xeb4(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
je     11b2 <main+0x92>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm0
movslq -0x8(%rbp),%rax
movss  %xmm0,-0x160(%rbp,%rax,4)
ff ff
movss  -0x10(%rbp),%xmm0
movslq -0x8(%rbp),%rax
addss  -0x160(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1159 <main+0x39>
movss  -0x10(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  0xe2e(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     11ec <main+0xcc>
lea    0xe27(%rip),%rdi
call   1030 <printf@plt>
jmp    11f8 <main+0xd8>
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
je     118f <main+0x6f>
xor    %ecx,%ecx
xorps  %xmm0,%xmm0
nop
movslq %eax,%rdx
imul   $0x66666667,%rdx,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rax
add    %esi,%eax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edx,%edi
sub    %esi,%edi
xorps  %xmm1,%xmm1
cvtsi2ss %edi,%xmm1
addss  %xmm1,%xmm0
add    $0x1,%ecx
add    $0x9,%edx
cmp    $0x12,%edx
ja     1140 <main+0x20>
mov    %eax,0x4(%rsp)
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
divss  %xmm1,%xmm0
ucomiss 0xe73(%rip),%xmm0
jae    1198 <main+0x78>
lea    0xe79(%rip),%rdi
jmp    119f <main+0x7f>
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d/n\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 float
%5 = alloca float
%6 = alloca [80 x float]
store i32 0, i32* %1
store i32 0, i32* %2
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %5
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %8
8: ; preds = %26, %0
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %29
11: ; preds = %8
%12 = load i32, i32* %3
%13 = srem i32 %12, 10
%14 = sitofp i32 %13 to float
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [80 x float], [80 x float]* %6, i64 0, i64 %16
store float %14, float* %17
%18 = load float, float* %4
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [80 x float], [80 x float]* %6, i64 0, i64 %20
%22 = load float, float* %21
%23 = fadd float %18, %22
store float %23, float* %4
%24 = load i32, i32* %3
%25 = sdiv i32 %24, 10
store i32 %25, i32* %3
br label %26
26: ; preds = %11
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
store i32 %28, i32* %2
br label %8
29: ; preds = %8
%30 = load float, float* %4
%31 = load i32, i32* %2
%32 = sitofp i32 %31 to float
%33 = fdiv float %30, %32
store float %33, float* %5
%34 = load float, float* %5
%35 = fcmp oge float %34, 7.000000e+00
br i1 %35, label %36, label %38
36: ; preds = %29
%37 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %40
38: ; preds = %29
%39 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %40
40: ; preds = %38, %36
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d/n\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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %21, label %6
6: ; preds = %0, %6
%7 = phi float [ %12, %6 ], [ 0.000000e+00, %0 ]
%8 = phi i32 [ %14, %6 ], [ 0, %0 ]
%9 = phi i32 [ %13, %6 ], [ %4, %0 ]
%10 = srem i32 %9, 10
%11 = sitofp i32 %10 to float
%12 = fadd float %7, %11
%13 = sdiv i32 %9, 10
%14 = add nuw nsw i32 %8, 1
%15 = add i32 %9, 9
%16 = icmp ult i32 %15, 19
br i1 %16, label %17, label %6
17: ; preds = %6
store i32 %13, i32* %1
%18 = sitofp i32 %14 to float
%19 = fdiv float %12, %18
%20 = fcmp ult float %19, 7.000000e+00
br i1 %20, label %21, label %22
21: ; preds = %0, %17
br label %22
22: ; preds = %17, %21
%23 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %21 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %17 ]
%24 = call i32 @printf(i8* dereferenceable(1) %23)
ret i32 0
}