#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*/ OPM_FPrint(long long *, int);
int Platform_Halt(int);
void OPT_FPrintName(long long *fp, unsigned char *name, long long name__len) {
  int i;
  unsigned char ch;
  i = 0;
  do {
    ch = name[(((unsigned long long)(i) < (unsigned long long)(name__len))
                   ? i
                   : (Platform_Halt(-2), 0))];
    OPM_FPrint(&*fp, (int)ch);
    i += 1;
  } while (!(ch == 0x00));
}


x86 assembly (clang, -O0):
<OPT_FPrintName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    115c <OPT_FPrintName+0x3c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    116b <OPT_FPrintName+0x4b>
mov    $0xfffffffe,%edi
call   1040 <Platform_Halt@plt>
xor    %eax,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1d(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x1d(%rbp),%esi
call   1030 <OPM_FPrint@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movzbl -0x1d(%rbp),%eax
cmp    $0x0,%eax
sete   %al
xor    $0xff,%al
test   $0x1,%al
jne    113b <OPT_FPrintName+0x1b>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPT_FPrintName>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %ebx,%ebx
jmp    1159 <OPT_FPrintName+0x39>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,%eax
movzbl (%r15,%rax,1),%ebp
mov    %r12,%rdi
mov    %ebp,%esi
call   1030 <OPM_FPrint@plt>
add    $0x1,%rbx
test   %ebp,%ebp
je     116f <OPT_FPrintName+0x4f>
mov    %rbx,%rax
cmp    %r14,%rbx
jb     1140 <OPT_FPrintName+0x20>
mov    $0xfffffffe,%edi
call   1040 <Platform_Halt@plt>
xor    %eax,%eax
jmp    1140 <OPT_FPrintName+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @OPT_FPrintName(i64* %0, i8* %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8
store i64* %0, i64** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i32 0, i32* %7
br label %9
9: ; preds = %30, %3
%10 = load i8*, i8** %5
%11 = load i32, i32* %7
%12 = sext i32 %11 to i64
%13 = load i64, i64* %6
%14 = icmp ult i64 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = load i32, i32* %7
br label %19
17: ; preds = %9
%18 = call i32 @Platform_Halt(i32 -2)
br label %19
19: ; preds = %17, %15
%20 = phi i32 [ %16, %15 ], [ 0, %17 ]
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %10, i64 %21
%23 = load i8, i8* %22
store i8 %23, i8* %8
%24 = load i64*, i64** %4
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = call i32 @OPM_FPrint(i64* %24, i32 %26)
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %30
30: ; preds = %19
%31 = load i8, i8* %8
%32 = zext i8 %31 to i32
%33 = icmp eq i32 %32, 0
%34 = xor i1 %33, true
br i1 %34, label %9, label %35
35: ; preds = %30
ret void
}

LLVM IR (-O2):
define void @OPT_FPrintName(i64* %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i64 [ %16, %9 ], [ 0, %3 ]
%6 = icmp ult i64 %5, %2
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @Platform_Halt(i32 -2)
br label %9
9: ; preds = %4, %7
%10 = phi i64 [ 0, %7 ], [ %5, %4 ]
%11 = and i64 %10, 4294967295
%12 = getelementptr inbounds i8, i8* %1, i64 %11
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = tail call i32 @OPM_FPrint(i64* %0, i32 %14)
%16 = add nuw i64 %5, 1
%17 = icmp eq i8 %13, 0
br i1 %17, label %18, label %4
18: ; preds = %9
ret void
}