#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 EOF;
int base16(int);
int getchar();
int /*<<< orphan*/ gsm2ascii(int);
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int main() {
  for (int msb = getchar(), lsb = getchar(), tmp = 0, bits = 0;
       msb != EOF && lsb != EOF; msb = getchar(), lsb = getchar()) {
    tmp |= (base16(msb) << 4 | base16(lsb)) << bits;
    bits += 8;
    while (bits >= 7) {
      putchar(gsm2ascii(tmp & 127));
      bits -= 7;
      tmp >>= 7;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
mov    0x2e6b(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x15(%rbp)
je     119a <main+0x5a>
mov    -0xc(%rbp),%eax
mov    0x2e56(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    11aa <main+0x6a>
jmp    122c <main+0xec>
mov    -0x8(%rbp),%edi
call   1050 <base16@plt>
shl    $0x4,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <base16@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
or     %ecx,%eax
mov    -0x14(%rbp),%ecx
shl    %cl,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x7,-0x14(%rbp)
jl     120e <main+0xce>
mov    -0x10(%rbp),%edi
and    $0x7f,%edi
call   1060 <gsm2ascii@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
sub    $0x7,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x7,%eax
mov    %eax,-0x10(%rbp)
jmp    11db <main+0x9b>
jmp    1213 <main+0xd3>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
jmp    1171 <main+0x31>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%r15d
mov    0x2e82(%rip),%r12
mov    (%r12),%eax
cmp    %eax,%r14d
je     1209 <main+0xc9>
cmp    %eax,%r15d
je     1209 <main+0xc9>
xor    %ebx,%ebx
xor    %ebp,%ebp
mov    %ebp,%r13d
mov    %r14d,%edi
call   1050 <base16@plt>
mov    %eax,%r14d
shl    $0x4,%r14d
mov    %r15d,%edi
call   1050 <base16@plt>
mov    %eax,%ebp
or     %r14d,%ebp
mov    %ebx,%ecx
shl    %cl,%ebp
or     %r13d,%ebp
cmp    $0xffffffff,%ebx
jl     11e0 <main+0xa0>
add    $0xf,%ebx
xchg   %ax,%ax
mov    %ebp,%edi
and    $0x7f,%edi
call   1060 <gsm2ascii@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
sar    $0x7,%ebp
add    $0xfffffff9,%ebx
cmp    $0xd,%ebx
ja     11b0 <main+0x70>
add    $0xfffffff9,%ebx
jmp    11e3 <main+0xa3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x8,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%r15d
mov    (%r12),%eax
cmp    %eax,%r14d
je     1209 <main+0xc9>
cmp    %eax,%r15d
jne    1180 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (...) @getchar()
store i32 %6, i32* %2
%7 = call i32 (...) @getchar()
store i32 %7, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %8
8: ; preds = %44, %0
%9 = load i32, i32* %2
%10 = load i32, i32* @EOF
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32, i32* %3
%14 = load i32, i32* @EOF
%15 = icmp ne i32 %13, %14
br label %16
16: ; preds = %12, %8
%17 = phi i1 [ false, %8 ], [ %15, %12 ]
br i1 %17, label %18, label %47
18: ; preds = %16
%19 = load i32, i32* %2
%20 = call i32 @base16(i32 %19)
%21 = shl i32 %20, 4
%22 = load i32, i32* %3
%23 = call i32 @base16(i32 %22)
%24 = or i32 %21, %23
%25 = load i32, i32* %5
%26 = shl i32 %24, %25
%27 = load i32, i32* %4
%28 = or i32 %27, %26
store i32 %28, i32* %4
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 8
store i32 %30, i32* %5
br label %31
31: ; preds = %34, %18
%32 = load i32, i32* %5
%33 = icmp sge i32 %32, 7
br i1 %33, label %34, label %43
34: ; preds = %31
%35 = load i32, i32* %4
%36 = and i32 %35, 127
%37 = call i32 @gsm2ascii(i32 %36)
%38 = call i32 @putchar(i32 %37)
%39 = load i32, i32* %5
%40 = sub nsw i32 %39, 7
store i32 %40, i32* %5
%41 = load i32, i32* %4
%42 = ashr i32 %41, 7
store i32 %42, i32* %4
br label %31
43: ; preds = %31
br label %44
44: ; preds = %43
%45 = call i32 (...) @getchar()
store i32 %45, i32* %2
%46 = call i32 (...) @getchar()
store i32 %46, i32* %3
br label %8
47: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp ne i32 %1, %3
%5 = icmp ne i32 %2, %3
%6 = and i1 %4, %5
br i1 %6, label %8, label %7
7: ; preds = %30, %0
ret i32 0
8: ; preds = %0, %30
%9 = phi i32 [ %32, %30 ], [ 0, %0 ]
%10 = phi i32 [ %31, %30 ], [ 0, %0 ]
%11 = phi i32 [ %34, %30 ], [ %2, %0 ]
%12 = phi i32 [ %33, %30 ], [ %1, %0 ]
%13 = tail call i32 @base16(i32 %12)
%14 = shl i32 %13, 4
%15 = tail call i32 @base16(i32 %11)
%16 = or i32 %14, %15
%17 = shl i32 %16, %9
%18 = or i32 %17, %10
%19 = add nsw i32 %9, 8
%20 = icmp sgt i32 %9, -2
br i1 %20, label %21, label %30
21: ; preds = %8, %21
%22 = phi i32 [ %27, %21 ], [ %19, %8 ]
%23 = phi i32 [ %28, %21 ], [ %18, %8 ]
%24 = and i32 %23, 127
%25 = tail call i32 @gsm2ascii(i32 %24)
%26 = tail call i32 @putchar(i32 %25)
%27 = add nsw i32 %22, -7
%28 = ashr i32 %23, 7
%29 = icmp ugt i32 %22, 13
br i1 %29, label %21, label %30
30: ; preds = %21, %8
%31 = phi i32 [ %18, %8 ], [ %28, %21 ]
%32 = phi i32 [ %19, %8 ], [ %27, %21 ]
%33 = tail call i32 (...) @getchar()
%34 = tail call i32 (...) @getchar()
%35 = load i32, i32* @EOF
%36 = icmp ne i32 %33, %35
%37 = icmp ne i32 %34, %35
%38 = and i1 %36, %37
br i1 %38, label %8, label %7
}