#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 */
double pow(double, int);
int /*<<< orphan*/ printf(char *, ...);
int sscanf(char *, char *, ...);
double strtod(char *, int /*<<< orphan*/ *);
void CheckDec(char *s) {
  char s1[133], s2[133], SignC;
  double x, xx, scalar;
  int Value;
  int i, n2, n10;
  int Sign;
  int Oct1, Oct2;
  if (4 == (i = sscanf(s, "%o %o * E%d B%d", &Oct1, &Oct2, &n10, &n2))) {
    scalar = pow(2.0, n2) * pow(10.0, n10);
    goto Oct2Dec;
  }
  if (2 == (i = sscanf(s, "%o %o", &Oct1, &Oct2))) {
    printf("%05o %05o -> ", Oct1, Oct2);
    scalar = 1;
  Oct2Dec:
    if (0 != (040000 & Oct1)) {
      Oct1 = ~Oct1;
      Oct2 = ~Oct2;
      Sign = -1;
      SignC = '-';
    } else {
      Sign = 1;
      SignC = '+';
    }
    i = ((Oct1 & 037777) << 14) | (Oct2 & 037777);
    scalar *= pow(2.0, -28);
    x = Sign * scalar * i;
    printf("(%c%010o) %.10g\n", SignC, i, x);
    return;
  }
  if (2 == (i = sscanf(s, "%s / %s", s1, s2))) {
    xx = strtod(s1, NULL);
    scalar = strtod(s2, NULL);
    x = xx / scalar;
  } else {
    if (1 == (i = sscanf(s, "%s * %s", s1, s2)))
      scalar = 1.0;
    else if (i == 2)
      scalar = strtod(s2, NULL);
    else {
      printf("?\n");
      return;
    }
    xx = strtod(s1, NULL);
    x = xx * scalar;
  }
  Sign = 0;
  if (x < 0) {
    Sign = 1;
    x = -x;
  }
  if (x >= 1.0) {
    printf("Illegal value: Must be <1.0 according to AGC rules.\n");
    return;
  }
  for (Value = 0, i = 0; i < 28; i++) {
    Value = Value << 1;
    if (x >= 0.5) {
      Value++;
      x -= 0.5;
    }
    x *= 2;
  }
  if (x >= 0.5)
    Value++;
  i = Value & 0x00003fff;
  Value = (Value >> 14) & 0x00003fff;
  if (Sign) {
    Value = ~Value;
    i = ~i;
    i &= 0x00007fff;
    Value &= 0x00007fff;
  }
  printf("%05o %05o\n", Value, i);
}


