#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*/ printString(char *);
int /*<<< orphan*/ putc(char);
void crash(char *s) {
  for (int i = 0; i < 128; i++)
    putc('*');
  for (int i = 0; i < 58; i++)
    putc(' ');
  printString("System Crash\n");
  for (int i = 0; i < 128; i++)
    putc('*');
  printString("Cause:");
  printString(s);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jge    1158 <crash+0x38>
mov    $0x2a,%edi
call   1040 <putc@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <crash+0x13>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3a,-0x10(%rbp)
jge    1181 <crash+0x61>
mov    $0x20,%edi
call   1040 <putc@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115f <crash+0x3f>
lea    0xe78(%rip),%rdi
call   1030 <printString@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x80,-0x14(%rbp)
jge    11b9 <crash+0x99>
mov    $0x2a,%edi
call   1040 <putc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1194 <crash+0x74>
lea    0xe4e(%rip),%rdi
call   1030 <printString@plt>
mov    -0x8(%rbp),%rdi
call   1030 <printString@plt>
jmp    11ce <crash+0xae>

x86 assembly (clang, -O2):
<crash>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x80,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1040 <putc@plt>
add    $0xffffffff,%ebp
jne    1130 <crash+0x10>
mov    $0x3a,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x20,%edi
call   1040 <putc@plt>
add    $0xffffffff,%ebp
jne    1150 <crash+0x30>
lea    0xe9a(%rip),%rdi
call   1030 <printString@plt>
mov    $0x80,%ebp
mov    $0x2a,%edi
call   1040 <putc@plt>
add    $0xffffffff,%ebp
jne    1170 <crash+0x50>
lea    0xe88(%rip),%rdi
call   1030 <printString@plt>
mov    %rbx,%rdi
call   1030 <printString@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
jmp    11a0 <crash+0x80>

LLVM IR (-O0):
@.str = [14 x i8] c"System Crash\0A\00"
@.str.1 = [7 x i8] c"Cause:\00"
define void @crash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %6
6: ; preds = %11, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 128
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = call i32 @putc(i8 signext 42)
br label %11
11: ; preds = %9
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %6
14: ; preds = %6
store i32 0, i32* %4
br label %15
15: ; preds = %20, %14
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 58
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = call i32 @putc(i8 signext 32)
br label %20
20: ; preds = %18
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %15
23: ; preds = %15
%24 = call i32 @printString(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %25
25: ; preds = %30, %23
%26 = load i32, i32* %5
%27 = icmp slt i32 %26, 128
br i1 %27, label %28, label %33
28: ; preds = %25
%29 = call i32 @putc(i8 signext 42)
br label %30
30: ; preds = %28
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %25
33: ; preds = %25
%34 = call i32 @printString(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%35 = load i8*, i8** %2
%36 = call i32 @printString(i8* %35)
br label %37
37: ; preds = %33, %37
br label %37
}

LLVM IR (-O2):
@.str = [14 x i8] c"System Crash\0A\00"
@.str.1 = [7 x i8] c"Cause:\00"
define void @crash(i8* %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @putc(i8 signext 42)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 128
br i1 %6, label %9, label %2
7: ; preds = %9
%8 = tail call i32 @printString(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %17
9: ; preds = %2, %9
%10 = phi i32 [ %12, %9 ], [ 0, %2 ]
%11 = tail call i32 @putc(i8 signext 32)
%12 = add nuw nsw i32 %10, 1
%13 = icmp eq i32 %12, 58
br i1 %13, label %7, label %9
14: ; preds = %17
%15 = tail call i32 @printString(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%16 = tail call i32 @printString(i8* %0)
br label %22
17: ; preds = %7, %17
%18 = phi i32 [ 0, %7 ], [ %20, %17 ]
%19 = tail call i32 @putc(i8 signext 42)
%20 = add nuw nsw i32 %18, 1
%21 = icmp eq i32 %20, 128
br i1 %21, label %14, label %17
22: ; preds = %14, %22
br label %22
}