#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 */
typedef int /*<<< orphan*/ tmp;
struct SFMF_FileHash {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *);
char *logging_get_ticks();
int sfmf_filehash_format(struct SFMF_FileHash *, char *, int);
int /*<<< orphan*/ stderr;
void sfmf_print_hash(const char *filename, struct SFMF_FileHash *hash) {
  char tmp[512];
  int res = sfmf_filehash_format(hash, tmp, sizeof(tmp));
  assert(res != 0);
  fprintf(stderr,
          "[%6ld] "
          "%s %s\n",
          logging_get_ticks(), tmp, filename ?: "");
}


x86 assembly (clang, -O0):
<sfmf_print_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x210(%rbp),%rsi
mov    $0x200,%edx
call   1050 <sfmf_filehash_format@plt>
mov    %eax,-0x214(%rbp)
cmpl   $0x0,-0x214(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x234(%rbp)
mov    $0x0,%al
call   1060 <logging_get_ticks@plt>
mov    %rax,-0x230(%rbp)
lea    -0x210(%rbp),%rax
mov    %rax,-0x228(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x220(%rbp)
cmp    $0x0,%rax
je     11d5 <sfmf_print_hash+0x95>
mov    -0x220(%rbp),%rax
mov    %rax,-0x240(%rbp)
jmp    11e8 <sfmf_print_hash+0xa8>
lea    0xe31(%rip),%rax
mov    %rax,-0x240(%rbp)
jmp    11e8 <sfmf_print_hash+0xa8>
mov    -0x228(%rbp),%rcx
mov    -0x230(%rbp),%rdx
mov    -0x234(%rbp),%edi
mov    -0x240(%rbp),%r8
lea    0xdf6(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfmf_print_hash>:
push   %rbp
push   %r14
push   %rbx
sub    $0x200,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %rsi,%rdi
mov    %r14,%rsi
mov    $0x200,%edx
call   1050 <sfmf_filehash_format@plt>
xor    %edi,%edi
test   %eax,%eax
setne  %dil
call   1030 <assert@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1060 <logging_get_ticks@plt>
test   %rbx,%rbx
lea    0xe85(%rip),%r8
cmovne %rbx,%r8
lea    0xe6d(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
mov    %r14,%rcx
call   1040 <fprintf@plt>
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.SFMF_FileHash = type { i32 }
@stderr = global i32 0
@.str = [14 x i8] c"[%6ld] %s %s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @sfmf_print_hash(i8* %0, %struct.SFMF_FileHash* %1) {
%3 = alloca i8*
%4 = alloca %struct.SFMF_FileHash*
%5 = alloca [512 x i8]
%6 = alloca i32
store i8* %0, i8** %3
store %struct.SFMF_FileHash* %1, %struct.SFMF_FileHash** %4
%7 = load %struct.SFMF_FileHash*, %struct.SFMF_FileHash** %4
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%9 = call i32 @sfmf_filehash_format(%struct.SFMF_FileHash* %7, i8* %8, i32 512)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* @stderr
%15 = call i8* (...) @logging_get_ticks()
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%17 = load i8*, i8** %3
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %20
19: ; preds = %2
br label %21
20: ; preds = %2
br label %21
21: ; preds = %20, %19
%22 = phi i8* [ %17, %19 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %20 ]
%23 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16, i8* %22)
ret void
}

LLVM IR (-O2):
%struct.SFMF_FileHash = type { i32 }
@stderr = global i32 0
@.str = [14 x i8] c"[%6ld] %s %s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @sfmf_print_hash(i8* %0, %struct.SFMF_FileHash* %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @sfmf_filehash_format(%struct.SFMF_FileHash* %1, i8* %4, i32 512)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* @stderr
%10 = call i8* (...) @logging_get_ticks()
%11 = icmp eq i8* %0, null
%12 = select i1 %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %0
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %4, i8* %12)
ret void
}