#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 */
struct TCP_STREAM {
  int dummy;
};
struct StringReassembler {
  int dummy;
};
struct NetFrame {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FRAMERR(struct NetFrame *, char *, unsigned int,
                           unsigned char const *);
int /*<<< orphan*/ msg_content_type(struct StringReassembler *,
                                    unsigned char const **, unsigned int *);
void msg_unknown(struct TCP_STREAM *stream, struct NetFrame *frame,
                 struct StringReassembler *data) {
  const unsigned char *content_type;
  unsigned content_type_length;
  msg_content_type(data, &content_type, &content_type_length);
  FRAMERR(frame, "msn-ms: unknown message from client: %.*s\n",
          content_type_length, content_type);
}


x86 assembly (clang, -O0):
<msg_unknown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x24(%rbp),%rdx
call   1030 <msg_content_type@plt>
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    0xea9(%rip),%rsi
call   1040 <FRAMERR@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_unknown>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rdi
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1030 <msg_content_type@plt>
mov    0x4(%rsp),%edx
mov    0x8(%rsp),%rcx
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <FRAMERR@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.TCP_STREAM = type { i32 }
%struct.NetFrame = type { i32 }
%struct.StringReassembler = type { i32 }
@.str = [43 x i8] c"msn-ms: unknown message from client: %.*s\0A\00"
define void @msg_unknown(%struct.TCP_STREAM* %0, %struct.NetFrame* %1, %struct.StringReassembler* %2) {
%4 = alloca %struct.TCP_STREAM*
%5 = alloca %struct.NetFrame*
%6 = alloca %struct.StringReassembler*
%7 = alloca i8*
%8 = alloca i32
store %struct.TCP_STREAM* %0, %struct.TCP_STREAM** %4
store %struct.NetFrame* %1, %struct.NetFrame** %5
store %struct.StringReassembler* %2, %struct.StringReassembler** %6
%9 = load %struct.StringReassembler*, %struct.StringReassembler** %6
%10 = call i32 @msg_content_type(%struct.StringReassembler* %9, i8** %7, i32* %8)
%11 = load %struct.NetFrame*, %struct.NetFrame** %5
%12 = load i32, i32* %8
%13 = load i8*, i8** %7
%14 = call i32 @FRAMERR(%struct.NetFrame* %11, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %13)
ret void
}

LLVM IR (-O2):
%struct.TCP_STREAM = type { i32 }
%struct.NetFrame = type { i32 }
%struct.StringReassembler = type { i32 }
@.str = [43 x i8] c"msn-ms: unknown message from client: %.*s\0A\00"
define void @msg_unknown(%struct.TCP_STREAM* nocapture readnone %0, %struct.NetFrame* %1, %struct.StringReassembler* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = bitcast i8** %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = call i32 @msg_content_type(%struct.StringReassembler* %2, i8** %4, i32* %5)
%9 = load i32, i32* %5
%10 = load i8*, i8** %4
%11 = call i32 @FRAMERR(%struct.NetFrame* %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
ret void
}