#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*/ abort();
int /*<<< orphan*/ write(int, char *, int);
void _assert(char *f, unsigned line) {
  char buf[20], *p, *s = &buf[20];
  write(2, "assertion failed: file ", 23);
  for (p = f; *p; p++)
    continue;
  write(2, f, p - f);
  write(2, ":", 7);
  *--s = '\n';
  do
    *--s = line % 10 + '0';
  while (line /= 10);
  write(2, s, &buf[20] - s);
  abort();
}


x86 assembly (clang, -O0):
<_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x20(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x30(%rbp)
mov    $0x2,%edi
lea    0xeb9(%rip),%rsi
mov    $0x17,%edx
call   1040 <write@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
je     117c <_assert+0x5c>
jmp    116b <_assert+0x4b>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1159 <_assert+0x39>
mov    -0x8(%rbp),%rsi
mov    -0x28(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
mov    $0x2,%edi
call   1040 <write@plt>
mov    $0x2,%edi
lea    0xe75(%rip),%rsi
mov    $0x7,%edx
call   1040 <write@plt>
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x30(%rbp)
movb   $0xa,-0x1(%rax)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x30(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x30(%rbp)
mov    %cl,-0x1(%rax)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jne    11c0 <_assert+0xa0>
mov    -0x30(%rbp),%rsi
lea    -0x20(%rbp),%rax
add    $0x14,%rax
mov    -0x30(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
mov    $0x2,%edi
call   1040 <write@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_assert>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %esi,%ebp
mov    %rdi,%r14
lea    0xecc(%rip),%rsi
mov    $0x2,%edi
mov    $0x17,%edx
call   1040 <write@plt>
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x0,(%r14,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1150 <_assert+0x30>
add    $0xffffffff,%edx
mov    $0x2,%edi
mov    %r14,%rsi
call   1040 <write@plt>
lea    0xea6(%rip),%rsi
mov    $0x2,%edi
mov    $0x7,%edx
call   1040 <write@plt>
lea    0x13(%rsp),%rsi
movb   $0xa,0x13(%rsp)
mov    $0x1,%edx
mov    $0xcccccccd,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
lea    (%rcx,%rcx,1),%edi
lea    (%rdi,%rdi,4),%edi
mov    %ebp,%ebx
sub    %edi,%ebx
or     $0x30,%bl
mov    %bl,-0x1(%rsi)
add    $0xffffffffffffffff,%rsi
add    $0x1,%edx
cmp    $0x9,%ebp
mov    %ecx,%ebp
ja     11a0 <_assert+0x80>
mov    $0x2,%edi
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"assertion failed: file \00"
@.str.1 = [2 x i8] c":\00"
define void @_assert(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [20 x i8]
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 20
store i8* %8, i8** %7
%9 = call i32 @write(i32 2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 23)
%10 = load i8*, i8** %3
store i8* %10, i8** %6
br label %11
11: ; preds = %16, %2
%12 = load i8*, i8** %6
%13 = load i8, i8* %12
%14 = icmp ne i8 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %11
br label %16
16: ; preds = %15
%17 = load i8*, i8** %6
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %6
br label %11
19: ; preds = %11
%20 = load i8*, i8** %3
%21 = load i8*, i8** %6
%22 = load i8*, i8** %3
%23 = ptrtoint i8* %21 to i64
%24 = ptrtoint i8* %22 to i64
%25 = sub i64 %23, %24
%26 = trunc i64 %25 to i32
%27 = call i32 @write(i32 2, i8* %20, i32 %26)
%28 = call i32 @write(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 7)
%29 = load i8*, i8** %7
%30 = getelementptr inbounds i8, i8* %29, i32 -1
store i8* %30, i8** %7
store i8 10, i8* %30
br label %31
31: ; preds = %38, %19
%32 = load i32, i32* %4
%33 = urem i32 %32, 10
%34 = add i32 %33, 48
%35 = trunc i32 %34 to i8
%36 = load i8*, i8** %7
%37 = getelementptr inbounds i8, i8* %36, i32 -1
store i8* %37, i8** %7
store i8 %35, i8* %37
br label %38
38: ; preds = %31
%39 = load i32, i32* %4
%40 = udiv i32 %39, 10
store i32 %40, i32* %4
%41 = icmp ne i32 %40, 0
br i1 %41, label %31, label %42
42: ; preds = %38
%43 = load i8*, i8** %7
%44 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 20
%45 = load i8*, i8** %7
%46 = ptrtoint i8* %44 to i64
%47 = ptrtoint i8* %45 to i64
%48 = sub i64 %46, %47
%49 = trunc i64 %48 to i32
%50 = call i32 @write(i32 2, i8* %43, i32 %49)
%51 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"assertion failed: file \00"
@.str.1 = [2 x i8] c":\00"
define void @_assert(i8* %0, i32 %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 23)
br label %6
6: ; preds = %6, %2
%7 = phi i8* [ %0, %2 ], [ %10, %6 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
%10 = getelementptr inbounds i8, i8* %7, i64 1
br i1 %9, label %11, label %6
11: ; preds = %6
%12 = ptrtoint i8* %7 to i64
%13 = ptrtoint i8* %0 to i64
%14 = sub i64 %12, %13
%15 = trunc i64 %14 to i32
%16 = tail call i32 @write(i32 2, i8* %0, i32 %15)
%17 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 7)
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 19
store i8 10, i8* %18
br label %19
19: ; preds = %19, %11
%20 = phi i32 [ %1, %11 ], [ %26, %19 ]
%21 = phi i8* [ %18, %11 ], [ %25, %19 ]
%22 = urem i32 %20, 10
%23 = trunc i32 %22 to i8
%24 = or i8 %23, 48
%25 = getelementptr inbounds i8, i8* %21, i64 -1
store i8 %24, i8* %25
%26 = udiv i32 %20, 10
%27 = icmp ult i32 %20, 10
br i1 %27, label %28, label %19
28: ; preds = %19
%29 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 20
%30 = ptrtoint i8* %29 to i64
%31 = ptrtoint i8* %25 to i64
%32 = sub i64 %30, %31
%33 = trunc i64 %32 to i32
%34 = call i32 @write(i32 2, i8* %25, i32 %33)
%35 = call i32 (...) @abort()
unreachable
}