int main(void) {
  const char forbidden_strings[][256] = {"abc", "123"};
  char text[] = "bc abcwiw23 123 hf abc1 sfoj21oabc23";
  char number_as_string[] = "-2348.231";
  double number = string_to_double(number_as_string);
  applyCensorship(text, forbidden_strings);
  printf("Censored text:\n%s\n\n", text);
  printf("Number as double:\n%lf\n\n", number);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x260,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1050 <memset@plt>
movb   $0x61,-0x210(%rbp)
movb   $0x62,-0x20f(%rbp)
movb   $0x63,-0x20e(%rbp)
movb   $0x31,-0x110(%rbp)
movb   $0x32,-0x10f(%rbp)
movb   $0x33,-0x10e(%rbp)
lea    -0x240(%rbp),%rdi
lea    0xe53(%rip),%rsi
mov    $0x25,%edx
call   1060 <memcpy@plt>
mov    0xe67(%rip),%rax
mov    %rax,-0x24a(%rbp)
mov    0xe61(%rip),%ax
mov    %ax,-0x242(%rbp)
lea    -0x24a(%rbp),%rdi
mov    $0x0,%al
call   1070 <string_to_double@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x258(%rbp)
ff
lea    -0x240(%rbp),%rdi
lea    -0x210(%rbp),%rsi
mov    $0x0,%al
call   1030 <applyCensorship@plt>
lea    -0x240(%rbp),%rsi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x258(%rbp),%xmm0
ff
lea    0xe1d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x260,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x258,%rsp
lea    0x50(%rsp),%r14
mov    $0x200,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
movw   $0x6261,0x50(%rsp)
movb   $0x63,0x52(%rsp)
movw   $0x3231,0x150(%rsp)
movb   $0x33,0x152(%rsp)
33
movaps 0xe8d(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe71(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movabs $0x33326362616f31,%rax
mov    %rax,0x3d(%rsp)
movabs $0x33322e383433322d,%rax
2e 32 33
mov    %rax,0x8(%rsp)
movw   $0x31,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1060 <string_to_double@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x18(%rsp)
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <applyCensorship@plt>
lea    0xe44(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe47(%rip),%rdi
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x258,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.text = [37 x i8] c"bc abcwiw23 123 hf abc1 sfoj21oabc23\00"
@__const.main.number_as_string = [10 x i8] c"-2348.231\00"
@.str = [20 x i8] c"Censored text:\0A%s\0A\0A\00"
@.str.1 = [24 x i8] c"Number as double:\0A%lf\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x [256 x i8]]
%3 = alloca [37 x i8]
%4 = alloca [10 x i8]
%5 = alloca double
store i32 0, i32* %1
%6 = bitcast [2 x [256 x i8]]* %2 to i8*
%7 = bitcast i8* %6 to [2 x [256 x i8]]*
%8 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %7, i32 0, i32 0
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i32 0, i32 0
store i8 97, i8* %9
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i32 0, i32 1
store i8 98, i8* %10
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i32 0, i32 2
store i8 99, i8* %11
%12 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %7, i32 0, i32 1
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i32 0, i32 0
store i8 49, i8* %13
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i32 0, i32 1
store i8 50, i8* %14
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i32 0, i32 2
store i8 51, i8* %15
%16 = bitcast [37 x i8]* %3 to i8*
%17 = bitcast [10 x i8]* %4 to i8*
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @string_to_double to i32 (i8*, ...)*)(i8* %18)
%20 = sitofp i32 %19 to double
store double %20, double* %5
%21 = getelementptr inbounds [37 x i8], [37 x i8]* %3, i64 0, i64 0
%22 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %2, i64 0, i64 0
%23 = call i32 (i8*, [256 x i8]*, ...) bitcast (i32 (...)* @applyCensorship to i32 (i8*, [256 x i8]*, ...)*)(i8* %21, [256 x i8]* %22)
%24 = getelementptr inbounds [37 x i8], [37 x i8]* %3, i64 0, i64 0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = load double, double* %5
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %26)
ret i32 0
}

LLVM IR (-O2):
@__const.main.text = [37 x i8] c"bc abcwiw23 123 hf abc1 sfoj21oabc23\00"
@__const.main.number_as_string = [10 x i8] c"-2348.231\00"
@.str = [20 x i8] c"Censored text:\0A%s\0A\0A\00"
@.str.1 = [24 x i8] c"Number as double:\0A%lf\0A\0A\00"
define i32 @main() {
%1 = alloca [2 x [256 x i8]]
%2 = alloca [37 x i8]
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 0
store i8 97, i8* %4
%5 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 1
store i8 98, i8* %5
%6 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 2
store i8 99, i8* %6
%7 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 0
store i8 49, i8* %7
%8 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 1
store i8 50, i8* %8
%9 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 2
store i8 51, i8* %9
%10 = getelementptr inbounds [37 x i8], [37 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @string_to_double to i32 (i8*, ...)*)(i8* %11)
%13 = sitofp i32 %12 to double
%14 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0
%15 = call i32 (i8*, [256 x i8]*, ...) bitcast (i32 (...)* @applyCensorship to i32 (i8*, [256 x i8]*, ...)*)(i8* %10, [256 x i8]* %14)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %10)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %13)
ret i32 0
}