#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 */
scalar_t__ fmod(double, int);
double getNextDataTransmitTime(double nextDataBoundary, int numSlots) {
  double returnTime;
  int i;
  returnTime = nextDataBoundary;
  for (i = 0; i < numSlots; i++) {
    returnTime += (3);
    if (fmod(returnTime, ((19 - (2 + 1)) * (3) + 2 * (4.5) + 1 * (3))) == 0) {
      returnTime += (2 * (4.5) + 1 * (3));
    }
  }
  return returnTime;
}


x86 assembly (clang, -O0):
<getNextDataTransmitTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    118d <getNextDataTransmitTime+0x7d>
movsd  0xebb(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x3c,%edi
call   1030 <fmod@plt>
cmp    $0x0,%rax
jne    117a <getNextDataTransmitTime+0x6a>
movsd  0xe98(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    117f <getNextDataTransmitTime+0x6f>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1131 <getNextDataTransmitTime+0x21>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNextDataTransmitTime>:
push   %rbx
sub    $0x10,%rsp
movapd %xmm0,%xmm1
test   %edi,%edi
jle    1172 <getNextDataTransmitTime+0x62>
mov    %edi,%ebx
jmp    1139 <getNextDataTransmitTime+0x29>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movapd %xmm0,%xmm1
add    $0xffffffff,%ebx
je     1176 <getNextDataTransmitTime+0x66>
addsd  0xebf(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
mov    $0x3c,%edi
call   1030 <fmod@plt>
movsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm0
addsd  0xea1(%rip),%xmm0
test   %rax,%rax
je     1130 <getNextDataTransmitTime+0x20>
movapd %xmm1,%xmm0
jmp    1130 <getNextDataTransmitTime+0x20>
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @getNextDataTransmitTime(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
%6 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%7 = load double, double* %3
store double %7, double* %5
store i32 0, i32* %6
br label %8
8: ; preds = %22, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %25
12: ; preds = %8
%13 = load double, double* %5
%14 = fadd double %13, 3.000000e+00
store double %14, double* %5
%15 = load double, double* %5
%16 = call i64 @fmod(double %15, i32 60)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = load double, double* %5
%20 = fadd double %19, 1.200000e+01
store double %20, double* %5
br label %21
21: ; preds = %18, %12
br label %22
22: ; preds = %21
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
br label %8
25: ; preds = %8
%26 = load double, double* %5
ret double %26
}

LLVM IR (-O2):
define double @getNextDataTransmitTime(double %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i32 [ %12, %4 ], [ 0, %2 ]
%6 = phi double [ %11, %4 ], [ %0, %2 ]
%7 = fadd double %6, 3.000000e+00
%8 = tail call i64 @fmod(double %7, i32 60)
%9 = icmp eq i64 %8, 0
%10 = fadd double %7, 1.200000e+01
%11 = select i1 %9, double %10, double %7
%12 = add nuw nsw i32 %5, 1
%13 = icmp eq i32 %12, %1
br i1 %13, label %14, label %4
14: ; preds = %4, %2
%15 = phi double [ %0, %2 ], [ %11, %4 ]
ret double %15
}