#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*/ error(char *, ...);
int fwrite(char *, int, int, int /*<<< orphan*/);
int sprintf(char *, char *, double, char);
int /*<<< orphan*/ stdout;
char *output(char *op, double val) {
  char buf[32];
  int len = 0;
  int iv;
  switch (*op++) {
  case 'a':
    len = sprintf(buf, "%.16g%c", val, *op ? ' ' : '\n');
    break;
  case 'b':
    iv = (val + 1) * 128;
    iv = iv < 0 ? 0 : iv > 255 ? 255 : iv;
    buf[0] = iv;
    len = 1;
    break;
  case 'w':
    iv = (val + 1) * 32768;
    iv = iv < 0 ? 0 : iv > 65535 ? 65535 : iv;
    buf[0] = iv;
    buf[1] = iv >> 8;
    len = 2;
    break;
  case 'W':
    iv = (val + 1) * 32768;
    iv = iv < 0 ? 0 : iv > 65535 ? 65535 : iv;
    buf[1] = iv;
    buf[0] = iv >> 8;
    len = 2;
    break;
  case 'c':
    iv = val * 128;
    iv = iv < -128 ? -128 : iv > 127 ? 127 : iv;
    buf[0] = iv;
    len = 1;
    break;
  case 's':
    iv = val * 32768;
    iv = iv < -32768 ? -32768 : iv > 32767 ? 32767 : iv;
    buf[0] = iv;
    buf[1] = iv >> 8;
    len = 2;
    break;
  case 'S':
    iv = val * 32768;
    iv = iv < -32768 ? -32768 : iv > 32767 ? 32767 : iv;
    buf[1] = iv;
    buf[0] = iv >> 8;
    len = 2;
    break;
  case 'f':
    *(float *)&buf[0] = val;
    len = sizeof(float);
    break;
  case 0:
    error("Internal error in output() -- ran out of format characters");
    break;
  default:
    error("Internal error in output() -- bad format '%c'", op[-1]);
    break;
  }
  if (1 != fwrite(buf, len, 1, stdout))
    error("Write error");
  return op;
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x3c(%rbp)
test   %eax,%eax
je     14fb <output+0x3cb>
jmp    116a <output+0x3a>
mov    -0x3c(%rbp),%eax
sub    $0x53,%eax
je     146c <output+0x33c>
jmp    117b <output+0x4b>
mov    -0x3c(%rbp),%eax
sub    $0x57,%eax
je     1316 <output+0x1e6>
jmp    118c <output+0x5c>
mov    -0x3c(%rbp),%eax
sub    $0x61,%eax
je     11f2 <output+0xc2>
jmp    119d <output+0x6d>
mov    -0x3c(%rbp),%eax
sub    $0x62,%eax
je     1229 <output+0xf9>
jmp    11ae <output+0x7e>
mov    -0x3c(%rbp),%eax
sub    $0x63,%eax
je     1391 <output+0x261>
jmp    11bf <output+0x8f>
mov    -0x3c(%rbp),%eax
sub    $0x66,%eax
je     14e1 <output+0x3b1>
jmp    11d0 <output+0xa0>
mov    -0x3c(%rbp),%eax
sub    $0x73,%eax
je     13f7 <output+0x2c7>
jmp    11e1 <output+0xb1>
mov    -0x3c(%rbp),%eax
sub    $0x77,%eax
je     129b <output+0x16b>
jmp    150e <output+0x3de>
lea    -0x30(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
mov    $0xa,%eax
mov    $0x20,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xdff(%rip),%rsi
movsbl %al,%edx
call   1040 <sprintf@plt>
mov    %eax,-0x34(%rbp)
jmp    1524 <output+0x3f4>
movsd  0xddf(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xdca(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jge    125d <output+0x12d>
xor    %eax,%eax
mov    %eax,-0x40(%rbp)
jmp    1283 <output+0x153>
cmpl   $0xff,-0x38(%rbp)
jle    1277 <output+0x147>
mov    $0xff,%eax
mov    %eax,-0x44(%rbp)
jmp    127d <output+0x14d>
mov    -0x38(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %al,-0x30(%rbp)
movl   $0x1,-0x34(%rbp)
jmp    1524 <output+0x3f4>
movsd  0xd6d(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xd50(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jge    12cf <output+0x19f>
xor    %eax,%eax
mov    %eax,-0x48(%rbp)
jmp    12f5 <output+0x1c5>
cmpl   $0xffff,-0x38(%rbp)
jle    12e9 <output+0x1b9>
mov    $0xffff,%eax
mov    %eax,-0x4c(%rbp)
jmp    12ef <output+0x1bf>
mov    -0x38(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %al,-0x30(%rbp)
mov    -0x38(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x2f(%rbp)
movl   $0x2,-0x34(%rbp)
jmp    1524 <output+0x3f4>
movsd  0xcf2(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xcd5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jge    134a <output+0x21a>
xor    %eax,%eax
mov    %eax,-0x50(%rbp)
jmp    1370 <output+0x240>
cmpl   $0xffff,-0x38(%rbp)
jle    1364 <output+0x234>
mov    $0xffff,%eax
mov    %eax,-0x54(%rbp)
jmp    136a <output+0x23a>
mov    -0x38(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %al,-0x2f(%rbp)
mov    -0x38(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x30(%rbp)
movl   $0x2,-0x34(%rbp)
jmp    1524 <output+0x3f4>
movsd  0xc6f(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x38(%rbp)
cmpl   $0xffffff80,-0x38(%rbp)
jge    13bc <output+0x28c>
mov    $0xffffff80,%eax
mov    %eax,-0x58(%rbp)
jmp    13df <output+0x2af>
cmpl   $0x7f,-0x38(%rbp)
jle    13d3 <output+0x2a3>
mov    $0x7f,%eax
mov    %eax,-0x5c(%rbp)
jmp    13d9 <output+0x2a9>
mov    -0x38(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %al,-0x30(%rbp)
movl   $0x1,-0x34(%rbp)
jmp    1524 <output+0x3f4>
movsd  0xc01(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x38(%rbp)
cmpl   $0xffff8000,-0x38(%rbp)
jge    1425 <output+0x2f5>
mov    $0xffff8000,%eax
mov    %eax,-0x60(%rbp)
jmp    144b <output+0x31b>
cmpl   $0x7fff,-0x38(%rbp)
jle    143f <output+0x30f>
mov    $0x7fff,%eax
mov    %eax,-0x64(%rbp)
jmp    1445 <output+0x315>
mov    -0x38(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %al,-0x30(%rbp)
mov    -0x38(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x2f(%rbp)
movl   $0x2,-0x34(%rbp)
jmp    1524 <output+0x3f4>
movsd  0xb8c(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x38(%rbp)
cmpl   $0xffff8000,-0x38(%rbp)
jge    149a <output+0x36a>
mov    $0xffff8000,%eax
mov    %eax,-0x68(%rbp)
jmp    14c0 <output+0x390>
cmpl   $0x7fff,-0x38(%rbp)
jle    14b4 <output+0x384>
mov    $0x7fff,%eax
mov    %eax,-0x6c(%rbp)
jmp    14ba <output+0x38a>
mov    -0x38(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x68(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %al,-0x2f(%rbp)
mov    -0x38(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x30(%rbp)
movl   $0x2,-0x34(%rbp)
jmp    1524 <output+0x3f4>
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
movl   $0x4,-0x34(%rbp)
jmp    1524 <output+0x3f4>
lea    0xb1e(%rip),%rdi
mov    $0x0,%al
call   1030 <error@plt>
jmp    1524 <output+0x3f4>
mov    -0x8(%rbp),%rax
movsbl -0x1(%rax),%esi
lea    0xb3e(%rip),%rdi
mov    $0x0,%al
call   1030 <error@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    0x2aae(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   1050 <fwrite@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     155b <output+0x42b>
lea    0xb35(%rip),%rdi
mov    $0x0,%al
call   1030 <error@plt>
mov    -0x8(%rbp),%rax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
movsbl (%rdi),%esi
add    $0x1,%rbx
lea    -0x53(%rsi),%eax
cmp    $0x24,%eax
ja     117e <output+0x4e>
lea    0xee9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mulsd  0xea0(%rip),%xmm0
movsd  0xea0(%rip),%xmm1
maxsd  %xmm0,%xmm1
movsd  0xe9c(%rip),%xmm0
minsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
jmp    11d4 <output+0xa4>
test   %esi,%esi
jne    1197 <output+0x67>
lea    0xf4b(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <error@plt>
jmp    12c2 <output+0x192>
lea    0xf71(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <error@plt>
jmp    12c2 <output+0x192>
addsd  0xe7c(%rip),%xmm0
mulsd  0xe44(%rip),%xmm0
cvttsd2si %xmm0,%eax
cmp    $0xffff,%eax
mov    $0xffff,%ecx
cmovl  %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovg  %ecx,%eax
rol    $0x8,%ax
jmp    12b9 <output+0x189>
cmpb   $0x0,(%rbx)
mov    $0xa,%eax
mov    $0x20,%edx
cmove  %eax,%edx
lea    0xed8(%rip),%rsi
mov    %rsp,%rdi
call   1040 <sprintf@plt>
mov    %eax,%ebp
jmp    12c2 <output+0x192>
addsd  0xe25(%rip),%xmm0
mulsd  0xe05(%rip),%xmm0
cvttsd2si %xmm0,%eax
cmp    $0xff,%eax
mov    $0xff,%ecx
cmovl  %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovg  %ecx,%eax
jmp    1251 <output+0x121>
mulsd  0xde3(%rip),%xmm0
movsd  0xde3(%rip),%xmm1
maxsd  %xmm0,%xmm1
movsd  0xddf(%rip),%xmm0
minsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %al,(%rsp)
mov    $0x1,%ebp
jmp    12c2 <output+0x192>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rsp)
mov    $0x4,%ebp
jmp    12c2 <output+0x192>
mulsd  0xd8d(%rip),%xmm0
movsd  0xd8d(%rip),%xmm1
maxsd  %xmm0,%xmm1
movsd  0xd89(%rip),%xmm0
minsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
jmp    12b9 <output+0x189>
addsd  0xd97(%rip),%xmm0
mulsd  0xd5f(%rip),%xmm0
cvttsd2si %xmm0,%eax
cmp    $0xffff,%eax
mov    $0xffff,%ecx
cmovl  %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovg  %ecx,%eax
mov    %ax,(%rsp)
mov    $0x2,%ebp
mov    0x2d17(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
cmp    $0x1,%eax
je     12ed <output+0x1bd>
lea    0xe57(%rip),%rdi
xor    %eax,%eax
call   1030 <error@plt>
mov    %rbx,%rax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%.16g%c\00"
@.str.1 = [59 x i8] c"Internal error in output() -- ran out of format characters\00"
@.str.2 = [46 x i8] c"Internal error in output() -- bad format '%c'\00"
@stdout = global i32 0
@.str.3 = [12 x i8] c"Write error\00"
define i8* @output(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca [32 x i8]
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store double %1, double* %4
store i32 0, i32* %6
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
switch i32 %11, label %169 [
i32 97, label %12
i32 98, label %23
i32 119, label %44
i32 87, label %69
i32 99, label %94
i32 115, label %114
i32 83, label %138
i32 102, label %162
i32 0, label %167
]
12: ; preds = %2
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%14 = load double, double* %4
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 0
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 32, i32 10
%21 = trunc i32 %20 to i8
%22 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %14, i8 signext %21)
store i32 %22, i32* %6
br label %175
23: ; preds = %2
%24 = load double, double* %4
%25 = fadd double %24, 1.000000e+00
%26 = fmul double %25, 1.280000e+02
%27 = fptosi double %26 to i32
store i32 %27, i32* %7
%28 = load i32, i32* %7
%29 = icmp slt i32 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %23
br label %39
31: ; preds = %23
%32 = load i32, i32* %7
%33 = icmp sgt i32 %32, 255
br i1 %33, label %34, label %35
34: ; preds = %31
br label %37
35: ; preds = %31
%36 = load i32, i32* %7
br label %37
37: ; preds = %35, %34
%38 = phi i32 [ 255, %34 ], [ %36, %35 ]
br label %39
39: ; preds = %37, %30
%40 = phi i32 [ 0, %30 ], [ %38, %37 ]
store i32 %40, i32* %7
%41 = load i32, i32* %7
%42 = trunc i32 %41 to i8
%43 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
store i8 %42, i8* %43
store i32 1, i32* %6
br label %175
44: ; preds = %2
%45 = load double, double* %4
%46 = fadd double %45, 1.000000e+00
%47 = fmul double %46, 3.276800e+04
%48 = fptosi double %47 to i32
store i32 %48, i32* %7
%49 = load i32, i32* %7
%50 = icmp slt i32 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %44
br label %60
52: ; preds = %44
%53 = load i32, i32* %7
%54 = icmp sgt i32 %53, 65535
br i1 %54, label %55, label %56
55: ; preds = %52
br label %58
56: ; preds = %52
%57 = load i32, i32* %7
br label %58
58: ; preds = %56, %55
%59 = phi i32 [ 65535, %55 ], [ %57, %56 ]
br label %60
60: ; preds = %58, %51
%61 = phi i32 [ 0, %51 ], [ %59, %58 ]
store i32 %61, i32* %7
%62 = load i32, i32* %7
%63 = trunc i32 %62 to i8
%64 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
store i8 %63, i8* %64
%65 = load i32, i32* %7
%66 = ashr i32 %65, 8
%67 = trunc i32 %66 to i8
%68 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 1
store i8 %67, i8* %68
store i32 2, i32* %6
br label %175
69: ; preds = %2
%70 = load double, double* %4
%71 = fadd double %70, 1.000000e+00
%72 = fmul double %71, 3.276800e+04
%73 = fptosi double %72 to i32
store i32 %73, i32* %7
%74 = load i32, i32* %7
%75 = icmp slt i32 %74, 0
br i1 %75, label %76, label %77
76: ; preds = %69
br label %85
77: ; preds = %69
%78 = load i32, i32* %7
%79 = icmp sgt i32 %78, 65535
br i1 %79, label %80, label %81
80: ; preds = %77
br label %83
81: ; preds = %77
%82 = load i32, i32* %7
br label %83
83: ; preds = %81, %80
%84 = phi i32 [ 65535, %80 ], [ %82, %81 ]
br label %85
85: ; preds = %83, %76
%86 = phi i32 [ 0, %76 ], [ %84, %83 ]
store i32 %86, i32* %7
%87 = load i32, i32* %7
%88 = trunc i32 %87 to i8
%89 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 1
store i8 %88, i8* %89
%90 = load i32, i32* %7
%91 = ashr i32 %90, 8
%92 = trunc i32 %91 to i8
%93 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
store i8 %92, i8* %93
store i32 2, i32* %6
br label %175
94: ; preds = %2
%95 = load double, double* %4
%96 = fmul double %95, 1.280000e+02
%97 = fptosi double %96 to i32
store i32 %97, i32* %7
%98 = load i32, i32* %7
%99 = icmp slt i32 %98, -128
br i1 %99, label %100, label %101
100: ; preds = %94
br label %109
101: ; preds = %94
%102 = load i32, i32* %7
%103 = icmp sgt i32 %102, 127
br i1 %103, label %104, label %105
104: ; preds = %101
br label %107
105: ; preds = %101
%106 = load i32, i32* %7
br label %107
107: ; preds = %105, %104
%108 = phi i32 [ 127, %104 ], [ %106, %105 ]
br label %109
109: ; preds = %107, %100
%110 = phi i32 [ -128, %100 ], [ %108, %107 ]
store i32 %110, i32* %7
%111 = load i32, i32* %7
%112 = trunc i32 %111 to i8
%113 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
store i8 %112, i8* %113
store i32 1, i32* %6
br label %175
114: ; preds = %2
%115 = load double, double* %4
%116 = fmul double %115, 3.276800e+04
%117 = fptosi double %116 to i32
store i32 %117, i32* %7
%118 = load i32, i32* %7
%119 = icmp slt i32 %118, -32768
br i1 %119, label %120, label %121
120: ; preds = %114
br label %129
121: ; preds = %114
%122 = load i32, i32* %7
%123 = icmp sgt i32 %122, 32767
br i1 %123, label %124, label %125
124: ; preds = %121
br label %127
125: ; preds = %121
%126 = load i32, i32* %7
br label %127
127: ; preds = %125, %124
%128 = phi i32 [ 32767, %124 ], [ %126, %125 ]
br label %129
129: ; preds = %127, %120
%130 = phi i32 [ -32768, %120 ], [ %128, %127 ]
store i32 %130, i32* %7
%131 = load i32, i32* %7
%132 = trunc i32 %131 to i8
%133 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
store i8 %132, i8* %133
%134 = load i32, i32* %7
%135 = ashr i32 %134, 8
%136 = trunc i32 %135 to i8
%137 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 1
store i8 %136, i8* %137
store i32 2, i32* %6
br label %175
138: ; preds = %2
%139 = load double, double* %4
%140 = fmul double %139, 3.276800e+04
%141 = fptosi double %140 to i32
store i32 %141, i32* %7
%142 = load i32, i32* %7
%143 = icmp slt i32 %142, -32768
br i1 %143, label %144, label %145
144: ; preds = %138
br label %153
145: ; preds = %138
%146 = load i32, i32* %7
%147 = icmp sgt i32 %146, 32767
br i1 %147, label %148, label %149
148: ; preds = %145
br label %151
149: ; preds = %145
%150 = load i32, i32* %7
br label %151
151: ; preds = %149, %148
%152 = phi i32 [ 32767, %148 ], [ %150, %149 ]
br label %153
153: ; preds = %151, %144
%154 = phi i32 [ -32768, %144 ], [ %152, %151 ]
store i32 %154, i32* %7
%155 = load i32, i32* %7
%156 = trunc i32 %155 to i8
%157 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 1
store i8 %156, i8* %157
%158 = load i32, i32* %7
%159 = ashr i32 %158, 8
%160 = trunc i32 %159 to i8
%161 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
store i8 %160, i8* %161
store i32 2, i32* %6
br label %175
162: ; preds = %2
%163 = load double, double* %4
%164 = fptrunc double %163 to float
%165 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%166 = bitcast i8* %165 to float*
store float %164, float* %166
store i32 4, i32* %6
br label %175
167: ; preds = %2
%168 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
br label %175
169: ; preds = %2
%170 = load i8*, i8** %3
%171 = getelementptr inbounds i8, i8* %170, i64 -1
%172 = load i8, i8* %171
%173 = sext i8 %172 to i32
%174 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i32 %173)
br label %175
175: ; preds = %169, %167, %162, %153, %129, %109, %85, %60, %39, %12
%176 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%177 = load i32, i32* %6
%178 = load i32, i32* @stdout
%179 = call i32 @fwrite(i8* %176, i32 %177, i32 1, i32 %178)
%180 = icmp ne i32 1, %179
br i1 %180, label %181, label %183
181: ; preds = %175
%182 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %183
183: ; preds = %181, %175
%184 = load i8*, i8** %3
ret i8* %184
}

LLVM IR (-O2):
@.str = [8 x i8] c"%.16g%c\00"
@.str.1 = [59 x i8] c"Internal error in output() -- ran out of format characters\00"
@.str.2 = [46 x i8] c"Internal error in output() -- bad format '%c'\00"
@stdout = global i32 0
@.str.3 = [12 x i8] c"Write error\00"
define i8* @output(i8* %0, double %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %0
%7 = sext i8 %6 to i32
switch i32 %7, label %81 [
i32 97, label %8
i32 98, label %13
i32 119, label %22
i32 87, label %34
i32 99, label %46
i32 115, label %54
i32 83, label %65
i32 102, label %76
i32 0, label %79
]
8: ; preds = %2
%9 = load i8, i8* %5
%10 = icmp eq i8 %9, 0
%11 = select i1 %10, i8 10, i8 32
%12 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %1, i8 signext %11)
br label %83
13: ; preds = %2
%14 = fadd double %1, 1.000000e+00
%15 = fmul double %14, 1.280000e+02
%16 = fptosi double %15 to i32
%17 = icmp slt i32 %16, 255
%18 = select i1 %17, i32 %16, i32 255
%19 = icmp sgt i32 %18, 0
%20 = select i1 %19, i32 %18, i32 0
%21 = trunc i32 %20 to i8
store i8 %21, i8* %4
br label %83
22: ; preds = %2
%23 = fadd double %1, 1.000000e+00
%24 = fmul double %23, 3.276800e+04
%25 = fptosi double %24 to i32
%26 = icmp slt i32 %25, 65535
%27 = select i1 %26, i32 %25, i32 65535
%28 = icmp sgt i32 %27, 0
%29 = select i1 %28, i32 %27, i32 0
%30 = trunc i32 %29 to i8
store i8 %30, i8* %4
%31 = lshr i32 %29, 8
%32 = trunc i32 %31 to i8
%33 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 1
store i8 %32, i8* %33
br label %83
34: ; preds = %2
%35 = fadd double %1, 1.000000e+00
%36 = fmul double %35, 3.276800e+04
%37 = fptosi double %36 to i32
%38 = icmp slt i32 %37, 65535
%39 = select i1 %38, i32 %37, i32 65535
%40 = icmp sgt i32 %39, 0
%41 = select i1 %40, i32 %39, i32 0
%42 = trunc i32 %41 to i8
%43 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 1
store i8 %42, i8* %43
%44 = lshr i32 %41, 8
%45 = trunc i32 %44 to i8
store i8 %45, i8* %4
br label %83
46: ; preds = %2
%47 = fmul double %1, 1.280000e+02
%48 = fptosi double %47 to i32
%49 = icmp slt i32 %48, 127
%50 = select i1 %49, i32 %48, i32 127
%51 = icmp sgt i32 %50, -128
%52 = select i1 %51, i32 %50, i32 -128
%53 = trunc i32 %52 to i8
store i8 %53, i8* %4
br label %83
54: ; preds = %2
%55 = fmul double %1, 3.276800e+04
%56 = fptosi double %55 to i32
%57 = icmp slt i32 %56, 32767
%58 = select i1 %57, i32 %56, i32 32767
%59 = icmp sgt i32 %58, -32768
%60 = select i1 %59, i32 %58, i32 -32768
%61 = trunc i32 %60 to i8
store i8 %61, i8* %4
%62 = lshr i32 %60, 8
%63 = trunc i32 %62 to i8
%64 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 1
store i8 %63, i8* %64
br label %83
65: ; preds = %2
%66 = fmul double %1, 3.276800e+04
%67 = fptosi double %66 to i32
%68 = icmp slt i32 %67, 32767
%69 = select i1 %68, i32 %67, i32 32767
%70 = icmp sgt i32 %69, -32768
%71 = select i1 %70, i32 %69, i32 -32768
%72 = trunc i32 %71 to i8
%73 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 1
store i8 %72, i8* %73
%74 = lshr i32 %71, 8
%75 = trunc i32 %74 to i8
store i8 %75, i8* %4
br label %83
76: ; preds = %2
%77 = fptrunc double %1 to float
%78 = bitcast [32 x i8]* %3 to float*
store float %77, float* %78
br label %83
79: ; preds = %2
%80 = tail call i32 (i8*, ...) @error(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
br label %83
81: ; preds = %2
%82 = tail call i32 (i8*, ...) @error(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i32 %7)
br label %83
83: ; preds = %81, %79, %76, %65, %54, %46, %34, %22, %13, %8
%84 = phi i32 [ 0, %81 ], [ 0, %79 ], [ 4, %76 ], [ 2, %65 ], [ 2, %54 ], [ 1, %46 ], [ 2, %34 ], [ 2, %22 ], [ 1, %13 ], [ %12, %8 ]
%85 = load i32, i32* @stdout
%86 = call i32 @fwrite(i8* %4, i32 %84, i32 1, i32 %85)
%87 = icmp eq i32 %86, 1
br i1 %87, label %90, label %88
88: ; preds = %83
%89 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %90
90: ; preds = %88, %83
ret i8* %5
}