#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 *, char *, ...);
void tau_register_loop(char **func, char **file, int *lineno, int id) {
  if (*file == NULL) {
    printf("tau_register_loop: name = %s, id = %d\n", *func, id);
  } else {
    printf("tau_register_loop: name = %s, file = %s, lineno = %d, id = %d\n",
           *func, *file, *lineno, id);
  }
}


x86 assembly (clang, -O0):
<tau_register_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1152 <tau_register_loop+0x42>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
mov    -0x1c(%rbp),%edx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1178 <tau_register_loop+0x68>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x1c(%rbp),%r8d
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tau_register_loop>:
mov    %ecx,%r8d
mov    %rdx,%rax
mov    (%rsi),%rdx
mov    (%rdi),%rsi
test   %rdx,%rdx
je     1131 <tau_register_loop+0x21>
mov    (%rax),%ecx
lea    0xefd(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xec8(%rip),%rdi
mov    %r8d,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

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

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