#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 */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ symbols;

/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ LOG_LOCAL5;
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ LOG_PID;
double atof(char *);
scalar_t__ atoi(char *);
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ setupDMA();
int /*<<< orphan*/ setupDMATab(double, double, double, int);
int /*<<< orphan*/ setup_gpios();
int /*<<< orphan*/ setup_io();
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
int strlen(char *);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ txSym(unsigned char, double);
int /*<<< orphan*/ txoff();
int /*<<< orphan*/ txon();
int /*<<< orphan*/ wait_every(int);
int /*<<< orphan*/ wspr(char *, char *, char *, unsigned char *);
int main(int argc, char *argv[]) {
  unsigned char symbols[162];
  int i;
  double centre_freq;
  int wspr15;
  double wspr_symtime;
  int nbands = argc - 4;
  int band = 0;
  int tune_mode = 0;
  openlog("wspr", LOG_PID, LOG_LOCAL5);
  syslog(LOG_INFO, "starting");
  if (argc < 5) {
    printf("Usage: wspr <[prefix/]callsign[/A-Z,/0-9,/00-99]> <locator> <power "
           "in dBm> [<frequency in Hz or 0 for interval> ...]\n");
    printf("\te.g.: ./wspr K1JT/P JO21 10 7040074 0 0 10140174 0 0\n");
    return 1;
  }
  if (atoi(argv[3]) < 0) {
    printf("Tune mode\n");
    tune_mode = 1;
  }
  wspr(argv[1], argv[2], argv[3], symbols);
  printf("Symbols: ");
  for (i = 0; i < sizeof(symbols) / sizeof(*symbols); i++)
    printf("%d,", symbols[i]);
  printf("\n");
  setup_io();
  setup_gpios();
  txon();
  setupDMA();
  printf("Ready for transmit...\n");
  for (;;) {
    txoff();
    centre_freq = atof(argv[band + 4]);
    wspr15 = (centre_freq > 137600 && centre_freq < 137625) ||
             (centre_freq > 475800 && centre_freq < 475825) ||
             (centre_freq > 1838200 && centre_freq < 1838225);
    wspr_symtime = (wspr15) ? 8.0 * (8192.0 / 12000.0) : (8192.0 / 12000.0);
    band++;
    if (band >= nbands)
      band = 0;
    if (centre_freq)
      setupDMATab(centre_freq, 1.0 / wspr_symtime, wspr_symtime, 4);
    if (tune_mode == 0) {
      wait_every((wspr15) ? 15 : 2);
    }
    time_t t;
    time(&t);
    char buf[256];
    strcpy(buf, ctime(&t));
    buf[strlen(buf) - 1] = '\0';
    printf("%s - %s@%f\n", buf, (wspr15) ? "wspr-15" : "wspr-2", centre_freq);
    if (centre_freq) {
      txon();
      for (i = 0; i < 162; i++) {
        txSym(symbols[i], wspr_symtime);
      }
    }
  }
  syslog(LOG_NOTICE, "terminated");
  closelog();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0xe4(%rbp)
movl   $0x0,-0xe8(%rbp)
movl   $0x0,-0xec(%rbp)
mov    0x2d80(%rip),%rax
mov    (%rax),%esi
mov    0x2d6f(%rip),%rax
mov    (%rax),%edx
lea    0xdd6(%rip),%rdi
call   1120 <openlog@plt>
mov    0x2d52(%rip),%rax
mov    (%rax),%edi
lea    0xdc6(%rip),%rsi
call   10e0 <syslog@plt>
cmpl   $0x5,-0x8(%rbp)
jge    12c0 <main+0xa0>
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x1,%eax
add    $0x210,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1110 <atoi@plt>
cmp    $0x0,%rax
jge    12ef <main+0xcf>
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x1,-0xec(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
lea    -0xc0(%rbp),%rcx
call   10b0 <wspr@plt>
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x0,-0xc4(%rbp)
movslq -0xc4(%rbp),%rax
cmp    $0xa2,%rax
jae    136f <main+0x14f>
movslq -0xc4(%rbp),%rax
movzbl -0xc0(%rbp,%rax,1),%esi
ff
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0xc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc4(%rbp)
jmp    132b <main+0x10b>
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x0,%al
call   1140 <setup_io@plt>
mov    $0x0,%al
call   10c0 <setup_gpios@plt>
mov    $0x0,%al
call   1090 <txon@plt>
mov    $0x0,%al
call   1100 <setupDMA@plt>
lea    0xd7c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x0,%al
call   1130 <txoff@plt>
mov    -0x10(%rbp),%rax
mov    -0xe8(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <atof@plt>
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
movsd  0xc21(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1407 <main+0x1e7>
mov    $0x1,%al
movsd  0xc15(%rip),%xmm0
ucomisd -0xd0(%rbp),%xmm0
ff
mov    %al,-0x1f1(%rbp)
ja     1486 <main+0x266>
movsd  -0xd0(%rbp),%xmm0
ff
movsd  0xbf9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    143f <main+0x21f>
mov    $0x1,%al
movsd  0xbed(%rip),%xmm0
ucomisd -0xd0(%rbp),%xmm0
ff
mov    %al,-0x1f1(%rbp)
ja     1486 <main+0x266>
movsd  -0xd0(%rbp),%xmm0
ff
xor    %eax,%eax
movsd  0xbcf(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x1f2(%rbp)
jbe    147a <main+0x25a>
movsd  0xbbf(%rip),%xmm0
ucomisd -0xd0(%rbp),%xmm0
ff
seta   %al
mov    %al,-0x1f2(%rbp)
mov    -0x1f2(%rbp),%al
mov    %al,-0x1f1(%rbp)
mov    -0x1f1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xd4(%rbp)
mov    -0xd4(%rbp),%eax
movsd  0xb8b(%rip),%xmm0
movsd  0xb8b(%rip),%xmm1
movsd  %xmm1,-0x208(%rbp)
ff
cmp    $0x0,%eax
movsd  %xmm0,-0x200(%rbp)
ff
jne    14d6 <main+0x2b6>
movsd  -0x208(%rbp),%xmm0
ff
movsd  %xmm0,-0x200(%rbp)
ff
movsd  -0x200(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
mov    -0xe8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe8(%rbp)
mov    -0xe8(%rbp),%eax
cmp    -0xe4(%rbp),%eax
jl     1511 <main+0x2f1>
movl   $0x0,-0xe8(%rbp)
movsd  -0xd0(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1531 <main+0x311>
jp     1531 <main+0x311>
jmp    155b <main+0x33b>
movsd  -0xd0(%rbp),%xmm0
ff
movsd  0xaff(%rip),%xmm1
divsd  -0xe0(%rbp),%xmm1
ff
movsd  -0xe0(%rbp),%xmm2
ff
mov    $0x4,%edi
call   10f0 <setupDMATab@plt>
cmpl   $0x0,-0xec(%rbp)
jne    1583 <main+0x363>
mov    -0xd4(%rbp),%ecx
mov    $0x2,%edi
mov    $0xf,%eax
cmp    $0x0,%ecx
cmovne %eax,%edi
call   1040 <wait_every@plt>
lea    -0xf0(%rbp),%rdi
call   10d0 <time@plt>
lea    -0x1f0(%rbp),%rax
mov    %rax,-0x210(%rbp)
lea    -0xf0(%rbp),%rdi
call   1060 <ctime@plt>
mov    -0x210(%rbp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
lea    -0x1f0(%rbp),%rdi
call   1070 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x1f0(%rbp,%rax,1)
lea    -0x1f0(%rbp),%rsi
mov    -0xd4(%rbp),%ecx
lea    0xb63(%rip),%rdx
lea    0xb54(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
movsd  -0xd0(%rbp),%xmm0
ff
lea    0xb32(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
movsd  -0xd0(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1628 <main+0x408>
jp     1628 <main+0x408>
jmp    1680 <main+0x460>
mov    $0x0,%al
call   1090 <txon@plt>
movl   $0x0,-0xc4(%rbp)
cmpl   $0xa2,-0xc4(%rbp)
jge    167b <main+0x45b>
movslq -0xc4(%rbp),%rax
mov    -0xc0(%rbp,%rax,1),%al
movsd  -0xe0(%rbp),%xmm0
ff
movzbl %al,%edi
call   10a0 <txSym@plt>
mov    -0xc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc4(%rbp)
jmp    1639 <main+0x419>
jmp    1680 <main+0x460>
jmp    13a7 <main+0x187>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1e8,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
mov    0x2d83(%rip),%rax
mov    (%rax),%esi
mov    0x2d72(%rip),%rax
mov    (%rax),%edx
lea    0xde1(%rip),%rdi
call   1140 <openlog@plt>
mov    0x2d55(%rip),%rax
mov    (%rax),%edi
lea    0xdd1(%rip),%rsi
call   1100 <syslog@plt>
mov    %ebx,0xc(%rsp)
cmp    $0x4,%ebx
jg     12c1 <main+0x81>
lea    0xe0e(%rip),%rdi
call   1060 <puts@plt>
lea    0xe77(%rip),%rdi
call   1060 <puts@plt>
mov    $0x1,%eax
add    $0x1e8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x18(%rbp),%rbx
mov    %rbx,%rdi
call   1130 <atoi@plt>
mov    %rax,0x20(%rsp)
test   %rax,%rax
jns    12e7 <main+0xa7>
lea    0xdbf(%rip),%rdi
call   1060 <puts@plt>
mov    0x18(%rbp),%rbx
addl   $0xfffffffc,0xc(%rsp)
mov    0x8(%rbp),%rdi
mov    0x10(%rbp),%rsi
lea    0x30(%rsp),%rcx
mov    %rbx,%rdx
call   10d0 <wspr@plt>
lea    0xd56(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xd52(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl 0x30(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
add    $0x1,%rbx
cmp    $0xa2,%rbx
jne    1320 <main+0xe0>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1160 <setup_io@plt>
xor    %eax,%eax
call   10e0 <setup_gpios@plt>
xor    %eax,%eax
call   10b0 <txon@plt>
xor    %eax,%eax
call   1120 <setupDMA@plt>
lea    0xd1e(%rip),%rdi
call   1060 <puts@plt>
lea    0x2c(%rsp),%r15
lea    0xe0(%rsp),%rbx
xor    %r13d,%r13d
jmp    1383 <main+0x143>
mov    %r12,%rbp
xor    %eax,%eax
call   1150 <txoff@plt>
movslq %r13d,%rax
mov    %rbp,%r12
mov    0x20(%rbp,%rax,8),%rdi
call   1070 <atof@plt>
movapd %xmm0,%xmm1
ucomisd 0xc5a(%rip),%xmm0
jbe    13b6 <main+0x176>
movsd  0xc58(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     1400 <main+0x1c0>
ucomisd 0xc52(%rip),%xmm1
jbe    13ce <main+0x18e>
movsd  0xc50(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     1400 <main+0x1c0>
xor    %r14d,%r14d
ucomisd 0xc47(%rip),%xmm1
jbe    1512 <main+0x2d2>
movsd  0xc49(%rip),%xmm0
ucomisd %xmm1,%xmm0
movsd  0xc35(%rip),%xmm0
jbe    140b <main+0x1cb>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%r14b
movsd  0xc2d(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
add    $0x1,%r13d
cmp    0xc(%rsp),%r13d
mov    $0x0,%eax
cmovge %eax,%r13d
ucomisd 0xc1d(%rip),%xmm1
movapd %xmm1,%xmm0
movsd  %xmm1,0x10(%rsp)
jne    1439 <main+0x1f9>
jnp    145b <main+0x21b>
movsd  0xbff(%rip),%xmm1
movsd  0x18(%rsp),%xmm2
divsd  %xmm2,%xmm1
movsd  0x10(%rsp),%xmm0
mov    $0x4,%edi
call   1110 <setupDMATab@plt>
cmpq   $0x0,0x20(%rsp)
js     1478 <main+0x238>
test   %r14b,%r14b
mov    $0x2,%edi
mov    $0xf,%eax
cmovne %eax,%edi
call   1050 <wait_every@plt>
mov    %r15,%rdi
call   10f0 <time@plt>
mov    %r15,%rdi
call   1080 <ctime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1090 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
test   %r14b,%r14b
lea    0xbd5(%rip),%rdx
lea    0xbc6(%rip),%rax
cmovne %rax,%rdx
lea    0xbaf(%rip),%rdi
mov    %rbx,%rsi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   10a0 <printf@plt>
movsd  0x10(%rsp),%xmm0
ucomisd 0xb6d(%rip),%xmm0
jne    14e3 <main+0x2a3>
jnp    1380 <main+0x140>
xor    %eax,%eax
call   10b0 <txon@plt>
xor    %ebp,%ebp
nopl   0x0(%rax)
movzbl 0x30(%rsp,%rbp,1),%edi
movsd  0x18(%rsp),%xmm0
call   10c0 <txSym@plt>
add    $0x1,%rbp
cmp    $0xa2,%rbp
jne    14f0 <main+0x2b0>
jmp    1380 <main+0x140>
movsd  0xb0e(%rip),%xmm0
jmp    140b <main+0x1cb>

LLVM IR (-O0):
@.str = [5 x i8] c"wspr\00"
@LOG_PID = global i32 0
@LOG_LOCAL5 = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [9 x i8] c"starting\00"
@.str.2 = [118 x i8] c"Usage: wspr <[prefix/]callsign[/A-Z,/0-9,/00-99]> <locator> <power in dBm> [<frequency in Hz or 0 for interval> ...]\0A\00"
@.str.3 = [55 x i8] c"\09e.g.: ./wspr K1JT/P JO21 10 7040074 0 0 10140174 0 0\0A\00"
@.str.4 = [11 x i8] c"Tune mode\0A\00"
@.str.5 = [10 x i8] c"Symbols: \00"
@.str.6 = [4 x i8] c"%d,\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [23 x i8] c"Ready for transmit...\0A\00"
@.str.9 = [12 x i8] c"%s - %s@%f\0A\00"
@.str.10 = [8 x i8] c"wspr-15\00"
@.str.11 = [7 x i8] c"wspr-2\00"
@LOG_NOTICE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [162 x i8]
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
%10 = alloca double
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* %4
%17 = sub nsw i32 %16, 4
store i32 %17, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
%18 = load i32, i32* @LOG_PID
%19 = load i32, i32* @LOG_LOCAL5
%20 = call i32 @openlog(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %19)
%21 = load i32, i32* @LOG_INFO
%22 = call i32 @syslog(i32 %21, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%23 = load i32, i32* %4
%24 = icmp slt i32 %23, 5
br i1 %24, label %25, label %28
25: ; preds = %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str.2, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0))
ret i32 1
28: ; preds = %2
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 3
%31 = load i8*, i8** %30
%32 = call i64 @atoi(i8* %31)
%33 = icmp slt i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %28
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %13
br label %36
36: ; preds = %34, %28
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 2
%42 = load i8*, i8** %41
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 3
%45 = load i8*, i8** %44
%46 = getelementptr inbounds [162 x i8], [162 x i8]* %6, i64 0, i64 0
%47 = call i32 @wspr(i8* %39, i8* %42, i8* %45, i8* %46)
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %7
br label %49
49: ; preds = %60, %36
%50 = load i32, i32* %7
%51 = sext i32 %50 to i64
%52 = icmp ult i64 %51, 162
br i1 %52, label %53, label %63
53: ; preds = %49
%54 = load i32, i32* %7
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [162 x i8], [162 x i8]* %6, i64 0, i64 %55
%57 = load i8, i8* %56
%58 = zext i8 %57 to i32
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %53
%61 = load i32, i32* %7
%62 = add nsw i32 %61, 1
store i32 %62, i32* %7
br label %49
63: ; preds = %49
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%65 = call i32 (...) @setup_io()
%66 = call i32 (...) @setup_gpios()
%67 = call i32 (...) @txon()
%68 = call i32 (...) @setupDMA()
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
br label %70
70: ; preds = %164, %63
%71 = call i32 (...) @txoff()
%72 = load i8**, i8*** %5
%73 = load i32, i32* %12
%74 = add nsw i32 %73, 4
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8*, i8** %72, i64 %75
%77 = load i8*, i8** %76
%78 = call double @atof(i8* %77)
store double %78, double* %8
%79 = load double, double* %8
%80 = fcmp ogt double %79, 1.376000e+05
br i1 %80, label %81, label %84
81: ; preds = %70
%82 = load double, double* %8
%83 = fcmp olt double %82, 1.376250e+05
br i1 %83, label %98, label %84
84: ; preds = %81, %70
%85 = load double, double* %8
%86 = fcmp ogt double %85, 4.758000e+05
br i1 %86, label %87, label %90
87: ; preds = %84
%88 = load double, double* %8
%89 = fcmp olt double %88, 4.758250e+05
br i1 %89, label %98, label %90
90: ; preds = %87, %84
%91 = load double, double* %8
%92 = fcmp ogt double %91, 1.838200e+06
br i1 %92, label %93, label %96
93: ; preds = %90
%94 = load double, double* %8
%95 = fcmp olt double %94, 0x413C0C9100000000
br label %96
96: ; preds = %93, %90
%97 = phi i1 [ false, %90 ], [ %95, %93 ]
br label %98
98: ; preds = %96, %87, %81
%99 = phi i1 [ true, %87 ], [ true, %81 ], [ %97, %96 ]
%100 = zext i1 %99 to i32
store i32 %100, i32* %9
%101 = load i32, i32* %9
%102 = icmp ne i32 %101, 0
%103 = zext i1 %102 to i64
%104 = select i1 %102, double 0x4015D867C3ECE2A5, double 0x3FE5D867C3ECE2A5
store double %104, double* %10
%105 = load i32, i32* %12
%106 = add nsw i32 %105, 1
store i32 %106, i32* %12
%107 = load i32, i32* %12
%108 = load i32, i32* %11
%109 = icmp sge i32 %107, %108
br i1 %109, label %110, label %111
110: ; preds = %98
store i32 0, i32* %12
br label %111
111: ; preds = %110, %98
%112 = load double, double* %8
%113 = fcmp une double %112, 0.000000e+00
br i1 %113, label %114, label %120
114: ; preds = %111
%115 = load double, double* %8
%116 = load double, double* %10
%117 = fdiv double 1.000000e+00, %116
%118 = load double, double* %10
%119 = call i32 @setupDMATab(double %115, double %117, double %118, i32 4)
br label %120
120: ; preds = %114, %111
%121 = load i32, i32* %13
%122 = icmp eq i32 %121, 0
br i1 %122, label %123, label %129
123: ; preds = %120
%124 = load i32, i32* %9
%125 = icmp ne i32 %124, 0
%126 = zext i1 %125 to i64
%127 = select i1 %125, i32 15, i32 2
%128 = call i32 @wait_every(i32 %127)
br label %129
129: ; preds = %123, %120
%130 = call i32 @time(i32* %14)
%131 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%132 = call i32 @ctime(i32* %14)
%133 = call i32 @strcpy(i8* %131, i32 %132)
%134 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%135 = call i32 @strlen(i8* %134)
%136 = sub nsw i32 %135, 1
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 %137
store i8 0, i8* %138
%139 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%140 = load i32, i32* %9
%141 = icmp ne i32 %140, 0
%142 = zext i1 %141 to i64
%143 = select i1 %141, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0)
%144 = load double, double* %8
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %139, i8* %143, double %144)
%146 = load double, double* %8
%147 = fcmp une double %146, 0.000000e+00
br i1 %147, label %148, label %164
148: ; preds = %129
%149 = call i32 (...) @txon()
store i32 0, i32* %7
br label %150
150: ; preds = %160, %148
%151 = load i32, i32* %7
%152 = icmp slt i32 %151, 162
br i1 %152, label %153, label %163
153: ; preds = %150
%154 = load i32, i32* %7
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds [162 x i8], [162 x i8]* %6, i64 0, i64 %155
%157 = load i8, i8* %156
%158 = load double, double* %10
%159 = call i32 @txSym(i8 zeroext %157, double %158)
br label %160
160: ; preds = %153
%161 = load i32, i32* %7
%162 = add nsw i32 %161, 1
store i32 %162, i32* %7
br label %150
163: ; preds = %150
br label %164
164: ; preds = %163, %129
br label %70
}

LLVM IR (-O2):
@.str = [5 x i8] c"wspr\00"
@LOG_PID = global i32 0
@LOG_LOCAL5 = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [9 x i8] c"starting\00"
@.str.5 = [10 x i8] c"Symbols: \00"
@.str.6 = [4 x i8] c"%d,\00"
@.str.9 = [12 x i8] c"%s - %s@%f\0A\00"
@.str.10 = [8 x i8] c"wspr-15\00"
@.str.11 = [7 x i8] c"wspr-2\00"
@LOG_NOTICE = global i32 0
@str = [22 x i8] c"Ready for transmit...\00"
@str.12 = [10 x i8] c"Tune mode\00"
@str.13 = [117 x i8] c"Usage: wspr <[prefix/]callsign[/A-Z,/0-9,/00-99]> <locator> <power in dBm> [<frequency in Hz or 0 for interval> ...]\00"
@str.14 = [54 x i8] c"\09e.g.: ./wspr K1JT/P JO21 10 7040074 0 0 10140174 0 0\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [162 x i8]
%4 = alloca i32
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [162 x i8], [162 x i8]* %3, i64 0, i64 0
%7 = add nsw i32 %0, -4
%8 = load i32, i32* @LOG_PID
%9 = load i32, i32* @LOG_LOCAL5
%10 = tail call i32 @openlog(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = load i32, i32* @LOG_INFO
%12 = tail call i32 @syslog(i32 %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp slt i32 %0, 5
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([117 x i8], [117 x i8]* @str.13, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.14, i64 0, i64 0))
ret i32 1
17: ; preds = %2
%18 = getelementptr inbounds i8*, i8** %1, i64 3
%19 = load i8*, i8** %18
%20 = tail call i64 @atoi(i8* %19)
%21 = icmp slt i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %17
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.12, i64 0, i64 0))
%24 = load i8*, i8** %18
br label %25
25: ; preds = %22, %17
%26 = phi i8* [ %24, %22 ], [ %19, %17 ]
%27 = getelementptr inbounds i8*, i8** %1, i64 1
%28 = load i8*, i8** %27
%29 = getelementptr inbounds i8*, i8** %1, i64 2
%30 = load i8*, i8** %29
%31 = call i32 @wspr(i8* %28, i8* %30, i8* %26, i8* %6)
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %33
33: ; preds = %25, %33
%34 = phi i64 [ 0, %25 ], [ %39, %33 ]
%35 = getelementptr inbounds [162 x i8], [162 x i8]* %3, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %37)
%39 = add nuw nsw i64 %34, 1
%40 = icmp eq i64 %39, 162
br i1 %40, label %41, label %33
41: ; preds = %33
%42 = call i32 @putchar(i32 10)
%43 = call i32 (...) @setup_io()
%44 = call i32 (...) @setup_gpios()
%45 = call i32 (...) @txon()
%46 = call i32 (...) @setupDMA()
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%48 = bitcast i32* %4 to i8*
%49 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
br label %50
50: ; preds = %103, %41
%51 = phi i32 [ 0, %41 ], [ %75, %103 ]
%52 = call i32 (...) @txoff()
%53 = add nsw i32 %51, 4
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8*, i8** %1, i64 %54
%56 = load i8*, i8** %55
%57 = call double @atof(i8* %56)
%58 = fcmp ogt double %57, 1.376000e+05
%59 = fcmp olt double %57, 1.376250e+05
%60 = and i1 %58, %59
br i1 %60, label %69, label %61
61: ; preds = %50
%62 = fcmp ogt double %57, 4.758000e+05
%63 = fcmp olt double %57, 4.758250e+05
%64 = and i1 %62, %63
br i1 %64, label %69, label %65
65: ; preds = %61
%66 = fcmp ogt double %57, 1.838200e+06
%67 = fcmp olt double %57, 0x413C0C9100000000
%68 = and i1 %66, %67
br i1 %68, label %69, label %70
69: ; preds = %61, %50, %65
br label %70
70: ; preds = %65, %69
%71 = phi i1 [ true, %69 ], [ false, %65 ]
%72 = phi double [ 0x4015D867C3ECE2A5, %69 ], [ 0x3FE5D867C3ECE2A5, %65 ]
%73 = add nsw i32 %51, 1
%74 = icmp slt i32 %73, %7
%75 = select i1 %74, i32 %73, i32 0
%76 = fcmp une double %57, 0.000000e+00
br i1 %76, label %77, label %80
77: ; preds = %70
%78 = fdiv double 1.000000e+00, %72
%79 = call i32 @setupDMATab(double %57, double %78, double %72, i32 4)
br label %80
80: ; preds = %77, %70
br i1 %21, label %84, label %81
81: ; preds = %80
%82 = select i1 %71, i32 15, i32 2
%83 = call i32 @wait_every(i32 %82)
br label %84
84: ; preds = %81, %80
%85 = call i32 @time(i32* %4)
%86 = call i32 @ctime(i32* %4)
%87 = call i32 @strcpy(i8* %49, i32 %86)
%88 = call i32 @strlen(i8* %49)
%89 = add nsw i32 %88, -1
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 %90
store i8 0, i8* %91
%92 = select i1 %71, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0)
%93 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %49, i8* %92, double %57)
br i1 %76, label %94, label %103
94: ; preds = %84
%95 = call i32 (...) @txon()
br label %96
96: ; preds = %94, %96
%97 = phi i64 [ 0, %94 ], [ %101, %96 ]
%98 = getelementptr inbounds [162 x i8], [162 x i8]* %3, i64 0, i64 %97
%99 = load i8, i8* %98
%100 = call i32 @txSym(i8 zeroext %99, double %72)
%101 = add nuw nsw i64 %97, 1
%102 = icmp eq i64 %101, 162
br i1 %102, label %103, label %96
103: ; preds = %96, %84
br label %50
}