#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 scalar_t__ *XrmQuarkList;
typedef scalar_t__ *XrmBindingList;
typedef int /*<<< orphan*/ FILE;
typedef scalar_t__ Bool;

/* Variables and functions */
scalar_t__ False;
scalar_t__ True;
scalar_t__ XrmBindLoosely;
int /*<<< orphan*/ XrmQuarkToString(scalar_t__);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ fputs(int /*<<< orphan*/, int /*<<< orphan*/ *);
void PrintBindingQuarkList(XrmBindingList bindings, XrmQuarkList quarks,
                           FILE *stream) {
  Bool firstNameSeen;
  for (firstNameSeen = False; *quarks; bindings++, quarks++) {
    if (*bindings == XrmBindLoosely) {
      (void)fprintf(stream, "*");
    } else if (firstNameSeen) {
      (void)fprintf(stream, ".");
    }
    firstNameSeen = True;
    (void)fputs(XrmQuarkToString(*quarks), stream);
  }
}


x86 assembly (clang, -O0):
<PrintBindingQuarkList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     11ee <PrintBindingQuarkList+0xbe>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e72(%rip),%rcx
cmp    (%rcx),%rax
jne    118c <PrintBindingQuarkList+0x5c>
mov    -0x18(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1050 <fprintf@plt>
jmp    11ac <PrintBindingQuarkList+0x7c>
cmpq   $0x0,-0x20(%rbp)
je     11a7 <PrintBindingQuarkList+0x77>
mov    -0x18(%rbp),%rdi
lea    0xe60(%rip),%rsi
call   1050 <fprintf@plt>
jmp    11ac <PrintBindingQuarkList+0x7c>
mov    0x2e25(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <XrmQuarkToString@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1152 <PrintBindingQuarkList+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintBindingQuarkList>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmpq   $0x0,(%rsi)
je     11ac <PrintBindingQuarkList+0x7c>
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r15
mov    0x2e97(%rip),%rax
mov    (%rax),%r13
xor    %ebx,%ebx
mov    0x2e7b(%rip),%rbp
jmp    118b <PrintBindingQuarkList+0x5b>
nop
mov    %r14,%rsi
call   1050 <fputc@plt>
mov    0x0(%rbp),%r13
mov    (%r12,%rbx,1),%rdi
call   1030 <XrmQuarkToString@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1040 <fputs@plt>
cmpq   $0x0,0x8(%r12,%rbx,1)
lea    0x8(%rbx),%rbx
je     11ac <PrintBindingQuarkList+0x7c>
mov    (%r15,%rbx,1),%rax
mov    $0x2a,%edi
mov    0x2e45(%rip),%rcx
cmp    (%rcx),%rax
je     1160 <PrintBindingQuarkList+0x30>
mov    $0x2e,%edi
test   %r13,%r13
jne    1160 <PrintBindingQuarkList+0x30>
jmp    1168 <PrintBindingQuarkList+0x38>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@False = global i64 0
@XrmBindLoosely = global i64 0
@.str = [2 x i8] c"*\00"
@.str.1 = [2 x i8] c".\00"
@True = global i64 0
define void @PrintBindingQuarkList(i64* %0, i64* %1, i32* %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i32*
%7 = alloca i64
store i64* %0, i64** %4
store i64* %1, i64** %5
store i32* %2, i32** %6
%8 = load i64, i64* @False
store i64 %8, i64* %7
br label %9
9: ; preds = %35, %3
%10 = load i64*, i64** %5
%11 = load i64, i64* %10
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %40
13: ; preds = %9
%14 = load i64*, i64** %4
%15 = load i64, i64* %14
%16 = load i64, i64* @XrmBindLoosely
%17 = icmp eq i64 %15, %16
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = load i32*, i32** %6
%20 = call i32 @fprintf(i32* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %28
21: ; preds = %13
%22 = load i64, i64* %7
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load i32*, i32** %6
%26 = call i32 @fprintf(i32* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %27
27: ; preds = %24, %21
br label %28
28: ; preds = %27, %18
%29 = load i64, i64* @True
store i64 %29, i64* %7
%30 = load i64*, i64** %5
%31 = load i64, i64* %30
%32 = call i32 @XrmQuarkToString(i64 %31)
%33 = load i32*, i32** %6
%34 = call i32 @fputs(i32 %32, i32* %33)
br label %35
35: ; preds = %28
%36 = load i64*, i64** %4
%37 = getelementptr inbounds i64, i64* %36, i32 1
store i64* %37, i64** %4
%38 = load i64*, i64** %5
%39 = getelementptr inbounds i64, i64* %38, i32 1
store i64* %39, i64** %5
br label %9
40: ; preds = %9
ret void
}

LLVM IR (-O2):
@False = global i64 0
@XrmBindLoosely = global i64 0
@True = global i64 0
define void @PrintBindingQuarkList(i64* nocapture %0, i64* nocapture %1, i32* %2) {
%4 = load i64, i64* %1
%5 = icmp eq i64 %4, 0
br i1 %5, label %29, label %6
6: ; preds = %3
%7 = load i64, i64* @False
br label %8
8: ; preds = %6, %20
%9 = phi i64 [ %21, %20 ], [ %7, %6 ]
%10 = phi i64* [ %25, %20 ], [ %0, %6 ]
%11 = phi i64* [ %26, %20 ], [ %1, %6 ]
%12 = load i64, i64* %10
%13 = load i64, i64* @XrmBindLoosely
%14 = icmp eq i64 %12, %13
br i1 %14, label %17, label %15
15: ; preds = %8
%16 = icmp eq i64 %9, 0
br i1 %16, label %20, label %17
17: ; preds = %15, %8
%18 = phi i32 [ 42, %8 ], [ 46, %15 ]
%19 = tail call i32 @fputc(i32 %18, i32* %2)
br label %20
20: ; preds = %17, %15
%21 = load i64, i64* @True
%22 = load i64, i64* %11
%23 = tail call i32 @XrmQuarkToString(i64 %22)
%24 = tail call i32 @fputs(i32 %23, i32* %2)
%25 = getelementptr inbounds i64, i64* %10, i64 1
%26 = getelementptr inbounds i64, i64* %11, i64 1
%27 = load i64, i64* %26
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %8
29: ; preds = %20, %3
ret void
}