long cntl(data, maxl, rcp)
char *data;
long maxl;
struct res *rcp;
{
  int vis, min, max, pid;
  int val, r1, r2, r3, r4;
  long ref;
  char title[128];
  char *skipsp(), *getline(), *lp;
  char *outp(), *outs(), *outl(), *outc();
  char *datap = data;
  char *strcpy();
  lp = skipsp(getline());
  strcpy(title, lp);
  if ((lp = getline()) == 0 ||
      sscanf(lp, "%d %d %d %d", &r1, &r2, &r3, &r4) != 4)
    fatal("bad rectangle");
  lp = skipsp(getline());
  vis = (*lp == 'V' || *lp == 'v' ? 1 : 0);
  if ((lp = getline()) == 0 || sscanf(lp, "%d", &pid) != 1)
    fatal("bad proc id");
  if ((lp = getline()) == 0 || sscanf(lp, "%ld", &ref) != 1)
    fatal("bad refcon");
  if ((lp = getline()) == 0 || sscanf(lp, "%d", &val) != 1)
    fatal("bad value");
  if ((lp = getline()) == 0 || sscanf(lp, "%d", &min) != 1)
    fatal("bad min");
  if ((lp = getline()) == 0 || sscanf(lp, "%d", &max) != 1)
    fatal("bad max");
  datap = outs(datap, r1, &maxl);
  datap = outs(datap, r2, &maxl);
  datap = outs(datap, r3, &maxl);
  datap = outs(datap, r4, &maxl);
  datap = outs(datap, val, &maxl);
  datap = outc(datap, (char)vis, &maxl);
  datap = outc(datap, (char)0, &maxl);
  datap = outs(datap, max, &maxl);
  datap = outs(datap, min, &maxl);
  datap = outs(datap, pid, &maxl);
  datap = outl(datap, (long)ref, &maxl);
  datap = outp(datap, title, &maxl, 1);
  return (datap - data);
}


