#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 _2OperandFunc(FILE *fo, char input[], int counter, char hexCode) {
  if (strlen(input) >= 8)
    fprintf(fo, "%c%c0%c ", hexCode, input[5], input[8]);
  else
    printf("Unable to resolve code written at line %d\n", counter);
  return;
}


x86 assembly (clang, -O0):
<_2OperandFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x8,%eax
jl     1188 <_2OperandFunc+0x58>
mov    -0x8(%rbp),%rdi
mov    -0x15(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    0x5(%rax),%cl
mov    -0x10(%rbp),%rax
lea    0xe8d(%rip),%rsi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl 0x8(%rax),%r8d
call   1050 <fprintf@plt>
jmp    1197 <_2OperandFunc+0x67>
mov    -0x14(%rbp),%esi
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_2OperandFunc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
cmp    $0x8,%eax
jl     1175 <_2OperandFunc+0x45>
movsbl 0x5(%rbx),%ecx
movsbl 0x8(%rbx),%r8d
movsbl %r14b,%edx
lea    0xe9d(%rip),%rsi
mov    %r15,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fprintf@plt>
lea    0xe8d(%rip),%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%c%c0%c \00"
@.str.1 = [43 x i8] c"Unable to resolve code written at line %d\0A\00"
define void @_2OperandFunc(i32* %0, i8* %1, i32 %2, i8 signext %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8 %3, i8* %8
%9 = load i8*, i8** %6
%10 = call i32 @strlen(i8* %9)
%11 = icmp sge i32 %10, 8
br i1 %11, label %12, label %22
12: ; preds = %4
%13 = load i32*, i32** %5
%14 = load i8, i8* %8
%15 = load i8*, i8** %6
%16 = getelementptr inbounds i8, i8* %15, i64 5
%17 = load i8, i8* %16
%18 = load i8*, i8** %6
%19 = getelementptr inbounds i8, i8* %18, i64 8
%20 = load i8, i8* %19
%21 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %14, i8 signext %17, i8 signext %20)
br label %25
22: ; preds = %4
%23 = load i32, i32* %7
%24 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %22, %12
ret void
}

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