#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*/ atol(char *);
char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
void AnnotationDump(FILE *HelpFile, long FileLength, char *name) {
  long l;
  printf("Annotation %s for topic 0x%08lx:\n", name, atol(name));
  for (l = 0; l < FileLength; l++)
    putchar(getc(HelpFile));
  putchar('\n');
}


x86 assembly (clang, -O0):
<AnnotationDump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <atol@plt>
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    11af <AnnotationDump+0x6f>
mov    -0x8(%rbp),%rdi
call   1060 <getc@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    117f <AnnotationDump+0x3f>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AnnotationDump>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rdx,%rdi
call   1050 <atol@plt>
lea    0xea3(%rip),%rdi
mov    %r15,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
test   %rbx,%rbx
jle    1186 <AnnotationDump+0x46>
nopl   0x0(%rax)
mov    %r14,%rdi
call   1060 <getc@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
jne    1170 <AnnotationDump+0x30>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Annotation %s for topic 0x%08lx:\0A\00"
define void @AnnotationDump(i32* %0, i64 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @atol(i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %10)
store i64 0, i64* %7
br label %12
12: ; preds = %20, %3
%13 = load i64, i64* %7
%14 = load i64, i64* %5
%15 = icmp slt i64 %13, %14
br i1 %15, label %16, label %23
16: ; preds = %12
%17 = load i32*, i32** %4
%18 = call signext i8 @getc(i32* %17)
%19 = call i32 @putchar(i8 signext %18)
br label %20
20: ; preds = %16
%21 = load i64, i64* %7
%22 = add nsw i64 %21, 1
store i64 %22, i64* %7
br label %12
23: ; preds = %12
%24 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Annotation %s for topic 0x%08lx:\0A\00"
define void @AnnotationDump(i32* nocapture %0, i64 %1, i8* %2) {
%4 = tail call i32 @atol(i8* %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %4)
%6 = icmp sgt i64 %1, 0
br i1 %6, label %7, label %13
7: ; preds = %3, %7
%8 = phi i64 [ %11, %7 ], [ 0, %3 ]
%9 = tail call signext i8 @getc(i32* %0)
%10 = tail call i32 @putchar(i8 signext %9)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %7
13: ; preds = %7, %3
%14 = tail call i32 @putchar(i8 signext 10)
ret void
}