#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("↓星の総数を入力↓\n");
  scanf("%d", &max);
  printf("↓光らせたい星の数を入力↓\n");
  scanf("%d", &kazu);
  for (s = 0; s < max - kazu; s++) {
    printf("★");
  }
  for (s = kazu - 1; s < max; s++) {
    printf("☆");
  }
  printf("\n");
}


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    0xecd(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jge    11a7 <main+0x87>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117c <main+0x5c>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11d6 <main+0xb6>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11b0 <main+0x90>
lea    0xe3e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xeac(%rip),%rdi
call   1040 <puts@plt>
lea    0xe95(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xea8(%rip),%rdi
call   1040 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0x8(%rsp),%eax
mov    0xc(%rsp),%ebp
cmp    %ebp,%eax
jle    11cb <main+0x8b>
xor    %ebx,%ebx
lea    0xe5d(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1050 <printf@plt>
add    $0x1,%ebx
mov    0x8(%rsp),%eax
mov    0xc(%rsp),%ebp
mov    %eax,%ecx
sub    %ebp,%ecx
cmp    %ecx,%ebx
jl     11b0 <main+0x70>
cmp    %eax,%ebp
jg     11f1 <main+0xb1>
add    $0xffffffff,%ebp
lea    0xe2e(%rip),%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1050 <printf@plt>
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jl     11e0 <main+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 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\E2\86\93\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [41 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\E2\86\93\0A\00"
@.str.3 = [4 x i8] c"\E2\98\85\00"
@.str.4 = [4 x i8] c"\E2\98\86\00"
@.str.5 = [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 0, i32* %3
store i32 0, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 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 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
store i32 0, i32* %2
br label %9
9: ; preds = %17, %0
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sub nsw i32 %11, %12
%14 = icmp slt i32 %10, %13
br i1 %14, label %15, label %20
15: ; preds = %9
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %9
20: ; preds = %9
%21 = load i32, i32* %4
%22 = sub nsw i32 %21, 1
store i32 %22, i32* %2
br label %23
23: ; preds = %29, %20
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %32
27: ; preds = %23
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %29
29: ; preds = %27
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
store i32 %31, i32* %2
br label %23
32: ; preds = %23
%33 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%34 = load i32, i32* %1
ret i32 %34
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"\E2\98\85\00"
@.str.4 = [4 x i8] c"\E2\98\86\00"
@str = [28 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\E2\86\93\00"
@str.6 = [40 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\E2\86\93\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 ([28 x i8], [28 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 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.6, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %0, %12
%13 = phi i32 [ %15, %12 ], [ 0, %0 ]
%14 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%15 = add nuw nsw i32 %13, 1
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = sub nsw i32 %16, %17
%19 = icmp slt i32 %15, %18
br i1 %19, label %12, label %20
20: ; preds = %12, %0
%21 = phi i32 [ %9, %0 ], [ %16, %12 ]
%22 = phi i32 [ %10, %0 ], [ %17, %12 ]
%23 = icmp sgt i32 %22, %21
br i1 %23, label %32, label %24
24: ; preds = %20
%25 = add nsw i32 %22, -1
br label %26
26: ; preds = %24, %26
%27 = phi i32 [ %29, %26 ], [ %25, %24 ]
%28 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%29 = add nsw i32 %27, 1
%30 = load i32, i32* %1
%31 = icmp slt i32 %29, %30
br i1 %31, label %26, label %32
32: ; preds = %26, %20
%33 = call i32 @putchar(i32 10)
ret i32 0
}