#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*/ errprintf(char *, ...);
void eprintf_program_ident(const char *program_name, long revision_number) {
  if (program_name) {
    errprintf((revision_number ? "%s " : "%s"), program_name);
    if (revision_number) {
      int fpart = revision_number % 100;
      errprintf("%d.%02d", (int)(revision_number / 100), fpart);
    }
    errprintf(": ");
  }
}


x86 assembly (clang, -O0):
<eprintf_program_ident>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     119d <eprintf_program_ident+0x8d>
mov    -0x10(%rbp),%rcx
lea    0xece(%rip),%rdi
lea    0xec3(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <errprintf@plt>
cmpq   $0x0,-0x10(%rbp)
je     118f <eprintf_program_ident+0x7f>
mov    -0x10(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
mov    %eax,%esi
mov    -0x14(%rbp),%edx
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <errprintf@plt>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <errprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eprintf_program_ident>:
test   %rdi,%rdi
je     1182 <eprintf_program_ident+0x72>
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
test   %rbx,%rbx
lea    0xede(%rip),%rax
lea    0xed3(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1030 <errprintf@plt>
test   %rbx,%rbx
je     1173 <eprintf_program_ident+0x63>
movabs $0xa3d70a3d70a3d70b,%rcx
0a d7 a3
mov    %rbx,%rax
imul   %rcx
lea    (%rdx,%rbx,1),%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
shr    $0x6,%rsi
add    %eax,%esi
imul   $0x64,%esi,%eax
sub    %eax,%ebx
lea    0xe9d(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <errprintf@plt>
lea    0xe95(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <errprintf@plt>
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [8 x i8] c"%d.%02d\00"
@.str.3 = [3 x i8] c": \00"
define void @eprintf_program_ident(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %28
8: ; preds = %2
%9 = load i64, i64* %4
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%13 = load i8*, i8** %3
%14 = call i32 (i8*, ...) @errprintf(i8* %12, i8* %13)
%15 = load i64, i64* %4
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %26
17: ; preds = %8
%18 = load i64, i64* %4
%19 = srem i64 %18, 100
%20 = trunc i64 %19 to i32
store i32 %20, i32* %5
%21 = load i64, i64* %4
%22 = sdiv i64 %21, 100
%23 = trunc i64 %22 to i32
%24 = load i32, i32* %5
%25 = call i32 (i8*, ...) @errprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %23, i32 %24)
br label %26
26: ; preds = %17, %8
%27 = call i32 (i8*, ...) @errprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %28
28: ; preds = %26, %2
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [8 x i8] c"%d.%02d\00"
@.str.3 = [3 x i8] c": \00"
define void @eprintf_program_ident(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = icmp eq i64 %1, 0
%6 = select i1 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%7 = tail call i32 (i8*, ...) @errprintf(i8* %6, i8* %0)
br i1 %5, label %14, label %8
8: ; preds = %4
%9 = srem i64 %1, 100
%10 = trunc i64 %9 to i32
%11 = sdiv i64 %1, 100
%12 = trunc i64 %11 to i32
%13 = tail call i32 (i8*, ...) @errprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %10)
br label %14
14: ; preds = %8, %4
%15 = tail call i32 (i8*, ...) @errprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %16
16: ; preds = %14, %2
ret void
}