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


x86 assembly (clang, -O0):
<lsf>:
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
jl     1187 <lsf+0x57>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x5(%rax),%dl
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%cl
mov    -0x10(%rbp),%rax
lea    0xe8e(%rip),%rsi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl 0xb(%rax),%r8d
call   1050 <fprintf@plt>
jmp    1196 <lsf+0x66>
mov    -0x14(%rbp),%esi
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsf>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
cmp    $0xb,%eax
jl     1169 <lsf+0x39>
movsbl 0x5(%rbx),%edx
movsbl 0x8(%rbx),%ecx
movsbl 0xb(%rbx),%r8d
lea    0xea3(%rip),%rsi
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <fprintf@plt>
lea    0xe99(%rip),%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

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

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