#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*/ ArbF3();
int /*<<< orphan*/ BNCHz();
int /*<<< orphan*/ BNCIO(int);
int /*<<< orphan*/ DoubleDigits(long);
int /*<<< orphan*/ printf(char *, double);
long int PulseF4(double freq) {
  long int contrep;
  long int stat = 0;
  printf("frequency = %0.2lf\n", freq);
  BNCIO(46);
  BNCIO(4);
  BNCIO(49);
  DoubleDigits(freq);
  BNCHz();
  if (freq <= 10.) {
    BNCIO(40);
    BNCIO(1);
    BNCHz();
    BNCIO(24);
    BNCIO(46);
    BNCIO(2);
    contrep = 16000 * freq;
    DoubleDigits(contrep);
    BNCHz();
    ArbF3();
  }
  return (stat);
}


x86 assembly (clang, -O0):
<PulseF4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2e,%edi
call   1050 <BNCIO@plt>
mov    $0x4,%edi
call   1050 <BNCIO@plt>
mov    $0x31,%edi
call   1050 <BNCIO@plt>
cvttsd2si -0x8(%rbp),%rdi
call   1030 <DoubleDigits@plt>
mov    $0x0,%al
call   1070 <BNCHz@plt>
movsd  0xe52(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     121f <PulseF4+0xcf>
mov    $0x28,%edi
call   1050 <BNCIO@plt>
mov    $0x1,%edi
call   1050 <BNCIO@plt>
mov    $0x0,%al
call   1070 <BNCHz@plt>
mov    $0x18,%edi
call   1050 <BNCIO@plt>
mov    $0x2e,%edi
call   1050 <BNCIO@plt>
mov    $0x2,%edi
call   1050 <BNCIO@plt>
movsd  0xe0e(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <DoubleDigits@plt>
mov    $0x0,%al
call   1070 <BNCHz@plt>
mov    $0x0,%al
call   1060 <ArbF3@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PulseF4>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2e,%edi
call   1050 <BNCIO@plt>
mov    $0x4,%edi
call   1050 <BNCIO@plt>
mov    $0x31,%edi
call   1050 <BNCIO@plt>
cvttsd2si (%rsp),%rdi
call   1030 <DoubleDigits@plt>
xor    %eax,%eax
call   1070 <BNCHz@plt>
movsd  0xe66(%rip),%xmm0
ucomisd (%rsp),%xmm0
jb     11ff <PulseF4+0xaf>
mov    $0x28,%edi
call   1050 <BNCIO@plt>
mov    $0x1,%edi
call   1050 <BNCIO@plt>
xor    %eax,%eax
call   1070 <BNCHz@plt>
mov    $0x18,%edi
call   1050 <BNCIO@plt>
mov    $0x2e,%edi
call   1050 <BNCIO@plt>
mov    $0x2,%edi
call   1050 <BNCIO@plt>
movsd  (%rsp),%xmm0
mulsd  0xe21(%rip),%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <DoubleDigits@plt>
xor    %eax,%eax
call   1070 <BNCHz@plt>
xor    %eax,%eax
call   1060 <ArbF3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"frequency = %0.2lf\0A\00"
define i64 @PulseF4(double %0) {
%2 = alloca double
%3 = alloca i64
%4 = alloca i64
store double %0, double* %2
store i64 0, i64* %4
%5 = load double, double* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %5)
%7 = call i32 @BNCIO(i32 46)
%8 = call i32 @BNCIO(i32 4)
%9 = call i32 @BNCIO(i32 49)
%10 = load double, double* %2
%11 = fptosi double %10 to i64
%12 = call i32 @DoubleDigits(i64 %11)
%13 = call i32 (...) @BNCHz()
%14 = load double, double* %2
%15 = fcmp ole double %14, 1.000000e+01
br i1 %15, label %16, label %30
16: ; preds = %1
%17 = call i32 @BNCIO(i32 40)
%18 = call i32 @BNCIO(i32 1)
%19 = call i32 (...) @BNCHz()
%20 = call i32 @BNCIO(i32 24)
%21 = call i32 @BNCIO(i32 46)
%22 = call i32 @BNCIO(i32 2)
%23 = load double, double* %2
%24 = fmul double 1.600000e+04, %23
%25 = fptosi double %24 to i64
store i64 %25, i64* %3
%26 = load i64, i64* %3
%27 = call i32 @DoubleDigits(i64 %26)
%28 = call i32 (...) @BNCHz()
%29 = call i32 (...) @ArbF3()
br label %30
30: ; preds = %16, %1
%31 = load i64, i64* %4
ret i64 %31
}

LLVM IR (-O2):
@.str = [20 x i8] c"frequency = %0.2lf\0A\00"
define i64 @PulseF4(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %0)
%3 = tail call i32 @BNCIO(i32 46)
%4 = tail call i32 @BNCIO(i32 4)
%5 = tail call i32 @BNCIO(i32 49)
%6 = fptosi double %0 to i64
%7 = tail call i32 @DoubleDigits(i64 %6)
%8 = tail call i32 (...) @BNCHz()
%9 = fcmp ugt double %0, 1.000000e+01
br i1 %9, label %22, label %10
10: ; preds = %1
%11 = tail call i32 @BNCIO(i32 40)
%12 = tail call i32 @BNCIO(i32 1)
%13 = tail call i32 (...) @BNCHz()
%14 = tail call i32 @BNCIO(i32 24)
%15 = tail call i32 @BNCIO(i32 46)
%16 = tail call i32 @BNCIO(i32 2)
%17 = fmul double %0, 1.600000e+04
%18 = fptosi double %17 to i64
%19 = tail call i32 @DoubleDigits(i64 %18)
%20 = tail call i32 (...) @BNCHz()
%21 = tail call i32 (...) @ArbF3()
br label %22
22: ; preds = %10, %1
ret i64 0
}