#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__ do10800Fn(double, double, double, double, double, double, double,
                     double, double, double, double, double, double, double,
                     double);
long long doManyExternal(long long numIters) {
  long long count = 0;
  double x = 0;
  while (numIters--) {
    x += do10800Fn(.0000001, .0000002, .0000003, .0000004, .0000005, .0000006,
                   .0000007, .0000008, .0000009, .00000010, .00000011,
                   .00000012, .00000013, .00000014, .00000015);
    count += 10800;
  }
  if (x == 0.0)
    count += 1;
  return count;
}


x86 assembly (clang, -O0):
<doManyExternal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
cmp    $0x0,%rax
je     1217 <doManyExternal+0x107>
movsd  0xeb2(%rip),%xmm13
movsd  0xeb2(%rip),%xmm1
movsd  0xeb2(%rip),%xmm2
movsd  0xeb2(%rip),%xmm3
movsd  0xeb2(%rip),%xmm4
movsd  0xeb2(%rip),%xmm5
movsd  0xeb2(%rip),%xmm6
movsd  0xeb2(%rip),%xmm7
movsd  0xeb1(%rip),%xmm14
movsd  0xeb0(%rip),%xmm12
movsd  0xeaf(%rip),%xmm11
movsd  0xeae(%rip),%xmm10
movsd  0xead(%rip),%xmm9
movsd  0xeac(%rip),%xmm8
movaps %xmm13,%xmm0
movsd  %xmm14,(%rsp)
movsd  %xmm13,0x8(%rsp)
movsd  %xmm12,0x10(%rsp)
movsd  %xmm11,0x18(%rsp)
movsd  %xmm10,0x20(%rsp)
movsd  %xmm9,0x28(%rsp)
movsd  %xmm8,0x30(%rsp)
call   1030 <do10800Fn@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x2a30,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <doManyExternal+0x1c>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    123b <doManyExternal+0x12b>
jp     123b <doManyExternal+0x12b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doManyExternal>:
test   %rdi,%rdi
je     1229 <doManyExternal+0x119>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xorpd  %xmm1,%xmm1
movabs $0x3e8172c417c771ef,%r13
72 81 3e
movabs $0x3e801b2b29a4692b,%rbx
1b 80 3e
movabs $0x3e7d87247702c0d0,%rbp
87 7d 3e
movabs $0x3e7ad7f29abcaf48,%r14
d7 7a 3e
movabs $0x3eae32f0ee144531,%r15
32 ae 3e
mov    %rdi,0x8(%rsp)
mov    %rdi,%r12
cs nopw 0x0(%rax,%rax,1)
nop
movsd  %xmm1,0x10(%rsp)
sub    $0x8,%rsp
movsd  0xe7e(%rip),%xmm0
movsd  0xe7e(%rip),%xmm1
movsd  0xe7e(%rip),%xmm2
movsd  0xe7e(%rip),%xmm3
movsd  0xe7e(%rip),%xmm4
movsd  0xe7e(%rip),%xmm5
movsd  0xe7e(%rip),%xmm6
movsd  0xe7e(%rip),%xmm7
movabs $0x3e8421f5f40d8376,%rax
21 84 3e
push   %rax
movabs $0x3e82ca5d05ea7ab3,%rax
ca 82 3e
push   %rax
push   %r13
push   %rbx
push   %rbp
push   %r14
push   %r15
call   1030 <do10800Fn@plt>
movsd  0x50(%rsp),%xmm1
add    $0x40,%rsp
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  %xmm0,%xmm1
add    $0xffffffffffffffff,%r12
jne    1170 <doManyExternal+0x60>
imul   $0x2a30,0x8(%rsp),%rcx
xorpd  %xmm0,%xmm0
cmpeqsd %xmm0,%xmm1
movq   %xmm1,%rax
and    $0x1,%eax
or     %rcx,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @doManyExternal(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca double
store i64 %0, i64* %2
store i64 0, i64* %3
store double 0.000000e+00, double* %4
br label %5
5: ; preds = %9, %1
%6 = load i64, i64* %2
%7 = add nsw i64 %6, -1
store i64 %7, i64* %2
%8 = icmp ne i64 %6, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = call i64 @do10800Fn(double 0x3E7AD7F29ABCAF48, double 2.000000e-07, double 3.000000e-07, double 4.000000e-07, double 5.000000e-07, double 6.000000e-07, double 0x3EA77CF44765195F, double 0x3EAAD7F29ABCAF48, double 0x3EAE32F0EE144531, double 0x3E7AD7F29ABCAF48, double 1.100000e-07, double 1.200000e-07, double 1.300000e-07, double 1.400000e-07, double 1.500000e-07)
%11 = sitofp i64 %10 to double
%12 = load double, double* %4
%13 = fadd double %12, %11
store double %13, double* %4
%14 = load i64, i64* %3
%15 = add nsw i64 %14, 10800
store i64 %15, i64* %3
br label %5
16: ; preds = %5
%17 = load double, double* %4
%18 = fcmp oeq double %17, 0.000000e+00
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i64, i64* %3
%21 = add nsw i64 %20, 1
store i64 %21, i64* %3
br label %22
22: ; preds = %19, %16
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
define i64 @doManyExternal(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %16, label %3
3: ; preds = %1, %3
%4 = phi double [ %9, %3 ], [ 0.000000e+00, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = add nsw i64 %5, -1
%7 = tail call i64 @do10800Fn(double 0x3E7AD7F29ABCAF48, double 2.000000e-07, double 3.000000e-07, double 4.000000e-07, double 5.000000e-07, double 6.000000e-07, double 0x3EA77CF44765195F, double 0x3EAAD7F29ABCAF48, double 0x3EAE32F0EE144531, double 0x3E7AD7F29ABCAF48, double 1.100000e-07, double 1.200000e-07, double 1.300000e-07, double 1.400000e-07, double 1.500000e-07)
%8 = sitofp i64 %7 to double
%9 = fadd double %4, %8
%10 = icmp eq i64 %6, 0
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = mul i64 %0, 10800
%13 = fcmp oeq double %9, 0.000000e+00
%14 = zext i1 %13 to i64
%15 = or i64 %12, %14
br label %16
16: ; preds = %11, %1
%17 = phi i64 [ %15, %11 ], [ 1, %1 ]
ret i64 %17
}