#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_SymWCh(unsigned char);
int Platform_Halt(int);
void OPT_OutName(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_SymWCh(ch);
    i += 1;
  } while (!(ch == 0x00));
}


x86 assembly (clang, -O0):
<OPT_OutName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1158 <OPT_OutName+0x38>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1167 <OPT_OutName+0x47>
mov    $0xfffffffe,%edi
call   1030 <Platform_Halt@plt>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
movzbl -0x15(%rbp),%edi
call   1040 <OPM_SymWCh@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movzbl -0x15(%rbp),%eax
cmp    $0x0,%eax
sete   %al
xor    $0xff,%al
test   $0x1,%al
jne    1137 <OPT_OutName+0x17>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPT_OutName>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
jmp    1156 <OPT_OutName+0x36>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%eax
movzbl (%r15,%rax,1),%ebp
mov    %ebp,%edi
call   1040 <OPM_SymWCh@plt>
add    $0x1,%rbx
test   %ebp,%ebp
je     116c <OPT_OutName+0x4c>
mov    %rbx,%rax
cmp    %r14,%rbx
jb     1140 <OPT_OutName+0x20>
mov    $0xfffffffe,%edi
call   1030 <Platform_Halt@plt>
xor    %eax,%eax
jmp    1140 <OPT_OutName+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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