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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xebf(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x10(%rbp)
je     1191 <main+0x71>
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114e <main+0x2e>
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xe54(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11c2 <main+0xa2>
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xe31(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11e4 <main+0xc4>
lea    0xe2e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%eax
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
test   %eax,%eax
je     1175 <main+0x55>
xorps  %xmm2,%xmm2
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
lea    (%rax,%rax,1),%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ecx
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
addss  %xmm1,%xmm2
inc    %eax
jne    1140 <main+0x20>
movl   $0x0,(%rsp)
divss  %xmm0,%xmm2
movss  0xe7f(%rip),%xmm0
ucomiss %xmm2,%xmm0
jbe    119e <main+0x7e>
lea    0xe7a(%rip),%rdi
movss  %xmm2,0x4(%rsp)
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm2
ucomiss 0xe5b(%rip),%xmm2
jbe    11b3 <main+0x93>
lea    0xe5f(%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 float
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store float 0.000000e+00, float* %2
store i32 0, i32* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
br label %6
6: ; preds = %9, %0
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load float, float* %2
%11 = load i32, i32* %4
%12 = srem i32 %11, 10
%13 = sitofp i32 %12 to float
%14 = fadd float %10, %13
store float %14, float* %2
%15 = load i32, i32* %4
%16 = sdiv i32 %15, 10
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %6
19: ; preds = %6
%20 = load float, float* %2
%21 = load i32, i32* %3
%22 = sitofp i32 %21 to float
%23 = fdiv float %20, %22
store float %23, float* %2
%24 = load float, float* %2
%25 = fcmp olt float %24, 7.000000e+00
br i1 %25, label %26, label %28
26: ; preds = %19
%27 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %26, %19
%29 = load float, float* %2
%30 = fcmp ogt float %29, 7.000000e+00
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %33
33: ; preds = %31, %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 %16, label %6
6: ; preds = %0, %6
%7 = phi float [ %11, %6 ], [ 0.000000e+00, %0 ]
%8 = phi i32 [ %13, %6 ], [ %4, %0 ]
%9 = srem i32 %8, 10
%10 = sitofp i32 %9 to float
%11 = fadd float %7, %10
%12 = sdiv i32 %8, 10
%13 = add nsw i32 %12, 1
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6
store i32 0, i32* %1
br label %16
16: ; preds = %15, %0
%17 = phi float [ %11, %15 ], [ 0.000000e+00, %0 ]
%18 = fdiv float %17, 0.000000e+00
%19 = fcmp olt float %18, 7.000000e+00
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20, %16
%23 = fcmp ogt float %18, 7.000000e+00
br i1 %23, label %24, label %26
24: ; preds = %22
%25 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %26
26: ; preds = %24, %22
ret i32 0
}