#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(void) {
  int i, respuesta, contadores[11], contador, total;
  for (i = 1; i <= 10; i++) {
    contadores[i] = 0;
  }
  printf("Cuantas respuestas deseas introducir? ");
  scanf("%i", &total);
  printf("Introduce tus respuestas\n");
  for (i = 1; i <= total; i++) {
    scanf("%i", &respuesta);
    if (respuesta < 1 || respuesta > 10) {
      printf("Respuesta incorrecta: %i\n", respuesta);
    } else {
      contadores[respuesta]++;
    }
  }
  printf("\n\nCalificacion	Numero de Respuesta\n");
  printf("----- ----------------\n");
  for (i = 1; i <= 10; i++) {
    printf("%4i%14i\n", i, contadores[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     115a <main+0x3a>
movslq -0x8(%rbp),%rax
movl   $0x0,-0x40(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x48(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x48(%rbp),%eax
jg     11f5 <main+0xd5>
lea    0xe87(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0xc(%rbp)
jl     11bd <main+0x9d>
cmpl   $0xa,-0xc(%rbp)
jle    11d3 <main+0xb3>
mov    -0xc(%rbp),%esi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e2 <main+0xc2>
movslq -0xc(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x40(%rbp,%rax,4)
jmp    11e7 <main+0xc7>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118d <main+0x6d>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     1249 <main+0x129>
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edx
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1218 <main+0xf8>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x24(%rsp)
movups %xmm0,0x34(%rsp)
movq   $0x0,0x44(%rsp)
lea    0xea5(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,0x4(%rsp)
mov    $0x0,%eax
mov    $0x0,%ecx
mov    $0x0,%edx
mov    $0x0,%esi
mov    $0x0,%ebx
mov    $0x0,%r15d
mov    $0x0,%r8d
mov    $0x0,%r13d
mov    $0x0,%r12d
jle    122d <main+0xfd>
lea    0xe67(%rip),%r15
lea    0x1c(%rsp),%rbp
lea    0xe5e(%rip),%r14
xor    %ebx,%ebx
jmp    11de <main+0xae>
addl   $0x1,0x20(%rsp,%rsi,4)
add    $0x1,%ebx
cmp    0x4(%rsp),%ebx
jge    1201 <main+0xd1>
mov    %r15,%rdi
mov    %rbp,%rsi
call   1050 <scanf@plt>
mov    0x1c(%rsp),%esi
lea    -0xb(%rsi),%eax
cmp    $0xfffffff5,%eax
ja     11d0 <main+0xa0>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11d5 <main+0xa5>
mov    0x24(%rsp),%r12d
mov    0x28(%rsp),%r13d
mov    0x2c(%rsp),%r8d
mov    0x30(%rsp),%r15d
mov    0x34(%rsp),%ebx
mov    0x38(%rsp),%esi
mov    0x3c(%rsp),%edx
mov    0x40(%rsp),%ecx
mov    0x44(%rsp),%eax
mov    0x48(%rsp),%ebp
mov    %ebx,0x8(%rsp)
mov    %esi,0xc(%rsp)
mov    %edx,0x10(%rsp)
mov    %ecx,0x14(%rsp)
mov    %eax,0x18(%rsp)
lea    0xe1e(%rip),%rdi
mov    %r8d,%ebx
call   1030 <puts@plt>
lea    0xe32(%rip),%rdi
call   1030 <puts@plt>
lea    0xde1(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x5,%esi
mov    0x8(%rsp),%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x6,%esi
mov    0xc(%rsp),%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x7,%esi
mov    0x10(%rsp),%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x8,%esi
mov    0x14(%rsp),%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x9,%esi
mov    0x18(%rsp),%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0xa,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Cuantas respuestas deseas introducir? \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [26 x i8] c"Introduce tus respuestas\0A\00"
@.str.3 = [26 x i8] c"Respuesta incorrecta: %i\0A\00"
@.str.4 = [36 x i8] c"\0A\0ACalificacion\09Numero de Respuesta\0A\00"
@.str.5 = [24 x i8] c"----- ----------------\0A\00"
@.str.6 = [9 x i8] c"%4i%14i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [11 x i32]
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %7
7: ; preds = %14, %0
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 10
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 %12
store i32 0, i32* %13
br label %14
14: ; preds = %10
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %7
17: ; preds = %7
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %2
br label %21
21: ; preds = %42, %17
%22 = load i32, i32* %2
%23 = load i32, i32* %6
%24 = icmp sle i32 %22, %23
br i1 %24, label %25, label %45
25: ; preds = %21
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%27 = load i32, i32* %3
%28 = icmp slt i32 %27, 1
br i1 %28, label %32, label %29
29: ; preds = %25
%30 = load i32, i32* %3
%31 = icmp sgt i32 %30, 10
br i1 %31, label %32, label %35
32: ; preds = %29, %25
%33 = load i32, i32* %3
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i32 %33)
br label %41
35: ; preds = %29
%36 = load i32, i32* %3
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = add nsw i32 %39, 1
store i32 %40, i32* %38
br label %41
41: ; preds = %35, %32
br label %42
42: ; preds = %41
%43 = load i32, i32* %2
%44 = add nsw i32 %43, 1
store i32 %44, i32* %2
br label %21
45: ; preds = %21
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %2
br label %48
48: ; preds = %58, %45
%49 = load i32, i32* %2
%50 = icmp sle i32 %49, 10
br i1 %50, label %51, label %61
51: ; preds = %48
%52 = load i32, i32* %2
%53 = load i32, i32* %2
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %52, i32 %56)
br label %58
58: ; preds = %51
%59 = load i32, i32* %2
%60 = add nsw i32 %59, 1
store i32 %60, i32* %2
br label %48
61: ; preds = %48
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"Cuantas respuestas deseas introducir? \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.3 = [26 x i8] c"Respuesta incorrecta: %i\0A\00"
@.str.6 = [9 x i8] c"%4i%14i\0A\00"
@str = [25 x i8] c"Introduce tus respuestas\00"
@str.7 = [35 x i8] c"\0A\0ACalificacion\09Numero de Respuesta\00"
@str.8 = [23 x i8] c"----- ----------------\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i32]
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast [11 x i32]* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 1
%8 = bitcast i32* %7 to i8*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 1
br i1 %13, label %51, label %14
14: ; preds = %0, %27
%15 = phi i32 [ %28, %27 ], [ 1, %0 ]
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%17 = load i32, i32* %1
%18 = add i32 %17, -11
%19 = icmp ult i32 %18, -10
br i1 %19, label %20, label %22
20: ; preds = %14
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i32 %17)
br label %27
22: ; preds = %14
%23 = zext i32 %17 to i64
%24 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = add nsw i32 %25, 1
store i32 %26, i32* %24
br label %27
27: ; preds = %20, %22
%28 = add nuw nsw i32 %15, 1
%29 = load i32, i32* %3
%30 = icmp slt i32 %15, %29
br i1 %30, label %14, label %31
31: ; preds = %27
%32 = load i32, i32* %7
%33 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 2
%34 = load i32, i32* %33
%35 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 3
%36 = load i32, i32* %35
%37 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 4
%38 = load i32, i32* %37
%39 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 5
%40 = load i32, i32* %39
%41 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 6
%42 = load i32, i32* %41
%43 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 7
%44 = load i32, i32* %43
%45 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 8
%46 = load i32, i32* %45
%47 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 9
%48 = load i32, i32* %47
%49 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 10
%50 = load i32, i32* %49
br label %51
51: ; preds = %31, %0
%52 = phi i32 [ %50, %31 ], [ 0, %0 ]
%53 = phi i32 [ %48, %31 ], [ 0, %0 ]
%54 = phi i32 [ %46, %31 ], [ 0, %0 ]
%55 = phi i32 [ %44, %31 ], [ 0, %0 ]
%56 = phi i32 [ %42, %31 ], [ 0, %0 ]
%57 = phi i32 [ %40, %31 ], [ 0, %0 ]
%58 = phi i32 [ %38, %31 ], [ 0, %0 ]
%59 = phi i32 [ %36, %31 ], [ 0, %0 ]
%60 = phi i32 [ %34, %31 ], [ 0, %0 ]
%61 = phi i32 [ %32, %31 ], [ 0, %0 ]
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.7, i64 0, i64 0))
%63 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.8, i64 0, i64 0))
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 1, i32 %61)
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 2, i32 %60)
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 3, i32 %59)
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 4, i32 %58)
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 5, i32 %57)
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 6, i32 %56)
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 7, i32 %55)
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 8, i32 %54)
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 9, i32 %53)
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 10, i32 %52)
ret i32 0
}