#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 inv_sqrt(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%f\n", 1 / inv_sqrt(3));
  printf("%f\n", 1 / inv_sqrt(5));
  printf("%f\n", 1 / inv_sqrt(7));
  printf("%f\n", 1 / inv_sqrt(11));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1040 <inv_sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <inv_sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    $0x7,%edi
call   1040 <inv_sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
mov    $0xb,%edi
call   1040 <inv_sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x3,%edi
call   1040 <inv_sqrt@plt>
lea    0x1(%rax),%ecx
xor    %ebp,%ebp
cmp    $0x3,%ecx
cmovae %ebp,%eax
lea    0xec1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <inv_sqrt@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovae %ebp,%eax
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x7,%edi
call   1040 <inv_sqrt@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovae %ebp,%eax
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xb,%edi
call   1040 <inv_sqrt@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovae %ebp,%eax
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @inv_sqrt(i32 3)
%3 = sdiv i32 1, %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @inv_sqrt(i32 5)
%6 = sdiv i32 1, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @inv_sqrt(i32 7)
%9 = sdiv i32 1, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @inv_sqrt(i32 11)
%12 = sdiv i32 1, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @inv_sqrt(i32 3)
%2 = add i32 %1, 1
%3 = icmp ult i32 %2, 3
%4 = select i1 %3, i32 %1, i32 0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @inv_sqrt(i32 5)
%7 = add i32 %6, 1
%8 = icmp ult i32 %7, 3
%9 = select i1 %8, i32 %6, i32 0
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = tail call i32 @inv_sqrt(i32 7)
%12 = add i32 %11, 1
%13 = icmp ult i32 %12, 3
%14 = select i1 %13, i32 %11, i32 0
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = tail call i32 @inv_sqrt(i32 11)
%17 = add i32 %16, 1
%18 = icmp ult i32 %17, 3
%19 = select i1 %18, i32 %16, i32 0
%20 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
ret i32 0
}