#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 s, max = 0, kazu = 0;
  printf("↓星の総数を入力(1～10)↓\n");
  scanf("%d", &max);
  if (max < 1 || max > 10) {
    printf("総数の範囲を超えています！プログラム終了\n");
    return 1;
  }
  printf("↓光らせたい星の数を入力(1～10)↓\n");
  scanf("%d", &kazu);
  if (kazu < 1 || kazu > 10) {
    printf("光らせたい星の数の範囲を超えています！プログラム終了\n");
    return 2;
  }
  for (s = 0; s < max; s++) {
    if (s < kazu - 1) {
      printf("★");
    } else {
      printf("☆");
    }
  }
  printf("プログラム終了\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0xc(%rbp)
jl     116d <main+0x4d>
cmpl   $0xa,-0xc(%rbp)
jle    1185 <main+0x65>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1234 <main+0x114>
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xe8d(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x10(%rbp)
jl     11b5 <main+0x95>
cmpl   $0xa,-0x10(%rbp)
jle    11cd <main+0xad>
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1234 <main+0x114>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1221 <main+0x101>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1202 <main+0xe2>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
jmp    120e <main+0xee>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
jmp    1213 <main+0xf3>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11d4 <main+0xb4>
lea    0xe27(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
lea    0xea1(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
add    $0xfffffff5,%eax
cmp    $0xfffffff6,%eax
jae    1187 <main+0x57>
mov    $0x1,%r14d
lea    0xf2c(%rip),%r12
jmp    1221 <main+0xf1>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
lea    0xe66(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
lea    -0xb(%rax),%ecx
cmp    $0xfffffff6,%ecx
jae    11bf <main+0x8f>
mov    $0x2,%r14d
lea    0xea2(%rip),%r12
jmp    1221 <main+0xf1>
xor    %r14d,%r14d
lea    0xf0c(%rip),%r12
cmpl   $0x0,0x8(%rsp)
jle    1221 <main+0xf1>
cmp    $0x2,%eax
lea    0xe29(%rip),%rbp
lea    0xe26(%rip),%r15
mov    %r15,%rdi
cmovge %rbp,%rdi
call   1040 <printf@plt>
cmpl   $0x2,0x8(%rsp)
jl     1221 <main+0xf1>
mov    $0x1,%ebx
jmp    120e <main+0xde>
nopl   0x0(%rax,%rax,1)
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    0x8(%rsp),%ebx
jge    1221 <main+0xf1>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
mov    %rbp,%rdi
cmp    %eax,%ebx
jl     1200 <main+0xd0>
mov    %r15,%rdi
jmp    1200 <main+0xd0>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r14d,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"\E2\86\93\E6\98\9F\E3\81\AE\E7\B7\8F\E6\95\B0\E3\82\92\E5\85\A5\E5\8A\9B(1\EF\BD\9E10)\E2\86\93\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [62 x i8] c"\E7\B7\8F\E6\95\B0\E3\81\AE\E7\AF\84\E5\9B\B2\E3\82\92\E8\B6\85\E3\81\88\E3\81\A6\E3\81\84\E3\81\BE\E3\81\99\EF\BC\81\E3\83\97\E3\83\AD\E3\82\B0\E3\83\A9\E3\83\A0\E7\B5\82\E4\BA\86\0A\00"
@.str.3 = [49 x i8] c"\E2\86\93\E5\85\89\E3\82\89\E3\81\9B\E3\81\9F\E3\81\84\E6\98\9F\E3\81\AE\E6\95\B0\E3\82\92\E5\85\A5\E5\8A\9B(1\EF\BD\9E10)\E2\86\93\0A\00"
@.str.4 = [80 x i8] c"\E5\85\89\E3\82\89\E3\81\9B\E3\81\9F\E3\81\84\E6\98\9F\E3\81\AE\E6\95\B0\E3\81\AE\E7\AF\84\E5\9B\B2\E3\82\92\E8\B6\85\E3\81\88\E3\81\A6\E3\81\84\E3\81\BE\E3\81\99\EF\BC\81\E3\83\97\E3\83\AD\E3\82\B0\E3\83\A9\E3\83\A0\E7\B5\82\E4\BA\86\0A\00"
@.str.5 = [4 x i8] c"\E2\98\85\00"
@.str.6 = [4 x i8] c"\E2\98\86\00"
@.str.7 = [23 x i8] c"\E3\83\97\E3\83\AD\E3\82\B0\E3\83\A9\E3\83\A0\E7\B5\82\E4\BA\86\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 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* %3)
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 1
br i1 %8, label %12, label %9
9: ; preds = %0
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 10
br i1 %11, label %12, label %14
12: ; preds = %9, %0
%13 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %44
14: ; preds = %9
%15 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 1
br i1 %18, label %22, label %19
19: ; preds = %14
%20 = load i32, i32* %4
%21 = icmp sgt i32 %20, 10
br i1 %21, label %22, label %24
22: ; preds = %19, %14
%23 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.4, i64 0, i64 0))
store i32 2, i32* %1
br label %44
24: ; preds = %19
store i32 0, i32* %2
br label %25
25: ; preds = %39, %24
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %42
29: ; preds = %25
%30 = load i32, i32* %2
%31 = load i32, i32* %4
%32 = sub nsw i32 %31, 1
%33 = icmp slt i32 %30, %32
br i1 %33, label %34, label %36
34: ; preds = %29
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %38
36: ; preds = %29
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %38
38: ; preds = %36, %34
br label %39
39: ; preds = %38
%40 = load i32, i32* %2
%41 = add nsw i32 %40, 1
store i32 %41, i32* %2
br label %25
42: ; preds = %25
%43 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %1
br label %44
44: ; preds = %42, %22, %12
%45 = load i32, i32* %1
ret i32 %45
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.5 = [4 x i8] c"\E2\98\85\00"
@.str.6 = [4 x i8] c"\E2\98\86\00"
@str = [36 x i8] c"\E2\86\93\E6\98\9F\E3\81\AE\E7\B7\8F\E6\95\B0\E3\82\92\E5\85\A5\E5\8A\9B(1\EF\BD\9E10)\E2\86\93\00"
@str.8 = [48 x i8] c"\E2\86\93\E5\85\89\E3\82\89\E3\81\9B\E3\81\9F\E3\81\84\E6\98\9F\E3\81\AE\E6\95\B0\E3\82\92\E5\85\A5\E5\8A\9B(1\EF\BD\9E10)\E2\86\93\00"
@str.9 = [22 x i8] c"\E3\83\97\E3\83\AD\E3\82\B0\E3\83\A9\E3\83\A0\E7\B5\82\E4\BA\86\00"
@str.10 = [79 x i8] c"\E5\85\89\E3\82\89\E3\81\9B\E3\81\9F\E3\81\84\E6\98\9F\E3\81\AE\E6\95\B0\E3\81\AE\E7\AF\84\E5\9B\B2\E3\82\92\E8\B6\85\E3\81\88\E3\81\A6\E3\81\84\E3\81\BE\E3\81\99\EF\BC\81\E3\83\97\E3\83\AD\E3\82\B0\E3\83\A9\E3\83\A0\E7\B5\82\E4\BA\86\00"
@str.11 = [61 x i8] c"\E7\B7\8F\E6\95\B0\E3\81\AE\E7\AF\84\E5\9B\B2\E3\82\92\E8\B6\85\E3\81\88\E3\81\A6\E3\81\84\E3\81\BE\E3\81\99\EF\BC\81\E3\83\97\E3\83\AD\E3\82\B0\E3\83\A9\E3\83\A0\E7\B5\82\E4\BA\86\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 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 = load i32, i32* %1
%8 = add i32 %7, -11
%9 = icmp ult i32 %8, -10
br i1 %9, label %35, label %10
10: ; preds = %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.8, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%13 = load i32, i32* %2
%14 = add i32 %13, -11
%15 = icmp ult i32 %14, -10
br i1 %15, label %35, label %16
16: ; preds = %10
%17 = load i32, i32* %1
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %35
19: ; preds = %16
%20 = icmp sgt i32 %13, 1
%21 = select i1 %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0)
%22 = call i32 @printf(i8* dereferenceable(1) %21)
%23 = load i32, i32* %1
%24 = icmp sgt i32 %23, 1
br i1 %24, label %25, label %35
25: ; preds = %19, %25
%26 = phi i32 [ %32, %25 ], [ 1, %19 ]
%27 = load i32, i32* %2
%28 = add nsw i32 %27, -1
%29 = icmp slt i32 %26, %28
%30 = select i1 %29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0)
%31 = call i32 @printf(i8* dereferenceable(1) %30)
%32 = add nuw nsw i32 %26, 1
%33 = load i32, i32* %1
%34 = icmp slt i32 %32, %33
br i1 %34, label %25, label %35
35: ; preds = %25, %19, %16, %10, %0
%36 = phi i8* [ getelementptr inbounds ([61 x i8], [61 x i8]* @str.11, i64 0, i64 0), %0 ], [ getelementptr inbounds ([79 x i8], [79 x i8]* @str.10, i64 0, i64 0), %10 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.9, i64 0, i64 0), %16 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.9, i64 0, i64 0), %19 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.9, i64 0, i64 0), %25 ]
%37 = phi i32 [ 1, %0 ], [ 2, %10 ], [ 0, %16 ], [ 0, %19 ], [ 0, %25 ]
%38 = call i32 @puts(i8* dereferenceable(1) %36)
ret i32 %37
}