#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*/ free(char *);
char *get_line(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int skip_comment_lines(char **line) {
  if ((*line = get_line(stdin)) == NULL)
    return -1;
  while ((**line == '*') || (**line == '\0')) {
    free(*line);
    if ((*line = get_line(stdin)) == NULL)
      return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<skip_comment_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <get_line@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    1157 <skip_comment_lines+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    11da <skip_comment_lines+0xba>
jmp    115c <skip_comment_lines+0x3c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x2a,%ecx
mov    %al,-0x11(%rbp)
je     1187 <skip_comment_lines+0x67>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1197 <skip_comment_lines+0x77>
jmp    11d3 <skip_comment_lines+0xb3>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
call   1040 <get_line@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    11ce <skip_comment_lines+0xae>
movl   $0xffffffff,-0x4(%rbp)
jmp    11da <skip_comment_lines+0xba>
jmp    115c <skip_comment_lines+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_comment_lines>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2eba(%rip),%rbp
mov    0x0(%rbp),%edi
call   1040 <get_line@plt>
mov    %rax,(%rbx)
mov    $0xffffffff,%r14d
jmp    1163 <skip_comment_lines+0x43>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1030 <free@plt>
mov    0x0(%rbp),%edi
call   1040 <get_line@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     1177 <skip_comment_lines+0x57>
movzbl (%rax),%ecx
cmp    $0x2a,%cl
je     1150 <skip_comment_lines+0x30>
test   %cl,%cl
je     1150 <skip_comment_lines+0x30>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @skip_comment_lines(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = load i32, i32* @stdin
%5 = call i8* @get_line(i32 %4)
%6 = load i8**, i8*** %3
store i8* %5, i8** %6
%7 = icmp eq i8* %5, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %35
9: ; preds = %1
br label %10
10: ; preds = %33, %9
%11 = load i8**, i8*** %3
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 42
br i1 %15, label %22, label %16
16: ; preds = %10
%17 = load i8**, i8*** %3
%18 = load i8*, i8** %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 0
br label %22
22: ; preds = %16, %10
%23 = phi i1 [ true, %10 ], [ %21, %16 ]
br i1 %23, label %24, label %34
24: ; preds = %22
%25 = load i8**, i8*** %3
%26 = load i8*, i8** %25
%27 = call i32 @free(i8* %26)
%28 = load i32, i32* @stdin
%29 = call i8* @get_line(i32 %28)
%30 = load i8**, i8*** %3
store i8* %29, i8** %30
%31 = icmp eq i8* %29, null
br i1 %31, label %32, label %33
32: ; preds = %24
store i32 -1, i32* %2
br label %35
33: ; preds = %24
br label %10
34: ; preds = %22
store i32 0, i32* %2
br label %35
35: ; preds = %34, %32, %8
%36 = load i32, i32* %2
ret i32 %36
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @skip_comment_lines(i8** nocapture %0) {
%2 = load i32, i32* @stdin
%3 = tail call i8* @get_line(i32 %2)
store i8* %3, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %13, label %5
5: ; preds = %1, %8
%6 = phi i8* [ %11, %8 ], [ %3, %1 ]
%7 = load i8, i8* %6
switch i8 %7, label %13 [
i8 42, label %8
i8 0, label %8
]
8: ; preds = %5, %5
%9 = tail call i32 @free(i8* %6)
%10 = load i32, i32* @stdin
%11 = tail call i8* @get_line(i32 %10)
store i8* %11, i8** %0
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %5
13: ; preds = %5, %8, %1
%14 = phi i32 [ -1, %1 ], [ 0, %5 ], [ -1, %8 ]
ret i32 %14
}