#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 nwk_transaction {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mm_access_rights_request(struct nwk_transaction *,
                                            unsigned char *, int);
int /*<<< orphan*/ mm_locate_request(struct nwk_transaction *, unsigned char *,
                                     int);
void mm_command(struct nwk_transaction *trans, unsigned char cmd,
                unsigned char *data, int len) {
  switch (cmd) {
  case 0x54:
    mm_locate_request(trans, data, len);
    break;
  case 0x44:
    mm_access_rights_request(trans, data, len);
    break;
  }
}


x86 assembly (clang, -O0):
<mm_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movzbl -0x9(%rbp),%eax
mov    %eax,-0x20(%rbp)
sub    $0x44,%eax
je     1174 <mm_command+0x54>
jmp    114e <mm_command+0x2e>
mov    -0x20(%rbp),%eax
sub    $0x54,%eax
jne    1184 <mm_command+0x64>
jmp    115f <mm_command+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <mm_locate_request@plt>
jmp    1184 <mm_command+0x64>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <mm_access_rights_request@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_command>:
cmp    $0x44,%sil
je     1136 <mm_command+0x16>
cmp    $0x54,%sil
jne    1140 <mm_command+0x20>
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <mm_locate_request@plt>
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1040 <mm_access_rights_request@plt>
ret

LLVM IR (-O0):
%struct.nwk_transaction = type { i32 }
define void @mm_command(%struct.nwk_transaction* %0, i8 zeroext %1, i8* %2, i32 %3) {
%5 = alloca %struct.nwk_transaction*
%6 = alloca i8
%7 = alloca i8*
%8 = alloca i32
store %struct.nwk_transaction* %0, %struct.nwk_transaction** %5
store i8 %1, i8* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
switch i32 %10, label %21 [
i32 84, label %11
i32 68, label %16
]
11: ; preds = %4
%12 = load %struct.nwk_transaction*, %struct.nwk_transaction** %5
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = call i32 @mm_locate_request(%struct.nwk_transaction* %12, i8* %13, i32 %14)
br label %21
16: ; preds = %4
%17 = load %struct.nwk_transaction*, %struct.nwk_transaction** %5
%18 = load i8*, i8** %7
%19 = load i32, i32* %8
%20 = call i32 @mm_access_rights_request(%struct.nwk_transaction* %17, i8* %18, i32 %19)
br label %21
21: ; preds = %4, %16, %11
ret void
}

LLVM IR (-O2):
%struct.nwk_transaction = type { i32 }
define void @mm_command(%struct.nwk_transaction* %0, i8 zeroext %1, i8* %2, i32 %3) {
switch i8 %1, label %9 [
i8 84, label %5
i8 68, label %7
]
5: ; preds = %4
%6 = tail call i32 @mm_locate_request(%struct.nwk_transaction* %0, i8* %2, i32 %3)
br label %9
7: ; preds = %4
%8 = tail call i32 @mm_access_rights_request(%struct.nwk_transaction* %0, i8* %2, i32 %3)
br label %9
9: ; preds = %4, %7, %5
ret void
}