#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 fat(int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  int i, p = 2, sinal = -1;
  double soma = 0.0;
  for (i = 1; i <= 4; i++) {
    soma = soma + (i + 0.0) / (fat(p) * sinal);
    p = p + 2;
    sinal *= -1;
  }
  printf("%lf", soma);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jg     11b6 <main+0x96>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <fat@plt>
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
imul   -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
imul   $0xffffffff,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114c <main+0x2c>
movsd  -0x18(%rbp),%xmm0
lea    0xe3e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x2,%edi
call   1040 <fat@plt>
mov    %eax,%ebx
neg    %ebx
mov    $0x4,%edi
call   1040 <fat@plt>
movd   %ebx,%xmm0
movd   %eax,%xmm1
punpckldq %xmm1,%xmm0
cvtdq2pd %xmm0,%xmm0
movapd 0xeab(%rip),%xmm1
divpd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
unpckhpd %xmm1,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
mov    $0x6,%edi
call   1040 <fat@plt>
mov    %eax,%ebx
neg    %ebx
mov    $0x8,%edi
call   1040 <fat@plt>
movd   %ebx,%xmm0
movd   %eax,%xmm1
punpckldq %xmm1,%xmm0
cvtdq2pd %xmm0,%xmm1
movapd 0xe72(%rip),%xmm0
divpd  %xmm1,%xmm0
movapd (%rsp),%xmm1
addsd  %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 0, i32* %1
store i32 2, i32* %3
store i32 -1, i32* %4
store double 0.000000e+00, double* %5
store i32 1, i32* %2
br label %6
6: ; preds = %25, %0
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 4
br i1 %8, label %9, label %28
9: ; preds = %6
%10 = load double, double* %5
%11 = load i32, i32* %2
%12 = sitofp i32 %11 to double
%13 = fadd double %12, 0.000000e+00
%14 = load i32, i32* %3
%15 = call i32 @fat(i32 %14)
%16 = load i32, i32* %4
%17 = mul nsw i32 %15, %16
%18 = sitofp i32 %17 to double
%19 = fdiv double %13, %18
%20 = fadd double %10, %19
store double %20, double* %5
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 2
store i32 %22, i32* %3
%23 = load i32, i32* %4
%24 = mul nsw i32 %23, -1
store i32 %24, i32* %4
br label %25
25: ; preds = %9
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %6
28: ; preds = %6
%29 = load double, double* %5
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = tail call i32 @fat(i32 2)
%2 = sub nsw i32 0, %1
%3 = tail call i32 @fat(i32 4)
%4 = insertelement <2 x i32> poison, i32 %2, i64 0
%5 = insertelement <2 x i32> %4, i32 %3, i64 1
%6 = sitofp <2 x i32> %5 to <2 x double>
%7 = fdiv <2 x double> <double 1.000000e+00, double 2.000000e+00>, %6
%8 = extractelement <2 x double> %7, i64 0
%9 = fadd double %8, 0.000000e+00
%10 = extractelement <2 x double> %7, i64 1
%11 = fadd double %9, %10
%12 = tail call i32 @fat(i32 6)
%13 = sub nsw i32 0, %12
%14 = tail call i32 @fat(i32 8)
%15 = insertelement <2 x i32> poison, i32 %13, i64 0
%16 = insertelement <2 x i32> %15, i32 %14, i64 1
%17 = sitofp <2 x i32> %16 to <2 x double>
%18 = fdiv <2 x double> <double 3.000000e+00, double 4.000000e+00>, %17
%19 = extractelement <2 x double> %18, i64 0
%20 = fadd double %11, %19
%21 = extractelement <2 x double> %18, i64 1
%22 = fadd double %20, %21
%23 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %22)
ret i32 0
}