#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 size_t uint32_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, size_t);
char *strstr(char *, char *);
char *get_file_entry(char **p_file_lines, uint32_t lines, char *name) {
  for (uint32_t i = 0; i < lines; ++i) {
    if (strstr(p_file_lines[i], name) == p_file_lines[i]) {
      char *pC = &p_file_lines[i][0];
      while (*(pC++) != ':')
        ;
      while (*pC == ' ')
        pC++;
      if (*pC == '\n' || *pC == '\r') {
        printf("Illegal info file syntax at entry %s (line %d)\n", name, i);
        exit(1);
      }
      return pC;
    }
  }
  return NULL;
}


x86 assembly (clang, -O0):
<get_file_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1238 <get_file_entry+0x108>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <strstr@plt>
mov    -0x10(%rbp),%rcx
mov    -0x28(%rbp),%rdx
cmp    (%rcx,%rdx,8),%rax
jne    1222 <get_file_entry+0xf2>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
movsbl (%rax),%eax
cmp    $0x3a,%eax
je     11b1 <get_file_entry+0x81>
jmp    1191 <get_file_entry+0x61>
jmp    11b6 <get_file_entry+0x86>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    11d7 <get_file_entry+0xa7>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    11b6 <get_file_entry+0x86>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     11f7 <get_file_entry+0xc7>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    1215 <get_file_entry+0xe5>
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xdfa(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1240 <get_file_entry+0x110>
jmp    1227 <get_file_entry+0xf7>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    114c <get_file_entry+0x1c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_entry>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1190 <get_file_entry+0x50>
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r13
mov    %rdx,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbp
xor    %r15d,%r15d
nopw   0x0(%rax,%rax,1)
mov    0x0(%r13,%r15,8),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
call   1030 <strncmp@plt>
test   %eax,%eax
je     11a0 <get_file_entry+0x60>
add    $0x1,%r15
cmp    %r15,%r12
jne    1170 <get_file_entry+0x30>
xor    %ebx,%ebx
jmp    11c3 <get_file_entry+0x83>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x3a,(%rbx)
lea    0x1(%rbx),%rbx
jne    11a0 <get_file_entry+0x60>
jmp    11b4 <get_file_entry+0x74>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x20,%al
je     11b0 <get_file_entry+0x70>
cmp    $0xa,%al
je     11d5 <get_file_entry+0x95>
cmp    $0xd,%al
je     11d5 <get_file_entry+0x95>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe24(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Illegal info file syntax at entry %s (line %d)\0A\00"
define i8* @get_file_entry(i8** %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
store i8** %0, i8*** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 0, i64* %8
br label %10
10: ; preds = %66, %3
%11 = load i64, i64* %8
%12 = load i64, i64* %6
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %69
14: ; preds = %10
%15 = load i8**, i8*** %5
%16 = load i64, i64* %8
%17 = getelementptr inbounds i8*, i8** %15, i64 %16
%18 = load i8*, i8** %17
%19 = load i8*, i8** %7
%20 = call i8* @strstr(i8* %18, i8* %19)
%21 = load i8**, i8*** %5
%22 = load i64, i64* %8
%23 = getelementptr inbounds i8*, i8** %21, i64 %22
%24 = load i8*, i8** %23
%25 = icmp eq i8* %20, %24
br i1 %25, label %26, label %65
26: ; preds = %14
%27 = load i8**, i8*** %5
%28 = load i64, i64* %8
%29 = getelementptr inbounds i8*, i8** %27, i64 %28
%30 = load i8*, i8** %29
%31 = getelementptr inbounds i8, i8* %30, i64 0
store i8* %31, i8** %9
br label %32
32: ; preds = %38, %26
%33 = load i8*, i8** %9
%34 = getelementptr inbounds i8, i8* %33, i32 1
store i8* %34, i8** %9
%35 = load i8, i8* %33
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %36, 58
br i1 %37, label %38, label %39
38: ; preds = %32
br label %32
39: ; preds = %32
br label %40
40: ; preds = %45, %39
%41 = load i8*, i8** %9
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 32
br i1 %44, label %45, label %48
45: ; preds = %40
%46 = load i8*, i8** %9
%47 = getelementptr inbounds i8, i8* %46, i32 1
store i8* %47, i8** %9
br label %40
48: ; preds = %40
%49 = load i8*, i8** %9
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %51, 10
br i1 %52, label %58, label %53
53: ; preds = %48
%54 = load i8*, i8** %9
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 13
br i1 %57, label %58, label %63
58: ; preds = %53, %48
%59 = load i8*, i8** %7
%60 = load i64, i64* %8
%61 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %59, i64 %60)
%62 = call i32 @exit(i32 1)
unreachable
63: ; preds = %53
%64 = load i8*, i8** %9
store i8* %64, i8** %4
br label %70
65: ; preds = %14
br label %66
66: ; preds = %65
%67 = load i64, i64* %8
%68 = add i64 %67, 1
store i64 %68, i64* %8
br label %10
69: ; preds = %10
store i8* null, i8** %4
br label %70
70: ; preds = %69, %63
%71 = load i8*, i8** %4
ret i8* %71
}

LLVM IR (-O2):
@.str = [48 x i8] c"Illegal info file syntax at entry %s (line %d)\0A\00"
define i8* @get_file_entry(i8** nocapture %0, i64 %1, i8* %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %29, label %5
5: ; preds = %3
%6 = tail call i64 @strlen(i8* dereferenceable(1) %2)
br label %7
7: ; preds = %5, %26
%8 = phi i64 [ 0, %5 ], [ %27, %26 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @strncmp(i8* %10, i8* %2, i64 %6)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %26
13: ; preds = %7, %13
%14 = phi i8* [ %15, %13 ], [ %10, %7 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %14
%17 = icmp eq i8 %16, 58
br i1 %17, label %18, label %13
18: ; preds = %13, %21
%19 = phi i8* [ %22, %21 ], [ %15, %13 ]
%20 = load i8, i8* %19
switch i8 %20, label %29 [
i8 32, label %21
i8 10, label %23
i8 13, label %23
]
21: ; preds = %18
%22 = getelementptr inbounds i8, i8* %19, i64 1
br label %18
23: ; preds = %18, %18
%24 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %2, i64 %8)
%25 = tail call i32 @exit(i32 1)
unreachable
26: ; preds = %7
%27 = add nuw i64 %8, 1
%28 = icmp eq i64 %27, %1
br i1 %28, label %29, label %7
29: ; preds = %26, %18, %3
%30 = phi i8* [ null, %3 ], [ %19, %18 ], [ null, %26 ]
ret i8* %30
}