#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void ir_prof_error(int type, char *fmt, char *fname) {
  fprintf(stderr, "%s: ", "Ir_prof");
  fprintf(stderr, fmt, fname);
  fputc('\n', stderr);
  fflush(stderr);
  switch (type) {
  ER_FATAL:
    exit(1);
  ER_WARNING:
  ER_INFO:
  ER_ERROR:
  ER_VERBOSE:
  ER_MSG:
    return;
  }
}


x86 assembly (clang, -O0):
<ir_prof_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e96(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
lea    0xea7(%rip),%rdx
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ir_prof_error>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    0x2e9e(%rip),%r15
mov    (%r15),%edi
lea    0xeb4(%rip),%rsi
lea    0xeb2(%rip),%rdx
call   1040 <fprintf@plt>
mov    (%r15),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    (%r15),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
mov    (%r15),%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <fflush@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [5 x i8] c"%s: \00"
@.str.1 = [8 x i8] c"Ir_prof\00"
define void @ir_prof_error(i32 %0, i8* %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* %1, i8* %2)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fputc(i8 signext 10, i32 %8)
%10 = load i32, i32* @stderr
%11 = tail call i32 @fflush(i32 %10)
ret void
}