#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*/ fprintf(int /*<<< orphan*/ *, char *, char, char, char);
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
void io(FILE *fo, char input[], int counter) {
  char temp;
  if (strlen(input) < 11) {
    printf("Unable to resolve code written at line %d\n", counter);
    return;
  }
  temp = input[3] - 0x30;
  temp = temp << 2;
  temp = temp | (input[5] - 0x30);
  fprintf(fo, "9%x%c%c ", temp, input[8], input[11]);
  return;
}


x86 assembly (clang, -O0):
<io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0xb,%eax
jge    1169 <io+0x39>
mov    -0x14(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
jmp    11be <io+0x8e>
mov    -0x10(%rbp),%rax
movsbl 0x3(%rax),%eax
sub    $0x30,%eax
mov    %al,-0x15(%rbp)
movsbl -0x15(%rbp),%eax
shl    $0x2,%eax
mov    %al,-0x15(%rbp)
movsbl -0x15(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl 0x5(%rcx),%ecx
sub    $0x30,%ecx
or     %ecx,%eax
mov    %al,-0x15(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x15(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%cl
mov    -0x10(%rbp),%rax
lea    0xe7d(%rip),%rsi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl 0xb(%rax),%r8d
call   1050 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
cmp    $0xa,%eax
jg     115b <io+0x2b>
lea    0xeb0(%rip),%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>
mov    0x3(%rbx),%al
mov    0x5(%rbx),%dl
shl    $0x2,%al
add    $0x40,%al
add    $0xd0,%dl
or     %al,%dl
movsbl 0x8(%rbx),%ecx
movsbl 0xb(%rbx),%r8d
movsbl %dl,%edx
lea    0xead(%rip),%rsi
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <fprintf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Unable to resolve code written at line %d\0A\00"
@.str.1 = [9 x i8] c"9%x%c%c \00"
define void @io(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = call i32 @strlen(i8* %8)
%10 = icmp slt i32 %9, 11
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i32, i32* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %43
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %18, 48
%20 = trunc i32 %19 to i8
store i8 %20, i8* %7
%21 = load i8, i8* %7
%22 = sext i8 %21 to i32
%23 = shl i32 %22, 2
%24 = trunc i32 %23 to i8
store i8 %24, i8* %7
%25 = load i8, i8* %7
%26 = sext i8 %25 to i32
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i64 5
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = sub nsw i32 %30, 48
%32 = or i32 %26, %31
%33 = trunc i32 %32 to i8
store i8 %33, i8* %7
%34 = load i32*, i32** %4
%35 = load i8, i8* %7
%36 = load i8*, i8** %5
%37 = getelementptr inbounds i8, i8* %36, i64 8
%38 = load i8, i8* %37
%39 = load i8*, i8** %5
%40 = getelementptr inbounds i8, i8* %39, i64 11
%41 = load i8, i8* %40
%42 = call i32 @fprintf(i32* %34, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8 signext %35, i8 signext %38, i8 signext %41)
br label %43
43: ; preds = %14, %11
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Unable to resolve code written at line %d\0A\00"
@.str.1 = [9 x i8] c"9%x%c%c \00"
define void @io(i32* nocapture %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp slt i32 %4, 11
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %22
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %1, i64 3
%10 = load i8, i8* %9
%11 = shl i8 %10, 2
%12 = add i8 %11, 64
%13 = getelementptr inbounds i8, i8* %1, i64 5
%14 = load i8, i8* %13
%15 = add i8 %14, -48
%16 = or i8 %15, %12
%17 = getelementptr inbounds i8, i8* %1, i64 8
%18 = load i8, i8* %17
%19 = getelementptr inbounds i8, i8* %1, i64 11
%20 = load i8, i8* %19
%21 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8 signext %16, i8 signext %18, i8 signext %20)
br label %22
22: ; preds = %8, %6
ret void
}