#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 num, i = 1, j;
  for (; i <= 5; i++) {
    printf("insira o %d, de 5, de 1 a 30", i);
    scanf("%d", &num);
    while (num > 30 || num < 1) {
      printf("numero nao aceito: ");
      scanf("%d", &num);
    }
    for (j = 0; j < num; j++) {
      printf("*");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jg     11f8 <main+0xd8>
mov    -0xc(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x1e,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jg     117a <main+0x5a>
cmpl   $0x1,-0x8(%rbp)
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    118a <main+0x6a>
jmp    11ad <main+0x8d>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7e(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    1161 <main+0x41>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11dc <main+0xbc>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11b4 <main+0x94>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x1,%r15d
lea    0xeb8(%rip),%r14
lea    0xece(%rip),%r13
lea    0x4(%rsp),%rbp
lea    0xec5(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffe1,%eax
cmp    $0xffffffe1,%eax
ja     11b1 <main+0x81>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffe1,%eax
cmp    $0xffffffe2,%eax
jb     1190 <main+0x60>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0x4(%rsp),%ebx
jl     11c0 <main+0x90>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
cmp    $0x6,%r15d
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"insira o %d, de 5, de 1 a 30\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"numero nao aceito: \00"
@.str.3 = [2 x i8] c"*\00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
br label %5
5: ; preds = %35, %0
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 5
br i1 %7, label %8, label %38
8: ; preds = %5
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %12
12: ; preds = %20, %8
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 30
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 1
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ true, %12 ], [ %17, %15 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %12
23: ; preds = %18
store i32 0, i32* %4
br label %24
24: ; preds = %30, %23
%25 = load i32, i32* %4
%26 = load i32, i32* %2
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %33
28: ; preds = %24
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %30
30: ; preds = %28
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %24
33: ; preds = %24
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %35
35: ; preds = %33
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
br label %5
38: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"insira o %d, de 5, de 1 a 30\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"numero nao aceito: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %0, %23
%4 = phi i32 [ 1, %0 ], [ %25, %23 ]
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = add i32 %7, -31
%9 = icmp ult i32 %8, -30
br i1 %9, label %10, label %16
10: ; preds = %3, %10
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%13 = load i32, i32* %1
%14 = add i32 %13, -31
%15 = icmp ult i32 %14, -30
br i1 %15, label %10, label %16
16: ; preds = %10, %3
br label %17
17: ; preds = %16, %17
%18 = phi i32 [ %20, %17 ], [ 0, %16 ]
%19 = call i32 @putchar(i32 42)
%20 = add nuw nsw i32 %18, 1
%21 = load i32, i32* %1
%22 = icmp slt i32 %20, %21
br i1 %22, label %17, label %23
23: ; preds = %17
%24 = call i32 @putchar(i32 10)
%25 = add nuw nsw i32 %4, 1
%26 = icmp eq i32 %25, 6
br i1 %26, label %27, label %3
27: ; preds = %23
ret i32 0
}