#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*/ pretty_int(int, char *);
int /*<<< orphan*/ printf(char *, char *, char *, double);
void show_results(int num_spins, int num_wins) {
  char spins_string[] = {' ', ' ', ' ', ' ', ' ', ' ', ' ',
                         ' ', ' ', ' ', ' ', ' ', '\0'};
  char wins_string[] = {' ', ' ', ' ', ' ', ' ', ' ', ' ',
                        ' ', ' ', ' ', ' ', ' ', '\0'};
  double percent = 100.0 * (double)num_wins / (double)num_spins;
  pretty_int(num_spins, spins_string);
  pretty_int(num_wins, wins_string);
  printf(" | %15s | %14s | %11.2f%% |\n", spins_string, wins_string, percent);
}


x86 assembly (clang, -O0):
<show_results>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x15(%rbp)
mov    0xed1(%rip),%eax
mov    %eax,-0xd(%rbp)
mov    0xecc(%rip),%al
mov    %al,-0x9(%rbp)
mov    0xeb6(%rip),%rax
mov    %rax,-0x22(%rbp)
mov    0xeb4(%rip),%eax
mov    %eax,-0x1a(%rbp)
mov    0xeaf(%rip),%al
mov    %al,-0x16(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xe8b(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x15(%rbp),%rsi
call   1040 <pretty_int@plt>
mov    -0x8(%rbp),%edi
lea    -0x22(%rbp),%rsi
call   1040 <pretty_int@plt>
lea    -0x15(%rbp),%rsi
lea    -0x22(%rbp),%rdx
movsd  -0x30(%rbp),%xmm0
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_results>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %esi,%ebx
movabs $0x20202020202020,%rax
mov    %rax,0x25(%rsp)
movabs $0x2020202020202020,%rcx
20 20 20
mov    %rcx,0x20(%rsp)
mov    %rax,0x15(%rsp)
cvtsi2sd %esi,%xmm1
mulsd  0xea6(%rip),%xmm1
mov    %rcx,0x10(%rsp)
cvtsi2sd %edi,%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
lea    0x20(%rsp),%r14
mov    %r14,%rsi
call   1040 <pretty_int@plt>
lea    0x10(%rsp),%r15
mov    %ebx,%edi
mov    %r15,%rsi
call   1040 <pretty_int@plt>
lea    0xe85(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.show_results.spins_string = [13 x i8] c" \00"
@__const.show_results.wins_string = [13 x i8] c" \00"
@.str = [29 x i8] c" | %15s | %14s | %11.2f%% |\0A\00"
define void @show_results(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [13 x i8]
%6 = alloca [13 x i8]
%7 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = bitcast [13 x i8]* %5 to i8*
%9 = bitcast [13 x i8]* %6 to i8*
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = fmul double 1.000000e+02, %11
%13 = load i32, i32* %3
%14 = sitofp i32 %13 to double
%15 = fdiv double %12, %14
store double %15, double* %7
%16 = load i32, i32* %3
%17 = getelementptr inbounds [13 x i8], [13 x i8]* %5, i64 0, i64 0
%18 = call i32 @pretty_int(i32 %16, i8* %17)
%19 = load i32, i32* %4
%20 = getelementptr inbounds [13 x i8], [13 x i8]* %6, i64 0, i64 0
%21 = call i32 @pretty_int(i32 %19, i8* %20)
%22 = getelementptr inbounds [13 x i8], [13 x i8]* %5, i64 0, i64 0
%23 = getelementptr inbounds [13 x i8], [13 x i8]* %6, i64 0, i64 0
%24 = load double, double* %7
%25 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %22, i8* %23, double %24)
ret void
}

LLVM IR (-O2):
@__const.show_results.wins_string = [13 x i8] c" \00"
@.str = [29 x i8] c" | %15s | %14s | %11.2f%% |\0A\00"
define void @show_results(i32 %0, i32 %1) {
%3 = alloca [13 x i8]
%4 = alloca [13 x i8]
%5 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%7 = sitofp i32 %1 to double
%8 = fmul double %7, 1.000000e+02
%9 = sitofp i32 %0 to double
%10 = fdiv double %8, %9
%11 = call i32 @pretty_int(i32 %0, i8* %5)
%12 = call i32 @pretty_int(i32 %1, i8* %6)
%13 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6, double %10)
ret void
}