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

/* Variables and functions */
int /*<<< orphan*/ SendToComputer(char *, char *);
int /*<<< orphan*/ SendToIcs(char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
void ProcessConsoleLine(char *line) {
  if (!strncmp(line, "computer: ", 10)) {
    SendToComputer("%s\n", line + 10);
  } else if (!strncmp(line, "ics: ", 5)) {
    SendToIcs("%s\n", line + 5);
  } else {
    printf("Unknown target\n");
  }
}


x86 assembly (clang, -O0):
<ProcessConsoleLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
mov    $0xa,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1183 <ProcessConsoleLine+0x43>
mov    -0x8(%rbp),%rsi
add    $0xa,%rsi
lea    0xe92(%rip),%rdi
call   1040 <SendToComputer@plt>
jmp    11cb <ProcessConsoleLine+0x8b>
mov    -0x8(%rbp),%rdi
lea    0xe81(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11ba <ProcessConsoleLine+0x7a>
mov    -0x8(%rbp),%rsi
add    $0x5,%rsi
lea    0xe5b(%rip),%rdi
call   1050 <SendToIcs@plt>
jmp    11c6 <ProcessConsoleLine+0x86>
lea    0xe54(%rip),%rdi
call   1060 <printf@plt>
jmp    11cb <ProcessConsoleLine+0x8b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ProcessConsoleLine>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rsi
mov    $0xa,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     117e <ProcessConsoleLine+0x3e>
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1192 <ProcessConsoleLine+0x52>
lea    0xe9d(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>
add    $0xa,%rbx
lea    0xe82(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1050 <SendToComputer@plt>
add    $0x5,%rbx
lea    0xe6e(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1060 <SendToIcs@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"computer: \00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [6 x i8] c"ics: \00"
@.str.3 = [16 x i8] c"Unknown target\0A\00"
define void @ProcessConsoleLine(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strncmp(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 10
%9 = call i32 @SendToComputer(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
br label %21
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%13 = icmp ne i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 5
%17 = call i32 @SendToIcs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
br label %20
18: ; preds = %10
%19 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %18, %14
br label %21
21: ; preds = %20, %6
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"computer: \00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [6 x i8] c"ics: \00"
@str = [15 x i8] c"Unknown target\00"
define void @ProcessConsoleLine(i8* %0) {
%2 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 10
%6 = tail call i32 @SendToComputer(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
br label %15
7: ; preds = %1
%8 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = getelementptr inbounds i8, i8* %0, i64 5
%12 = tail call i32 @SendToIcs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %15
13: ; preds = %7
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %15
15: ; preds = %10, %13, %4
ret void
}