void main() {
  int num;
  int again = 1;
  printf("\40:Program will stop if input value less than 50.\n");
  while (again) {
    printf("\40:Please input number==>");
    scanf("%d", &num);
    printf("The square for this number is %d\n", (num) * (num));
    if (num >= 50)
      again = 1;
    else
      again = 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
je     119e <main+0x7e>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
imul   -0x4(%rbp),%esi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x32,-0x4(%rbp)
jl     1192 <main+0x72>
movl   $0x1,-0x8(%rbp)
jmp    1199 <main+0x79>
movl   $0x0,-0x8(%rbp)
jmp    113d <main+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%r14
lea    0xec7(%rip),%r15
lea    0x4(%rsp),%r12
lea    0xebe(%rip),%rbx
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
imul   %esi,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x31,0x4(%rsp)
jg     1160 <main+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [50 x i8] c" :Program will stop if input value less than 50.\0A\00"
@.str.1 = [25 x i8] c" :Please input number==>\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [34 x i8] c"The square for this number is %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %18, %0
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = load i32, i32* %1
%12 = mul nsw i32 %10, %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %1
%15 = icmp sge i32 %14, 50
br i1 %15, label %16, label %17
16: ; preds = %7
store i32 1, i32* %2
br label %18
17: ; preds = %7
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c" :Please input number==>\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [34 x i8] c"The square for this number is %d\0A\00"
@str = [49 x i8] c" :Program will stop if input value less than 50.\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %7
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %1
%11 = icmp slt i32 %10, 50
br i1 %11, label %12, label %4
12: ; preds = %4
ret void
}