#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 *, int);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void fprint_decimal_and_dots(FILE *f, unsigned char *p, unsigned char *e) {
  while (p < e) {
    fprintf(f, "%d", (int)(*p++));
    if (p < e)
      fputc('.', f);
  }
}


x86 assembly (clang, -O0):
<fprint_decimal_and_dots>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1185 <fprint_decimal_and_dots+0x65>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%edx
lea    0xea1(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1180 <fprint_decimal_and_dots+0x60>
mov    -0x8(%rbp),%rsi
mov    $0x2e,%edi
call   1030 <fputc@plt>
jmp    1134 <fprint_decimal_and_dots+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_decimal_and_dots>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
cmp    %rdx,%rsi
jae    117d <fprint_decimal_and_dots+0x5d>
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rdx,%r13
sub    %rsi,%r13
add    $0x1,%rbx
lea    0xeb8(%rip),%r12
jmp    115a <fprint_decimal_and_dots+0x3a>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
add    $0xffffffffffffffff,%r13
je     117d <fprint_decimal_and_dots+0x5d>
movzbl -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <fprintf@plt>
cmp    %r14,%rbx
jae    1150 <fprint_decimal_and_dots+0x30>
mov    $0x2e,%edi
mov    %r15,%rsi
call   1030 <fputc@plt>
jmp    1150 <fprint_decimal_and_dots+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @fprint_decimal_and_dots(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 = %24, %3
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = icmp ult i8* %8, %9
br i1 %10, label %11, label %25
11: ; preds = %7
%12 = load i32*, i32** %4
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %5
%15 = load i8, i8* %13
%16 = zext i8 %15 to i32
%17 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i8*, i8** %5
%19 = load i8*, i8** %6
%20 = icmp ult i8* %18, %19
br i1 %20, label %21, label %24
21: ; preds = %11
%22 = load i32*, i32** %4
%23 = call i32 @fputc(i8 signext 46, i32* %22)
br label %24
24: ; preds = %21, %11
br label %7
25: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @fprint_decimal_and_dots(i32* nocapture %0, i8* %1, i8* readnone %2) {
%4 = icmp ult i8* %1, %2
br i1 %4, label %5, label %21
5: ; preds = %3
%6 = ptrtoint i8* %2 to i64
%7 = ptrtoint i8* %1 to i64
%8 = sub i64 %6, %7
%9 = getelementptr i8, i8* %1, i64 %8
br label %10
10: ; preds = %5, %19
%11 = phi i8* [ %12, %19 ], [ %1, %5 ]
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %11
%14 = zext i8 %13 to i32
%15 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = icmp ult i8* %12, %2
br i1 %16, label %17, label %19
17: ; preds = %10
%18 = tail call i32 @fputc(i8 signext 46, i32* %0)
br label %19
19: ; preds = %17, %10
%20 = icmp eq i8* %12, %9
br i1 %20, label %21, label %10
21: ; preds = %19, %3
ret void
}