#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 uint8_t;

/* Variables and functions */
void logLineSanitize(uint8_t *str) {
  int k = 0;
  while (*str) {
    if (*str < 0x08 || (*str > 0x0D && *str < 0x20)) {
      *str = '?';
      k++;
    }
    str++;
  }
  return;
}


x86 assembly (clang, -O0):
<logLineSanitize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     1167 <logLineSanitize+0x67>
mov    -0x8(%rbp),%rax
cmpl   $0x8,(%rax)
jl     1143 <logLineSanitize+0x43>
mov    -0x8(%rbp),%rax
cmpl   $0xd,(%rax)
jle    1156 <logLineSanitize+0x56>
mov    -0x8(%rbp),%rax
cmpl   $0x20,(%rax)
jge    1156 <logLineSanitize+0x56>
mov    -0x8(%rbp),%rax
movl   $0x3f,(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <logLineSanitize+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<logLineSanitize>:
mov    (%rdi),%eax
test   %eax,%eax
je     1130 <logLineSanitize+0x30>
add    $0x4,%rdi
jmp    1121 <logLineSanitize+0x21>
nopl   0x0(%rax)
movl   $0x3f,-0x4(%rdi)
mov    (%rdi),%eax
add    $0x4,%rdi
test   %eax,%eax
je     1130 <logLineSanitize+0x30>
cmp    $0x8,%eax
jl     1110 <logLineSanitize+0x10>
add    $0xfffffff2,%eax
cmp    $0x11,%eax
ja     1117 <logLineSanitize+0x17>
jmp    1110 <logLineSanitize+0x10>
ret

LLVM IR (-O0):
define void @logLineSanitize(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %24, %1
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %27
8: ; preds = %4
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = icmp slt i32 %10, 8
br i1 %11, label %20, label %12
12: ; preds = %8
%13 = load i32*, i32** %2
%14 = load i32, i32* %13
%15 = icmp sgt i32 %14, 13
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = load i32*, i32** %2
%18 = load i32, i32* %17
%19 = icmp slt i32 %18, 32
br i1 %19, label %20, label %24
20: ; preds = %16, %8
%21 = load i32*, i32** %2
store i32 63, i32* %21
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %24
24: ; preds = %20, %16, %12
%25 = load i32*, i32** %2
%26 = getelementptr inbounds i32, i32* %25, i32 1
store i32* %26, i32** %2
br label %4
27: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @logLineSanitize(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i32 [ %14, %12 ], [ %2, %1 ]
%6 = phi i32* [ %13, %12 ], [ %0, %1 ]
%7 = icmp slt i32 %5, 8
%8 = add i32 %5, -14
%9 = icmp ult i32 %8, 18
%10 = or i1 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %4
store i32 63, i32* %6
br label %12
12: ; preds = %4, %11
%13 = getelementptr inbounds i32, i32* %6, i64 1
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret void
}