#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, t = 0;
  printf("正整数: ");
  scanf("%d", &n);
  t = n;
  while (t-- > 0) {
    putchar('*');
  }
  if (n >= 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)
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1192 <main+0x62>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    116f <main+0x3f>
cmpl   $0x0,-0x8(%rbp)
jl     11a6 <main+0x76>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
test   %ebx,%ebx
jle    1186 <main+0x56>
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1170 <main+0x40>
mov    0xc(%rsp),%ebx
test   %ebx,%ebx
js     1194 <main+0x64>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"\E6\AD\A3\E6\95\B4\E6\95\B0: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
store i32 %6, i32* %3
br label %7
7: ; preds = %11, %0
%8 = load i32, i32* %3
%9 = add nsw i32 %8, -1
store i32 %9, i32* %3
%10 = icmp sgt i32 %8, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @putchar(i8 signext 42)
br label %7
13: ; preds = %7
%14 = load i32, i32* %2
%15 = icmp sge i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @putchar(i8 signext 10)
br label %18
18: ; preds = %16, %13
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"\E6\AD\A3\E6\95\B4\E6\95\B0: \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 ([12 x i8], [12 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 sgt i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %0, %7
%8 = phi i32 [ %9, %7 ], [ %5, %0 ]
%9 = add nsw i32 %8, -1
%10 = call i32 @putchar(i8 signext 42)
%11 = icmp ugt i32 %8, 1
br i1 %11, label %7, label %12
12: ; preds = %7
%13 = load i32, i32* %1
br label %14
14: ; preds = %12, %0
%15 = phi i32 [ %13, %12 ], [ %5, %0 ]
%16 = icmp sgt i32 %15, -1
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @putchar(i8 signext 10)
br label %19
19: ; preds = %17, %14
ret i32 0
}