#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 scanf(char *, int *);
main() {
  int peso = 0, alumnos[91];
  int peso_bien = 0, peso_mal = 0, temp;
  for (temp = 0; temp < 91; temp++)
    alumnos[temp] = 0;
  printf("\nEscriba los pesos de los alumnos separados por espacios.\n"
         "Cuando haya terminado escriba \"fin\" y pulse [Entrar]:\n");
  while (scanf("%d", &peso) == 1) {
    if (peso < 10 || peso > 100) {
      peso_mal++;
      continue;
    }
    alumnos[peso - 10]++;
  }
  printf("\nPeso  Número de alumnos\n"
         "-----------------------");
  for (peso = 10; peso <= 100; peso++) {
    if (alumnos[peso - 10] != 0) {
      printf("\n%3d   ", peso);
      for (temp = alumnos[peso - 10]; temp > 0; temp--) {
        printf("*");
        peso_bien++;
      }
    }
  }
  printf("\n\nNúmero de pesos correctos: %d\n", peso_bien);
  printf("Número de pesos erróneos: %d\n", peso_mal);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x184(%rbp)
movl   $0x0,-0x188(%rbp)
movl   $0x0,-0x18c(%rbp)
cmpl   $0x5b,-0x18c(%rbp)
jge    118a <main+0x6a>
movslq -0x18c(%rbp),%rax
movl   $0x0,-0x180(%rbp,%rax,4)
mov    -0x18c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18c(%rbp)
jmp    1157 <main+0x37>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11f7 <main+0xd7>
cmpl   $0xa,-0x8(%rbp)
jl     11c5 <main+0xa5>
cmpl   $0x64,-0x8(%rbp)
jle    11d9 <main+0xb9>
mov    -0x188(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x188(%rbp)
jmp    1198 <main+0x78>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
cltq
mov    -0x180(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x180(%rbp,%rax,4)
jmp    1198 <main+0x78>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xa,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     12a8 <main+0x188>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
cltq
cmpl   $0x0,-0x180(%rbp,%rax,4)
je     1295 <main+0x175>
mov    -0x8(%rbp),%esi
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
cltq
mov    -0x180(%rbp,%rax,4),%eax
mov    %eax,-0x18c(%rbp)
cmpl   $0x0,-0x18c(%rbp)
jle    1290 <main+0x170>
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x184(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x184(%rbp)
mov    -0x18c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18c(%rbp)
jmp    1252 <main+0x132>
jmp    1295 <main+0x175>
jmp    129a <main+0x17a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    120c <main+0xec>
mov    -0x184(%rbp),%esi
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x188(%rbp),%esi
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x180,%rsp
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x16c,%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    0xf00(%rip),%rdi
call   1040 <puts@plt>
lea    0xe75(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
mov    $0x0,%r14d
cmp    $0x1,%eax
jne    11dc <main+0x8c>
xor    %r14d,%r14d
lea    0xe56(%rip),%rbx
lea    0xc(%rsp),%rbp
nop
mov    0xc(%rsp),%eax
lea    -0x65(%rax),%ecx
cmp    $0xffffffa4,%ecx
jbe    11d6 <main+0x86>
add    $0xfffffff6,%eax
addl   $0x1,0x10(%rsp,%rax,4)
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1070 <scanf@plt>
cmp    $0x1,%eax
je     11b0 <main+0x60>
jmp    11dc <main+0x8c>
add    $0x1,%r14d
jmp    11c4 <main+0x74>
lea    0xe20(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movl   $0xa,0xc(%rsp)
mov    $0xa,%esi
lea    0xe37(%rip),%r15
xor    %r12d,%r12d
jmp    121e <main+0xce>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x1(%rsi),%eax
mov    %eax,0xc(%rsp)
cmp    $0x64,%esi
mov    %eax,%esi
jge    126b <main+0x11b>
movslq %esi,%rax
cmpl   $0x0,-0x18(%rsp,%rax,4)
je     1210 <main+0xc0>
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movslq 0xc(%rsp),%rsi
mov    -0x18(%rsp,%rsi,4),%ebx
test   %ebx,%ebx
jle    1210 <main+0xc0>
lea    0x1(%rbx),%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1250 <main+0x100>
add    %ebx,%r12d
mov    0xc(%rsp),%esi
jmp    1210 <main+0xc0>
lea    0xdcb(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xddc(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x180,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [113 x i8] c"\0AEscriba los pesos de los alumnos separados por espacios.\0ACuando haya terminado escriba \22fin\22 y pulse [Entrar]:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [50 x i8] c"\0APeso N\C3\BAmero de alumnos\0A-----------------------\00"
@.str.3 = [8 x i8] c"\0A%3d \00"
@.str.4 = [2 x i8] c"*\00"
@.str.5 = [34 x i8] c"\0A\0AN\C3\BAmero de pesos correctos: %d\0A\00"
@.str.6 = [32 x i8] c"N\C3\BAmero de pesos err\C3\B3neos: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [91 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %14, %0
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 91
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [91 x i32], [91 x i32]* %3, i64 0, i64 %12
store i32 0, i32* %13
br label %14
14: ; preds = %10
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 1
store i32 %16, i32* %6
br label %7
17: ; preds = %7
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %31, %28, %17
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %38
22: ; preds = %19
%23 = load i32, i32* %2
%24 = icmp slt i32 %23, 10
br i1 %24, label %28, label %25
25: ; preds = %22
%26 = load i32, i32* %2
%27 = icmp sgt i32 %26, 100
br i1 %27, label %28, label %31
28: ; preds = %25, %22
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %19
31: ; preds = %25
%32 = load i32, i32* %2
%33 = sub nsw i32 %32, 10
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [91 x i32], [91 x i32]* %3, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = add nsw i32 %36, 1
store i32 %37, i32* %35
br label %19
38: ; preds = %19
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
store i32 10, i32* %2
br label %40
40: ; preds = %70, %38
%41 = load i32, i32* %2
%42 = icmp sle i32 %41, 100
br i1 %42, label %43, label %73
43: ; preds = %40
%44 = load i32, i32* %2
%45 = sub nsw i32 %44, 10
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [91 x i32], [91 x i32]* %3, i64 0, i64 %46
%48 = load i32, i32* %47
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %69
50: ; preds = %43
%51 = load i32, i32* %2
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %51)
%53 = load i32, i32* %2
%54 = sub nsw i32 %53, 10
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [91 x i32], [91 x i32]* %3, i64 0, i64 %55
%57 = load i32, i32* %56
store i32 %57, i32* %6
br label %58
58: ; preds = %65, %50
%59 = load i32, i32* %6
%60 = icmp sgt i32 %59, 0
br i1 %60, label %61, label %68
61: ; preds = %58
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%63 = load i32, i32* %4
%64 = add nsw i32 %63, 1
store i32 %64, i32* %4
br label %65
65: ; preds = %61
%66 = load i32, i32* %6
%67 = add nsw i32 %66, -1
store i32 %67, i32* %6
br label %58
68: ; preds = %58
br label %69
69: ; preds = %68, %43
br label %70
70: ; preds = %69
%71 = load i32, i32* %2
%72 = add nsw i32 %71, 1
store i32 %72, i32* %2
br label %40
73: ; preds = %40
%74 = load i32, i32* %4
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i32 %74)
%76 = load i32, i32* %5
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i32 %76)
%78 = load i32, i32* %1
ret i32 %78
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [50 x i8] c"\0APeso N\C3\BAmero de alumnos\0A-----------------------\00"
@.str.3 = [8 x i8] c"\0A%3d \00"
@.str.5 = [34 x i8] c"\0A\0AN\C3\BAmero de pesos correctos: %d\0A\00"
@.str.6 = [32 x i8] c"N\C3\BAmero de pesos err\C3\B3neos: %d\0A\00"
@str = [112 x i8] c"\0AEscriba los pesos de los alumnos separados por espacios.\0ACuando haya terminado escriba \22fin\22 y pulse [Entrar]:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [91 x i32]
%3 = bitcast [91 x i32]* %2 to i8*
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([112 x i8], [112 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %26
8: ; preds = %0, %14
%9 = phi i32 [ %15, %14 ], [ 0, %0 ]
br label %10
10: ; preds = %8, %18
%11 = load i32, i32* %1
%12 = add i32 %11, -101
%13 = icmp ult i32 %12, -91
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = add nuw nsw i32 %9, 1
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%17 = icmp eq i32 %16, 1
br i1 %17, label %8, label %26
18: ; preds = %10
%19 = add nsw i32 %11, -10
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds [91 x i32], [91 x i32]* %2, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = add nsw i32 %22, 1
store i32 %23, i32* %21
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%25 = icmp eq i32 %24, 1
br i1 %25, label %10, label %26
26: ; preds = %14, %18, %0
%27 = phi i32 [ 0, %0 ], [ %9, %18 ], [ %15, %14 ]
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
store i32 10, i32* %1
br label %29
29: ; preds = %26, %53
%30 = phi i32 [ 0, %26 ], [ %55, %53 ]
%31 = phi i32 [ 10, %26 ], [ %56, %53 ]
%32 = add nsw i32 %31, -10
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [91 x i32], [91 x i32]* %2, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = icmp eq i32 %35, 0
br i1 %36, label %53, label %37
37: ; preds = %29
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %31)
%39 = load i32, i32* %1
%40 = add nsw i32 %39, -10
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [91 x i32], [91 x i32]* %2, i64 0, i64 %41
%43 = load i32, i32* %42
%44 = icmp sgt i32 %43, 0
br i1 %44, label %45, label %53
45: ; preds = %37, %45
%46 = phi i32 [ %48, %45 ], [ %43, %37 ]
%47 = call i32 @putchar(i32 42)
%48 = add nsw i32 %46, -1
%49 = icmp ugt i32 %46, 1
br i1 %49, label %45, label %50
50: ; preds = %45
%51 = add i32 %30, %43
%52 = load i32, i32* %1
br label %53
53: ; preds = %50, %37, %29
%54 = phi i32 [ %31, %29 ], [ %39, %37 ], [ %52, %50 ]
%55 = phi i32 [ %30, %29 ], [ %30, %37 ], [ %51, %50 ]
%56 = add nsw i32 %54, 1
store i32 %56, i32* %1
%57 = icmp slt i32 %54, 100
br i1 %57, label %29, label %58
58: ; preds = %53
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i32 %55)
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i32 %27)
ret i32 0
}