#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*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char, char *);
void send_communication_message(FILE *stream, char messageType, int messageVer,
                                char *message) {
  switch (messageType) {
  case 'M':
    fprintf(stream, "%c%s\n", messageType, message);
    break;
  case 'H':
    fprintf(stream, "%c%s\n", messageType, message);
    break;
  }
  fflush(stream);
}


x86 assembly (clang, -O0):
<send_communication_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x48,%eax
je     117e <send_communication_message+0x5e>
jmp    114e <send_communication_message+0x2e>
mov    -0x1c(%rbp),%eax
sub    $0x4d,%eax
jne    1198 <send_communication_message+0x78>
jmp    115f <send_communication_message+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rcx
lea    0xe8f(%rip),%rsi
movsbl %al,%edx
call   1030 <fprintf@plt>
jmp    1198 <send_communication_message+0x78>
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rcx
lea    0xe70(%rip),%rsi
movsbl %al,%edx
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_communication_message>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x4d,%esi
je     112e <send_communication_message+0xe>
cmp    $0x48,%esi
jne    1141 <send_communication_message+0x21>
movsbl %sil,%edx
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%c%s\0A\00"
define void @send_communication_message(i32* %0, i8 signext %1, i32 %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i8
%7 = alloca i32
%8 = alloca i8*
store i32* %0, i32** %5
store i8 %1, i8* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
switch i32 %10, label %21 [
i32 77, label %11
i32 72, label %16
]
11: ; preds = %4
%12 = load i32*, i32** %5
%13 = load i8, i8* %6
%14 = load i8*, i8** %8
%15 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %13, i8* %14)
br label %21
16: ; preds = %4
%17 = load i32*, i32** %5
%18 = load i8, i8* %6
%19 = load i8*, i8** %8
%20 = call i32 @fprintf(i32* %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %18, i8* %19)
br label %21
21: ; preds = %4, %16, %11
%22 = load i32*, i32** %5
%23 = call i32 @fflush(i32* %22)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%c%s\0A\00"
define void @send_communication_message(i32* nocapture %0, i8 signext %1, i32 %2, i8* %3) {
%5 = sext i8 %1 to i32
switch i32 %5, label %8 [
i32 77, label %6
i32 72, label %6
]
6: ; preds = %4, %4
%7 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %1, i8* %3)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @fflush(i32* %0)
ret void
}