#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*/ ec_bad_exit(char *);
int /*<<< orphan*/ strcat(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
scalar_t__ *strncpy(char *, char const *, int);
void default_panic(const char *what, const char *where) {
  char buf[200];
  if (strlen(what) + 4 + strlen(where) < 200)
    strcat(strcat(strcpy(buf, what), " in "), where);
  else
    strncpy(buf, what, 200 - 1)[200] = 0;
  ec_bad_exit(buf);
}


x86 assembly (clang, -O0):
<default_panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x4,%eax
mov    %eax,-0xe4(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0xe4(%rbp),%eax
add    %ecx,%eax
cmp    $0xc8,%eax
jge    11c1 <default_panic+0x71>
lea    -0xe0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    %eax,%edi
lea    0xe54(%rip),%rsi
call   1070 <strcat@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1070 <strcat@plt>
jmp    11e1 <default_panic+0x91>
lea    -0xe0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xc7,%edx
call   1030 <strncpy@plt>
movq   $0x0,0x640(%rax)
lea    -0xe0(%rbp),%rdi
call   1060 <ec_bad_exit@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_panic>:
push   %r15
push   %r14
push   %rbx
sub    $0xd0,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
call   1050 <strlen@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1050 <strlen@plt>
add    %ebx,%eax
add    $0x4,%eax
mov    %rsp,%rdi
mov    %r15,%rsi
cmp    $0xc7,%eax
jg     11a2 <default_panic+0x52>
call   1040 <strcpy@plt>
lea    0xe71(%rip),%rsi
mov    %eax,%edi
call   1070 <strcat@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1070 <strcat@plt>
jmp    11b7 <default_panic+0x67>
mov    $0xc7,%edx
call   1030 <strncpy@plt>
movq   $0x0,0x640(%rax)
mov    %rsp,%rdi
call   1060 <ec_bad_exit@plt>
add    $0xd0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c" in \00"
define void @default_panic(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [200 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %8, %10
%12 = icmp slt i32 %11, 200
br i1 %12, label %13, label %20
13: ; preds = %2
%14 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%15 = load i8*, i8** %3
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = call i32 @strcat(i32 %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%18 = load i8*, i8** %4
%19 = call i32 @strcat(i32 %17, i8* %18)
br label %25
20: ; preds = %2
%21 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%22 = load i8*, i8** %3
%23 = call i64* @strncpy(i8* %21, i8* %22, i32 199)
%24 = getelementptr inbounds i64, i64* %23, i64 200
store i64 0, i64* %24
br label %25
25: ; preds = %20, %13
%26 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%27 = call i32 @ec_bad_exit(i8* %26)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" in \00"
define void @default_panic(i8* %0, i8* %1) {
%3 = alloca [200 x i8]
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, 4
%7 = tail call i32 @strlen(i8* %1)
%8 = add nsw i32 %6, %7
%9 = icmp slt i32 %8, 200
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = call i32 @strcpy(i8* %4, i8* %0)
%12 = call i32 @strcat(i32 %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @strcat(i32 %12, i8* %1)
br label %17
14: ; preds = %2
%15 = call i64* @strncpy(i8* %4, i8* %0, i32 199)
%16 = getelementptr inbounds i64, i64* %15, i64 200
store i64 0, i64* %16
br label %17
17: ; preds = %14, %10
%18 = call i32 @ec_bad_exit(i8* %4)
ret void
}