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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jl     116a <main+0x4a>
cmpl   $0x2710,-0x8(%rbp)
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    113e <main+0x1e>
jmp    117a <main+0x5a>
cmpl   $0x0,-0x8(%rbp)
je     11bd <main+0x9d>
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117a <main+0x5a>
movss  -0x10(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe28(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11f3 <main+0xd3>
lea    0xe1e(%rip),%rdi
call   1030 <printf@plt>
jmp    11ff <main+0xdf>
lea    0xe13(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed9(%rip),%r14
lea    0x4(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x2711(%rax),%ecx
cmp    $0xffffd8f0,%ecx
jb     1130 <main+0x10>
xor    %ecx,%ecx
xorps  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
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     1160 <main+0x40>
mov    %eax,0x4(%rsp)
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
divss  %xmm1,%xmm0
movss  0xe52(%rip),%xmm1
ucomiss %xmm0,%xmm1
lea    0xe4f(%rip),%rax
lea    0xe4e(%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"light\00"
@.str.2 = [6 x i8] c"heavy\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %4
store i32 0, i32* %3
br label %5
5: ; preds = %13, %0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %7
7: ; preds = %5
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 1
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 10000
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ true, %7 ], [ %12, %10 ]
br i1 %14, label %5, label %15
15: ; preds = %13
br label %16
16: ; preds = %19, %15
%17 = load i32, i32* %2
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %29
19: ; preds = %16
%20 = load float, float* %4
%21 = load i32, i32* %2
%22 = srem i32 %21, 10
%23 = sitofp i32 %22 to float
%24 = fadd float %20, %23
store float %24, float* %4
%25 = load i32, i32* %2
%26 = sdiv i32 %25, 10
store i32 %26, i32* %2
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %16
29: ; preds = %16
%30 = load float, float* %4
%31 = load i32, i32* %3
%32 = sitofp i32 %31 to float
%33 = fdiv float %30, %32
store float %33, float* %4
%34 = load float, float* %4
%35 = fcmp olt 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
%41 = load i32, i32* %1
ret i32 %41
}

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*
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, -10001
%7 = icmp ult i32 %6, -10000
br i1 %7, label %3, label %8
8: ; preds = %3, %8
%9 = phi float [ %14, %8 ], [ 0.000000e+00, %3 ]
%10 = phi i32 [ %16, %8 ], [ 0, %3 ]
%11 = phi i32 [ %15, %8 ], [ %5, %3 ]
%12 = srem i32 %11, 10
%13 = sitofp i32 %12 to float
%14 = fadd float %9, %13
%15 = sdiv i32 %11, 10
%16 = add nuw nsw i32 %10, 1
%17 = add i32 %11, 9
%18 = icmp ult i32 %17, 19
br i1 %18, label %19, label %8
19: ; preds = %8
store i32 %15, i32* %1
%20 = sitofp i32 %16 to float
%21 = fdiv float %14, %20
%22 = fcmp olt float %21, 7.000000e+00
%23 = select i1 %22, 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)
%24 = call i32 @printf(i8* dereferenceable(1) %23)
ret i32 0
}