#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*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int /*<<< orphan*/ stderr;
void ReportRerror(char *caller, char *name) {
  static unsigned int draw_error_counter = 0;
  if (draw_error_counter < 8) {
    fprintf(stderr, "%s warning: '%s' not found in shader!\n", caller, name);
    draw_error_counter++;
  } else if (draw_error_counter == 8) {
    fprintf(stderr,
            "%s: Number of error bigger than %i. No more vill be printed.\n",
            caller, 8);
    draw_error_counter++;
  }
}


x86 assembly (clang, -O0):
<ReportRerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x8,0x2f05(%rip)
jae    1160 <ReportRerror+0x50>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xebb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2eda(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ed1(%rip)
jmp    11a1 <ReportRerror+0x91>
cmpl   $0x8,0x2ec5(%rip)
jne    119c <ReportRerror+0x8c>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea6(%rip),%rsi
mov    $0x8,%ecx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e99(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2e90(%rip)
jmp    11a1 <ReportRerror+0x91>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReportRerror>:
push   %rax
mov    %rdi,%rdx
mov    0x2f12(%rip),%eax
cmp    $0x7,%eax
ja     113b <ReportRerror+0x2b>
mov    %rsi,%rcx
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    115c <ReportRerror+0x4c>
cmp    $0x8,%eax
jne    1163 <ReportRerror+0x53>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
mov    $0x8,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
addl   $0x1,0x2ec9(%rip)
pop    %rax
ret

LLVM IR (-O0):
@ReportRerror.draw_error_counter = internal global i32 0
@stderr = global i32 0
@.str = [39 x i8] c"%s warning: '%s' not found in shader!\0A\00"
@.str.1 = [62 x i8] c"%s: Number of error bigger than %i. No more vill be printed.\0A\00"
define void @ReportRerror(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ReportRerror.draw_error_counter
%6 = icmp ult i32 %5, 8
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
%12 = load i32, i32* @ReportRerror.draw_error_counter
%13 = add i32 %12, 1
store i32 %13, i32* @ReportRerror.draw_error_counter
br label %24
14: ; preds = %2
%15 = load i32, i32* @ReportRerror.draw_error_counter
%16 = icmp eq i32 %15, 8
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %3
%20 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i8* %19, i32 8)
%21 = load i32, i32* @ReportRerror.draw_error_counter
%22 = add i32 %21, 1
store i32 %22, i32* @ReportRerror.draw_error_counter
br label %23
23: ; preds = %17, %14
br label %24
24: ; preds = %23, %7
ret void
}

LLVM IR (-O2):
@ReportRerror.draw_error_counter = internal unnamed_addr global i32 0
@stderr = global i32 0
@.str = [39 x i8] c"%s warning: '%s' not found in shader!\0A\00"
@.str.1 = [62 x i8] c"%s: Number of error bigger than %i. No more vill be printed.\0A\00"
define void @ReportRerror(i8* %0, i8* %1) {
%3 = load i32, i32* @ReportRerror.draw_error_counter
%4 = icmp ult i32 %3, 8
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %13
8: ; preds = %2
%9 = icmp eq i32 %3, 8
br i1 %9, label %10, label %16
10: ; preds = %8
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 8)
br label %13
13: ; preds = %5, %10
%14 = load i32, i32* @ReportRerror.draw_error_counter
%15 = add i32 %14, 1
store i32 %15, i32* @ReportRerror.draw_error_counter
br label %16
16: ; preds = %13, %8
ret void
}