#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 */
char *strchr(char *, int);
char *delete_ppd_comment(char *line) {
  char *p;
  p = strchr(line, '%');
  if (p)
    *p = 0;
  p = strchr(line, 0x0a);
  if (p)
    *p = 0;
  p = strchr(line, 0x0d);
  if (p)
    *p = 0;
  p = strchr(line, 0x0c);
  if (p)
    *p = 0;
  if (line[0] == 0)
    return NULL;
  return line;
}


x86 assembly (clang, -O0):
<delete_ppd_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x25,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1140 <delete_ppd_comment+0x30>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1164 <delete_ppd_comment+0x54>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    $0xd,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1188 <delete_ppd_comment+0x78>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    $0xc,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11ac <delete_ppd_comment+0x9c>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11c9 <delete_ppd_comment+0xb9>
movq   $0x0,-0x8(%rbp)
jmp    11d1 <delete_ppd_comment+0xc1>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_ppd_comment>:
push   %rbx
mov    %rdi,%rbx
mov    $0x25,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1126 <delete_ppd_comment+0x16>
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113b <delete_ppd_comment+0x2b>
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1150 <delete_ppd_comment+0x40>
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1165 <delete_ppd_comment+0x55>
movb   $0x0,(%rax)
xor    %eax,%eax
cmpb   $0x0,(%rbx)
cmovne %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @delete_ppd_comment(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strchr(i8* %5, i32 37)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %4
store i8 0, i8* %10
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
%13 = call i8* @strchr(i8* %12, i32 10)
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = load i8*, i8** %4
store i8 0, i8* %17
br label %18
18: ; preds = %16, %11
%19 = load i8*, i8** %3
%20 = call i8* @strchr(i8* %19, i32 13)
store i8* %20, i8** %4
%21 = load i8*, i8** %4
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = load i8*, i8** %4
store i8 0, i8* %24
br label %25
25: ; preds = %23, %18
%26 = load i8*, i8** %3
%27 = call i8* @strchr(i8* %26, i32 12)
store i8* %27, i8** %4
%28 = load i8*, i8** %4
%29 = icmp ne i8* %28, null
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = load i8*, i8** %4
store i8 0, i8* %31
br label %32
32: ; preds = %30, %25
%33 = load i8*, i8** %3
%34 = getelementptr inbounds i8, i8* %33, i64 0
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %32
store i8* null, i8** %2
br label %41
39: ; preds = %32
%40 = load i8*, i8** %3
store i8* %40, i8** %2
br label %41
41: ; preds = %39, %38
%42 = load i8*, i8** %2
ret i8* %42
}

LLVM IR (-O2):
define i8* @delete_ppd_comment(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 37)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
%6 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 10)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %5
store i8 0, i8* %6
br label %9
9: ; preds = %8, %5
%10 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 13)
%11 = icmp eq i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %9
store i8 0, i8* %10
br label %13
13: ; preds = %12, %9
%14 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 12)
%15 = icmp eq i8* %14, null
br i1 %15, label %17, label %16
16: ; preds = %13
store i8 0, i8* %14
br label %17
17: ; preds = %16, %13
%18 = load i8, i8* %0
%19 = icmp eq i8 %18, 0
%20 = select i1 %19, i8* null, i8* %0
ret i8* %20
}