#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 igamif(float, float);
int /*<<< orphan*/ mtherrf(char *, int);
float pdtrif(int k, float yy) {
  float v, y;
  y = yy;
  if ((k < 0) || (y < 0.0) || (y >= 1.0)) {
    mtherrf("pdtrif", 1);
    return (0.0);
  }
  v = k + 1;
  v = igamif(v, y);
  return (v);
}


x86 assembly (clang, -O0):
<pdtrif>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1175 <pdtrif+0x55>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     1175 <pdtrif+0x55>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe95(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1193 <pdtrif+0x73>
lea    0xe8c(%rip),%rdi
mov    $0x1,%esi
call   1040 <mtherrf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11c0 <pdtrif+0xa0>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
call   1030 <igamif@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdtrif>:
push   %rax
ucomiss 0xed8(%rip),%xmm0
jae    1149 <pdtrif+0x29>
test   %edi,%edi
js     1149 <pdtrif+0x29>
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm1,%xmm0
ja     1149 <pdtrif+0x29>
add    $0x1,%edi
xorps  %xmm0,%xmm0
cvtsi2ss %edi,%xmm0
pop    %rax
jmp    1030 <igamif@plt>
lea    0xeb4(%rip),%rdi
mov    $0x1,%esi
call   1040 <mtherrf@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"pdtrif\00"
define float @pdtrif(i32 %0, float %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 %0, i32* %4
store float %1, float* %5
%8 = load float, float* %5
store float %8, float* %7
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %2
%12 = load float, float* %7
%13 = fpext float %12 to double
%14 = fcmp olt double %13, 0.000000e+00
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load float, float* %7
%17 = fpext float %16 to double
%18 = fcmp oge double %17, 1.000000e+00
br i1 %18, label %19, label %21
19: ; preds = %15, %11, %2
%20 = call i32 @mtherrf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1)
store float 0.000000e+00, float* %3
br label %29
21: ; preds = %15
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
%24 = sitofp i32 %23 to float
store float %24, float* %6
%25 = load float, float* %6
%26 = load float, float* %7
%27 = call float @igamif(float %25, float %26)
store float %27, float* %6
%28 = load float, float* %6
store float %28, float* %3
br label %29
29: ; preds = %21, %19
%30 = load float, float* %3
ret float %30
}

LLVM IR (-O2):
@.str = [7 x i8] c"pdtrif\00"
define float @pdtrif(i32 %0, float %1) {
%3 = icmp sgt i32 %0, -1
%4 = fcmp uge float %1, 0.000000e+00
%5 = and i1 %3, %4
%6 = fcmp ult float %1, 1.000000e+00
%7 = and i1 %6, %5
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @mtherrf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1)
br label %14
10: ; preds = %2
%11 = add nuw nsw i32 %0, 1
%12 = sitofp i32 %11 to float
%13 = tail call float @igamif(float %12, float %1)
br label %14
14: ; preds = %10, %8
%15 = phi float [ 0.000000e+00, %8 ], [ %13, %10 ]
ret float %15
}