#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*/ _readIGXFileHelper(char *, int *, char);
int /*<<< orphan*/ error(char *, char *);
int /*<<< orphan*/ *strstr(char *, char *);
void readIGXFiles(char *ptr_ig, int *q_no_igL, int *q_no_igR) {
  if (strstr(ptr_ig, "%c") == NULL)
    error("IG File '%s' is invalid.  Must contain '%%c'.", ptr_ig);
  _readIGXFileHelper(ptr_ig, q_no_igL, 'L');
  _readIGXFileHelper(ptr_ig, q_no_igR, 'R');
}


x86 assembly (clang, -O0):
<readIGXFiles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
jne    116e <readIGXFiles+0x3e>
mov    -0x8(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <error@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4c,%edx
call   1040 <_readIGXFileHelper@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x52,%edx
call   1040 <_readIGXFileHelper@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readIGXFiles>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xebb(%rip),%rsi
call   1050 <strstr@plt>
test   %rax,%rax
jne    115e <readIGXFiles+0x2e>
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
call   1030 <error@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x4c,%edx
call   1040 <_readIGXFileHelper@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x52,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <_readIGXFileHelper@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [46 x i8] c"IG File '%s' is invalid. Must contain '%%c'.\00"
define void @readIGXFiles(i8* %0, i32* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = call i32* @strstr(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i8*, i8** %4
%12 = call i32 @error(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %3
%14 = load i8*, i8** %4
%15 = load i32*, i32** %5
%16 = call i32 @_readIGXFileHelper(i8* %14, i32* %15, i8 signext 76)
%17 = load i8*, i8** %4
%18 = load i32*, i32** %6
%19 = call i32 @_readIGXFileHelper(i8* %17, i32* %18, i8 signext 82)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [46 x i8] c"IG File '%s' is invalid. Must contain '%%c'.\00"
define void @readIGXFiles(i8* %0, i32* %1, i32* %2) {
%4 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @error(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @_readIGXFileHelper(i8* %0, i32* %1, i8 signext 76)
%10 = tail call i32 @_readIGXFileHelper(i8* %0, i32* %2, i8 signext 82)
ret void
}