#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*/ printf(char const *, ...);
void __gmp_assert_header(char const *filename, int linenum) {
  {
    if ((unsigned long)filename != (unsigned long)((void *)0)) {
      if ((int const) * (filename + 0) != 0) {
        printf((char const *__restrict)"%s:", filename);
        if (linenum != -1) {
          printf((char const *__restrict)"%d: ", linenum);
        }
      }
    }
    return;
  }
}


x86 assembly (clang, -O0):
<__gmp_assert_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x0,%rax
je     1174 <__gmp_assert_header+0x64>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116f <__gmp_assert_header+0x5f>
mov    -0x8(%rbp),%rsi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xffffffff,-0xc(%rbp)
je     116a <__gmp_assert_header+0x5a>
mov    -0xc(%rbp),%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116f <__gmp_assert_header+0x5f>
jmp    1174 <__gmp_assert_header+0x64>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__gmp_assert_header>:
push   %rbx
test   %rdi,%rdi
je     1144 <__gmp_assert_header+0x34>
mov    %esi,%ebx
mov    %rdi,%rsi
cmpb   $0x0,(%rdi)
je     1144 <__gmp_assert_header+0x34>
lea    0xed9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0xffffffff,%ebx
je     1144 <__gmp_assert_header+0x34>
lea    0xeca(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s:\00"
@.str.1 = [5 x i8] c"%d: \00"
define void @__gmp_assert_header(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %24
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %23
14: ; preds = %8
%15 = load i8*, i8** %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, -1
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = load i32, i32* %4
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %19, %14
br label %23
23: ; preds = %22, %8
br label %24
24: ; preds = %23, %2
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s:\00"
@.str.1 = [5 x i8] c"%d: \00"
define void @__gmp_assert_header(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %4
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = icmp eq i32 %1, -1
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %1)
br label %12
12: ; preds = %4, %10, %7, %2
ret void
}