#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*/ strlen(char *);
scalar_t__ strncmp(char const *, char *, int /*<<< orphan*/);
void skip_comment(const char *line, size_t *line_offset) {
  if (strncmp(line + *line_offset, "#", strlen("#")) == 0) {
    for (; line[*line_offset] != '\0'; ++*line_offset) {
      if (line[*line_offset] == '\n') {
        return;
      }
    }
  }
}


x86 assembly (clang, -O0):
<skip_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    (%rcx),%rax
mov    %rax,-0x18(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
lea    0xea8(%rip),%rsi
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11be <skip_comment+0x9e>
jmp    116c <skip_comment+0x4c>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     11b9 <skip_comment+0x99>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    11a1 <skip_comment+0x81>
jmp    11be <skip_comment+0x9e>
jmp    11a6 <skip_comment+0x86>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    116c <skip_comment+0x4c>
jmp    11be <skip_comment+0x9e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_comment>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rsi),%r15
add    %rdi,%r15
lea    0xec5(%rip),%r12
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1161 <skip_comment+0x41>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    (%r14),%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rax
movzbl -0x1(%rbx,%rax,1),%ecx
test   %cl,%cl
je     1155 <skip_comment+0x35>
cmp    $0xa,%cl
je     1155 <skip_comment+0x35>
mov    %rax,(%r14)
jmp    1170 <skip_comment+0x50>

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

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