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


x86 assembly (clang, -O0):
<_3OperandFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8b,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%ecx
add    $0x8,%ecx
cmp    %ecx,%eax
jl     119d <_3OperandFunc+0x6d>
mov    -0x8(%rbp),%rdi
mov    -0x19(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%cl
mov    -0x10(%rbp),%rax
mov    0x7(%rax),%r8b
mov    -0x10(%rbp),%rax
lea    0xe7c(%rip),%rsi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl %r8b,%r8d
movsbl 0xa(%rax),%r9d
call   1050 <fprintf@plt>
jmp    11ac <_3OperandFunc+0x7c>
mov    -0x14(%rbp),%esi
lea    0xe63(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_3OperandFunc>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%ebx
mov    %edx,%r12d
mov    %rsi,%rbp
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
add    $0x8,%ebx
cmp    %ebx,%eax
jge    116c <_3OperandFunc+0x3c>
lea    0xeae(%rip),%rdi
mov    %r12d,%esi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>
movsbl 0x4(%rbp),%ecx
movsbl 0x7(%rbp),%r8d
movsbl 0xa(%rbp),%r9d
movsbl %r14b,%edx
lea    0xe7b(%rip),%rsi
mov    %r15,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fprintf@plt>

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

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