#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*/ fwrite(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strlen(char *);
void regerror(char *s) {
  char buf[132];
  strcpy(buf, "regerror: ");
  strcat(buf, s);
  strcat(buf, "\n");
  fwrite(buf, 1, strlen(buf), stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<regerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xe93(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x90(%rbp),%rdi
lea    0xe7b(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x98(%rbp)
lea    -0x90(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x98(%rbp),%rdi
mov    %eax,%edx
mov    0x2e21(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1070 <fwrite@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<regerror>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%r14
lea    0xe9c(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
lea    0xe8a(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    0x2e48(%rip),%rcx
mov    (%rcx),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
call   1070 <fwrite@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"regerror: \00"
@.str.1 = [2 x i8] c"\0A\00"
@stderr = global i32 0
define void @regerror(i8* %0) {
%2 = alloca i8*
%3 = alloca [132 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [132 x i8], [132 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [132 x i8], [132 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @strcat(i8* %6, i8* %7)
%9 = getelementptr inbounds [132 x i8], [132 x i8]* %3, i64 0, i64 0
%10 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds [132 x i8], [132 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [132 x i8], [132 x i8]* %3, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
%14 = load i32, i32* @stderr
%15 = call i32 @fwrite(i8* %11, i32 1, i32 %13, i32 %14)
%16 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"regerror: \00"
@.str.1 = [2 x i8] c"\0A\00"
@stderr = global i32 0
define void @regerror(i8* %0) {
%2 = alloca [132 x i8]
%3 = getelementptr inbounds [132 x i8], [132 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @strcat(i8* %3, i8* %0)
%6 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @strlen(i8* %3)
%8 = load i32, i32* @stderr
%9 = call i32 @fwrite(i8* %3, i32 1, i32 %7, i32 %8)
%10 = call i32 @exit(i32 1)
unreachable
}