#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*/ mpz_t;
typedef int /*<<< orphan*/ mpfr_t;
typedef int mpfr_prec_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ GMP_RNDZ;
int /*<<< orphan*/ abort();
scalar_t__ asprintf(char **, char *, char const *);
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fwrite(char *, int, int, int /*<<< orphan*/ *);
scalar_t__ mpfr_cmp_ui(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpfr_div_2exp(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                 int /*<<< orphan*/);
int mpfr_get_prec(int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_get_z(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_mul_2exp(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                 int /*<<< orphan*/);
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
scalar_t__ mpz_tstbit(int /*<<< orphan*/, unsigned long);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ system(char *);
void output(mpfr_t f, const char *basename) {
  mpfr_prec_t prec;
  unsigned long i, pos, prev;
  char byte;
  char *filename, *command;
  FILE *fp;
  mpz_t z;
  if (asprintf(&filename, "../lib/App/MathImage/%s", basename) < 0) {
    perror("asprintf");
    abort();
  }
  printf("output to %s\n", filename);
  fp = fopen(filename, "wb");
  if (!fp)
    abort();
  while (mpfr_cmp_ui(f, 1) < 0)
    mpfr_mul_2exp(f, f, 1, GMP_RNDZ);
  while (mpfr_cmp_ui(f, 1) >= 0)
    mpfr_div_2exp(f, f, 1, GMP_RNDZ);
  prec = mpfr_get_prec(f);
  mpfr_mul_2exp(f, f, prec, GMP_RNDZ);
  mpz_init(z);
  mpfr_get_z(z, f, GMP_RNDZ);
  pos = 1;
  prev = 1;
  i = prec;
  while (i--) {
    if (mpz_tstbit(z, i)) {
      if (pos - prev > 255) {
        printf("bigger than a byte\n");
        abort();
      }
      byte = pos - prev;
      if (fwrite(&byte, 1, 1, fp) != 1) {
        perror("fwrite");
        abort();
      }
      prev = pos;
    } else {
    }
    pos++;
  }
  if (fclose(fp) != 0) {
    perror("error closing");
    abort();
  }
  mpz_clear(z);
  if (asprintf(&command, "ls -l %s", filename) < 0) {
    perror("asprintf");
    abort();
  }
  if (system(command) != 0)
    abort();
  if (asprintf(&command, "gzip -9f %s", filename) < 0) {
    perror("asprintf");
    abort();
  }
  printf("%s\n", command);
  if (system(command) != 0)
    abort();
  if (asprintf(&command, "ls -l %s.gz", filename) < 0) {
    perror("asprintf");
    abort();
  }
  if (system(command) != 0)
    abort();
  printf("\n");
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    -0x40(%rbp),%rdi
lea    0xde2(%rip),%rsi
call   10c0 <asprintf@plt>
cmp    $0x0,%rax
jge    1240 <output+0x40>
lea    0xde4(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x40(%rbp),%rsi
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x40(%rbp),%rdi
lea    0xdd2(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    1278 <output+0x78>
mov    $0x0,%al
call   1040 <abort@plt>
jmp    127d <output+0x7d>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1050 <mpfr_cmp_ui@plt>
cmp    $0x0,%rax
jge    12b2 <output+0xb2>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    0x2d3f(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   10b0 <mpfr_mul_2exp@plt>
jmp    127d <output+0x7d>
jmp    12b7 <output+0xb7>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1050 <mpfr_cmp_ui@plt>
cmp    $0x0,%rax
jl     12ec <output+0xec>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    0x2d05(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   1110 <mpfr_div_2exp@plt>
jmp    12b7 <output+0xb7>
mov    -0x4(%rbp),%edi
call   1100 <mpfr_get_prec@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    0x2cd9(%rip),%rax
mov    (%rax),%ecx
call   10b0 <mpfr_mul_2exp@plt>
mov    -0x54(%rbp),%edi
call   10a0 <mpz_init@plt>
mov    -0x54(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    0x2cbd(%rip),%rax
mov    (%rax),%edx
call   1060 <mpfr_get_z@plt>
movq   $0x1,-0x28(%rbp)
movq   $0x1,-0x30(%rbp)
movslq -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
je     13f8 <output+0x1f8>
mov    -0x54(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1030 <mpz_tstbit@plt>
cmp    $0x0,%rax
je     13e2 <output+0x1e2>
mov    -0x28(%rbp),%rax
sub    -0x30(%rbp),%rax
cmp    $0xff,%rax
jbe    139a <output+0x19a>
lea    0xca6(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x28(%rbp),%rax
sub    -0x30(%rbp),%rax
mov    %al,-0x31(%rbp)
mov    -0x50(%rbp),%rcx
lea    -0x31(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1120 <fwrite@plt>
cmp    $0x1,%eax
je     13d5 <output+0x1d5>
lea    0xc7d(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    13e7 <output+0x1e7>
jmp    13e7 <output+0x1e7>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1342 <output+0x142>
mov    -0x50(%rbp),%rdi
call   1070 <fclose@plt>
cmp    $0x0,%rax
je     141e <output+0x21e>
lea    0xc3b(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x54(%rbp),%edi
call   10d0 <mpz_clear@plt>
mov    -0x40(%rbp),%rdx
lea    -0x48(%rbp),%rdi
lea    0xc26(%rip),%rsi
call   10c0 <asprintf@plt>
cmp    $0x0,%rax
jge    1457 <output+0x257>
lea    0xbcd(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x48(%rbp),%rdi
call   1080 <system@plt>
cmp    $0x0,%rax
je     1471 <output+0x271>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x40(%rbp),%rdx
lea    -0x48(%rbp),%rdi
lea    0xbe4(%rip),%rsi
call   10c0 <asprintf@plt>
cmp    $0x0,%rax
jge    14a2 <output+0x2a2>
lea    0xb82(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x48(%rbp),%rsi
lea    0xb7e(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x48(%rbp),%rdi
call   1080 <system@plt>
cmp    $0x0,%rax
je     14ce <output+0x2ce>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x40(%rbp),%rdx
lea    -0x48(%rbp),%rdi
lea    0xb93(%rip),%rsi
call   10c0 <asprintf@plt>
cmp    $0x0,%rax
jge    14ff <output+0x2ff>
lea    0xb25(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x48(%rbp),%rdi
call   1080 <system@plt>
cmp    $0x0,%rax
je     1519 <output+0x319>
mov    $0x0,%al
call   1040 <abort@plt>
lea    0xb24(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rdx
mov    %edi,%ebp
lea    0xdc8(%rip),%rsi
lea    0x18(%rsp),%rdi
call   10e0 <asprintf@plt>
test   %rax,%rax
js     147f <output+0x25f>
mov    0x18(%rsp),%rsi
lea    0xdca(%rip),%rdi
xor    %eax,%eax
call   10b0 <printf@plt>
mov    0x18(%rsp),%rdi
lea    0xdc5(%rip),%rsi
call   1100 <fopen@plt>
test   %rax,%rax
je     1478 <output+0x258>
mov    %rax,%r15
mov    %ebp,%edi
mov    $0x1,%esi
call   1070 <mpfr_cmp_ui@plt>
test   %rax,%rax
jns    12c1 <output+0xa1>
mov    0x2d4d(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rbx),%ecx
mov    %ebp,%edi
mov    %ebp,%esi
mov    $0x1,%edx
call   10d0 <mpfr_mul_2exp@plt>
mov    %ebp,%edi
mov    $0x1,%esi
call   1070 <mpfr_cmp_ui@plt>
test   %rax,%rax
js     12a0 <output+0x80>
mov    %ebp,%edi
mov    $0x1,%esi
call   1070 <mpfr_cmp_ui@plt>
test   %rax,%rax
js     1301 <output+0xe1>
mov    0x2d07(%rip),%rbx
nopl   0x0(%rax)
mov    (%rbx),%ecx
mov    %ebp,%edi
mov    %ebp,%esi
mov    $0x1,%edx
call   1130 <mpfr_div_2exp@plt>
mov    %ebp,%edi
mov    $0x1,%esi
call   1070 <mpfr_cmp_ui@plt>
test   %rax,%rax
jns    12e0 <output+0xc0>
mov    %ebp,%edi
call   1120 <mpfr_get_prec@plt>
mov    %eax,%r14d
mov    0x2cce(%rip),%rbx
mov    (%rbx),%ecx
mov    %ebp,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   10d0 <mpfr_mul_2exp@plt>
call   10c0 <mpz_init@plt>
mov    (%rbx),%edx
mov    %ebp,%esi
call   1080 <mpfr_get_z@plt>
test   %r14d,%r14d
je     13af <output+0x18f>
movslq %r14d,%r12
add    $0xffffffffffffffff,%r12
mov    $0x1,%ebp
lea    0xf(%rsp),%r14
mov    $0x1,%ebx
jmp    135a <output+0x13a>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
add    $0xffffffffffffffff,%r12
jae    13af <output+0x18f>
mov    %r12,%rsi
call   1030 <mpz_tstbit@plt>
test   %rax,%rax
je     1350 <output+0x130>
mov    %rbx,%rax
sub    %rbp,%rax
cmp    $0x100,%rax
jae    146c <output+0x24c>
neg    %bpl
movzbl %bpl,%eax
add    %ebx,%eax
mov    %al,0xf(%rsp)
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1140 <fwrite@plt>
mov    %rbx,%rbp
cmp    $0x1,%eax
je     1350 <output+0x130>
lea    0xc88(%rip),%rdi
jmp    148f <output+0x26f>
mov    %r15,%rdi
call   1090 <fclose@plt>
test   %rax,%rax
jne    1488 <output+0x268>
call   10f0 <mpz_clear@plt>
mov    0x18(%rsp),%rdx
lea    0xc76(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10e0 <asprintf@plt>
test   %rax,%rax
js     147f <output+0x25f>
mov    0x10(%rsp),%rdi
call   10a0 <system@plt>
test   %rax,%rax
jne    1478 <output+0x258>
mov    0x18(%rsp),%rdx
lea    0xc4d(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10e0 <asprintf@plt>
test   %rax,%rax
js     147f <output+0x25f>
mov    0x10(%rsp),%rdi
call   1060 <puts@plt>
mov    0x10(%rsp),%rdi
call   10a0 <system@plt>
test   %rax,%rax
jne    1478 <output+0x258>
mov    0x18(%rsp),%rdx
lea    0xc25(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10e0 <asprintf@plt>
test   %rax,%rax
js     147f <output+0x25f>
mov    0x10(%rsp),%rdi
call   10a0 <system@plt>
test   %rax,%rax
jne    1478 <output+0x258>
mov    $0xa,%edi
call   1040 <putchar@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbf5(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1050 <abort@plt>
lea    0xb92(%rip),%rdi
jmp    148f <output+0x26f>
lea    0xbaa(%rip),%rdi
call   1110 <perror@plt>
xor    %eax,%eax
call   1050 <abort@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"../lib/App/MathImage/%s\00"
@.str.1 = [9 x i8] c"asprintf\00"
@.str.2 = [14 x i8] c"output to %s\0A\00"
@.str.3 = [3 x i8] c"wb\00"
@GMP_RNDZ = global i32 0
@.str.4 = [20 x i8] c"bigger than a byte\0A\00"
@.str.5 = [7 x i8] c"fwrite\00"
@.str.6 = [14 x i8] c"error closing\00"
@.str.7 = [9 x i8] c"ls -l %s\00"
@.str.8 = [12 x i8] c"gzip -9f %s\00"
@.str.9 = [4 x i8] c"%s\0A\00"
@.str.10 = [12 x i8] c"ls -l %s.gz\00"
@.str.11 = [2 x i8] c"\0A\00"
define void @output(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i8
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32*
%13 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%14 = load i8*, i8** %4
%15 = call i64 @asprintf(i8** %10, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %2
%21 = load i8*, i8** %10
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %21)
%23 = load i8*, i8** %10
%24 = call i32* @fopen(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %24, i32** %12
%25 = load i32*, i32** %12
%26 = icmp ne i32* %25, null
br i1 %26, label %29, label %27
27: ; preds = %20
%28 = call i32 (...) @abort()
unreachable
29: ; preds = %20
br label %30
30: ; preds = %34, %29
%31 = load i32, i32* %3
%32 = call i64 @mpfr_cmp_ui(i32 %31, i32 1)
%33 = icmp slt i64 %32, 0
br i1 %33, label %34, label %39
34: ; preds = %30
%35 = load i32, i32* %3
%36 = load i32, i32* %3
%37 = load i32, i32* @GMP_RNDZ
%38 = call i32 @mpfr_mul_2exp(i32 %35, i32 %36, i32 1, i32 %37)
br label %30
39: ; preds = %30
br label %40
40: ; preds = %44, %39
%41 = load i32, i32* %3
%42 = call i64 @mpfr_cmp_ui(i32 %41, i32 1)
%43 = icmp sge i64 %42, 0
br i1 %43, label %44, label %49
44: ; preds = %40
%45 = load i32, i32* %3
%46 = load i32, i32* %3
%47 = load i32, i32* @GMP_RNDZ
%48 = call i32 @mpfr_div_2exp(i32 %45, i32 %46, i32 1, i32 %47)
br label %40
49: ; preds = %40
%50 = load i32, i32* %3
%51 = call i32 @mpfr_get_prec(i32 %50)
store i32 %51, i32* %5
%52 = load i32, i32* %3
%53 = load i32, i32* %3
%54 = load i32, i32* %5
%55 = load i32, i32* @GMP_RNDZ
%56 = call i32 @mpfr_mul_2exp(i32 %52, i32 %53, i32 %54, i32 %55)
%57 = load i32, i32* %13
%58 = call i32 @mpz_init(i32 %57)
%59 = load i32, i32* %13
%60 = load i32, i32* %3
%61 = load i32, i32* @GMP_RNDZ
%62 = call i32 @mpfr_get_z(i32 %59, i32 %60, i32 %61)
store i64 1, i64* %7
store i64 1, i64* %8
%63 = load i32, i32* %5
%64 = sext i32 %63 to i64
store i64 %64, i64* %6
br label %65
65: ; preds = %96, %49
%66 = load i64, i64* %6
%67 = add i64 %66, -1
store i64 %67, i64* %6
%68 = icmp ne i64 %66, 0
br i1 %68, label %69, label %99
69: ; preds = %65
%70 = load i32, i32* %13
%71 = load i64, i64* %6
%72 = call i64 @mpz_tstbit(i32 %70, i64 %71)
%73 = icmp ne i64 %72, 0
br i1 %73, label %74, label %95
74: ; preds = %69
%75 = load i64, i64* %7
%76 = load i64, i64* %8
%77 = sub i64 %75, %76
%78 = icmp ugt i64 %77, 255
br i1 %78, label %79, label %82
79: ; preds = %74
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%81 = call i32 (...) @abort()
unreachable
82: ; preds = %74
%83 = load i64, i64* %7
%84 = load i64, i64* %8
%85 = sub i64 %83, %84
%86 = trunc i64 %85 to i8
store i8 %86, i8* %9
%87 = load i32*, i32** %12
%88 = call i32 @fwrite(i8* %9, i32 1, i32 1, i32* %87)
%89 = icmp ne i32 %88, 1
br i1 %89, label %90, label %93
90: ; preds = %82
%91 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%92 = call i32 (...) @abort()
unreachable
93: ; preds = %82
%94 = load i64, i64* %7
store i64 %94, i64* %8
br label %96
95: ; preds = %69
br label %96
96: ; preds = %95, %93
%97 = load i64, i64* %7
%98 = add i64 %97, 1
store i64 %98, i64* %7
br label %65
99: ; preds = %65
%100 = load i32*, i32** %12
%101 = call i64 @fclose(i32* %100)
%102 = icmp ne i64 %101, 0
br i1 %102, label %103, label %106
103: ; preds = %99
%104 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%105 = call i32 (...) @abort()
unreachable
106: ; preds = %99
%107 = load i32, i32* %13
%108 = call i32 @mpz_clear(i32 %107)
%109 = load i8*, i8** %10
%110 = call i64 @asprintf(i8** %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* %109)
%111 = icmp slt i64 %110, 0
br i1 %111, label %112, label %115
112: ; preds = %106
%113 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%114 = call i32 (...) @abort()
unreachable
115: ; preds = %106
%116 = load i8*, i8** %11
%117 = call i64 @system(i8* %116)
%118 = icmp ne i64 %117, 0
br i1 %118, label %119, label %121
119: ; preds = %115
%120 = call i32 (...) @abort()
unreachable
121: ; preds = %115
%122 = load i8*, i8** %10
%123 = call i64 @asprintf(i8** %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8* %122)
%124 = icmp slt i64 %123, 0
br i1 %124, label %125, label %128
125: ; preds = %121
%126 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%127 = call i32 (...) @abort()
unreachable
128: ; preds = %121
%129 = load i8*, i8** %11
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %129)
%131 = load i8*, i8** %11
%132 = call i64 @system(i8* %131)
%133 = icmp ne i64 %132, 0
br i1 %133, label %134, label %136
134: ; preds = %128
%135 = call i32 (...) @abort()
unreachable
136: ; preds = %128
%137 = load i8*, i8** %10
%138 = call i64 @asprintf(i8** %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* %137)
%139 = icmp slt i64 %138, 0
br i1 %139, label %140, label %143
140: ; preds = %136
%141 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%142 = call i32 (...) @abort()
unreachable
143: ; preds = %136
%144 = load i8*, i8** %11
%145 = call i64 @system(i8* %144)
%146 = icmp ne i64 %145, 0
br i1 %146, label %147, label %149
147: ; preds = %143
%148 = call i32 (...) @abort()
unreachable
149: ; preds = %143
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"../lib/App/MathImage/%s\00"
@.str.1 = [9 x i8] c"asprintf\00"
@.str.2 = [14 x i8] c"output to %s\0A\00"
@.str.3 = [3 x i8] c"wb\00"
@GMP_RNDZ = global i32 0
@.str.5 = [7 x i8] c"fwrite\00"
@.str.6 = [14 x i8] c"error closing\00"
@.str.7 = [9 x i8] c"ls -l %s\00"
@.str.8 = [12 x i8] c"gzip -9f %s\00"
@.str.10 = [12 x i8] c"ls -l %s.gz\00"
@str = [19 x i8] c"bigger than a byte\00"
define void @output(i32 %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i8*
%6 = bitcast i8** %4 to i8*
%7 = bitcast i8** %5 to i8*
%8 = call i64 @asprintf(i8** %4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %14)
%16 = load i8*, i8** %4
%17 = call i32* @fopen(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i32* %17, null
br i1 %18, label %22, label %19
19: ; preds = %13
%20 = call i64 @mpfr_cmp_ui(i32 %0, i32 1)
%21 = icmp slt i64 %20, 0
br i1 %21, label %27, label %24
22: ; preds = %13
%23 = call i32 (...) @abort()
unreachable
24: ; preds = %27, %19
%25 = call i64 @mpfr_cmp_ui(i32 %0, i32 1)
%26 = icmp sgt i64 %25, -1
br i1 %26, label %32, label %37
27: ; preds = %19, %27
%28 = load i32, i32* @GMP_RNDZ
%29 = call i32 @mpfr_mul_2exp(i32 %0, i32 %0, i32 1, i32 %28)
%30 = call i64 @mpfr_cmp_ui(i32 %0, i32 1)
%31 = icmp slt i64 %30, 0
br i1 %31, label %27, label %24
32: ; preds = %24, %32
%33 = load i32, i32* @GMP_RNDZ
%34 = call i32 @mpfr_div_2exp(i32 %0, i32 %0, i32 1, i32 %33)
%35 = call i64 @mpfr_cmp_ui(i32 %0, i32 1)
%36 = icmp sgt i64 %35, -1
br i1 %36, label %32, label %37
37: ; preds = %32, %24
%38 = call i32 @mpfr_get_prec(i32 %0)
%39 = load i32, i32* @GMP_RNDZ
%40 = call i32 @mpfr_mul_2exp(i32 %0, i32 %0, i32 %38, i32 %39)
%41 = call i32 @mpz_init(i32 undef)
%42 = load i32, i32* @GMP_RNDZ
%43 = call i32 @mpfr_get_z(i32 undef, i32 %0, i32 %42)
%44 = icmp eq i32 %38, 0
br i1 %44, label %71, label %45
45: ; preds = %37
%46 = sext i32 %38 to i64
br label %47
47: ; preds = %45, %67
%48 = phi i64 [ %51, %67 ], [ %46, %45 ]
%49 = phi i64 [ %68, %67 ], [ 1, %45 ]
%50 = phi i64 [ %69, %67 ], [ 1, %45 ]
%51 = add i64 %48, -1
%52 = call i64 @mpz_tstbit(i32 undef, i64 %51)
%53 = icmp eq i64 %52, 0
br i1 %53, label %67, label %54
54: ; preds = %47
%55 = sub i64 %50, %49
%56 = icmp ugt i64 %55, 255
br i1 %56, label %57, label %60
57: ; preds = %54
%58 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%59 = call i32 (...) @abort()
unreachable
60: ; preds = %54
%61 = trunc i64 %55 to i8
store i8 %61, i8* %3
%62 = call i32 @fwrite(i8* %3, i32 1, i32 1, i32* %17)
%63 = icmp eq i32 %62, 1
br i1 %63, label %67, label %64
64: ; preds = %60
%65 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%66 = call i32 (...) @abort()
unreachable
67: ; preds = %60, %47
%68 = phi i64 [ %49, %47 ], [ %50, %60 ]
%69 = add i64 %50, 1
%70 = icmp eq i64 %51, 0
br i1 %70, label %71, label %47
71: ; preds = %67, %37
%72 = call i64 @fclose(i32* %17)
%73 = icmp eq i64 %72, 0
br i1 %73, label %77, label %74
74: ; preds = %71
%75 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%76 = call i32 (...) @abort()
unreachable
77: ; preds = %71
%78 = call i32 @mpz_clear(i32 undef)
%79 = load i8*, i8** %4
%80 = call i64 @asprintf(i8** %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* %79)
%81 = icmp slt i64 %80, 0
br i1 %81, label %82, label %85
82: ; preds = %77
%83 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%84 = call i32 (...) @abort()
unreachable
85: ; preds = %77
%86 = load i8*, i8** %5
%87 = call i64 @system(i8* %86)
%88 = icmp eq i64 %87, 0
br i1 %88, label %91, label %89
89: ; preds = %85
%90 = call i32 (...) @abort()
unreachable
91: ; preds = %85
%92 = load i8*, i8** %4
%93 = call i64 @asprintf(i8** %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8* %92)
%94 = icmp slt i64 %93, 0
br i1 %94, label %95, label %98
95: ; preds = %91
%96 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%97 = call i32 (...) @abort()
unreachable
98: ; preds = %91
%99 = load i8*, i8** %5
%100 = call i32 @puts(i8* dereferenceable(1) %99)
%101 = load i8*, i8** %5
%102 = call i64 @system(i8* %101)
%103 = icmp eq i64 %102, 0
br i1 %103, label %106, label %104
104: ; preds = %98
%105 = call i32 (...) @abort()
unreachable
106: ; preds = %98
%107 = load i8*, i8** %4
%108 = call i64 @asprintf(i8** %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* %107)
%109 = icmp slt i64 %108, 0
br i1 %109, label %110, label %113
110: ; preds = %106
%111 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%112 = call i32 (...) @abort()
unreachable
113: ; preds = %106
%114 = load i8*, i8** %5
%115 = call i64 @system(i8* %114)
%116 = icmp eq i64 %115, 0
br i1 %116, label %119, label %117
117: ; preds = %113
%118 = call i32 (...) @abort()
unreachable
119: ; preds = %113
%120 = call i32 @putchar(i32 10)
ret void
}