#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 *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void print_clean(FILE *out, char *s) {
  for (; s && *s; ++s) {
    if (*s == '\t')
      fprintf(out, "        ");
    else
      fputc(*s, out);
  }
}


x86 assembly (clang, -O0):
<print_clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1150 <print_clean+0x30>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1160 <print_clean+0x40>
jmp    11ad <print_clean+0x8d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    1185 <print_clean+0x65>
mov    -0x8(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1197 <print_clean+0x77>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
jmp    119c <print_clean+0x7c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <print_clean+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_clean>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1175 <print_clean+0x55>
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xec9(%rip),%r15
jmp    1159 <print_clean+0x39>
nopl   0x0(%rax)
mov    $0x8,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r14,%rcx
call   1040 <fwrite@plt>
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x9,%al
je     1140 <print_clean+0x20>
test   %al,%al
je     1175 <print_clean+0x55>
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0x1,%rbx
jmp    1159 <print_clean+0x39>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c" \00"
define void @print_clean(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %29, %2
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br label %13
13: ; preds = %8, %5
%14 = phi i1 [ false, %5 ], [ %12, %8 ]
br i1 %14, label %15, label %32
15: ; preds = %13
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 9
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i32*, i32** %3
%22 = call i32 @fprintf(i32* %21, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %28
23: ; preds = %15
%24 = load i8*, i8** %4
%25 = load i8, i8* %24
%26 = load i32*, i32** %3
%27 = call i32 @fputc(i8 signext %25, i32* %26)
br label %28
28: ; preds = %23, %20
br label %29
29: ; preds = %28
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %4
br label %5
32: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c" \00"
define void @print_clean(i32* nocapture %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %13, label %4
4: ; preds = %2, %11
%5 = phi i8* [ %12, %11 ], [ %1, %2 ]
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %13
i8 9, label %7
]
7: ; preds = %4
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 8, i64 1, i32* %0)
br label %11
9: ; preds = %4
%10 = tail call i32 @fputc(i8 signext %6, i32* %0)
br label %11
11: ; preds = %7, %9
%12 = getelementptr inbounds i8, i8* %5, i64 1
br label %4
13: ; preds = %4, %2
ret void
}