#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*/ ErrorString(char *, int);
int /*<<< orphan*/ NumberIO_CardToStr(unsigned int, int /*<<< orphan*/, char *,
                                      int);
int /*<<< orphan*/ StrLib_StrEqual(char *, unsigned int, char *,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ libc_exit(int);
int /*<<< orphan*/ memcpy(char *, char *, unsigned int);
void M2RTS_ErrorMessage(char *message_, unsigned int _message_high, char *file_,
                        unsigned int _file_high, unsigned int line,
                        char *function_, unsigned int _function_high) {
  typedef struct _T2_a _T2;
  struct _T2_a {
    char array[10 + 1];
  };
  _T2 LineNo;
  char message[_message_high + 1];
  char file[_file_high + 1];
  char function[_function_high + 1];
  memcpy(message, message_, _message_high + 1);
  memcpy(file, file_, _file_high + 1);
  memcpy(function, function_, _function_high + 1);
  ErrorString((char *)file, _file_high);
  ErrorString((char *)":", 1);
  NumberIO_CardToStr(line, 0, (char *)&LineNo.array[0], 10);
  ErrorString((char *)&LineNo.array[0], 10);
  ErrorString((char *)":", 1);
  if (!(StrLib_StrEqual((char *)function, _function_high, (char *)"", 0))) {
    ErrorString((char *)"in ", 3);
    ErrorString((char *)function, _function_high);
    ErrorString((char *)" has caused ", 12);
  }
  ErrorString((char *)message, _message_high);
  LineNo.array[0] = (char)012;
  LineNo.array[1] = (char)000;
  ErrorString((char *)&LineNo.array[0], 10);
  libc_exit(1);
}


x86 assembly (clang, -O0):
<M2RTS_ErrorMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x70(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x48(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%rbp)
mov    0x10(%rbp),%eax
add    $0x1,%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1060 <memcpy@plt>
mov    -0x68(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
call   1060 <memcpy@plt>
mov    -0x60(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    0x10(%rbp),%edx
add    $0x1,%edx
call   1060 <memcpy@plt>
mov    -0x68(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <ErrorString@plt>
lea    0xdda(%rip),%rdi
mov    $0x1,%esi
call   1040 <ErrorString@plt>
mov    -0x20(%rbp),%edi
lea    -0x38(%rbp),%rdx
xor    %esi,%esi
mov    $0xa,%ecx
call   1050 <NumberIO_CardToStr@plt>
lea    -0x38(%rbp),%rdi
mov    $0xa,%esi
call   1040 <ErrorString@plt>
lea    0xda8(%rip),%rdi
mov    $0x1,%esi
call   1040 <ErrorString@plt>
mov    -0x60(%rbp),%rdi
mov    0x10(%rbp),%esi
lea    0xda2(%rip),%rdx
xor    %ecx,%ecx
call   1030 <StrLib_StrEqual@plt>
cmp    $0x0,%eax
jne    12ae <M2RTS_ErrorMessage+0x15e>
lea    0xd7b(%rip),%rdi
mov    $0x3,%esi
call   1040 <ErrorString@plt>
mov    -0x60(%rbp),%rdi
mov    0x10(%rbp),%esi
call   1040 <ErrorString@plt>
lea    0xd62(%rip),%rdi
mov    $0xc,%esi
call   1040 <ErrorString@plt>
mov    -0x70(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <ErrorString@plt>
movb   $0xa,-0x38(%rbp)
movb   $0x0,-0x37(%rbp)
lea    -0x38(%rbp),%rdi
mov    $0xa,%esi
call   1040 <ErrorString@plt>
mov    $0x1,%edi
call   1070 <libc_exit@plt>
mov    -0x40(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M2RTS_ErrorMessage>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9,-0x50(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %rcx,-0x40(%rbp)
mov    %rdx,-0x48(%rbp)
mov    %rdi,%r8
mov    %rsp,-0x60(%rbp)
mov    0x10(%rbp),%edi
mov    %rsi,-0x58(%rbp)
lea    0x1(%rsi),%edx
mov    %rsp,%r13
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
lea    0x1(%rcx),%r14d
mov    %rsp,%r12
lea    0xf(%r14),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
lea    0x1(%rdi),%r15d
mov    %rsp,%rbx
lea    0xf(%r15),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %r13,%rdi
mov    %r8,%rsi
call   1060 <memcpy@plt>
mov    %r12,%rdi
mov    -0x48(%rbp),%rsi
mov    %r14d,%edx
call   1060 <memcpy@plt>
mov    %rbx,%rdi
mov    -0x50(%rbp),%rsi
mov    %r15d,%edx
call   1060 <memcpy@plt>
mov    %r12,%rdi
mov    -0x40(%rbp),%rsi
call   1040 <ErrorString@plt>
lea    0xe07(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
call   1040 <ErrorString@plt>
lea    -0x38(%rbp),%r15
mov    -0x2c(%rbp),%edi
xor    %esi,%esi
mov    %r15,%rdx
mov    $0xa,%ecx
call   1050 <NumberIO_CardToStr@plt>
mov    %r15,%rdi
mov    $0xa,%esi
call   1040 <ErrorString@plt>
mov    %r14,%rdi
mov    0x10(%rbp),%r14d
mov    $0x1,%esi
call   1040 <ErrorString@plt>
lea    0xdd1(%rip),%rdx
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %ecx,%ecx
call   1030 <StrLib_StrEqual@plt>
test   %eax,%eax
jne    127f <M2RTS_ErrorMessage+0x12f>
lea    0xda9(%rip),%rdi
mov    $0x3,%esi
call   1040 <ErrorString@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <ErrorString@plt>
lea    0xd91(%rip),%rdi
mov    $0xc,%esi
call   1040 <ErrorString@plt>
mov    %r13,%rdi
mov    -0x58(%rbp),%rsi
call   1040 <ErrorString@plt>
movw   $0xa,-0x38(%rbp)
lea    -0x38(%rbp),%rdi
mov    $0xa,%esi
call   1040 <ErrorString@plt>
mov    $0x1,%edi
call   1070 <libc_exit@plt>
mov    -0x60(%rbp),%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct._T2_a = type { [11 x i8] }
@.str = [2 x i8] c":\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [4 x i8] c"in \00"
@.str.3 = [13 x i8] c" has caused \00"
define void @M2RTS_ErrorMessage(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4, i8* %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32
%15 = alloca %struct._T2_a
%16 = alloca i8*
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
store i8* %0, i8** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i8* %5, i8** %13
store i32 %6, i32* %14
%20 = load i32, i32* %9
%21 = add i32 %20, 1
%22 = zext i32 %21 to i64
%23 = call i8* @llvm.stacksave()
store i8* %23, i8** %16
%24 = alloca i8, i64 %22
store i64 %22, i64* %17
%25 = load i32, i32* %11
%26 = add i32 %25, 1
%27 = zext i32 %26 to i64
%28 = alloca i8, i64 %27
store i64 %27, i64* %18
%29 = load i32, i32* %14
%30 = add i32 %29, 1
%31 = zext i32 %30 to i64
%32 = alloca i8, i64 %31
store i64 %31, i64* %19
%33 = load i8*, i8** %8
%34 = load i32, i32* %9
%35 = add i32 %34, 1
%36 = call i32 @memcpy(i8* %24, i8* %33, i32 %35)
%37 = load i8*, i8** %10
%38 = load i32, i32* %11
%39 = add i32 %38, 1
%40 = call i32 @memcpy(i8* %28, i8* %37, i32 %39)
%41 = load i8*, i8** %13
%42 = load i32, i32* %14
%43 = add i32 %42, 1
%44 = call i32 @memcpy(i8* %32, i8* %41, i32 %43)
%45 = load i32, i32* %11
%46 = call i32 @ErrorString(i8* %28, i32 %45)
%47 = call i32 @ErrorString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%48 = load i32, i32* %12
%49 = getelementptr inbounds %struct._T2_a, %struct._T2_a* %15, i32 0, i32 0
%50 = getelementptr inbounds [11 x i8], [11 x i8]* %49, i64 0, i64 0
%51 = call i32 @NumberIO_CardToStr(i32 %48, i32 0, i8* %50, i32 10)
%52 = getelementptr inbounds %struct._T2_a, %struct._T2_a* %15, i32 0, i32 0
%53 = getelementptr inbounds [11 x i8], [11 x i8]* %52, i64 0, i64 0
%54 = call i32 @ErrorString(i8* %53, i32 10)
%55 = call i32 @ErrorString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%56 = load i32, i32* %14
%57 = call i32 @StrLib_StrEqual(i8* %32, i32 %56, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 0)
%58 = icmp ne i32 %57, 0
br i1 %58, label %64, label %59
59: ; preds = %7
%60 = call i32 @ErrorString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%61 = load i32, i32* %14
%62 = call i32 @ErrorString(i8* %32, i32 %61)
%63 = call i32 @ErrorString(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 12)
br label %64
64: ; preds = %59, %7
%65 = load i32, i32* %9
%66 = call i32 @ErrorString(i8* %24, i32 %65)
%67 = getelementptr inbounds %struct._T2_a, %struct._T2_a* %15, i32 0, i32 0
%68 = getelementptr inbounds [11 x i8], [11 x i8]* %67, i64 0, i64 0
store i8 10, i8* %68
%69 = getelementptr inbounds %struct._T2_a, %struct._T2_a* %15, i32 0, i32 0
%70 = getelementptr inbounds [11 x i8], [11 x i8]* %69, i64 0, i64 1
store i8 0, i8* %70
%71 = getelementptr inbounds %struct._T2_a, %struct._T2_a* %15, i32 0, i32 0
%72 = getelementptr inbounds [11 x i8], [11 x i8]* %71, i64 0, i64 0
%73 = call i32 @ErrorString(i8* %72, i32 10)
%74 = call i32 @libc_exit(i32 1)
%75 = load i8*, i8** %16
ret void
}

LLVM IR (-O2):
%struct._T2_a = type { [11 x i8] }
@.str = [2 x i8] c":\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [4 x i8] c"in \00"
@.str.3 = [13 x i8] c" has caused \00"
define void @M2RTS_ErrorMessage(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4, i8* %5, i32 %6) {
%8 = alloca %struct._T2_a
%9 = getelementptr inbounds %struct._T2_a, %struct._T2_a* %8, i64 0, i32 0, i64 0
%10 = add i32 %1, 1
%11 = zext i32 %10 to i64
%12 = tail call i8* @llvm.stacksave()
%13 = alloca i8, i64 %11
%14 = add i32 %3, 1
%15 = zext i32 %14 to i64
%16 = alloca i8, i64 %15
%17 = add i32 %6, 1
%18 = zext i32 %17 to i64
%19 = alloca i8, i64 %18
%20 = call i32 @memcpy(i8* %13, i8* %0, i32 %10)
%21 = call i32 @memcpy(i8* %16, i8* %2, i32 %14)
%22 = call i32 @memcpy(i8* %19, i8* %5, i32 %17)
%23 = call i32 @ErrorString(i8* %16, i32 %3)
%24 = call i32 @ErrorString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%25 = call i32 @NumberIO_CardToStr(i32 %4, i32 0, i8* %9, i32 10)
%26 = call i32 @ErrorString(i8* %9, i32 10)
%27 = call i32 @ErrorString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%28 = call i32 @StrLib_StrEqual(i8* %19, i32 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 0)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %34
30: ; preds = %7
%31 = call i32 @ErrorString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%32 = call i32 @ErrorString(i8* %19, i32 %6)
%33 = call i32 @ErrorString(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 12)
br label %34
34: ; preds = %30, %7
%35 = call i32 @ErrorString(i8* %13, i32 %1)
store i8 10, i8* %9
%36 = getelementptr inbounds %struct._T2_a, %struct._T2_a* %8, i64 0, i32 0, i64 1
store i8 0, i8* %36
%37 = call i32 @ErrorString(i8* %9, i32 10)
%38 = call i32 @libc_exit(i32 1)
ret void
}