#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void _write_auto_types_xrefs(FILE *f, char **auto_types,
                             char *found_auto_types) {
  while (*auto_types) {
    if (*found_auto_types) {
      *found_auto_types = 0;
      fprintf(f, "@xref{%s}.@*\n", *auto_types);
    }
    auto_types++;
    found_auto_types++;
  }
}


x86 assembly (clang, -O0):
<_write_auto_types_xrefs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     117a <_write_auto_types_xrefs+0x6a>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     115d <_write_auto_types_xrefs+0x4d>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xea8(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <_write_auto_types_xrefs+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write_auto_types_xrefs>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
cmpq   $0x0,(%rsi)
je     116a <_write_auto_types_xrefs+0x5a>
mov    %rdx,%r14
mov    %rsi,%r13
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xecf(%rip),%r12
jmp    114c <_write_auto_types_xrefs+0x3c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpq   $0x0,0x8(%r13,%rbx,8)
lea    0x1(%rbx),%rbx
je     116a <_write_auto_types_xrefs+0x5a>
cmpb   $0x0,(%r14,%rbx,1)
je     1140 <_write_auto_types_xrefs+0x30>
movb   $0x0,(%r14,%rbx,1)
mov    0x0(%r13,%rbx,8),%rdx
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <fprintf@plt>
jmp    1140 <_write_auto_types_xrefs+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"@xref{%s}.@*\0A\00"
define void @_write_auto_types_xrefs(i32* nocapture %0, i8** nocapture %1, i8* nocapture %2) {
%4 = load i8*, i8** %1
%5 = icmp eq i8* %4, null
br i1 %5, label %19, label %6
6: ; preds = %3, %14
%7 = phi i8* [ %16, %14 ], [ %2, %3 ]
%8 = phi i8** [ %15, %14 ], [ %1, %3 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %6
store i8 0, i8* %7
%12 = load i8*, i8** %8
%13 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %6
%15 = getelementptr inbounds i8*, i8** %8, i64 1
%16 = getelementptr inbounds i8, i8* %7, i64 1
%17 = load i8*, i8** %15
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %6
19: ; preds = %14, %3
ret void
}