#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 argc, const char *argv[]) {
  int i, n, idade, idade_media = 0;
  i = 0;
  printf("Digite a quantidade de alunos da turma: ");
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    printf("Digite a idade do aluno(a): ");
    scanf("%d", &idade);
    idade_media += idade;
  }
  idade_media /= n;
  if (idade_media <= 25) {
    printf("\nTurma jovem!\n");
  } else {
    if (idade_media <= 60) {
      printf("\nTurma Adulta!\n");
    } else {
      printf("\nTurma Idosa!\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11a6 <main+0x86>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
lea    0xea3(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1167 <main+0x47>
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
cmpl   $0x19,-0x20(%rbp)
jg     11cd <main+0xad>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
jmp    11f9 <main+0xd9>
cmpl   $0x3c,-0x20(%rbp)
jg     11e8 <main+0xc8>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
jmp    11f4 <main+0xd4>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
jmp    11f9 <main+0xd9>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%ecx
xor    %ebx,%ebx
test   %ecx,%ecx
jle    11a2 <main+0x72>
lea    0xec2(%rip),%r14
lea    0xeb8(%rip),%r15
lea    0xc(%rsp),%r12
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
add    0xc(%rsp),%ebx
add    $0x1,%ebp
mov    0x8(%rsp),%ecx
cmp    %ecx,%ebp
jl     1180 <main+0x50>
mov    %ebx,%eax
cltd
idiv   %ecx
cmp    $0x3d,%eax
lea    0xea6(%rip),%rcx
lea    0xe91(%rip),%rdx
cmovb  %rcx,%rdx
cmp    $0x1a,%eax
lea    0xea0(%rip),%rdi
cmovge %rdx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Digite a quantidade de alunos da turma: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"Digite a idade do aluno(a): \00"
@.str.3 = [15 x i8] c"\0ATurma jovem!\0A\00"
@.str.4 = [16 x i8] c"\0ATurma Adulta!\0A\00"
@.str.5 = [15 x i8] c"\0ATurma Idosa!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %9
store i32 0, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
store i32 0, i32* %6
br label %12
12: ; preds = %22, %2
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %25
16: ; preds = %12
%17 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%19 = load i32, i32* %8
%20 = load i32, i32* %9
%21 = add nsw i32 %20, %19
store i32 %21, i32* %9
br label %22
22: ; preds = %16
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
br label %12
25: ; preds = %12
%26 = load i32, i32* %7
%27 = load i32, i32* %9
%28 = sdiv i32 %27, %26
store i32 %28, i32* %9
%29 = load i32, i32* %9
%30 = icmp sle i32 %29, 25
br i1 %30, label %31, label %33
31: ; preds = %25
%32 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %41
33: ; preds = %25
%34 = load i32, i32* %9
%35 = icmp sle i32 %34, 60
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
br label %40
38: ; preds = %33
%39 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
br label %40
40: ; preds = %38, %36
br label %41
41: ; preds = %40, %31
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"Digite a quantidade de alunos da turma: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"Digite a idade do aluno(a): \00"
@str = [14 x i8] c"\0ATurma Idosa!\00"
@str.6 = [15 x i8] c"\0ATurma Adulta!\00"
@str.7 = [14 x i8] c"\0ATurma jovem!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %2, %11
%12 = phi i32 [ %17, %11 ], [ 0, %2 ]
%13 = phi i32 [ %18, %11 ], [ 0, %2 ]
%14 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%16 = load i32, i32* %4
%17 = add nsw i32 %16, %12
%18 = add nuw nsw i32 %13, 1
%19 = load i32, i32* %3
%20 = icmp slt i32 %18, %19
br i1 %20, label %11, label %21
21: ; preds = %11, %2
%22 = phi i32 [ 0, %2 ], [ %17, %11 ]
%23 = phi i32 [ %9, %2 ], [ %19, %11 ]
%24 = sdiv i32 %22, %23
%25 = icmp slt i32 %24, 26
%26 = icmp ult i32 %24, 61
%27 = select i1 %26, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0)
%28 = select i1 %25, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.7, i64 0, i64 0), i8* %27
%29 = call i32 @puts(i8* dereferenceable(1) %28)
ret i32 0
}