#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 scalar_t__ uint32_t;
typedef scalar_t__ uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
double sin(double);
int /*<<< orphan*/ *stderr;
double tan(double);
int main(int argc, char **argv, char **envp) {
  FILE *outfile;
  double angle;
  double valuef;
  uint32_t value32;
  uint16_t value16;
  int i;
  int j;
  outfile = fopen("trigtbl.tmp", "w");
  if (!outfile) {
    fprintf(stderr, "Unable to open trigtbl.tmp\n");
    exit(1);
  }
  fprintf(outfile, "#define TWOPI            1920\n");
  fprintf(outfile, "#define PI                960\n");
  fprintf(outfile, "#define HALFPI            480\n");
  fprintf(outfile, "#define QTRPI             240\n\n");
  fprintf(outfile, "const int32_t g_tan_table[PI + HALFPI + 1] =\n");
  fprintf(outfile, "{\n");
  for (i = 0; i < 1440;) {
    fprintf(outfile, "  ");
    for (j = 0; ((j < 5) && (i < 1440));) {
      angle = ((double)i) * (2.0 * 3.1415926 / 1920.0);
      valuef = (4096.0 * tan(angle));
      if (valuef >= 0.0) {
        valuef += 0.5;
      } else {
        valuef -= 0.5;
      }
      value32 = (uint32_t)((long)(valuef));
      fprintf(outfile, "0x%08lx", (unsigned long)value32);
      i++;
      j++;
      if ((j < 5) && (i < 1440)) {
        fprintf(outfile, ", ");
      }
    }
    fprintf(outfile, ",\n");
  }
  fprintf(outfile, "  0x00000000\n");
  fprintf(outfile, "};\n\n");
  fprintf(outfile, "const int16_t g_sin_table[TWOPI + HALFPI + 1] =\n");
  fprintf(outfile, "{\n");
  for (i = 0; i < 2400;) {
    fprintf(outfile, "  ");
    for (j = 0; ((j < 8) && (i < 2400));) {
      angle = ((double)i) * (2.0 * 3.1415926 / 1920.0);
      valuef = (4096.0 * sin(angle));
      if (valuef >= 0.0) {
        valuef += 0.5;
      } else {
        valuef -= 0.5;
      }
      value16 = (uint16_t)((long)(valuef));
      fprintf(outfile, "0x%04x", (unsigned int)value16);
      i++;
      j++;
      if ((j < 8) && (i < 2400)) {
        fprintf(outfile, ", ");
      }
    }
    fprintf(outfile, ",\n");
  }
  fprintf(outfile, "  0x1000\n");
  fprintf(outfile, "};\n\n");
  fprintf(outfile, "const int32_t cscTable[TWOPI + HALFPI + 1] =\n");
  fprintf(outfile, "{\n");
  for (i = 0; i < 2400;) {
    fprintf(outfile, "  ");
    for (j = 0; ((j < 5) && (i < 2400));) {
      angle = ((double)i) * (2.0 * 3.1415926 / 1920.0);
      valuef = (4096.0 / sin(angle));
      if (valuef >= 0.0) {
        valuef += 0.5;
      } else {
        valuef -= 0.5;
      }
      value32 = (uint32_t)((long)(valuef));
      fprintf(outfile, "0x%08lx", (unsigned long)value32);
      i++;
      j++;
      if ((j < 5) && (i < 2400)) {
        fprintf(outfile, ", ");
      }
    }
    fprintf(outfile, ",\n");
  }
  fprintf(outfile, "  0x00001000\n");
  fprintf(outfile, "};\n\n");
  fclose(outfile);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xe97(%rip),%rdi
lea    0xe9c(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11be <main+0x5e>
mov    0x2e3d(%rip),%rax
mov    (%rax),%rdi
lea    0xe79(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x20(%rbp),%rdi
lea    0xe79(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe86(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe93(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xea0(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xeae(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xeca(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x5a0,-0x44(%rbp)
jge    136d <main+0x20d>
mov    -0x20(%rbp),%rdi
lea    0xea7(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x48(%rbp)
xor    %eax,%eax
cmpl   $0x5,-0x48(%rbp)
mov    %al,-0x49(%rbp)
jge    1273 <main+0x113>
cmpl   $0x5a0,-0x44(%rbp)
setl   %al
mov    %al,-0x49(%rbp)
mov    -0x49(%rbp),%al
test   $0x1,%al
jne    1283 <main+0x123>
jmp    1356 <main+0x1f6>
cvtsi2sdl -0x44(%rbp),%xmm0
movsd  0xd78(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1060 <tan@plt>
movaps %xmm0,%xmm1
movsd  0xd52(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     12e0 <main+0x180>
movsd  0xd3f(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    12f6 <main+0x196>
movsd  -0x30(%rbp),%xmm0
movsd  0xd23(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
cvttsd2si -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x38(%rbp),%rdx
lea    0xde4(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
cmpl   $0x5,-0x48(%rbp)
jge    1351 <main+0x1f1>
cmpl   $0x5a0,-0x44(%rbp)
jge    1351 <main+0x1f1>
mov    -0x20(%rbp),%rdi
lea    0xdb1(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1257 <main+0xf7>
mov    -0x20(%rbp),%rdi
lea    0xd9d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1231 <main+0xd1>
mov    -0x20(%rbp),%rdi
lea    0xd89(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd85(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd78(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd3f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x960,-0x44(%rbp)
jge    14fa <main+0x39a>
mov    -0x20(%rbp),%rdi
lea    0xd1c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x48(%rbp)
xor    %eax,%eax
cmpl   $0x8,-0x48(%rbp)
mov    %al,-0x4a(%rbp)
jge    13fe <main+0x29e>
cmpl   $0x960,-0x44(%rbp)
setl   %al
mov    %al,-0x4a(%rbp)
mov    -0x4a(%rbp),%al
test   $0x1,%al
jne    140e <main+0x2ae>
jmp    14e3 <main+0x383>
cvtsi2sdl -0x44(%rbp),%xmm0
movsd  0xbed(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xbc7(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     146b <main+0x30b>
movsd  0xbb4(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1481 <main+0x321>
movsd  -0x30(%rbp),%xmm0
movsd  0xb98(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
cvttsd2si -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    %eax,%edx
lea    0xca9(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
cmpl   $0x8,-0x48(%rbp)
jge    14de <main+0x37e>
cmpl   $0x960,-0x44(%rbp)
jge    14de <main+0x37e>
mov    -0x20(%rbp),%rdi
lea    0xc24(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    13e2 <main+0x282>
mov    -0x20(%rbp),%rdi
lea    0xc10(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    13bc <main+0x25c>
mov    -0x20(%rbp),%rdi
lea    0xc47(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xbf8(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xc2d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xbb2(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x960,-0x44(%rbp)
jge    1685 <main+0x525>
mov    -0x20(%rbp),%rdi
lea    0xb8f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x48(%rbp)
xor    %eax,%eax
cmpl   $0x5,-0x48(%rbp)
mov    %al,-0x4b(%rbp)
jge    158b <main+0x42b>
cmpl   $0x960,-0x44(%rbp)
setl   %al
mov    %al,-0x4b(%rbp)
mov    -0x4b(%rbp),%al
test   $0x1,%al
jne    159b <main+0x43b>
jmp    166e <main+0x50e>
cvtsi2sdl -0x44(%rbp),%xmm0
movsd  0xa60(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xa3a(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     15f8 <main+0x498>
movsd  0xa27(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    160e <main+0x4ae>
movsd  -0x30(%rbp),%xmm0
movsd  0xa0b(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
cvttsd2si -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x38(%rbp),%rdx
lea    0xacc(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
cmpl   $0x5,-0x48(%rbp)
jge    1669 <main+0x509>
cmpl   $0x960,-0x44(%rbp)
jge    1669 <main+0x509>
mov    -0x20(%rbp),%rdi
lea    0xa99(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    156f <main+0x40f>
mov    -0x20(%rbp),%rdi
lea    0xa85(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1549 <main+0x3e9>
mov    -0x20(%rbp),%rdi
lea    0xaf4(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xa6d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xea6(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     1667 <main+0x4f7>
mov    %rax,%rbx
lea    0xeb1(%rip),%rdi
mov    $0x1e,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1090 <fwrite@plt>
lea    0xeb7(%rip),%rdi
mov    $0x1e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xebd(%rip),%rdi
mov    $0x1e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xec3(%rip),%rdi
mov    $0x1f,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xeca(%rip),%rdi
mov    $0x2d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xedf(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
xor    %r14d,%r14d
jmp    126e <main+0xfe>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xebd(%rip),%rdi
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    (%r14,%r15,1),%eax
add    $0xffffffff,%eax
add    %r15d,%r14d
cmp    $0x59f,%eax
jge    1338 <main+0x1c8>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xe81(%rip),%rdi
mov    %rbx,%rcx
call   1090 <fwrite@plt>
mov    $0x59f,%r13d
sub    %r14d,%r13d
cmp    $0x4,%r13d
mov    $0x4,%eax
cmovae %eax,%r13d
add    $0x1,%r13d
xor    %r15d,%r15d
jmp    12b5 <main+0x145>
cs nopw 0x0(%rax,%rax,1)
cmp    %r15d,%r13d
je     1240 <main+0xd0>
mov    %r15d,%r12d
lea    (%r14,%r12,1),%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  0xd35(%rip),%xmm0
call   1060 <tan@plt>
mulsd  0xd30(%rip),%xmm0
xor    %eax,%eax
ucomisd 0xd2e(%rip),%xmm0
setb   %al
lea    0xd2c(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%rdx
mov    %rbx,%rdi
lea    0xe03(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0x1(%r12),%r15d
cmp    $0x3,%r12d
ja     12b0 <main+0x140>
cmp    $0x59e,%ebp
jg     12b0 <main+0x140>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xde0(%rip),%rdi
mov    %rbx,%rcx
call   1090 <fwrite@plt>
jmp    12b0 <main+0x140>
lea    0xdd2(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xdc7(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xdb3(%rip),%rdi
mov    $0x30,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xd73(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
xor    %r14d,%r14d
jmp    13de <main+0x26e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xd4d(%rip),%rdi
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    (%r14,%r15,1),%eax
add    $0xffffffff,%eax
add    %r15d,%r14d
cmp    $0x95f,%eax
jge    14a8 <main+0x338>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xd11(%rip),%rdi
mov    %rbx,%rcx
call   1090 <fwrite@plt>
mov    $0x95f,%r13d
sub    %r14d,%r13d
cmp    $0x7,%r13d
mov    $0x7,%eax
cmovae %eax,%r13d
add    $0x1,%r13d
xor    %r15d,%r15d
jmp    1425 <main+0x2b5>
cs nopw 0x0(%rax,%rax,1)
cmp    %r15d,%r13d
je     13b0 <main+0x240>
mov    %r15d,%ebp
lea    (%r14,%rbp,1),%r12d
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
mulsd  0xbc4(%rip),%xmm0
call   1050 <sin@plt>
mulsd  0xbbf(%rip),%xmm0
xor    %eax,%eax
ucomisd 0xbbd(%rip),%xmm0
setb   %al
lea    0xbbb(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%rdx
mov    %rbx,%rdi
lea    0xce4(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0x1(%rbp),%r15d
cmp    $0x6,%ebp
ja     1420 <main+0x2b0>
cmp    $0x95e,%r12d
jg     1420 <main+0x2b0>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xc70(%rip),%rdi
mov    %rbx,%rcx
call   1090 <fwrite@plt>
jmp    1420 <main+0x2b0>
lea    0xcad(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xc57(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xc85(%rip),%rdi
mov    $0x2d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xc03(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
xor    %r14d,%r14d
jmp    154e <main+0x3de>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xbdd(%rip),%rdi
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    (%r14,%r15,1),%eax
add    $0xffffffff,%eax
add    %r15d,%r14d
cmp    $0x95f,%eax
jge    161c <main+0x4ac>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xba1(%rip),%rdi
mov    %rbx,%rcx
call   1090 <fwrite@plt>
mov    $0x95f,%r13d
sub    %r14d,%r13d
cmp    $0x4,%r13d
mov    $0x4,%eax
cmovae %eax,%r13d
add    $0x1,%r13d
xor    %r15d,%r15d
jmp    1595 <main+0x425>
cs nopw 0x0(%rax,%rax,1)
cmp    %r15d,%r13d
je     1520 <main+0x3b0>
mov    %r15d,%ebp
lea    (%r14,%rbp,1),%r12d
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
mulsd  0xa54(%rip),%xmm0
call   1050 <sin@plt>
movsd  0xa4f(%rip),%xmm1
divsd  %xmm0,%xmm1
xor    %eax,%eax
ucomisd 0xa49(%rip),%xmm1
setb   %al
lea    0xa47(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm1
cvttsd2si %xmm1,%rdx
mov    %rbx,%rdi
lea    0xb1e(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0x1(%rbp),%r15d
cmp    $0x3,%ebp
ja     1590 <main+0x420>
cmp    $0x95e,%r12d
jg     1590 <main+0x420>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xafc(%rip),%rdi
mov    %rbx,%rcx
call   1090 <fwrite@plt>
jmp    1590 <main+0x420>
lea    0xb71(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xae3(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2972(%rip),%rax
mov    (%rax),%rcx
lea    0x9be(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
call   1090 <fwrite@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"trigtbl.tmp\00"
@.str.1 = [2 x i8] c"w\00"
@stderr = global i32* null
@.str.2 = [28 x i8] c"Unable to open trigtbl.tmp\0A\00"
@.str.3 = [31 x i8] c"#define TWOPI 1920\0A\00"
@.str.4 = [31 x i8] c"#define PI 960\0A\00"
@.str.5 = [31 x i8] c"#define HALFPI 480\0A\00"
@.str.6 = [32 x i8] c"#define QTRPI 240\0A\0A\00"
@.str.7 = [46 x i8] c"const int32_t g_tan_table[PI + HALFPI + 1] =\0A\00"
@.str.8 = [3 x i8] c"{\0A\00"
@.str.9 = [3 x i8] c" \00"
@.str.10 = [8 x i8] c"0x%08lx\00"
@.str.11 = [3 x i8] c", \00"
@.str.12 = [3 x i8] c",\0A\00"
@.str.13 = [14 x i8] c" 0x00000000\0A\00"
@.str.14 = [5 x i8] c"};\0A\0A\00"
@.str.15 = [49 x i8] c"const int16_t g_sin_table[TWOPI + HALFPI + 1] =\0A\00"
@.str.16 = [7 x i8] c"0x%04x\00"
@.str.17 = [10 x i8] c" 0x1000\0A\00"
@.str.18 = [46 x i8] c"const int32_t cscTable[TWOPI + HALFPI + 1] =\0A\00"
@.str.19 = [14 x i8] c" 0x00001000\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32*
%9 = alloca double
%10 = alloca double
%11 = alloca i64
%12 = alloca i64
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%15 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %15, i32** %8
%16 = load i32*, i32** %8
%17 = icmp ne i32* %16, null
br i1 %17, label %22, label %18
18: ; preds = %3
%19 = load i32*, i32** @stderr
%20 = call i32 (i32*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %3
%23 = load i32*, i32** %8
%24 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%25 = load i32*, i32** %8
%26 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%27 = load i32*, i32** %8
%28 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%29 = load i32*, i32** %8
%30 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
%31 = load i32*, i32** %8
%32 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0))
%33 = load i32*, i32** %8
%34 = call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %13
br label %35
35: ; preds = %83, %22
%36 = load i32, i32* %13
%37 = icmp slt i32 %36, 1440
br i1 %37, label %38, label %86
38: ; preds = %35
%39 = load i32*, i32** %8
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %14
br label %41
41: ; preds = %82, %38
%42 = load i32, i32* %14
%43 = icmp slt i32 %42, 5
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = load i32, i32* %13
%46 = icmp slt i32 %45, 1440
br label %47
47: ; preds = %44, %41
%48 = phi i1 [ false, %41 ], [ %46, %44 ]
br i1 %48, label %49, label %83
49: ; preds = %47
%50 = load i32, i32* %13
%51 = sitofp i32 %50 to double
%52 = fmul double %51, 0x3F6ACEE9EBCFD5A4
store double %52, double* %9
%53 = load double, double* %9
%54 = call double @tan(double %53)
%55 = fmul double 4.096000e+03, %54
store double %55, double* %10
%56 = load double, double* %10
%57 = fcmp oge double %56, 0.000000e+00
br i1 %57, label %58, label %61
58: ; preds = %49
%59 = load double, double* %10
%60 = fadd double %59, 5.000000e-01
store double %60, double* %10
br label %64
61: ; preds = %49
%62 = load double, double* %10
%63 = fsub double %62, 5.000000e-01
store double %63, double* %10
br label %64
64: ; preds = %61, %58
%65 = load double, double* %10
%66 = fptosi double %65 to i64
store i64 %66, i64* %11
%67 = load i32*, i32** %8
%68 = load i64, i64* %11
%69 = call i32 (i32*, i8*, ...) @fprintf(i32* %67, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i64 %68)
%70 = load i32, i32* %13
%71 = add nsw i32 %70, 1
store i32 %71, i32* %13
%72 = load i32, i32* %14
%73 = add nsw i32 %72, 1
store i32 %73, i32* %14
%74 = load i32, i32* %14
%75 = icmp slt i32 %74, 5
br i1 %75, label %76, label %82
76: ; preds = %64
%77 = load i32, i32* %13
%78 = icmp slt i32 %77, 1440
br i1 %78, label %79, label %82
79: ; preds = %76
%80 = load i32*, i32** %8
%81 = call i32 (i32*, i8*, ...) @fprintf(i32* %80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %82
82: ; preds = %79, %76, %64
br label %41
83: ; preds = %47
%84 = load i32*, i32** %8
%85 = call i32 (i32*, i8*, ...) @fprintf(i32* %84, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
br label %35
86: ; preds = %35
%87 = load i32*, i32** %8
%88 = call i32 (i32*, i8*, ...) @fprintf(i32* %87, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
%89 = load i32*, i32** %8
%90 = call i32 (i32*, i8*, ...) @fprintf(i32* %89, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
%91 = load i32*, i32** %8
%92 = call i32 (i32*, i8*, ...) @fprintf(i32* %91, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.15, i64 0, i64 0))
%93 = load i32*, i32** %8
%94 = call i32 (i32*, i8*, ...) @fprintf(i32* %93, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %13
br label %95
95: ; preds = %144, %86
%96 = load i32, i32* %13
%97 = icmp slt i32 %96, 2400
br i1 %97, label %98, label %147
98: ; preds = %95
%99 = load i32*, i32** %8
%100 = call i32 (i32*, i8*, ...) @fprintf(i32* %99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %14
br label %101
101: ; preds = %143, %98
%102 = load i32, i32* %14
%103 = icmp slt i32 %102, 8
br i1 %103, label %104, label %107
104: ; preds = %101
%105 = load i32, i32* %13
%106 = icmp slt i32 %105, 2400
br label %107
107: ; preds = %104, %101
%108 = phi i1 [ false, %101 ], [ %106, %104 ]
br i1 %108, label %109, label %144
109: ; preds = %107
%110 = load i32, i32* %13
%111 = sitofp i32 %110 to double
%112 = fmul double %111, 0x3F6ACEE9EBCFD5A4
store double %112, double* %9
%113 = load double, double* %9
%114 = call double @sin(double %113)
%115 = fmul double 4.096000e+03, %114
store double %115, double* %10
%116 = load double, double* %10
%117 = fcmp oge double %116, 0.000000e+00
br i1 %117, label %118, label %121
118: ; preds = %109
%119 = load double, double* %10
%120 = fadd double %119, 5.000000e-01
store double %120, double* %10
br label %124
121: ; preds = %109
%122 = load double, double* %10
%123 = fsub double %122, 5.000000e-01
store double %123, double* %10
br label %124
124: ; preds = %121, %118
%125 = load double, double* %10
%126 = fptosi double %125 to i64
store i64 %126, i64* %12
%127 = load i32*, i32** %8
%128 = load i64, i64* %12
%129 = trunc i64 %128 to i32
%130 = call i32 (i32*, i8*, ...) @fprintf(i32* %127, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i32 %129)
%131 = load i32, i32* %13
%132 = add nsw i32 %131, 1
store i32 %132, i32* %13
%133 = load i32, i32* %14
%134 = add nsw i32 %133, 1
store i32 %134, i32* %14
%135 = load i32, i32* %14
%136 = icmp slt i32 %135, 8
br i1 %136, label %137, label %143
137: ; preds = %124
%138 = load i32, i32* %13
%139 = icmp slt i32 %138, 2400
br i1 %139, label %140, label %143
140: ; preds = %137
%141 = load i32*, i32** %8
%142 = call i32 (i32*, i8*, ...) @fprintf(i32* %141, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %143
143: ; preds = %140, %137, %124
br label %101
144: ; preds = %107
%145 = load i32*, i32** %8
%146 = call i32 (i32*, i8*, ...) @fprintf(i32* %145, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
br label %95
147: ; preds = %95
%148 = load i32*, i32** %8
%149 = call i32 (i32*, i8*, ...) @fprintf(i32* %148, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i64 0, i64 0))
%150 = load i32*, i32** %8
%151 = call i32 (i32*, i8*, ...) @fprintf(i32* %150, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
%152 = load i32*, i32** %8
%153 = call i32 (i32*, i8*, ...) @fprintf(i32* %152, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.18, i64 0, i64 0))
%154 = load i32*, i32** %8
%155 = call i32 (i32*, i8*, ...) @fprintf(i32* %154, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %13
br label %156
156: ; preds = %204, %147
%157 = load i32, i32* %13
%158 = icmp slt i32 %157, 2400
br i1 %158, label %159, label %207
159: ; preds = %156
%160 = load i32*, i32** %8
%161 = call i32 (i32*, i8*, ...) @fprintf(i32* %160, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %14
br label %162
162: ; preds = %203, %159
%163 = load i32, i32* %14
%164 = icmp slt i32 %163, 5
br i1 %164, label %165, label %168
165: ; preds = %162
%166 = load i32, i32* %13
%167 = icmp slt i32 %166, 2400
br label %168
168: ; preds = %165, %162
%169 = phi i1 [ false, %162 ], [ %167, %165 ]
br i1 %169, label %170, label %204
170: ; preds = %168
%171 = load i32, i32* %13
%172 = sitofp i32 %171 to double
%173 = fmul double %172, 0x3F6ACEE9EBCFD5A4
store double %173, double* %9
%174 = load double, double* %9
%175 = call double @sin(double %174)
%176 = fdiv double 4.096000e+03, %175
store double %176, double* %10
%177 = load double, double* %10
%178 = fcmp oge double %177, 0.000000e+00
br i1 %178, label %179, label %182
179: ; preds = %170
%180 = load double, double* %10
%181 = fadd double %180, 5.000000e-01
store double %181, double* %10
br label %185
182: ; preds = %170
%183 = load double, double* %10
%184 = fsub double %183, 5.000000e-01
store double %184, double* %10
br label %185
185: ; preds = %182, %179
%186 = load double, double* %10
%187 = fptosi double %186 to i64
store i64 %187, i64* %11
%188 = load i32*, i32** %8
%189 = load i64, i64* %11
%190 = call i32 (i32*, i8*, ...) @fprintf(i32* %188, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i64 %189)
%191 = load i32, i32* %13
%192 = add nsw i32 %191, 1
store i32 %192, i32* %13
%193 = load i32, i32* %14
%194 = add nsw i32 %193, 1
store i32 %194, i32* %14
%195 = load i32, i32* %14
%196 = icmp slt i32 %195, 5
br i1 %196, label %197, label %203
197: ; preds = %185
%198 = load i32, i32* %13
%199 = icmp slt i32 %198, 2400
br i1 %199, label %200, label %203
200: ; preds = %197
%201 = load i32*, i32** %8
%202 = call i32 (i32*, i8*, ...) @fprintf(i32* %201, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %203
203: ; preds = %200, %197, %185
br label %162
204: ; preds = %168
%205 = load i32*, i32** %8
%206 = call i32 (i32*, i8*, ...) @fprintf(i32* %205, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
br label %156
207: ; preds = %156
%208 = load i32*, i32** %8
%209 = call i32 (i32*, i8*, ...) @fprintf(i32* %208, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0))
%210 = load i32*, i32** %8
%211 = call i32 (i32*, i8*, ...) @fprintf(i32* %210, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
%212 = load i32*, i32** %8
%213 = call i32 @fclose(i32* %212)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"trigtbl.tmp\00"
@.str.1 = [2 x i8] c"w\00"
@stderr = global i32* null
@.str.2 = [28 x i8] c"Unable to open trigtbl.tmp\0A\00"
@.str.3 = [31 x i8] c"#define TWOPI 1920\0A\00"
@.str.4 = [31 x i8] c"#define PI 960\0A\00"
@.str.5 = [31 x i8] c"#define HALFPI 480\0A\00"
@.str.6 = [32 x i8] c"#define QTRPI 240\0A\0A\00"
@.str.7 = [46 x i8] c"const int32_t g_tan_table[PI + HALFPI + 1] =\0A\00"
@.str.8 = [3 x i8] c"{\0A\00"
@.str.9 = [3 x i8] c" \00"
@.str.10 = [8 x i8] c"0x%08lx\00"
@.str.11 = [3 x i8] c", \00"
@.str.12 = [3 x i8] c",\0A\00"
@.str.13 = [14 x i8] c" 0x00000000\0A\00"
@.str.14 = [5 x i8] c"};\0A\0A\00"
@.str.15 = [49 x i8] c"const int16_t g_sin_table[TWOPI + HALFPI + 1] =\0A\00"
@.str.16 = [7 x i8] c"0x%04x\00"
@.str.17 = [10 x i8] c" 0x1000\0A\00"
@.str.18 = [46 x i8] c"const int32_t cscTable[TWOPI + HALFPI + 1] =\0A\00"
@.str.19 = [14 x i8] c" 0x00001000\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32*, i32** @stderr
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i64 27, i64 1, i32* %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
%11 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i64 30, i64 1, i32* %4)
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i64 30, i64 1, i32* %4)
%13 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i64 30, i64 1, i32* %4)
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i64 31, i64 1, i32* %4)
%15 = tail call i64 @fwrite(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0), i64 45, i64 1, i32* %4)
%16 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i64 2, i64 1, i32* %4)
br label %17
17: ; preds = %43, %10
%18 = phi i32 [ 0, %10 ], [ %34, %43 ]
%19 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i64 2, i64 1, i32* %4)
%20 = sub i32 1439, %18
%21 = call i32 @llvm.umin.i32(i32 %20, i32 4)
br label %22
22: ; preds = %17, %41
%23 = phi i32 [ %35, %41 ], [ 0, %17 ]
%24 = phi i32 [ %34, %41 ], [ %18, %17 ]
%25 = sitofp i32 %24 to double
%26 = fmul double %25, 0x3F6ACEE9EBCFD5A4
%27 = tail call double @tan(double %26)
%28 = fmul double %27, 4.096000e+03
%29 = fcmp ult double %28, 0.000000e+00
%30 = select i1 %29, double -5.000000e-01, double 5.000000e-01
%31 = fadd double %28, %30
%32 = fptosi double %31 to i64
%33 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i64 %32)
%34 = add nsw i32 %24, 1
%35 = add nuw nsw i32 %23, 1
%36 = icmp ult i32 %23, 4
%37 = icmp slt i32 %24, 1439
%38 = select i1 %36, i1 %37, i1 false
br i1 %38, label %39, label %41
39: ; preds = %22
%40 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i64 2, i64 1, i32* %4)
br label %41
41: ; preds = %39, %22
%42 = icmp eq i32 %23, %21
br i1 %42, label %43, label %22
43: ; preds = %41
%44 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i64 2, i64 1, i32* %4)
%45 = icmp slt i32 %24, 1439
br i1 %45, label %17, label %46
46: ; preds = %43
%47 = tail call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0), i64 13, i64 1, i32* %4)
%48 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 4, i64 1, i32* %4)
%49 = tail call i64 @fwrite(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.15, i64 0, i64 0), i64 48, i64 1, i32* %4)
%50 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i64 2, i64 1, i32* %4)
br label %51
51: ; preds = %78, %46
%52 = phi i32 [ 0, %46 ], [ %69, %78 ]
%53 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i64 2, i64 1, i32* %4)
%54 = sub i32 2399, %52
%55 = call i32 @llvm.umin.i32(i32 %54, i32 7)
br label %56
56: ; preds = %51, %76
%57 = phi i32 [ %70, %76 ], [ 0, %51 ]
%58 = phi i32 [ %69, %76 ], [ %52, %51 ]
%59 = sitofp i32 %58 to double
%60 = fmul double %59, 0x3F6ACEE9EBCFD5A4
%61 = tail call double @sin(double %60)
%62 = fmul double %61, 4.096000e+03
%63 = fcmp ult double %62, 0.000000e+00
%64 = select i1 %63, double -5.000000e-01, double 5.000000e-01
%65 = fadd double %62, %64
%66 = fptosi double %65 to i64
%67 = trunc i64 %66 to i32
%68 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i32 %67)
%69 = add nsw i32 %58, 1
%70 = add nuw nsw i32 %57, 1
%71 = icmp ult i32 %57, 7
%72 = icmp slt i32 %58, 2399
%73 = select i1 %71, i1 %72, i1 false
br i1 %73, label %74, label %76
74: ; preds = %56
%75 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i64 2, i64 1, i32* %4)
br label %76
76: ; preds = %74, %56
%77 = icmp eq i32 %57, %55
br i1 %77, label %78, label %56
78: ; preds = %76
%79 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i64 2, i64 1, i32* %4)
%80 = icmp slt i32 %58, 2399
br i1 %80, label %51, label %81
81: ; preds = %78
%82 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i64 0, i64 0), i64 9, i64 1, i32* %4)
%83 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 4, i64 1, i32* %4)
%84 = tail call i64 @fwrite(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.18, i64 0, i64 0), i64 45, i64 1, i32* %4)
%85 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i64 2, i64 1, i32* %4)
br label %86
86: ; preds = %112, %81
%87 = phi i32 [ 0, %81 ], [ %103, %112 ]
%88 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i64 2, i64 1, i32* %4)
%89 = sub i32 2399, %87
%90 = call i32 @llvm.umin.i32(i32 %89, i32 4)
br label %91
91: ; preds = %86, %110
%92 = phi i32 [ %104, %110 ], [ 0, %86 ]
%93 = phi i32 [ %103, %110 ], [ %87, %86 ]
%94 = sitofp i32 %93 to double
%95 = fmul double %94, 0x3F6ACEE9EBCFD5A4
%96 = tail call double @sin(double %95)
%97 = fdiv double 4.096000e+03, %96
%98 = fcmp ult double %97, 0.000000e+00
%99 = select i1 %98, double -5.000000e-01, double 5.000000e-01
%100 = fadd double %97, %99
%101 = fptosi double %100 to i64
%102 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i64 %101)
%103 = add nsw i32 %93, 1
%104 = add nuw nsw i32 %92, 1
%105 = icmp ult i32 %92, 4
%106 = icmp slt i32 %93, 2399
%107 = select i1 %105, i1 %106, i1 false
br i1 %107, label %108, label %110
108: ; preds = %91
%109 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i64 2, i64 1, i32* %4)
br label %110
110: ; preds = %108, %91
%111 = icmp eq i32 %92, %90
br i1 %111, label %112, label %91
112: ; preds = %110
%113 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i64 2, i64 1, i32* %4)
%114 = icmp slt i32 %93, 2399
br i1 %114, label %86, label %115
115: ; preds = %112
%116 = tail call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0), i64 13, i64 1, i32* %4)
%117 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 4, i64 1, i32* %4)
%118 = tail call i32 @fclose(i32* %4)
ret i32 0
}