x86 assembly (clang, -O0):
<CheckDec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
lea    -0x158(%rbp),%rdx
lea    -0x15c(%rbp),%rcx
lea    -0x150(%rbp),%r8
lea    -0x14c(%rbp),%r9
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    %eax,%ecx
mov    %ecx,-0x148(%rbp)
mov    $0x4,%eax
cmp    %ecx,%eax
jne    11dc <CheckDec+0x9c>
mov    -0x14c(%rbp),%edi
movsd  0xe70(%rip),%xmm0
call   1060 <pow@plt>
movsd  %xmm0,-0x168(%rbp)
ff
mov    -0x150(%rbp),%edi
movsd  0xe5d(%rip),%xmm0
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x168(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
jmp    123b <CheckDec+0xfb>
mov    -0x8(%rbp),%rdi
lea    0xe49(%rip),%rsi
lea    -0x158(%rbp),%rdx
lea    -0x15c(%rbp),%rcx
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    %eax,%ecx
mov    %ecx,-0x148(%rbp)
mov    $0x2,%eax
cmp    %ecx,%eax
jne    1326 <CheckDec+0x1e6>
mov    -0x158(%rbp),%esi
mov    -0x15c(%rbp),%edx
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  0xdcd(%rip),%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
mov    -0x158(%rbp),%ecx
and    $0x4000,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1285 <CheckDec+0x145>
mov    -0x158(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x158(%rbp)
mov    -0x15c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x15c(%rbp)
movl   $0xffffffff,-0x154(%rbp)
ff ff ff
movb   $0x2d,-0x121(%rbp)
jmp    1296 <CheckDec+0x156>
movl   $0x1,-0x154(%rbp)
movb   $0x2b,-0x121(%rbp)
mov    -0x158(%rbp),%eax
and    $0x3fff,%eax
shl    $0xe,%eax
mov    -0x15c(%rbp),%ecx
and    $0x3fff,%ecx
or     %ecx,%eax
mov    %eax,-0x148(%rbp)
movsd  0xd50(%rip),%xmm0
mov    $0xffffffe4,%edi
call   1060 <pow@plt>
mulsd  -0x140(%rbp),%xmm0
ff
movsd  %xmm0,-0x140(%rbp)
ff
cvtsi2sdl -0x154(%rbp),%xmm0
ff
mulsd  -0x140(%rbp),%xmm0
ff
cvtsi2sdl -0x148(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsbl -0x121(%rbp),%esi
mov    -0x148(%rbp),%edx
movsd  -0x130(%rbp),%xmm0
ff
lea    0xd2a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1633 <CheckDec+0x4f3>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rdx
lea    -0x120(%rbp),%rcx
lea    0xd16(%rip),%rsi
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    %eax,%ecx
mov    %ecx,-0x148(%rbp)
mov    $0x2,%eax
cmp    %ecx,%eax
jne    13a8 <CheckDec+0x268>
lea    -0x90(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <strtod@plt>
movsd  %xmm0,-0x138(%rbp)
ff
lea    -0x120(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <strtod@plt>
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x138(%rbp),%xmm0
ff
divsd  -0x140(%rbp),%xmm0
ff
movsd  %xmm0,-0x130(%rbp)
ff
jmp    1464 <CheckDec+0x324>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rdx
lea    -0x120(%rbp),%rcx
lea    0xc9c(%rip),%rsi
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    %eax,%ecx
mov    %ecx,-0x148(%rbp)
mov    $0x1,%eax
cmp    %ecx,%eax
jne    13f2 <CheckDec+0x2b2>
movsd  0xc1b(%rip),%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
jmp    1434 <CheckDec+0x2f4>
cmpl   $0x2,-0x148(%rbp)
jne    141c <CheckDec+0x2dc>
lea    -0x120(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <strtod@plt>
movsd  %xmm0,-0x140(%rbp)
ff
jmp    142f <CheckDec+0x2ef>
lea    0xc42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1633 <CheckDec+0x4f3>
jmp    1434 <CheckDec+0x2f4>
lea    -0x90(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <strtod@plt>
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0x138(%rbp),%xmm0
ff
mulsd  -0x140(%rbp),%xmm0
ff
movsd  %xmm0,-0x130(%rbp)
ff
movl   $0x0,-0x154(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x130(%rbp),%xmm0
ff
jbe    14b0 <CheckDec+0x370>
movl   $0x1,-0x154(%rbp)
movsd  -0x130(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0x130(%rbp),%xmm0
ff
movsd  0xb40(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     14dd <CheckDec+0x39d>
lea    0xb97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1633 <CheckDec+0x4f3>
movl   $0x0,-0x144(%rbp)
movl   $0x0,-0x148(%rbp)
cmpl   $0x1c,-0x148(%rbp)
jge    157e <CheckDec+0x43e>
mov    -0x144(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x144(%rbp)
movsd  -0x130(%rbp),%xmm0
ff
movsd  0xaeb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1552 <CheckDec+0x412>
mov    -0x144(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x144(%rbp)
movsd  -0x130(%rbp),%xmm0
ff
movsd  0xac2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  0xab6(%rip),%xmm0
mulsd  -0x130(%rbp),%xmm0
ff
movsd  %xmm0,-0x130(%rbp)
ff
mov    -0x148(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x148(%rbp)
jmp    14f1 <CheckDec+0x3b1>
movsd  -0x130(%rbp),%xmm0
ff
movsd  0xa7a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     15a7 <CheckDec+0x467>
mov    -0x144(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x144(%rbp)
mov    -0x144(%rbp),%eax
and    $0x3fff,%eax
mov    %eax,-0x148(%rbp)
mov    -0x144(%rbp),%eax
sar    $0xe,%eax
and    $0x3fff,%eax
mov    %eax,-0x144(%rbp)
cmpl   $0x0,-0x154(%rbp)
je     1619 <CheckDec+0x4d9>
mov    -0x144(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x144(%rbp)
mov    -0x148(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x148(%rbp)
mov    -0x148(%rbp),%eax
and    $0x7fff,%eax
mov    %eax,-0x148(%rbp)
mov    -0x144(%rbp),%eax
and    $0x7fff,%eax
mov    %eax,-0x144(%rbp)
mov    -0x144(%rbp),%esi
mov    -0x148(%rbp),%edx
lea    0xa71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckDec>:
push   %rbp
push   %rbx
sub    $0x148,%rsp
mov    %rdi,%rbx
lea    0xedd(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x20(%rsp),%r8
lea    0x24(%rsp),%r9
xor    %eax,%eax
call   1060 <sscanf@plt>
cmp    $0x4,%eax
jne    11b3 <CheckDec+0x63>
mov    0x24(%rsp),%edi
movsd  0xe89(%rip),%xmm0
call   1070 <pow@plt>
movsd  %xmm0,0x10(%rsp)
mov    0x20(%rsp),%edi
movsd  0xe7a(%rip),%xmm0
call   1070 <pow@plt>
mulsd  0x10(%rsp),%xmm0
jmp    11f5 <CheckDec+0xa5>
lea    0xe96(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <sscanf@plt>
cmp    $0x2,%eax
jne    1294 <CheckDec+0x144>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xe70(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsd  0xe0b(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    0xc(%rsp),%eax
test   $0x4000,%eax
jne    121f <CheckDec+0xcf>
movsd  0xdf2(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
mov    $0x2b,%ebp
mov    0x8(%rsp),%ebx
jmp    1242 <CheckDec+0xf2>
not    %eax
mov    %eax,0xc(%rsp)
mov    0x8(%rsp),%ebx
not    %ebx
mov    %ebx,0x8(%rsp)
movsd  0xdf1(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
mov    $0x2d,%ebp
shl    $0xe,%eax
and    $0xfffc000,%eax
and    $0x3fff,%ebx
or     %eax,%ebx
movsd  0xdbe(%rip),%xmm0
mov    $0xffffffe4,%edi
call   1070 <pow@plt>
mulsd  0x10(%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
cvtsi2sd %ebx,%xmm1
mulsd  %xmm1,%xmm0
lea    0xde5(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x148,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xdda(%rip),%rsi
lea    0xc0(%rsp),%rdx
lea    0x30(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <sscanf@plt>
cmp    $0x2,%eax
jne    12e4 <CheckDec+0x194>
lea    0xc0(%rsp),%rdi
xor    %esi,%esi
call   1040 <strtod@plt>
movapd %xmm0,0x10(%rsp)
lea    0x30(%rsp),%rdi
xor    %esi,%esi
call   1040 <strtod@plt>
movapd 0x10(%rsp),%xmm5
divsd  %xmm0,%xmm5
jmp    1345 <CheckDec+0x1f5>
lea    0xd92(%rip),%rsi
lea    0xc0(%rsp),%rdx
lea    0x30(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <sscanf@plt>
cmp    $0x1,%eax
je     131e <CheckDec+0x1ce>
cmp    $0x2,%eax
jne    144d <CheckDec+0x2fd>
lea    0x30(%rsp),%rdi
xor    %esi,%esi
call   1040 <strtod@plt>
jmp    1326 <CheckDec+0x1d6>
movsd  0xcda(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0xc0(%rsp),%rdi
xor    %esi,%esi
call   1040 <strtod@plt>
movapd %xmm0,%xmm5
mulsd  0x10(%rsp),%xmm5
movapd 0xce3(%rip),%xmm1
xorpd  %xmm5,%xmm1
xorpd  %xmm2,%xmm2
movapd %xmm5,%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm5,%xmm0
orpd   %xmm1,%xmm0
ucomisd 0xc8e(%rip),%xmm0
jae    143c <CheckDec+0x2ec>
xor    %eax,%eax
mov    $0x1c,%ecx
movsd  0xc81(%rip),%xmm1
movsd  0xc81(%rip),%xmm2
nop
xor    %edx,%edx
ucomisd %xmm1,%xmm0
setae  %dl
movapd %xmm1,%xmm3
cmpnlesd %xmm0,%xmm3
movapd %xmm3,%xmm4
andpd  %xmm0,%xmm3
addsd  %xmm2,%xmm0
andnpd %xmm0,%xmm4
orpd   %xmm4,%xmm3
addsd  %xmm3,%xmm3
add    %edx,%edx
lea    (%rdx,%rax,4),%edx
xor    %eax,%eax
ucomisd %xmm1,%xmm3
setae  %al
movapd %xmm3,%xmm4
addsd  %xmm2,%xmm4
movapd %xmm1,%xmm0
cmpnlesd %xmm3,%xmm0
andpd  %xmm0,%xmm3
andnpd %xmm4,%xmm0
orpd   %xmm3,%xmm0
or     %edx,%eax
addsd  %xmm0,%xmm0
add    $0xfffffffe,%ecx
jne    1390 <CheckDec+0x240>
ucomisd 0xc10(%rip),%xmm0
sbb    $0xffffffff,%eax
mov    %eax,%ecx
and    $0x3fff,%ecx
shr    $0xe,%eax
and    $0x3fff,%eax
mov    %ecx,%edx
xor    $0x7fff,%edx
mov    %eax,%esi
xor    $0x7fff,%esi
xorpd  %xmm0,%xmm0
ucomisd %xmm5,%xmm0
cmovbe %eax,%esi
cmovbe %ecx,%edx
lea    0xc55(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    128a <CheckDec+0x13a>
lea    0xc4f(%rip),%rdi
call   1030 <puts@plt>
jmp    128a <CheckDec+0x13a>
lea    0xc3c(%rip),%rdi
call   1030 <puts@plt>
jmp    128a <CheckDec+0x13a>

LLVM IR (-O0):
@.str = [16 x i8] c"%o %o * E%d B%d\00"
@.str.1 = [6 x i8] c"%o %o\00"
@.str.2 = [14 x i8] c"%05o %05o -> \00"
@.str.3 = [17 x i8] c"(%c%010o) %.10g\0A\00"
@.str.4 = [8 x i8] c"%s / %s\00"
@.str.5 = [8 x i8] c"%s * %s\00"
@.str.6 = [3 x i8] c"?\0A\00"
@.str.7 = [53 x i8] c"Illegal value: Must be <1.0 according to AGC rules.\0A\00"
@.str.8 = [11 x i8] c"%05o %05o\0A\00"
define void @CheckDec(i8* %0) {
%2 = alloca i8*
%3 = alloca [133 x i8]
%4 = alloca [133 x i8]
%5 = alloca i8
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i8* %0, i8** %2
%16 = load i8*, i8** %2
%17 = call i32 (i8*, i8*, ...) @sscanf(i8* %16, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32* %14, i32* %15, i32* %12, i32* %11)
store i32 %17, i32* %10
%18 = icmp eq i32 4, %17
br i1 %18, label %19, label %25
19: ; preds = %1
%20 = load i32, i32* %11
%21 = call double @pow(double 2.000000e+00, i32 %20)
%22 = load i32, i32* %12
%23 = call double @pow(double 1.000000e+01, i32 %22)
%24 = fmul double %21, %23
store double %24, double* %8
br label %33
25: ; preds = %1
%26 = load i8*, i8** %2
%27 = call i32 (i8*, i8*, ...) @sscanf(i8* %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %14, i32* %15)
store i32 %27, i32* %10
%28 = icmp eq i32 2, %27
br i1 %28, label %29, label %65
29: ; preds = %25
%30 = load i32, i32* %14
%31 = load i32, i32* %15
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %30, i32 %31)
store double 1.000000e+00, double* %8
br label %33
33: ; preds = %29, %19
%34 = load i32, i32* %14
%35 = and i32 16384, %34
%36 = icmp ne i32 0, %35
br i1 %36, label %37, label %42
37: ; preds = %33
%38 = load i32, i32* %14
%39 = xor i32 %38, -1
store i32 %39, i32* %14
%40 = load i32, i32* %15
%41 = xor i32 %40, -1
store i32 %41, i32* %15
store i32 -1, i32* %13
store i8 45, i8* %5
br label %43
42: ; preds = %33
store i32 1, i32* %13
store i8 43, i8* %5
br label %43
43: ; preds = %42, %37
%44 = load i32, i32* %14
%45 = and i32 %44, 16383
%46 = shl i32 %45, 14
%47 = load i32, i32* %15
%48 = and i32 %47, 16383
%49 = or i32 %46, %48
store i32 %49, i32* %10
%50 = call double @pow(double 2.000000e+00, i32 -28)
%51 = load double, double* %8
%52 = fmul double %51, %50
store double %52, double* %8
%53 = load i32, i32* %13
%54 = sitofp i32 %53 to double
%55 = load double, double* %8
%56 = fmul double %54, %55
%57 = load i32, i32* %10
%58 = sitofp i32 %57 to double
%59 = fmul double %56, %58
store double %59, double* %6
%60 = load i8, i8* %5
%61 = sext i8 %60 to i32
%62 = load i32, i32* %10
%63 = load double, double* %6
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %61, i32 %62, double %63)
br label %159
65: ; preds = %25
%66 = load i8*, i8** %2
%67 = getelementptr inbounds [133 x i8], [133 x i8]* %3, i64 0, i64 0
%68 = getelementptr inbounds [133 x i8], [133 x i8]* %4, i64 0, i64 0
%69 = call i32 (i8*, i8*, ...) @sscanf(i8* %66, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %67, i8* %68)
store i32 %69, i32* %10
%70 = icmp eq i32 2, %69
br i1 %70, label %71, label %79
71: ; preds = %65
%72 = getelementptr inbounds [133 x i8], [133 x i8]* %3, i64 0, i64 0
%73 = call double @strtod(i8* %72, i32* null)
store double %73, double* %7
%74 = getelementptr inbounds [133 x i8], [133 x i8]* %4, i64 0, i64 0
%75 = call double @strtod(i8* %74, i32* null)
store double %75, double* %8
%76 = load double, double* %7
%77 = load double, double* %8
%78 = fdiv double %76, %77
store double %78, double* %6
br label %101
79: ; preds = %65
%80 = load i8*, i8** %2
%81 = getelementptr inbounds [133 x i8], [133 x i8]* %3, i64 0, i64 0
%82 = getelementptr inbounds [133 x i8], [133 x i8]* %4, i64 0, i64 0
%83 = call i32 (i8*, i8*, ...) @sscanf(i8* %80, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %81, i8* %82)
store i32 %83, i32* %10
%84 = icmp eq i32 1, %83
br i1 %84, label %85, label %86
85: ; preds = %79
store double 1.000000e+00, double* %8
br label %95
86: ; preds = %79
%87 = load i32, i32* %10
%88 = icmp eq i32 %87, 2
br i1 %88, label %89, label %92
89: ; preds = %86
%90 = getelementptr inbounds [133 x i8], [133 x i8]* %4, i64 0, i64 0
%91 = call double @strtod(i8* %90, i32* null)
store double %91, double* %8
br label %94
92: ; preds = %86
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %159
94: ; preds = %89
br label %95
95: ; preds = %94, %85
%96 = getelementptr inbounds [133 x i8], [133 x i8]* %3, i64 0, i64 0
%97 = call double @strtod(i8* %96, i32* null)
store double %97, double* %7
%98 = load double, double* %7
%99 = load double, double* %8
%100 = fmul double %98, %99
store double %100, double* %6
br label %101
101: ; preds = %95, %71
store i32 0, i32* %13
%102 = load double, double* %6
%103 = fcmp olt double %102, 0.000000e+00
br i1 %103, label %104, label %107
104: ; preds = %101
store i32 1, i32* %13
%105 = load double, double* %6
%106 = fneg double %105
store double %106, double* %6
br label %107
107: ; preds = %104, %101
%108 = load double, double* %6
%109 = fcmp oge double %108, 1.000000e+00
br i1 %109, label %110, label %112
110: ; preds = %107
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.7, i64 0, i64 0))
br label %159
112: ; preds = %107
store i32 0, i32* %9
store i32 0, i32* %10
br label %113
113: ; preds = %129, %112
%114 = load i32, i32* %10
%115 = icmp slt i32 %114, 28
br i1 %115, label %116, label %132
116: ; preds = %113
%117 = load i32, i32* %9
%118 = shl i32 %117, 1
store i32 %118, i32* %9
%119 = load double, double* %6
%120 = fcmp oge double %119, 5.000000e-01
br i1 %120, label %121, label %126
121: ; preds = %116
%122 = load i32, i32* %9
%123 = add nsw i32 %122, 1
store i32 %123, i32* %9
%124 = load double, double* %6
%125 = fsub double %124, 5.000000e-01
store double %125, double* %6
br label %126
126: ; preds = %121, %116
%127 = load double, double* %6
%128 = fmul double %127, 2.000000e+00
store double %128, double* %6
br label %129
129: ; preds = %126
%130 = load i32, i32* %10
%131 = add nsw i32 %130, 1
store i32 %131, i32* %10
br label %113
132: ; preds = %113
%133 = load double, double* %6
%134 = fcmp oge double %133, 5.000000e-01
br i1 %134, label %135, label %138
135: ; preds = %132
%136 = load i32, i32* %9
%137 = add nsw i32 %136, 1
store i32 %137, i32* %9
br label %138
138: ; preds = %135, %132
%139 = load i32, i32* %9
%140 = and i32 %139, 16383
store i32 %140, i32* %10
%141 = load i32, i32* %9
%142 = ashr i32 %141, 14
%143 = and i32 %142, 16383
store i32 %143, i32* %9
%144 = load i32, i32* %13
%145 = icmp ne i32 %144, 0
br i1 %145, label %146, label %155
146: ; preds = %138
%147 = load i32, i32* %9
%148 = xor i32 %147, -1
store i32 %148, i32* %9
%149 = load i32, i32* %10
%150 = xor i32 %149, -1
store i32 %150, i32* %10
%151 = load i32, i32* %10
%152 = and i32 %151, 32767
store i32 %152, i32* %10
%153 = load i32, i32* %9
%154 = and i32 %153, 32767
store i32 %154, i32* %9
br label %155
155: ; preds = %146, %138
%156 = load i32, i32* %9
%157 = load i32, i32* %10
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %156, i32 %157)
br label %159
159: ; preds = %155, %110, %92, %43
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%o %o * E%d B%d\00"
@.str.1 = [6 x i8] c"%o %o\00"
@.str.2 = [14 x i8] c"%05o %05o -> \00"
@.str.3 = [17 x i8] c"(%c%010o) %.10g\0A\00"
@.str.4 = [8 x i8] c"%s / %s\00"
@.str.5 = [8 x i8] c"%s * %s\00"
@.str.8 = [11 x i8] c"%05o %05o\0A\00"
@str = [2 x i8] c"?\00"
@str.9 = [52 x i8] c"Illegal value: Must be <1.0 according to AGC rules.\00"
define void @CheckDec(i8* nocapture %0) {
%2 = alloca [133 x i8]
%3 = alloca [133 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = getelementptr inbounds [133 x i8], [133 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [133 x i8], [133 x i8]* %3, i64 0, i64 0
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = bitcast i32* %7 to i8*
%14 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7, i32* %5, i32* %4)
%15 = icmp eq i32 %14, 4
br i1 %15, label %16, label %22
16: ; preds = %1
%17 = load i32, i32* %4
%18 = call double @pow(double 2.000000e+00, i32 %17)
%19 = load i32, i32* %5
%20 = call double @pow(double 1.000000e+01, i32 %19)
%21 = fmul double %18, %20
br label %29
22: ; preds = %1
%23 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7)
%24 = icmp eq i32 %23, 2
br i1 %24, label %25, label %55
25: ; preds = %22
%26 = load i32, i32* %6
%27 = load i32, i32* %7
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %26, i32 %27)
br label %29
29: ; preds = %25, %16
%30 = phi double [ %21, %16 ], [ 1.000000e+00, %25 ]
%31 = load i32, i32* %6
%32 = and i32 %31, 16384
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %29
%35 = load i32, i32* %7
br label %40
36: ; preds = %29
%37 = xor i32 %31, -1
store i32 %37, i32* %6
%38 = load i32, i32* %7
%39 = xor i32 %38, -1
store i32 %39, i32* %7
br label %40
40: ; preds = %34, %36
%41 = phi i32 [ %39, %36 ], [ %35, %34 ]
%42 = phi i32 [ %37, %36 ], [ %31, %34 ]
%43 = phi i32 [ 45, %36 ], [ 43, %34 ]
%44 = phi double [ -1.000000e+00, %36 ], [ 1.000000e+00, %34 ]
%45 = shl i32 %42, 14
%46 = and i32 %45, 268419072
%47 = and i32 %41, 16383
%48 = or i32 %46, %47
%49 = call double @pow(double 2.000000e+00, i32 -28)
%50 = fmul double %30, %49
%51 = fmul double %44, %50
%52 = sitofp i32 %48 to double
%53 = fmul double %51, %52
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %43, i32 %48, double %53)
br label %112
55: ; preds = %22
%56 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %8, i8* %9)
%57 = icmp eq i32 %56, 2
br i1 %57, label %58, label %62
58: ; preds = %55
%59 = call double @strtod(i8* nocapture %8, i32* null)
%60 = call double @strtod(i8* nocapture %9, i32* null)
%61 = fdiv double %59, %60
br label %72
62: ; preds = %55
%63 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %8, i8* %9)
switch i32 %63, label %66 [
i32 1, label %68
i32 2, label %64
]
64: ; preds = %62
%65 = call double @strtod(i8* nocapture %9, i32* null)
br label %68
66: ; preds = %62
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %112
68: ; preds = %62, %64
%69 = phi double [ %65, %64 ], [ 1.000000e+00, %62 ]
%70 = call double @strtod(i8* nocapture %8, i32* null)
%71 = fmul double %69, %70
br label %72
72: ; preds = %68, %58
%73 = phi double [ %61, %58 ], [ %71, %68 ]
%74 = fcmp olt double %73, 0.000000e+00
%75 = fneg double %73
%76 = select i1 %74, double %75, double %73
%77 = fcmp ult double %76, 1.000000e+00
br i1 %77, label %80, label %78
78: ; preds = %72
%79 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.9, i64 0, i64 0))
br label %112
80: ; preds = %72, %80
%81 = phi i32 [ %98, %80 ], [ 0, %72 ]
%82 = phi i32 [ %96, %80 ], [ 0, %72 ]
%83 = phi double [ %97, %80 ], [ %76, %72 ]
%84 = fcmp ult double %83, 5.000000e-01
%85 = fadd double %83, -5.000000e-01
%86 = select i1 %84, double %83, double %85
%87 = fmul double %86, 2.000000e+00
%88 = shl i32 %82, 2
%89 = select i1 %84, i32 0, i32 2
%90 = or i32 %88, %89
%91 = fcmp ult double %87, 5.000000e-01
%92 = fadd double %87, -5.000000e-01
%93 = select i1 %91, double %87, double %92
%94 = xor i1 %91, true
%95 = zext i1 %94 to i32
%96 = or i32 %90, %95
%97 = fmul double %93, 2.000000e+00
%98 = add nuw nsw i32 %81, 2
%99 = icmp eq i32 %98, 28
br i1 %99, label %100, label %80
100: ; preds = %80
%101 = fcmp oge double %97, 5.000000e-01
%102 = zext i1 %101 to i32
%103 = add nsw i32 %96, %102
%104 = and i32 %103, 16383
%105 = lshr i32 %103, 14
%106 = and i32 %105, 16383
%107 = xor i32 %104, 32767
%108 = xor i32 %106, 32767
%109 = select i1 %74, i32 %108, i32 %106
%110 = select i1 %74, i32 %107, i32 %104
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %109, i32 %110)
br label %112
112: ; preds = %100, %78, %66, %40
ret void
}