#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 int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *, ...);
void add_filter(FILE *js, char boeknaam[], char hoofdstuk[], char verzen[]) {
  if (verzen == NULL)
    fprintf(js,
            "AkelPad.TextReplace(0, \"^[\\\\^] [^0-9]+[0-9]{1,2} [(]%s "
            "%s[)][^\\\\n]+\\\\n\", \"\", 0x00280005, true);\n",
            boeknaam, hoofdstuk);
  else
    fprintf(js,
            "AkelPad.TextReplace(0, \"^[\\\\^] [^0-9]+[0-9]{1,2} [(]%s "
            "%s:%s[)][^\\\\n]+\\\\n\", \"\", 0x00280005, true);\n",
            boeknaam, hoofdstuk, verzen);
}


x86 assembly (clang, -O0):
<add_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1152 <add_filter+0x42>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeba(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1170 <add_filter+0x60>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xef8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_filter>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
test   %r8,%r8
je     112c <add_filter+0x1c>
lea    0xf3c(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
lea    0xecd(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [97 x i8] c"AkelPad.TextReplace(0, \22^[\\\\^] [^0-9]+[0-9]{1,2} [(]%s %s[)][^\\\\n]+\\\\n\22, \22\22, 0x00280005, true);\0A\00"
@.str.1 = [100 x i8] c"AkelPad.TextReplace(0, \22^[\\\\^] [^0-9]+[0-9]{1,2} [(]%s %s:%s[)][^\\\\n]+\\\\n\22, \22\22, 0x00280005, true);\0A\00"
define void @add_filter(i32* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = load i32*, i32** %5
%13 = load i8*, i8** %6
%14 = load i8*, i8** %7
%15 = call i32 (i32*, i8*, i8*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14)
br label %22
16: ; preds = %4
%17 = load i32*, i32** %5
%18 = load i8*, i8** %6
%19 = load i8*, i8** %7
%20 = load i8*, i8** %8
%21 = call i32 (i32*, i8*, i8*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.1, i64 0, i64 0), i8* %18, i8* %19, i8* %20)
br label %22
22: ; preds = %16, %11
ret void
}

LLVM IR (-O2):
@.str = [97 x i8] c"AkelPad.TextReplace(0, \22^[\\\\^] [^0-9]+[0-9]{1,2} [(]%s %s[)][^\\\\n]+\\\\n\22, \22\22, 0x00280005, true);\0A\00"
@.str.1 = [100 x i8] c"AkelPad.TextReplace(0, \22^[\\\\^] [^0-9]+[0-9]{1,2} [(]%s %s:%s[)][^\\\\n]+\\\\n\22, \22\22, 0x00280005, true);\0A\00"
define void @add_filter(i32* nocapture %0, i8* %1, i8* %2, i8* %3) {
%5 = icmp eq i8* %3, null
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 (i32*, i8*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
br label %10
8: ; preds = %4
%9 = tail call i32 (i32*, i8*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
br label %10
10: ; preds = %8, %6
ret void
}