#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void Message(char *progname, int level, char *message) {
  switch (level) {
  case 0:
    fprintf(stderr, "Info ");
    break;
  case 1:
    fprintf(stderr, "Warning ");
    break;
  case 2:
  case 3:
    fprintf(stderr, "Error ");
    break;
  }
  fprintf(stderr, "(%s) %s\n", progname, message);
  if (level == 3)
    exit(1);
}


x86 assembly (clang, -O0):
<Message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
test   %eax,%eax
je     116b <Message+0x4b>
jmp    1146 <Message+0x26>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
je     1187 <Message+0x67>
jmp    1157 <Message+0x37>
mov    -0x1c(%rbp),%eax
add    $0xfffffffe,%eax
sub    $0x2,%eax
jb     11a3 <Message+0x83>
jmp    11ba <Message+0x9a>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
lea    0xe85(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11ba <Message+0x9a>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
lea    0xe6f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11ba <Message+0x9a>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
lea    0xe5c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe44(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpl   $0x3,-0xc(%rbp)
jne    11ed <Message+0xcd>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Message>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%ebx
mov    %rdi,%r15
lea    -0x2(%rbx),%eax
cmp    $0x2,%eax
jb     114a <Message+0x2a>
test   %ebx,%ebx
je     118c <Message+0x6c>
cmp    $0x1,%ebx
jne    11a3 <Message+0x83>
lea    0xebe(%rip),%rsi
jmp    1193 <Message+0x73>
mov    0x2e8f(%rip),%r12
mov    (%r12),%edi
lea    0xeb3(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
lea    0xea8(%rip),%rsi
mov    %r15,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1030 <fprintf@plt>
cmp    $0x3,%ebx
je     11cb <Message+0xab>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xe6d(%rip),%rsi
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
lea    0xe63(%rip),%rsi
mov    %r15,%rdx
mov    %r14,%rcx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"Info \00"
@.str.1 = [9 x i8] c"Warning \00"
@.str.2 = [7 x i8] c"Error \00"
@.str.3 = [9 x i8] c"(%s) %s\0A\00"
define void @Message(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
switch i32 %7, label %17 [
i32 0, label %8
i32 1, label %11
i32 2, label %14
i32 3, label %14
]
8: ; preds = %3
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %17
11: ; preds = %3
%12 = load i32, i32* @stderr
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %17
14: ; preds = %3, %3
%15 = load i32, i32* @stderr
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %3, %14, %11, %8
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %4
%20 = load i8*, i8** %6
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %19, i8* %20)
%22 = load i32, i32* %5
%23 = icmp eq i32 %22, 3
br i1 %23, label %24, label %26
24: ; preds = %17
%25 = call i32 @exit(i32 1)
unreachable
26: ; preds = %17
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"Info \00"
@.str.1 = [9 x i8] c"Warning \00"
@.str.2 = [7 x i8] c"Error \00"
@.str.3 = [9 x i8] c"(%s) %s\0A\00"
define void @Message(i8* %0, i32 %1, i8* %2) {
switch i32 %1, label %9 [
i32 0, label %5
i32 1, label %4
i32 2, label %12
i32 3, label %12
]
4: ; preds = %3
br label %5
5: ; preds = %3, %4
%6 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %3 ]
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* %6)
br label %9
9: ; preds = %5, %3
%10 = load i32, i32* @stderr
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %0, i8* %2)
br label %20
12: ; preds = %3, %3
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %0, i8* %2)
%17 = icmp eq i32 %1, 3
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = tail call i32 @exit(i32 1)
unreachable
20: ; preds = %9, %12
ret void
}