#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*/ Calc_Time(int *, int *, int *, int);
int ceil(float);
int Calc_Tiny(int Size, int Dist, int *Days, int *Hrs, int *Mins) {
  int Total_Trips = 0;
  int Trip_Time = 0;
  int Total_Time = 0;
  if (Dist > 3000)
    return 0;
  Total_Trips = ceil((float)Size / (3 * 200 * 1000));
  if (Total_Trips > 1)
    Total_Trips += (Total_Trips - 1);
  Trip_Time = Dist * 15;
  Total_Time = Total_Trips * Trip_Time;
  Calc_Time(Days, Hrs, Mins, Total_Time);
  return Total_Time;
}


x86 assembly (clang, -O0):
<Calc_Tiny>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0xbb8,-0xc(%rbp)
jle    1168 <Calc_Tiny+0x48>
movl   $0x0,-0x4(%rbp)
jmp    11c2 <Calc_Tiny+0xa2>
cvtsi2ssl -0x8(%rbp),%xmm0
movss  0xe8b(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x1,-0x2c(%rbp)
jle    1197 <Calc_Tiny+0x77>
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
add    -0x2c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
imul   $0xf,-0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
imul   -0x30(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x34(%rbp),%ecx
call   1040 <Calc_Time@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Calc_Tiny>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %ebp,%ebp
cmp    $0xbb8,%esi
jg     1171 <Calc_Tiny+0x51>
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %esi,%ebx
cvtsi2ss %edi,%xmm0
divss  0xeb7(%rip),%xmm0
call   1030 <ceil@plt>
cmp    $0x2,%eax
lea    -0x1(%rax,%rax,1),%ecx
cmovl  %eax,%ecx
imul   %ecx,%ebx
lea    (%rbx,%rbx,4),%eax
lea    (%rax,%rax,2),%ebp
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %ebp,%ecx
call   1040 <Calc_Time@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Calc_Tiny(i32 %0, i32 %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32 0, i32* %12
store i32 0, i32* %13
store i32 0, i32* %14
%15 = load i32, i32* %8
%16 = icmp sgt i32 %15, 3000
br i1 %16, label %17, label %18
17: ; preds = %5
store i32 0, i32* %6
br label %42
18: ; preds = %5
%19 = load i32, i32* %7
%20 = sitofp i32 %19 to float
%21 = fdiv float %20, 6.000000e+05
%22 = call i32 @ceil(float %21)
store i32 %22, i32* %12
%23 = load i32, i32* %12
%24 = icmp sgt i32 %23, 1
br i1 %24, label %25, label %30
25: ; preds = %18
%26 = load i32, i32* %12
%27 = sub nsw i32 %26, 1
%28 = load i32, i32* %12
%29 = add nsw i32 %28, %27
store i32 %29, i32* %12
br label %30
30: ; preds = %25, %18
%31 = load i32, i32* %8
%32 = mul nsw i32 %31, 15
store i32 %32, i32* %13
%33 = load i32, i32* %12
%34 = load i32, i32* %13
%35 = mul nsw i32 %33, %34
store i32 %35, i32* %14
%36 = load i32*, i32** %9
%37 = load i32*, i32** %10
%38 = load i32*, i32** %11
%39 = load i32, i32* %14
%40 = call i32 @Calc_Time(i32* %36, i32* %37, i32* %38, i32 %39)
%41 = load i32, i32* %14
store i32 %41, i32* %6
br label %42
42: ; preds = %30, %17
%43 = load i32, i32* %6
ret i32 %43
}

LLVM IR (-O2):
define i32 @Calc_Tiny(i32 %0, i32 %1, i32* %2, i32* %3, i32* %4) {
%6 = icmp sgt i32 %1, 3000
br i1 %6, label %18, label %7
7: ; preds = %5
%8 = sitofp i32 %0 to float
%9 = fdiv float %8, 6.000000e+05
%10 = tail call i32 @ceil(float %9)
%11 = icmp sgt i32 %10, 1
%12 = shl i32 %10, 1
%13 = add i32 %12, -1
%14 = select i1 %11, i32 %13, i32 %10
%15 = mul nsw i32 %1, 15
%16 = mul nsw i32 %15, %14
%17 = tail call i32 @Calc_Time(i32* %2, i32* %3, i32* %4, i32 %16)
br label %18
18: ; preds = %5, %7
%19 = phi i32 [ %16, %7 ], [ 0, %5 ]
ret i32 %19
}