#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 */
double InverseSquareRoot(float);
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, float *);
int main(void) {
  float num;
  int ret;
  printf("Hello, llibrae ~\n");
  ret = scanf("%f", &num);
  while (num != 0) {
    printf("%f\n", InverseSquareRoot(num));
    ret = scanf("%f", &num);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    117c <main+0x4c>
jp     117c <main+0x4c>
jmp    11ac <main+0x7c>
movss  -0x8(%rbp),%xmm0
call   1040 <InverseSquareRoot@plt>
lea    0xe88(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe77(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0xc(%rbp)
jmp    1160 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
lea    0xea4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
movss  0xc(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1176 <main+0x36>
jnp    11ba <main+0x7a>
lea    0xe86(%rip),%r14
lea    0xe7c(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
call   1050 <InverseSquareRoot@plt>
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
xorps  %xmm1,%xmm1
movss  0xc(%rsp),%xmm0
ucomiss %xmm1,%xmm0
jne    1190 <main+0x50>
jp     1190 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Hello, llibrae ~\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 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), float* %2)
store i32 %5, i32* %3
br label %6
6: ; preds = %9, %0
%7 = load float, float* %2
%8 = fcmp une float %7, 0.000000e+00
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load float, float* %2
%11 = call double @InverseSquareRoot(float %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %11)
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
store i32 %13, i32* %3
br label %6
14: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [4 x i8] c"%f\0A\00"
@str = [17 x i8] c"Hello, llibrae ~\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 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), float* %1)
%5 = load float, float* %1
%6 = fcmp une float %5, 0.000000e+00
br i1 %6, label %7, label %14
7: ; preds = %0, %7
%8 = phi float [ %12, %7 ], [ %5, %0 ]
%9 = call double @InverseSquareRoot(float %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %9)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%12 = load float, float* %1
%13 = fcmp une float %12, 0.000000e+00
br i1 %13, label %7, label %14
14: ; preds = %7, %0
ret i32 0
}