#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*/ printf(char *, ...);
float winPercent(int, int);
int main() {
  int win = 110, lose = 44;
  float winPercent2 = 0.0;
  printf("\nThis program figures the win percentage of the 1927 New York "
         "Yankees & the 1955 Brooklyn Dodgers.\n");
  winPercent2 = winPercent(win, lose);
  printf("\n1927 Yankees won %.2f", winPercent2);
  win = 98, lose = 55;
  winPercent2 = winPercent(win, lose);
  printf("\n1955 Dodgers won %.2f\n", winPercent2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x6e,-0x8(%rbp)
movl   $0x2c,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <winPercent@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xef1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x62,-0x8(%rbp)
movl   $0x37,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <winPercent@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x6e,%edi
mov    $0x2c,%esi
call   1050 <winPercent@plt>
cvtss2sd %xmm0,%xmm0
lea    0xea9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x62,%edi
mov    $0x37,%esi
call   1050 <winPercent@plt>
cvtss2sd %xmm0,%xmm0
lea    0xe9f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [100 x i8] c"\0AThis program figures the win percentage of the 1927 New York Yankees & the 1955 Brooklyn Dodgers.\0A\00"
@.str.1 = [23 x i8] c"\0A1927 Yankees won %.2f\00"
@.str.2 = [24 x i8] c"\0A1955 Dodgers won %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
store i32 110, i32* %2
store i32 44, i32* %3
store float 0.000000e+00, float* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call float @winPercent(i32 %6, i32 %7)
store float %8, float* %4
%9 = load float, float* %4
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), double %10)
store i32 98, i32* %2
store i32 55, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call float @winPercent(i32 %12, i32 %13)
store float %14, float* %4
%15 = load float, float* %4
%16 = fpext float %15 to double
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), double %16)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"\0A1927 Yankees won %.2f\00"
@.str.2 = [24 x i8] c"\0A1955 Dodgers won %.2f\0A\00"
@str = [99 x i8] c"\0AThis program figures the win percentage of the 1927 New York Yankees & the 1955 Brooklyn Dodgers.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([99 x i8], [99 x i8]* @str, i64 0, i64 0))
%2 = tail call float @winPercent(i32 110, i32 44)
%3 = fpext float %2 to double
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = tail call float @winPercent(i32 98, i32 55)
%6 = fpext float %5 to double
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}