#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 /*<<< orphan*/ free(float *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, float);
void plusMinus(int n, int pNum, int nNum, int zeroNum) {
  float *result = (float *)malloc(3 * sizeof *result);
  result[0] = (float)pNum / n;
  result[1] = (float)nNum / n;
  result[2] = (float)zeroNum / n;
  printf("%.6f\n", result[0]);
  printf("%.6f\n", result[1]);
  printf("%.6f\n", result[2]);
  free(result);
}


x86 assembly (clang, -O0):
<plusMinus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
cvtsi2ssl -0xc(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
cvtsi2ssl -0x10(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
lea    0xe5b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
lea    0xe46(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm0
lea    0xe31(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plusMinus>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xc,%edi
call   1050 <malloc@plt>
cvtsi2ss %ebx,%xmm0
mov    %rax,%rbx
cvtsi2ss %ebp,%xmm1
divss  %xmm1,%xmm0
cvtsi2ss %r15d,%xmm2
movss  %xmm0,(%rax)
cvtsi2ss %r14d,%xmm3
divss  %xmm1,%xmm2
movss  %xmm2,0x4(%rax)
divss  %xmm1,%xmm3
movss  %xmm3,0x8(%rax)
lea    0xe7f(%rip),%rbp
mov    %rbp,%rdi
call   1040 <printf@plt>
movss  0x4(%rbx),%xmm0
mov    %rbp,%rdi
call   1040 <printf@plt>
movss  0x8(%rbx),%xmm0
mov    %rbp,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%.6f\0A\00"
define void @plusMinus(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca float*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = call i64 @malloc(i32 12)
%11 = inttoptr i64 %10 to float*
store float* %11, float** %9
%12 = load i32, i32* %6
%13 = sitofp i32 %12 to float
%14 = load i32, i32* %5
%15 = sitofp i32 %14 to float
%16 = fdiv float %13, %15
%17 = load float*, float** %9
%18 = getelementptr inbounds float, float* %17, i64 0
store float %16, float* %18
%19 = load i32, i32* %7
%20 = sitofp i32 %19 to float
%21 = load i32, i32* %5
%22 = sitofp i32 %21 to float
%23 = fdiv float %20, %22
%24 = load float*, float** %9
%25 = getelementptr inbounds float, float* %24, i64 1
store float %23, float* %25
%26 = load i32, i32* %8
%27 = sitofp i32 %26 to float
%28 = load i32, i32* %5
%29 = sitofp i32 %28 to float
%30 = fdiv float %27, %29
%31 = load float*, float** %9
%32 = getelementptr inbounds float, float* %31, i64 2
store float %30, float* %32
%33 = load float*, float** %9
%34 = getelementptr inbounds float, float* %33, i64 0
%35 = load float, float* %34
%36 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %35)
%37 = load float*, float** %9
%38 = getelementptr inbounds float, float* %37, i64 1
%39 = load float, float* %38
%40 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %39)
%41 = load float*, float** %9
%42 = getelementptr inbounds float, float* %41, i64 2
%43 = load float, float* %42
%44 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %43)
%45 = load float*, float** %9
%46 = call i32 @free(float* %45)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.6f\0A\00"
define void @plusMinus(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i64 @malloc(i32 12)
%6 = inttoptr i64 %5 to float*
%7 = sitofp i32 %1 to float
%8 = sitofp i32 %0 to float
%9 = fdiv float %7, %8
store float %9, float* %6
%10 = sitofp i32 %2 to float
%11 = fdiv float %10, %8
%12 = getelementptr inbounds float, float* %6, i64 1
store float %11, float* %12
%13 = sitofp i32 %3 to float
%14 = fdiv float %13, %8
%15 = getelementptr inbounds float, float* %6, i64 2
store float %14, float* %15
%16 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %9)
%17 = load float, float* %12
%18 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %17)
%19 = load float, float* %15
%20 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %19)
%21 = tail call i32 @free(float* %6)
ret void
}