#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void mtf_print_error(int error_code) {
  switch (error_code) {
  case -1:
    fprintf(stderr, "Premature end of the file.\n");
    break;
  case -2:
    fprintf(stderr, "Not enought memory.\n");
    break;
  case -3:
    fprintf(stderr, "Defective format.\n");
    break;
  }
}


x86 assembly (clang, -O0):
<mtf_print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0xfffffffd,%eax
je     1185 <mtf_print_error+0x75>
jmp    112f <mtf_print_error+0x1f>
mov    -0x8(%rbp),%eax
sub    $0xfffffffe,%eax
je     116b <mtf_print_error+0x5b>
jmp    1140 <mtf_print_error+0x30>
mov    -0x8(%rbp),%eax
sub    $0xffffffff,%eax
jne    119a <mtf_print_error+0x8a>
jmp    1151 <mtf_print_error+0x41>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
call   1030 <fprintf@plt>
jmp    119a <mtf_print_error+0x8a>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
jmp    119a <mtf_print_error+0x8a>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtf_print_error>:
cmp    $0xfffffffd,%edi
jb     1137 <mtf_print_error+0x27>
add    $0x3,%edi
movslq %edi,%rax
lea    0xf22(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprintf@plt>
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Premature end of the file.\0A\00"
@.str.1 = [21 x i8] c"Not enought memory.\0A\00"
@.str.2 = [19 x i8] c"Defective format.\0A\00"
define void @mtf_print_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %13 [
i32 -1, label %4
i32 -2, label %7
i32 -3, label %10
]
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %13
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %1, %10, %7, %4
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Premature end of the file.\0A\00"
@.str.1 = [21 x i8] c"Not enought memory.\0A\00"
@.str.2 = [19 x i8] c"Defective format.\0A\00"
@reltable.mtf_print_error = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.mtf_print_error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.mtf_print_error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([28 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.mtf_print_error to i64)) to i32)]
define void @mtf_print_error(i32 %0) {
%2 = icmp ugt i32 %0, -4
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = add i32 %0, 3
%5 = sext i32 %4 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.mtf_print_error to i8*), i64 %6)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* %7)
br label %10
10: ; preds = %1, %3
ret void
}