void imagetransfer_ServeImageRequest() {
  char *request = protocol_GetRequest();
  if (request[1] == 'N') {
    protocol_PrepareNextImage(request);
  } else if (request[1] == 'C') {
    protocol_TransmitChunks();
  } else {
    error(__FUNCTION__, "Erroneous request.");
  }
}


x86 assembly (clang, -O0):
<imagetransfer_ServeImageRequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <protocol_GetRequest@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x4e,%eax
jne    1176 <imagetransfer_ServeImageRequest+0x36>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1060 <protocol_PrepareNextImage@plt>
jmp    11ad <imagetransfer_ServeImageRequest+0x6d>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x43,%eax
jne    1193 <imagetransfer_ServeImageRequest+0x53>
mov    $0x0,%al
call   1030 <protocol_TransmitChunks@plt>
jmp    11a8 <imagetransfer_ServeImageRequest+0x68>
lea    0xe66(%rip),%rdi
lea    0xe7f(%rip),%rsi
mov    $0x0,%al
call   1050 <error@plt>
jmp    11ad <imagetransfer_ServeImageRequest+0x6d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imagetransfer_ServeImageRequest>:
push   %rax
xor    %eax,%eax
call   1040 <protocol_GetRequest@plt>
movslq %eax,%rdi
mov    0x1(%rdi),%al
cmp    $0x43,%al
je     115e <imagetransfer_ServeImageRequest+0x1e>
cmp    $0x4e,%al
jne    1166 <imagetransfer_ServeImageRequest+0x26>
xor    %eax,%eax
pop    %rcx
jmp    1060 <protocol_PrepareNextImage@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <protocol_TransmitChunks@plt>
lea    0xe93(%rip),%rdi
lea    0xeac(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1050 <error@plt>

LLVM IR (-O0):
@__FUNCTION__.imagetransfer_ServeImageRequest = [32 x i8] c"imagetransfer_ServeImageRequest\00"
@.str = [19 x i8] c"Erroneous request.\00"
define void @imagetransfer_ServeImageRequest() {
%1 = alloca i8*
%2 = call i32 (...) @protocol_GetRequest()
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 78
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = load i8*, i8** %1
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @protocol_PrepareNextImage to i32 (i8*, ...)*)(i8* %11)
br label %24
13: ; preds = %0
%14 = load i8*, i8** %1
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 67
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 (...) @protocol_TransmitChunks()
br label %23
21: ; preds = %13
%22 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @__FUNCTION__.imagetransfer_ServeImageRequest, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
br label %24
24: ; preds = %23, %10
ret void
}

LLVM IR (-O2):
@__FUNCTION__.imagetransfer_ServeImageRequest = [32 x i8] c"imagetransfer_ServeImageRequest\00"
@.str = [19 x i8] c"Erroneous request.\00"
define void @imagetransfer_ServeImageRequest() {
%1 = tail call i32 (...) @protocol_GetRequest()
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i8*
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
switch i8 %5, label %10 [
i8 78, label %6
i8 67, label %8
]
6: ; preds = %0
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @protocol_PrepareNextImage to i32 (i8*, ...)*)(i8* %3)
br label %12
8: ; preds = %0
%9 = tail call i32 (...) @protocol_TransmitChunks()
br label %12
10: ; preds = %0
%11 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @__FUNCTION__.imagetransfer_ServeImageRequest, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %8, %10, %6
ret void
}