#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 EOF;
char input();
char *strdup(char *);
void SingleLineComment(char **ret_string) {
  char c;
  do {
    c = input();
  } while (c != '\n' && c != EOF);
  if (ret_string) {
    *ret_string = strdup("comment");
  }
}


x86 assembly (clang, -O0):
<SingleLineComment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <input@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0xa(%rbp)
je     115e <SingleLineComment+0x3e>
movsbl -0x9(%rbp),%eax
mov    0x2e95(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    112c <SingleLineComment+0xc>
cmpq   $0x0,-0x8(%rbp)
je     118a <SingleLineComment+0x6a>
lea    0xe85(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SingleLineComment>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2eba(%rip),%rbx
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <input@plt>
cmp    $0xa,%al
je     113f <SingleLineComment+0x1f>
cmp    (%rbx),%al
jne    1130 <SingleLineComment+0x10>
test   %r14,%r14
je     1153 <SingleLineComment+0x33>
lea    0xeb5(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i8 0
@.str = [8 x i8] c"comment\00"
define void @SingleLineComment(i8** writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call signext i8 (...) @input()
%4 = icmp ne i8 %3, 10
%5 = load i8, i8* @EOF
%6 = icmp ne i8 %3, %5
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %2, label %8
8: ; preds = %2
%9 = icmp eq i8** %0, null
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = tail call dereferenceable_or_null(8) i8* @strdup(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i8* %11, i8** %0
br label %12
12: ; preds = %10, %8
ret void
}