#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 */
float get_ratio(short, float *, float *);
float get_vratio(short, unsigned long *, unsigned long *);
int /*<<< orphan*/ printf(char *, ...);
char *ratio_string(float);
void report_ratios(short dropping_id) {
  float pos;
  float neg;
  float ratio;
  unsigned long posv;
  unsigned long negv;
  ratio = get_vratio(dropping_id, &posv, &negv);
  printf("\n %9ld --> Number of Positive Voters\n", posv);
  printf("\n %9ld --> Number of Negative Voters\n", negv);
  printf("\n %9s --> Ratio of Positive to Negative Voters\n",
         ratio_string(ratio));
  ratio = get_ratio(dropping_id, &pos, &neg);
  printf("\n %9ld --> Sum of Positive Votes\n", (long)pos);
  printf("\n %9ld --> Sum of Negative Votes\n", (long)neg);
  printf("\n %9s --> Ratio of Sums, Positive to Negative\n",
         ratio_string(ratio));
}


x86 assembly (clang, -O0):
<report_ratios>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
movswl -0x2(%rbp),%edi
call   1060 <get_vratio@plt>
movss  %xmm0,-0x10(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  -0x10(%rbp),%xmm0
call   1030 <ratio_string@plt>
mov    %rax,%rsi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
movswl -0x2(%rbp),%edi
call   1050 <get_ratio@plt>
movss  %xmm0,-0x10(%rbp)
cvttss2si -0x8(%rbp),%rsi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cvttss2si -0xc(%rbp),%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  -0x10(%rbp),%xmm0
call   1030 <ratio_string@plt>
mov    %rax,%rsi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_ratios>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1060 <get_vratio@plt>
movss  %xmm0,0x4(%rsp)
mov    0x18(%rsp),%rsi
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%rsi
lea    0xeab(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
call   1030 <ratio_string@plt>
lea    0xeb8(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %ebx,%edi
call   1050 <get_ratio@plt>
movss  %xmm0,0x4(%rsp)
cvttss2si 0xc(%rsp),%rsi
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cvttss2si 0x8(%rsp),%rsi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
call   1030 <ratio_string@plt>
lea    0xecf(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"\0A %9ld --> Number of Positive Voters\0A\00"
@.str.1 = [38 x i8] c"\0A %9ld --> Number of Negative Voters\0A\00"
@.str.2 = [48 x i8] c"\0A %9s --> Ratio of Positive to Negative Voters\0A\00"
@.str.3 = [34 x i8] c"\0A %9ld --> Sum of Positive Votes\0A\00"
@.str.4 = [34 x i8] c"\0A %9ld --> Sum of Negative Votes\0A\00"
@.str.5 = [47 x i8] c"\0A %9s --> Ratio of Sums, Positive to Negative\0A\00"
define void @report_ratios(i16 signext %0) {
%2 = alloca i16
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i64
%7 = alloca i64
store i16 %0, i16* %2
%8 = load i16, i16* %2
%9 = call float @get_vratio(i16 signext %8, i64* %6, i64* %7)
store float %9, float* %5
%10 = load i64, i64* %6
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = load i64, i64* %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i64 %12)
%14 = load float, float* %5
%15 = call i8* @ratio_string(float %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%17 = load i16, i16* %2
%18 = call float @get_ratio(i16 signext %17, float* %3, float* %4)
store float %18, float* %5
%19 = load float, float* %3
%20 = fptosi float %19 to i64
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i64 %20)
%22 = load float, float* %4
%23 = fptosi float %22 to i64
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i64 %23)
%25 = load float, float* %5
%26 = call i8* @ratio_string(float %25)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), i8* %26)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"\0A %9ld --> Number of Positive Voters\0A\00"
@.str.1 = [38 x i8] c"\0A %9ld --> Number of Negative Voters\0A\00"
@.str.2 = [48 x i8] c"\0A %9s --> Ratio of Positive to Negative Voters\0A\00"
@.str.3 = [34 x i8] c"\0A %9ld --> Sum of Positive Votes\0A\00"
@.str.4 = [34 x i8] c"\0A %9ld --> Sum of Negative Votes\0A\00"
@.str.5 = [47 x i8] c"\0A %9s --> Ratio of Sums, Positive to Negative\0A\00"
define void @report_ratios(i16 signext %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i64
%5 = alloca i64
%6 = bitcast float* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = bitcast i64* %4 to i8*
%9 = bitcast i64* %5 to i8*
%10 = call float @get_vratio(i16 signext %0, i64* %4, i64* %5)
%11 = load i64, i64* %4
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = load i64, i64* %5
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i64 %13)
%15 = call i8* @ratio_string(float %10)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%17 = call float @get_ratio(i16 signext %0, float* %2, float* %3)
%18 = load float, float* %2
%19 = fptosi float %18 to i64
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i64 %19)
%21 = load float, float* %3
%22 = fptosi float %21 to i64
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i64 %22)
%24 = call i8* @ratio_string(float %17)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), i8* %24)
ret void
}