x86 assembly (clang, -O0):
<cntl>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0xe0(%rbp)
mov    $0x0,%al
call   1080 <getline@plt>
mov    %rax,%rdi
mov    $0x0,%al
call   1090 <skipsp@plt>
mov    %rax,-0xd8(%rbp)
lea    -0xd0(%rbp),%rdi
mov    -0xd8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    $0x0,%al
call   1080 <getline@plt>
mov    %rax,-0xd8(%rbp)
cmp    $0x0,%rax
je     1223 <cntl+0x93>
mov    -0xd8(%rbp),%rdi
lea    0xdfd(%rip),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x34(%rbp),%rcx
lea    -0x38(%rbp),%r8
lea    -0x3c(%rbp),%r9
mov    $0x0,%al
call   1060 <sscanf@plt>
cmp    $0x4,%eax
je     1231 <cntl+0xa1>
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   10b0 <fatal@plt>
mov    $0x0,%al
call   1080 <getline@plt>
mov    %rax,%rdi
mov    $0x0,%al
call   1090 <skipsp@plt>
mov    %rax,-0xd8(%rbp)
mov    -0xd8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x56,%ecx
mov    %al,-0xe1(%rbp)
je     127a <cntl+0xea>
mov    -0xd8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x76,%eax
sete   %al
mov    %al,-0xe1(%rbp)
mov    -0xe1(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1080 <getline@plt>
mov    %rax,-0xd8(%rbp)
cmp    $0x0,%rax
je     12ca <cntl+0x13a>
mov    -0xd8(%rbp),%rdi
lea    0xd53(%rip),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1060 <sscanf@plt>
cmp    $0x1,%eax
je     12d8 <cntl+0x148>
lea    0xd49(%rip),%rdi
mov    $0x0,%al
call   10b0 <fatal@plt>
mov    $0x0,%al
call   1080 <getline@plt>
mov    %rax,-0xd8(%rbp)
cmp    $0x0,%rax
je     1312 <cntl+0x182>
mov    -0xd8(%rbp),%rdi
lea    0xd28(%rip),%rsi
lea    -0x48(%rbp),%rdx
mov    $0x0,%al
call   1060 <sscanf@plt>
cmp    $0x1,%eax
je     1320 <cntl+0x190>
lea    0xd11(%rip),%rdi
mov    $0x0,%al
call   10b0 <fatal@plt>
mov    $0x0,%al
call   1080 <getline@plt>
mov    %rax,-0xd8(%rbp)
cmp    $0x0,%rax
je     135a <cntl+0x1ca>
mov    -0xd8(%rbp),%rdi
lea    0xcc3(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    $0x0,%al
call   1060 <sscanf@plt>
cmp    $0x1,%eax
je     1368 <cntl+0x1d8>
lea    0xcd4(%rip),%rdi
mov    $0x0,%al
call   10b0 <fatal@plt>
mov    $0x0,%al
call   1080 <getline@plt>
mov    %rax,-0xd8(%rbp)
cmp    $0x0,%rax
je     13a2 <cntl+0x212>
mov    -0xd8(%rbp),%rdi
lea    0xc7b(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1060 <sscanf@plt>
cmp    $0x1,%eax
je     13b0 <cntl+0x220>
lea    0xc96(%rip),%rdi
mov    $0x0,%al
call   10b0 <fatal@plt>
mov    $0x0,%al
call   1080 <getline@plt>
mov    %rax,-0xd8(%rbp)
cmp    $0x0,%rax
je     13ea <cntl+0x25a>
mov    -0xd8(%rbp),%rdi
lea    0xc33(%rip),%rsi
lea    -0x24(%rbp),%rdx
mov    $0x0,%al
call   1060 <sscanf@plt>
cmp    $0x1,%eax
je     13f8 <cntl+0x268>
lea    0xc56(%rip),%rdi
mov    $0x0,%al
call   10b0 <fatal@plt>
mov    -0xe0(%rbp),%rdi
mov    -0x30(%rbp),%esi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   10a0 <outs@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rdi
mov    -0x34(%rbp),%esi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   10a0 <outs@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rdi
mov    -0x38(%rbp),%esi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   10a0 <outs@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rdi
mov    -0x3c(%rbp),%esi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   10a0 <outs@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rdi
mov    -0x2c(%rbp),%esi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   10a0 <outs@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rdi
mov    -0x1c(%rbp),%eax
movsbl %al,%esi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1070 <outc@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rdi
xor    %esi,%esi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1070 <outc@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rdi
mov    -0x24(%rbp),%esi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   10a0 <outs@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rdi
mov    -0x20(%rbp),%esi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   10a0 <outs@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rdi
mov    -0x28(%rbp),%esi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   10a0 <outs@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rdi
mov    -0x48(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1050 <outl@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x0,%al
call   1040 <outp@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cntl>:
push   %rbp
push   %r14
push   %rbx
sub    $0xb0,%rsp
mov    %rdi,%r14
mov    %rsi,0x28(%rsp)
xor    %eax,%eax
call   1080 <getline@plt>
mov    %rax,%rdi
xor    %eax,%eax
call   1090 <skipsp@plt>
lea    0x30(%rsp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
call   1080 <getline@plt>
test   %rax,%rax
je     11f5 <cntl+0x65>
lea    0xe2c(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
mov    %rsp,%r9
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <sscanf@plt>
cmp    $0x4,%eax
je     1203 <cntl+0x73>
lea    0xe10(%rip),%rdi
xor    %eax,%eax
call   10b0 <fatal@plt>
xor    %eax,%eax
call   1080 <getline@plt>
mov    %rax,%rdi
xor    %eax,%eax
call   1090 <skipsp@plt>
mov    (%rax),%bl
xor    %eax,%eax
call   1080 <getline@plt>
test   %rax,%rax
je     123d <cntl+0xad>
lea    0xde0(%rip),%rsi
lea    0x14(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <sscanf@plt>
cmp    $0x1,%eax
je     124b <cntl+0xbb>
lea    0xdd6(%rip),%rdi
xor    %eax,%eax
call   10b0 <fatal@plt>
xor    %eax,%eax
call   1080 <getline@plt>
test   %rax,%rax
je     1272 <cntl+0xe2>
lea    0xdc8(%rip),%rsi
lea    0x20(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <sscanf@plt>
cmp    $0x1,%eax
je     1280 <cntl+0xf0>
lea    0xdb1(%rip),%rdi
xor    %eax,%eax
call   10b0 <fatal@plt>
xor    %eax,%eax
call   1080 <getline@plt>
test   %rax,%rax
je     12a7 <cntl+0x117>
lea    0xd76(%rip),%rsi
lea    0x10(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <sscanf@plt>
cmp    $0x1,%eax
je     12b5 <cntl+0x125>
lea    0xd87(%rip),%rdi
xor    %eax,%eax
call   10b0 <fatal@plt>
xor    %eax,%eax
call   1080 <getline@plt>
test   %rax,%rax
je     12dc <cntl+0x14c>
lea    0xd41(%rip),%rsi
lea    0x1c(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <sscanf@plt>
cmp    $0x1,%eax
je     12ea <cntl+0x15a>
lea    0xd5c(%rip),%rdi
xor    %eax,%eax
call   10b0 <fatal@plt>
xor    %eax,%eax
call   1080 <getline@plt>
test   %rax,%rax
je     1311 <cntl+0x181>
lea    0xd0c(%rip),%rsi
lea    0x18(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <sscanf@plt>
cmp    $0x1,%eax
je     131f <cntl+0x18f>
lea    0xd2f(%rip),%rdi
xor    %eax,%eax
call   10b0 <fatal@plt>
and    $0xdf,%bl
xor    %ebp,%ebp
cmp    $0x56,%bl
sete   %bpl
mov    0xc(%rsp),%esi
lea    0x28(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   10a0 <outs@plt>
mov    0x8(%rsp),%esi
mov    %rax,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   10a0 <outs@plt>
mov    0x4(%rsp),%esi
mov    %rax,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   10a0 <outs@plt>
mov    (%rsp),%esi
mov    %rax,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   10a0 <outs@plt>
mov    0x10(%rsp),%esi
mov    %rax,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   10a0 <outs@plt>
mov    %rax,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <outc@plt>
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <outc@plt>
mov    0x18(%rsp),%esi
mov    %rax,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   10a0 <outs@plt>
mov    0x1c(%rsp),%esi
mov    %rax,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   10a0 <outs@plt>
mov    0x14(%rsp),%esi
mov    %rax,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   10a0 <outs@plt>
mov    0x20(%rsp),%rsi
mov    %rax,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <outl@plt>
lea    0x30(%rsp),%rsi
mov    %rax,%rdi
mov    %rbx,%rdx
mov    $0x1,%ecx
xor    %eax,%eax
call   1040 <outp@plt>
sub    %r14,%rax
add    $0xb0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.res = type opaque
@.str = [12 x i8] c"%d %d %d %d\00"
@.str.1 = [14 x i8] c"bad rectangle\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [12 x i8] c"bad proc id\00"
@.str.4 = [4 x i8] c"%ld\00"
@.str.5 = [11 x i8] c"bad refcon\00"
@.str.6 = [10 x i8] c"bad value\00"
@.str.7 = [8 x i8] c"bad min\00"
@.str.8 = [8 x i8] c"bad max\00"
define i64 @cntl(i8* %0, i64 %1, %struct.res* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca %struct.res*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i64
%17 = alloca [128 x i8]
%18 = alloca i8*
%19 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store %struct.res* %2, %struct.res** %6
%20 = load i8*, i8** %4
store i8* %20, i8** %19
%21 = call i8* (...) @getline()
%22 = call i8* (i8*, ...) bitcast (i8* (...)* @skipsp to i8* (i8*, ...)*)(i8* %21)
store i8* %22, i8** %18
%23 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 0
%24 = load i8*, i8** %18
%25 = call i8* @strcpy(i8* %23, i8* %24)
%26 = call i8* (...) @getline()
store i8* %26, i8** %18
%27 = icmp eq i8* %26, null
br i1 %27, label %32, label %28
28: ; preds = %3
%29 = load i8*, i8** %18
%30 = call i32 (i8*, i8*, ...) @sscanf(i8* %29, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %12, i32* %13, i32* %14, i32* %15)
%31 = icmp ne i32 %30, 4
br i1 %31, label %32, label %34
32: ; preds = %28, %3
%33 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %34
34: ; preds = %32, %28
%35 = call i8* (...) @getline()
%36 = call i8* (i8*, ...) bitcast (i8* (...)* @skipsp to i8* (i8*, ...)*)(i8* %35)
store i8* %36, i8** %18
%37 = load i8*, i8** %18
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 86
br i1 %40, label %46, label %41
41: ; preds = %34
%42 = load i8*, i8** %18
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 118
br label %46
46: ; preds = %41, %34
%47 = phi i1 [ true, %34 ], [ %45, %41 ]
%48 = zext i1 %47 to i64
%49 = select i1 %47, i32 1, i32 0
store i32 %49, i32* %7
%50 = call i8* (...) @getline()
store i8* %50, i8** %18
%51 = icmp eq i8* %50, null
br i1 %51, label %56, label %52
52: ; preds = %46
%53 = load i8*, i8** %18
%54 = call i32 (i8*, i8*, ...) @sscanf(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %10)
%55 = icmp ne i32 %54, 1
br i1 %55, label %56, label %58
56: ; preds = %52, %46
%57 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %58
58: ; preds = %56, %52
%59 = call i8* (...) @getline()
store i8* %59, i8** %18
%60 = icmp eq i8* %59, null
br i1 %60, label %65, label %61
61: ; preds = %58
%62 = load i8*, i8** %18
%63 = call i32 (i8*, i8*, ...) @sscanf(i8* %62, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %16)
%64 = icmp ne i32 %63, 1
br i1 %64, label %65, label %67
65: ; preds = %61, %58
%66 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
br label %67
67: ; preds = %65, %61
%68 = call i8* (...) @getline()
store i8* %68, i8** %18
%69 = icmp eq i8* %68, null
br i1 %69, label %74, label %70
70: ; preds = %67
%71 = load i8*, i8** %18
%72 = call i32 (i8*, i8*, ...) @sscanf(i8* %71, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %11)
%73 = icmp ne i32 %72, 1
br i1 %73, label %74, label %76
74: ; preds = %70, %67
%75 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %76
76: ; preds = %74, %70
%77 = call i8* (...) @getline()
store i8* %77, i8** %18
%78 = icmp eq i8* %77, null
br i1 %78, label %83, label %79
79: ; preds = %76
%80 = load i8*, i8** %18
%81 = call i32 (i8*, i8*, ...) @sscanf(i8* %80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %8)
%82 = icmp ne i32 %81, 1
br i1 %82, label %83, label %85
83: ; preds = %79, %76
%84 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
br label %85
85: ; preds = %83, %79
%86 = call i8* (...) @getline()
store i8* %86, i8** %18
%87 = icmp eq i8* %86, null
br i1 %87, label %92, label %88
88: ; preds = %85
%89 = load i8*, i8** %18
%90 = call i32 (i8*, i8*, ...) @sscanf(i8* %89, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %9)
%91 = icmp ne i32 %90, 1
br i1 %91, label %92, label %94
92: ; preds = %88, %85
%93 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
br label %94
94: ; preds = %92, %88
%95 = load i8*, i8** %19
%96 = load i32, i32* %12
%97 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outs to i8* (i8*, i32, i64*, ...)*)(i8* %95, i32 %96, i64* %5)
store i8* %97, i8** %19
%98 = load i8*, i8** %19
%99 = load i32, i32* %13
%100 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outs to i8* (i8*, i32, i64*, ...)*)(i8* %98, i32 %99, i64* %5)
store i8* %100, i8** %19
%101 = load i8*, i8** %19
%102 = load i32, i32* %14
%103 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outs to i8* (i8*, i32, i64*, ...)*)(i8* %101, i32 %102, i64* %5)
store i8* %103, i8** %19
%104 = load i8*, i8** %19
%105 = load i32, i32* %15
%106 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outs to i8* (i8*, i32, i64*, ...)*)(i8* %104, i32 %105, i64* %5)
store i8* %106, i8** %19
%107 = load i8*, i8** %19
%108 = load i32, i32* %11
%109 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outs to i8* (i8*, i32, i64*, ...)*)(i8* %107, i32 %108, i64* %5)
store i8* %109, i8** %19
%110 = load i8*, i8** %19
%111 = load i32, i32* %7
%112 = trunc i32 %111 to i8
%113 = sext i8 %112 to i32
%114 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outc to i8* (i8*, i32, i64*, ...)*)(i8* %110, i32 %113, i64* %5)
store i8* %114, i8** %19
%115 = load i8*, i8** %19
%116 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outc to i8* (i8*, i32, i64*, ...)*)(i8* %115, i32 0, i64* %5)
store i8* %116, i8** %19
%117 = load i8*, i8** %19
%118 = load i32, i32* %9
%119 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outs to i8* (i8*, i32, i64*, ...)*)(i8* %117, i32 %118, i64* %5)
store i8* %119, i8** %19
%120 = load i8*, i8** %19
%121 = load i32, i32* %8
%122 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outs to i8* (i8*, i32, i64*, ...)*)(i8* %120, i32 %121, i64* %5)
store i8* %122, i8** %19
%123 = load i8*, i8** %19
%124 = load i32, i32* %10
%125 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outs to i8* (i8*, i32, i64*, ...)*)(i8* %123, i32 %124, i64* %5)
store i8* %125, i8** %19
%126 = load i8*, i8** %19
%127 = load i64, i64* %16
%128 = call i8* (i8*, i64, i64*, ...) bitcast (i8* (...)* @outl to i8* (i8*, i64, i64*, ...)*)(i8* %126, i64 %127, i64* %5)
store i8* %128, i8** %19
%129 = load i8*, i8** %19
%130 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 0
%131 = call i8* (i8*, i8*, i64*, i32, ...) bitcast (i8* (...)* @outp to i8* (i8*, i8*, i64*, i32, ...)*)(i8* %129, i8* %130, i64* %5, i32 1)
store i8* %131, i8** %19
%132 = load i8*, i8** %19
%133 = load i8*, i8** %4
%134 = ptrtoint i8* %132 to i64
%135 = ptrtoint i8* %133 to i64
%136 = sub i64 %134, %135
ret i64 %136
}

LLVM IR (-O2):
%struct.res = type opaque
@.str = [12 x i8] c"%d %d %d %d\00"
@.str.1 = [14 x i8] c"bad rectangle\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [12 x i8] c"bad proc id\00"
@.str.4 = [4 x i8] c"%ld\00"
@.str.5 = [11 x i8] c"bad refcon\00"
@.str.6 = [10 x i8] c"bad value\00"
@.str.7 = [8 x i8] c"bad min\00"
@.str.8 = [8 x i8] c"bad max\00"
define i64 @cntl(i8* %0, i64 %1, %struct.res* nocapture readnone %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i64
%14 = alloca [128 x i8]
store i64 %1, i64* %4
%15 = bitcast i32* %5 to i8*
%16 = bitcast i32* %6 to i8*
%17 = bitcast i32* %7 to i8*
%18 = bitcast i32* %8 to i8*
%19 = bitcast i32* %9 to i8*
%20 = bitcast i32* %10 to i8*
%21 = bitcast i32* %11 to i8*
%22 = bitcast i32* %12 to i8*
%23 = bitcast i64* %13 to i8*
%24 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%25 = tail call i8* (...) @getline()
%26 = tail call i8* (i8*, ...) bitcast (i8* (...)* @skipsp to i8* (i8*, ...)*)(i8* %25)
%27 = call i8* @strcpy(i8* %24, i8* dereferenceable(1) %26)
%28 = call i8* (...) @getline()
%29 = icmp eq i8* %28, null
br i1 %29, label %33, label %30
30: ; preds = %3
%31 = call i32 (i8*, i8*, ...) @sscanf(i8* %28, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %9, i32* %10, i32* %11, i32* %12)
%32 = icmp eq i32 %31, 4
br i1 %32, label %35, label %33
33: ; preds = %30, %3
%34 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %35
35: ; preds = %33, %30
%36 = call i8* (...) @getline()
%37 = call i8* (i8*, ...) bitcast (i8* (...)* @skipsp to i8* (i8*, ...)*)(i8* %36)
%38 = load i8, i8* %37
%39 = call i8* (...) @getline()
%40 = icmp eq i8* %39, null
br i1 %40, label %44, label %41
41: ; preds = %35
%42 = call i32 (i8*, i8*, ...) @sscanf(i8* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %7)
%43 = icmp eq i32 %42, 1
br i1 %43, label %46, label %44
44: ; preds = %41, %35
%45 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %46
46: ; preds = %44, %41
%47 = call i8* (...) @getline()
%48 = icmp eq i8* %47, null
br i1 %48, label %52, label %49
49: ; preds = %46
%50 = call i32 (i8*, i8*, ...) @sscanf(i8* %47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %13)
%51 = icmp eq i32 %50, 1
br i1 %51, label %54, label %52
52: ; preds = %49, %46
%53 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
br label %54
54: ; preds = %52, %49
%55 = call i8* (...) @getline()
%56 = icmp eq i8* %55, null
br i1 %56, label %60, label %57
57: ; preds = %54
%58 = call i32 (i8*, i8*, ...) @sscanf(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %8)
%59 = icmp eq i32 %58, 1
br i1 %59, label %62, label %60
60: ; preds = %57, %54
%61 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %62
62: ; preds = %60, %57
%63 = call i8* (...) @getline()
%64 = icmp eq i8* %63, null
br i1 %64, label %68, label %65
65: ; preds = %62
%66 = call i32 (i8*, i8*, ...) @sscanf(i8* %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%67 = icmp eq i32 %66, 1
br i1 %67, label %70, label %68
68: ; preds = %65, %62
%69 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
br label %70
70: ; preds = %68, %65
%71 = call i8* (...) @getline()
%72 = icmp eq i8* %71, null
br i1 %72, label %76, label %73
73: ; preds = %70
%74 = call i32 (i8*, i8*, ...) @sscanf(i8* %71, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
%75 = icmp eq i32 %74, 1
br i1 %75, label %78, label %76
76: ; preds = %73, %70
%77 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
br label %78
78: ; preds = %76, %73
%79 = and i8 %38, -33
%80 = icmp eq i8 %79, 86
%81 = zext i1 %80 to i32
%82 = load i32, i32* %9
%83 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outs to i8* (i8*, i32, i64*, ...)*)(i8* %0, i32 %82, i64* %4)
%84 = load i32, i32* %10
%85 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outs to i8* (i8*, i32, i64*, ...)*)(i8* %83, i32 %84, i64* %4)
%86 = load i32, i32* %11
%87 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outs to i8* (i8*, i32, i64*, ...)*)(i8* %85, i32 %86, i64* %4)
%88 = load i32, i32* %12
%89 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outs to i8* (i8*, i32, i64*, ...)*)(i8* %87, i32 %88, i64* %4)
%90 = load i32, i32* %8
%91 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outs to i8* (i8*, i32, i64*, ...)*)(i8* %89, i32 %90, i64* %4)
%92 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outc to i8* (i8*, i32, i64*, ...)*)(i8* %91, i32 %81, i64* %4)
%93 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outc to i8* (i8*, i32, i64*, ...)*)(i8* %92, i32 0, i64* %4)
%94 = load i32, i32* %6
%95 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outs to i8* (i8*, i32, i64*, ...)*)(i8* %93, i32 %94, i64* %4)
%96 = load i32, i32* %5
%97 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outs to i8* (i8*, i32, i64*, ...)*)(i8* %95, i32 %96, i64* %4)
%98 = load i32, i32* %7
%99 = call i8* (i8*, i32, i64*, ...) bitcast (i8* (...)* @outs to i8* (i8*, i32, i64*, ...)*)(i8* %97, i32 %98, i64* %4)
%100 = load i64, i64* %13
%101 = call i8* (i8*, i64, i64*, ...) bitcast (i8* (...)* @outl to i8* (i8*, i64, i64*, ...)*)(i8* %99, i64 %100, i64* %4)
%102 = call i8* (i8*, i8*, i64*, i32, ...) bitcast (i8* (...)* @outp to i8* (i8*, i8*, i64*, i32, ...)*)(i8* %101, i8* %24, i64* %4, i32 1)
%103 = ptrtoint i8* %102 to i64
%104 = ptrtoint i8* %0 to i64
%105 = sub i64 %103, %104
ret i64 %105
}