const char *GetCRDelineatedString(const char *psStripFileRef,
                                  const char *psStripStringRef, int iIndex) {
  static char sTemp[256];
  const char *psList = UI_GetStripEdString(psStripFileRef, psStripStringRef);
  char *p;
  while (iIndex--) {
    psList = strchr(psList, '\n');
    if (!psList) {
      return ((void *)0);
    }
    psList++;
  }
  strcpy(sTemp, psList);
  p = strchr(sTemp, '\n');
  if (p) {
    *p = '\0';
  }
  return sTemp;
}


x86 assembly (clang, -O0):
<GetCRDelineatedString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1050 <UI_GetStripEdString@plt>
cltq
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
je     11a7 <GetCRDelineatedString+0x77>
mov    -0x28(%rbp),%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1196 <GetCRDelineatedString+0x66>
movq   $0x0,-0x8(%rbp)
jmp    11e9 <GetCRDelineatedString+0xb9>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1158 <GetCRDelineatedString+0x28>
mov    -0x28(%rbp),%rsi
lea    0x2e9e(%rip),%rdi
call   1030 <strcpy@plt>
lea    0x2e92(%rip),%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     11de <GetCRDelineatedString+0xae>
mov    -0x30(%rbp),%rax
movb   $0x0,(%rax)
lea    0x2e6b(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetCRDelineatedString>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
xor    %eax,%eax
call   1050 <UI_GetStripEdString@plt>
cltq
test   %ebp,%ebp
je     116d <GetCRDelineatedString+0x3d>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1194 <GetCRDelineatedString+0x64>
add    $0xffffffff,%ebp
add    $0x1,%rax
test   %ebp,%ebp
jne    1150 <GetCRDelineatedString+0x20>
lea    0x2edc(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1194 <GetCRDelineatedString+0x64>
movb   $0x0,(%rax)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@GetCRDelineatedString.sTemp = internal global [256 x i8] zeroinitializer
define i8* @GetCRDelineatedString(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @UI_GetStripEdString to i32 (i8*, i8*, ...)*)(i8* %10, i8* %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %8
br label %15
15: ; preds = %25, %3
%16 = load i32, i32* %7
%17 = add nsw i32 %16, -1
store i32 %17, i32* %7
%18 = icmp ne i32 %16, 0
br i1 %18, label %19, label %28
19: ; preds = %15
%20 = load i8*, i8** %8
%21 = call i8* @strchr(i8* %20, i32 10)
store i8* %21, i8** %8
%22 = load i8*, i8** %8
%23 = icmp ne i8* %22, null
br i1 %23, label %25, label %24
24: ; preds = %19
store i8* null, i8** %4
br label %37
25: ; preds = %19
%26 = load i8*, i8** %8
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %8
br label %15
28: ; preds = %15
%29 = load i8*, i8** %8
%30 = call i8* @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @GetCRDelineatedString.sTemp, i64 0, i64 0), i8* %29)
%31 = call i8* @strchr(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @GetCRDelineatedString.sTemp, i64 0, i64 0), i32 10)
store i8* %31, i8** %9
%32 = load i8*, i8** %9
%33 = icmp ne i8* %32, null
br i1 %33, label %34, label %36
34: ; preds = %28
%35 = load i8*, i8** %9
store i8 0, i8* %35
br label %36
36: ; preds = %34, %28
store i8* getelementptr inbounds ([256 x i8], [256 x i8]* @GetCRDelineatedString.sTemp, i64 0, i64 0), i8** %4
br label %37
37: ; preds = %36, %24
%38 = load i8*, i8** %4
ret i8* %38
}

LLVM IR (-O2):
@GetCRDelineatedString.sTemp = internal global [256 x i8] zeroinitializer
define i8* @GetCRDelineatedString(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @UI_GetStripEdString to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i32 %2, 0
br i1 %7, label %17, label %10
8: ; preds = %10
%9 = icmp eq i32 %13, 0
br i1 %9, label %17, label %10
10: ; preds = %3, %8
%11 = phi i32 [ %13, %8 ], [ %2, %3 ]
%12 = phi i8* [ %16, %8 ], [ %6, %3 ]
%13 = add nsw i32 %11, -1
%14 = tail call i8* @strchr(i8* dereferenceable(1) %12, i32 10)
%15 = icmp eq i8* %14, null
%16 = getelementptr inbounds i8, i8* %14, i64 1
br i1 %15, label %23, label %8
17: ; preds = %8, %3
%18 = phi i8* [ %6, %3 ], [ %16, %8 ]
%19 = tail call i8* @strcpy(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @GetCRDelineatedString.sTemp, i64 0, i64 0), i8* dereferenceable(1) %18)
%20 = tail call i8* @strchr(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @GetCRDelineatedString.sTemp, i64 0, i64 0), i32 10)
%21 = icmp eq i8* %20, null
br i1 %21, label %23, label %22
22: ; preds = %17
store i8 0, i8* %20
br label %23
23: ; preds = %10, %17, %22
%24 = phi i8* [ getelementptr inbounds ([256 x i8], [256 x i8]* @GetCRDelineatedString.sTemp, i64 0, i64 0), %22 ], [ getelementptr inbounds ([256 x i8], [256 x i8]* @GetCRDelineatedString.sTemp, i64 0, i64 0), %17 ], [ null, %10 ]
ret i8* %24
}