#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*/ db_clean(char *, char *, int);
int /*<<< orphan*/ db_safe(char *, char *, int);
void cleanString(char *ostr) {
  char *str = ostr;
  while (*str && *str != '\n')
    str++;
  *str = 0;
  char temp[500];
  db_clean(temp, ostr, 250);
  db_safe(ostr, temp, 250);
}


x86 assembly (clang, -O0):
<cleanString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x211(%rbp)
je     1162 <cleanString+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x211(%rbp)
mov    -0x211(%rbp),%al
test   $0x1,%al
jne    1175 <cleanString+0x55>
jmp    1186 <cleanString+0x66>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <cleanString+0x17>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xfa,%edx
call   1030 <db_clean@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rsi
mov    $0xfa,%edx
call   1040 <db_safe@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanString>:
push   %r14
push   %rbx
sub    $0x1f8,%rsp
mov    %rdi,%rbx
mov    %rdi,%rax
movzbl (%rax),%ecx
test   %cl,%cl
je     1142 <cleanString+0x22>
cmp    $0xa,%cl
je     1142 <cleanString+0x22>
add    $0x1,%rax
jmp    1130 <cleanString+0x10>
movb   $0x0,(%rax)
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xfa,%edx
call   1030 <db_clean@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfa,%edx
call   1040 <db_safe@plt>
add    $0x1f8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @cleanString(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [500 x i8]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
br label %6
6: ; preds = %18, %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 10
br label %16
16: ; preds = %11, %6
%17 = phi i1 [ false, %6 ], [ %15, %11 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %6
21: ; preds = %16
%22 = load i8*, i8** %3
store i8 0, i8* %22
%23 = getelementptr inbounds [500 x i8], [500 x i8]* %4, i64 0, i64 0
%24 = load i8*, i8** %2
%25 = call i32 @db_clean(i8* %23, i8* %24, i32 250)
%26 = load i8*, i8** %2
%27 = getelementptr inbounds [500 x i8], [500 x i8]* %4, i64 0, i64 0
%28 = call i32 @db_safe(i8* %26, i8* %27, i32 250)
ret void
}

LLVM IR (-O2):
define void @cleanString(i8* %0) {
%2 = alloca [500 x i8]
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %0, %1 ], [ %7, %6 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 10, label %8
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %3
store i8 0, i8* %4
%9 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 0
%10 = call i32 @db_clean(i8* %9, i8* %0, i32 250)
%11 = call i32 @db_safe(i8* %0, i8* %9, i32 250)
ret void
}