#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int getc(int /*<<< orphan*/ *);
int putchar(int);
main() {
  int K, L, M = 0;
  FILE *J;
  J = fopen("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/kkaaii/c/refs/heads/master/ioccc/1994/"
            "shapiro.c",
            "r");
  for (; (L = getc(J)) != -1;
       L >= 'J' && L <= 'J' + 15 &&
       ((M = !M) ? K = L : putchar(K - 'J' | (L - 'J' << 4))))
    ;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xea3(%rip),%rdi
lea    0xf26(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <getc@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
je     1201 <main+0xc1>
jmp    1187 <main+0x47>
xor    %eax,%eax
cmpl   $0x4a,-0xc(%rbp)
mov    %al,-0x19(%rbp)
jl     11f9 <main+0xb9>
xor    %eax,%eax
cmpl   $0x59,-0xc(%rbp)
mov    %al,-0x19(%rbp)
jg     11f9 <main+0xb9>
cmpl   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x10(%rbp)
test   $0x1,%al
jne    11c6 <main+0x86>
jmp    11d4 <main+0x94>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x20(%rbp)
jmp    11ed <main+0xad>
mov    -0x8(%rbp),%edi
sub    $0x4a,%edi
mov    -0xc(%rbp),%eax
sub    $0x4a,%eax
shl    $0x4,%eax
or     %eax,%edi
call   1030 <putchar@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
jmp    116d <main+0x2d>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xeb5(%rip),%rdi
lea    0xf38(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <getc@plt>
cmp    $0xffffffff,%eax
jne    116e <main+0x2e>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %ebp,%ebp
jmp    1195 <main+0x55>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1,%ebp
mov    %eax,%r14d
mov    %rbx,%rdi
call   1060 <getc@plt>
cmp    $0xffffffff,%eax
je     1167 <main+0x27>
lea    -0x4a(%rax),%ecx
cmp    $0xf,%ecx
ja     1188 <main+0x48>
test   %ebp,%ebp
je     1180 <main+0x40>
lea    -0x4a(%r14),%ecx
shl    $0x4,%eax
add    $0xfffffb60,%eax
or     %ecx,%eax
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %ebp,%ebp
jmp    1188 <main+0x48>

LLVM IR (-O0):
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kkaaii/c/refs/heads/master/ioccc/1994/shapiro.c\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 0, i32* %1
store i32 0, i32* %4
%6 = call i32* @fopen(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %5
br label %7
7: ; preds = %36, %0
%8 = load i32*, i32** %5
%9 = call i32 @getc(i32* %8)
store i32 %9, i32* %3
%10 = icmp ne i32 %9, -1
br i1 %10, label %11, label %39
11: ; preds = %7
br label %12
12: ; preds = %11
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 74
br i1 %14, label %15, label %36
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 89
br i1 %17, label %18, label %36
18: ; preds = %15
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 0
%21 = xor i1 %20, true
%22 = zext i1 %21 to i32
store i32 %22, i32* %4
br i1 %21, label %23, label %25
23: ; preds = %18
%24 = load i32, i32* %3
store i32 %24, i32* %2
br label %33
25: ; preds = %18
%26 = load i32, i32* %2
%27 = sub nsw i32 %26, 74
%28 = load i32, i32* %3
%29 = sub nsw i32 %28, 74
%30 = shl i32 %29, 4
%31 = or i32 %27, %30
%32 = call i32 @putchar(i32 %31)
br label %33
33: ; preds = %25, %23
%34 = phi i32 [ %24, %23 ], [ %32, %25 ]
%35 = icmp ne i32 %34, 0
br label %36
36: ; preds = %33, %15, %12
%37 = phi i1 [ false, %15 ], [ false, %12 ], [ %35, %33 ]
%38 = zext i1 %37 to i32
br label %7
39: ; preds = %7
%40 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kkaaii/c/refs/heads/master/ioccc/1994/shapiro.c\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @getc(i32* %1)
%3 = icmp eq i32 %2, -1
br i1 %3, label %23, label %4
4: ; preds = %0, %18
%5 = phi i32 [ %21, %18 ], [ %2, %0 ]
%6 = phi i32 [ %20, %18 ], [ undef, %0 ]
%7 = phi i32 [ %19, %18 ], [ 0, %0 ]
%8 = add i32 %5, -74
%9 = icmp ult i32 %8, 16
br i1 %9, label %10, label %18
10: ; preds = %4
%11 = icmp eq i32 %7, 0
br i1 %11, label %18, label %12
12: ; preds = %10
%13 = add nsw i32 %6, -74
%14 = shl nuw nsw i32 %5, 4
%15 = add nsw i32 %14, -1184
%16 = or i32 %15, %13
%17 = tail call i32 @putchar(i32 %16)
br label %18
18: ; preds = %12, %10, %4
%19 = phi i32 [ %7, %4 ], [ 1, %10 ], [ 0, %12 ]
%20 = phi i32 [ %6, %4 ], [ %5, %10 ], [ %6, %12 ]
%21 = tail call i32 @getc(i32* %1)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %4
23: ; preds = %18, %0
%24 = tail call i32 @exit(i32 0)
unreachable
}