#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 expoentBi(int *);
float pow(int, int);
int /*<<< orphan*/ printf(char *, float);
void normalizada(int x[]) {
  int i, y, z;
  float aux = 0;
  for (i = 9, y = 1; i < 32; i++, y++) {
    if (x[i] == 1)
      aux = aux + (1 / pow(2, y));
  }
  aux += 1;
  z = expoentBi(x);
  aux *= pow(2, z);
  if (x[0] == 1) {
    printf("%.2f\n", -1 * aux);
  } else {
    printf("%.2f\n", aux);
  }
}


x86 assembly (clang, -O0):
<normalizada>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x9,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    11be <normalizada+0x8e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    11a2 <normalizada+0x72>
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x10(%rbp),%esi
mov    $0x2,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm2
movss  -0x1c(%rbp),%xmm0
movss  0xe6b(%rip),%xmm1
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    11a7 <normalizada+0x77>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <normalizada+0x22>
movss  0xe3a(%rip),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <expoentBi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    $0x2,%edi
call   1050 <pow@plt>
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jne    121e <normalizada+0xee>
movss  0xdfc(%rip),%xmm0
mulss  -0x18(%rbp),%xmm0
lea    0xdf4(%rip),%rdi
call   1040 <printf@plt>
jmp    122f <normalizada+0xff>
movss  -0x18(%rbp),%xmm0
lea    0xdde(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalizada>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xorps  %xmm0,%xmm0
mov    $0xa,%ebx
jmp    1154 <normalizada+0x24>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x2,%rbx
cmpl   $0x1,-0x4(%r14,%rbx,4)
jne    1186 <normalizada+0x56>
lea    -0x9(%rbx),%rsi
mov    $0x2,%edi
movss  %xmm0,0x4(%rsp)
call   1050 <pow@plt>
movss  0xe88(%rip),%xmm1
divss  %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
addss  %xmm1,%xmm0
cmp    $0x20,%rbx
je     11bf <normalizada+0x8f>
cmpl   $0x1,(%r14,%rbx,4)
jne    1150 <normalizada+0x20>
lea    -0x8(%rbx),%rsi
mov    $0x2,%edi
movss  %xmm0,0x4(%rsp)
call   1050 <pow@plt>
movss  0xe51(%rip),%xmm1
divss  %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
addss  %xmm1,%xmm0
jmp    1150 <normalizada+0x20>
addss  0xe39(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
mov    %r14,%rdi
call   1030 <expoentBi@plt>
mov    $0x2,%edi
mov    %eax,%esi
call   1050 <pow@plt>
mulss  0x4(%rsp),%xmm0
cmpl   $0x1,(%r14)
jne    11f4 <normalizada+0xc4>
xorps  0xe1c(%rip),%xmm0
lea    0xe25(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%.2f\0A\00"
define void @normalizada(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32* %0, i32** %2
store float 0.000000e+00, float* %6
store i32 9, i32* %3
store i32 1, i32* %4
br label %7
7: ; preds = %24, %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 32
br i1 %9, label %10, label %29
10: ; preds = %7
%11 = load i32*, i32** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %23
17: ; preds = %10
%18 = load float, float* %6
%19 = load i32, i32* %4
%20 = call float @pow(i32 2, i32 %19)
%21 = fdiv float 1.000000e+00, %20
%22 = fadd float %18, %21
store float %22, float* %6
br label %23
23: ; preds = %17, %10
br label %24
24: ; preds = %23
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %7
29: ; preds = %7
%30 = load float, float* %6
%31 = fadd float %30, 1.000000e+00
store float %31, float* %6
%32 = load i32*, i32** %2
%33 = call i32 @expoentBi(i32* %32)
store i32 %33, i32* %5
%34 = load i32, i32* %5
%35 = call float @pow(i32 2, i32 %34)
%36 = load float, float* %6
%37 = fmul float %36, %35
store float %37, float* %6
%38 = load i32*, i32** %2
%39 = getelementptr inbounds i32, i32* %38, i64 0
%40 = load i32, i32* %39
%41 = icmp eq i32 %40, 1
br i1 %41, label %42, label %46
42: ; preds = %29
%43 = load float, float* %6
%44 = fmul float -1.000000e+00, %43
%45 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %44)
br label %49
46: ; preds = %29
%47 = load float, float* %6
%48 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %47)
br label %49
49: ; preds = %46, %42
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.2f\0A\00"
define void @normalizada(i32* %0) {
br label %2
2: ; preds = %26, %1
%3 = phi i64 [ 9, %1 ], [ %28, %26 ]
%4 = phi float [ 0.000000e+00, %1 ], [ %27, %26 ]
%5 = phi i32 [ 1, %1 ], [ %29, %26 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %3
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = tail call float @pow(i32 2, i32 %5)
%11 = fdiv float 1.000000e+00, %10
%12 = fadd float %4, %11
br label %13
13: ; preds = %2, %9
%14 = phi float [ %12, %9 ], [ %4, %2 ]
%15 = add nuw nsw i64 %3, 1
%16 = add nuw nsw i32 %5, 1
%17 = icmp eq i64 %15, 32
br i1 %17, label %30, label %18
18: ; preds = %13
%19 = getelementptr inbounds i32, i32* %0, i64 %15
%20 = load i32, i32* %19
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = tail call float @pow(i32 2, i32 %16)
%24 = fdiv float 1.000000e+00, %23
%25 = fadd float %14, %24
br label %26
26: ; preds = %22, %18
%27 = phi float [ %25, %22 ], [ %14, %18 ]
%28 = add nuw nsw i64 %3, 2
%29 = add nuw nsw i32 %5, 2
br label %2
30: ; preds = %13
%31 = fadd float %14, 1.000000e+00
%32 = tail call i32 @expoentBi(i32* %0)
%33 = tail call float @pow(i32 2, i32 %32)
%34 = fmul float %31, %33
%35 = load i32, i32* %0
%36 = icmp eq i32 %35, 1
%37 = fneg float %34
%38 = select i1 %36, float %37, float %34
%39 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %38)
ret void
}