#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*/ putchar(char);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n = 0, i = 0, j = 0;
  printf("显示多少个*: ");
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    putchar('*');
    if (i % 5 == 0) {
      putchar('\n');
    }
  }
  if (n % 5 != 0) {
    putchar('\n');
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11be <main+0x8e>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ab <main+0x7b>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11b0 <main+0x80>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1177 <main+0x47>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11dc <main+0xac>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11bb <main+0x8b>
mov    $0x1,%ebx
xor    %ebp,%ebp
mov    $0xcccccccd,%r14d
jmp    118e <main+0x5e>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebx
mov    0x4(%rsp),%eax
add    $0x1,%ebp
cmp    %eax,%ebp
jge    11bb <main+0x8b>
mov    %ebx,%eax
imul   %r14,%rax
shr    $0x22,%rax
lea    (%rax,%rax,4),%r15d
add    $0xffffffff,%r15d
mov    $0x2a,%edi
call   1030 <putchar@plt>
cmp    %ebp,%r15d
jne    1180 <main+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1180 <main+0x50>
imul   $0xcccccccd,%eax,%eax
add    $0x19999999,%eax
cmp    $0x33333333,%eax
jb     11d7 <main+0xa7>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\E6\98\BE\E7\A4\BA\E5\A4\9A\E5\B0\91\E4\B8\AA*: \00"
@.str.1 = [3 x i8] c"%d\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* %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 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* %2)
store i32 1, i32* %3
br label %7
7: ; preds = %19, %0
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = call i32 @putchar(i8 signext 42)
%13 = load i32, i32* %3
%14 = srem i32 %13, 5
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 @putchar(i8 signext 10)
br label %18
18: ; preds = %16, %11
br label %19
19: ; preds = %18
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %7
22: ; preds = %7
%23 = load i32, i32* %2
%24 = srem i32 %23, 5
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 @putchar(i8 signext 10)
br label %28
28: ; preds = %26, %22
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\E6\98\BE\E7\A4\BA\E5\A4\9A\E5\B0\91\E4\B8\AA*: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 1
br i1 %6, label %18, label %7
7: ; preds = %0, %14
%8 = phi i32 [ %15, %14 ], [ 1, %0 ]
%9 = call i32 @putchar(i8 signext 42)
%10 = urem i32 %8, 5
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 @putchar(i8 signext 10)
br label %14
14: ; preds = %7, %12
%15 = add nuw nsw i32 %8, 1
%16 = load i32, i32* %1
%17 = icmp slt i32 %8, %16
br i1 %17, label %7, label %18
18: ; preds = %14, %0
%19 = phi i32 [ %5, %0 ], [ %16, %14 ]
%20 = srem i32 %19, 5
%21 = icmp eq i32 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %18
%23 = call i32 @putchar(i8 signext 10)
br label %24
24: ; preds = %22, %18
ret i32 0
}