#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 *, int, int, char *, int, double);
void dump(double rate, double num, double den, double bch, double spaces) {
  int i;
  char s[10];
  for (i = 0; i < (int)spaces; i++) {
    s[i] = 0x20;
  }
  s[i] = 0x0;
  printf("coderate = %d/%d,%sBCH rate = %2d, ts rate = %f\n", (int)num,
         (int)den, s, (int)bch, rate);
}


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cvttsd2si -0x28(%rbp),%ecx
cmp    %ecx,%eax
jge    115f <dump+0x4f>
movslq -0x2c(%rbp),%rax
movb   $0x20,-0x36(%rbp,%rax,1)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1138 <dump+0x28>
movslq -0x2c(%rbp),%rax
movb   $0x0,-0x36(%rbp,%rax,1)
cvttsd2si -0x10(%rbp),%esi
cvttsd2si -0x18(%rbp),%edx
lea    -0x36(%rbp),%rcx
cvttsd2si -0x20(%rbp),%r8d
movsd  -0x8(%rbp),%xmm0
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
push   %rbx
sub    $0x30,%rsp
cvttsd2si %xmm4,%eax
test   %eax,%eax
jle    1173 <dump+0x53>
mov    %eax,%ebx
lea    0x6(%rsp),%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
movsd  %xmm0,0x28(%rsp)
movsd  %xmm3,0x20(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
call   1040 <memset@plt>
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
movsd  0x28(%rsp),%xmm0
jmp    1175 <dump+0x55>
xor    %ebx,%ebx
movb   $0x0,0x6(%rsp,%rbx,1)
cvttsd2si %xmm1,%esi
cvttsd2si %xmm2,%edx
cvttsd2si %xmm3,%r8d
lea    0xe72(%rip),%rdi
lea    0x6(%rsp),%rcx
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"coderate = %d/%d,%sBCH rate = %2d, ts rate = %f\0A\00"
define void @dump(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca i32
%12 = alloca [10 x i8]
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
store i32 0, i32* %11
br label %13
13: ; preds = %22, %5
%14 = load i32, i32* %11
%15 = load double, double* %10
%16 = fptosi double %15 to i32
%17 = icmp slt i32 %14, %16
br i1 %17, label %18, label %25
18: ; preds = %13
%19 = load i32, i32* %11
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 %20
store i8 32, i8* %21
br label %22
22: ; preds = %18
%23 = load i32, i32* %11
%24 = add nsw i32 %23, 1
store i32 %24, i32* %11
br label %13
25: ; preds = %13
%26 = load i32, i32* %11
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 %27
store i8 0, i8* %28
%29 = load double, double* %7
%30 = fptosi double %29 to i32
%31 = load double, double* %8
%32 = fptosi double %31 to i32
%33 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 0
%34 = load double, double* %9
%35 = fptosi double %34 to i32
%36 = load double, double* %6
%37 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %30, i32 %32, i8* %33, i32 %35, double %36)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"coderate = %d/%d,%sBCH rate = %2d, ts rate = %f\0A\00"
define void @dump(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca [10 x i8]
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%8 = fptosi double %4 to i32
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%12 = zext i32 %8 to i64
%13 = zext i32 %8 to i64
br label %14
14: ; preds = %10, %5
%15 = phi i64 [ 0, %5 ], [ %13, %10 ]
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 %15
store i8 0, i8* %16
%17 = fptosi double %1 to i32
%18 = fptosi double %2 to i32
%19 = fptosi double %3 to i32
%20 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18, i8* %7, i32 %19, double %0)
ret void
}