#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*/ setData(char *, char *);
int /*<<< orphan*/ setFile(char *, char *);
int /*<<< orphan*/ setFlag(short, char *);
int /*<<< orphan*/ setNblock(short, char *);
void make_msg(short flag, char *file, char *data, short Nblock,
              char *datagram) {
  setFlag(flag, datagram);
  switch (flag) {
  case 1:
    setFile(file, datagram);
    break;
  case 2:
    setFile(file, datagram);
    break;
  case 4:
    setNblock(Nblock, datagram);
    break;
  case 3:
    setData(data, datagram);
    setNblock(Nblock, datagram);
    break;
  case 6:
    break;
  }
}


x86 assembly (clang, -O0):
<make_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %cx,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
mov    %r8,-0x28(%rbp)
movswl -0x2(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1040 <setFlag@plt>
movswl -0x2(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0x5,%eax
ja     11f9 <make_msg+0xb9>
mov    -0x30(%rbp),%rax
lea    0xe70(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1060 <setFile@plt>
jmp    11f9 <make_msg+0xb9>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1060 <setFile@plt>
jmp    11f9 <make_msg+0xb9>
mov    -0x1a(%rbp),%ax
mov    -0x28(%rbp),%rsi
movswl %ax,%edi
call   1030 <setNblock@plt>
jmp    11f9 <make_msg+0xb9>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <setData@plt>
mov    -0x1a(%rbp),%ax
mov    -0x28(%rbp),%rsi
movswl %ax,%edi
call   1030 <setNblock@plt>
jmp    11f9 <make_msg+0xb9>
jmp    11f9 <make_msg+0xb9>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_msg>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8,%rbx
mov    %ecx,%r15d
mov    %rdx,%r14
mov    %rsi,%r12
mov    %edi,%ebp
mov    %r8,%rsi
call   1040 <setFlag@plt>
add    $0xffffffff,%ebp
cmp    $0x3,%ebp
ja     1189 <make_msg+0x49>
lea    0xe93(%rip),%rax
movslq (%rax,%rbp,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    %r12,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <setFile@plt>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <setData@plt>
movswl %r15w,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <setNblock@plt>

LLVM IR (-O0):
define void @make_msg(i16 signext %0, i8* %1, i8* %2, i16 signext %3, i8* %4) {
%6 = alloca i16
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i16
%10 = alloca i8*
store i16 %0, i16* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i16 %3, i16* %9
store i8* %4, i8** %10
%11 = load i16, i16* %6
%12 = load i8*, i8** %10
%13 = call i32 @setFlag(i16 signext %11, i8* %12)
%14 = load i16, i16* %6
%15 = sext i16 %14 to i32
switch i32 %15, label %36 [
i32 1, label %16
i32 2, label %20
i32 4, label %24
i32 3, label %28
i32 6, label %35
]
16: ; preds = %5
%17 = load i8*, i8** %7
%18 = load i8*, i8** %10
%19 = call i32 @setFile(i8* %17, i8* %18)
br label %36
20: ; preds = %5
%21 = load i8*, i8** %7
%22 = load i8*, i8** %10
%23 = call i32 @setFile(i8* %21, i8* %22)
br label %36
24: ; preds = %5
%25 = load i16, i16* %9
%26 = load i8*, i8** %10
%27 = call i32 @setNblock(i16 signext %25, i8* %26)
br label %36
28: ; preds = %5
%29 = load i8*, i8** %8
%30 = load i8*, i8** %10
%31 = call i32 @setData(i8* %29, i8* %30)
%32 = load i16, i16* %9
%33 = load i8*, i8** %10
%34 = call i32 @setNblock(i16 signext %32, i8* %33)
br label %36
35: ; preds = %5
br label %36
36: ; preds = %5, %35, %28, %24, %20, %16
ret void
}

LLVM IR (-O2):
define void @make_msg(i16 signext %0, i8* %1, i8* %2, i16 signext %3, i8* %4) {
%6 = tail call i32 @setFlag(i16 signext %0, i8* %4)
%7 = sext i16 %0 to i32
switch i32 %7, label %17 [
i32 1, label %8
i32 2, label %10
i32 4, label %12
i32 3, label %14
]
8: ; preds = %5
%9 = tail call i32 @setFile(i8* %1, i8* %4)
br label %17
10: ; preds = %5
%11 = tail call i32 @setFile(i8* %1, i8* %4)
br label %17
12: ; preds = %5
%13 = tail call i32 @setNblock(i16 signext %3, i8* %4)
br label %17
14: ; preds = %5
%15 = tail call i32 @setData(i8* %2, i8* %4)
%16 = tail call i32 @setNblock(i16 signext %3, i8* %4)
br label %17
17: ; preds = %5, %14, %12, %10, %8
ret void
}