#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 */
char *dynamic_fgets(int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
char *rm_first_spaces(char *);
char *get_single_line_without_first_spaces(FILE *fp, char **gotstr, int *line) {
  char *ptr;
  for (;;) {
    if ((*gotstr = dynamic_fgets(fp)) == NULL) {
      return (NULL);
    }
    (*line)++;
    ptr = rm_first_spaces(*gotstr);
    if (*ptr != '#' && *ptr != '\0') {
      return (ptr);
    }
    free(*gotstr);
  }
}


x86 assembly (clang, -O0):
<get_single_line_without_first_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <dynamic_fgets@plt>
mov    -0x18(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    116b <get_single_line_without_first_spaces+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    11c4 <get_single_line_without_first_spaces+0x94>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1040 <rm_first_spaces@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     11b3 <get_single_line_without_first_spaces+0x83>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11b3 <get_single_line_without_first_spaces+0x83>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11c4 <get_single_line_without_first_spaces+0x94>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
jmp    1144 <get_single_line_without_first_spaces+0x14>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_single_line_without_first_spaces>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
jmp    114b <get_single_line_without_first_spaces+0x1b>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1050 <dynamic_fgets@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     1172 <get_single_line_without_first_spaces+0x42>
addl   $0x1,(%r14)
mov    %rax,%rdi
call   1040 <rm_first_spaces@plt>
movzbl (%rax),%ecx
cmp    $0x23,%cl
je     1140 <get_single_line_without_first_spaces+0x10>
test   %cl,%cl
je     1140 <get_single_line_without_first_spaces+0x10>
jmp    1174 <get_single_line_without_first_spaces+0x44>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @get_single_line_without_first_spaces(i32* %0, i8** nocapture %1, i32* nocapture %2) {
%4 = tail call i8* @dynamic_fgets(i32* %0)
store i8* %4, i8** %1
%5 = icmp eq i8* %4, null
br i1 %5, label %17, label %6
6: ; preds = %3, %12
%7 = phi i8* [ %15, %12 ], [ %4, %3 ]
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
%10 = tail call i8* @rm_first_spaces(i8* %7)
%11 = load i8, i8* %10
switch i8 %11, label %17 [
i8 35, label %12
i8 0, label %12
]
12: ; preds = %6, %6
%13 = load i8*, i8** %1
%14 = tail call i32 @free(i8* %13)
%15 = tail call i8* @dynamic_fgets(i32* %0)
store i8* %15, i8** %1
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %6
17: ; preds = %12, %6, %3
%18 = phi i8* [ null, %3 ], [ %10, %6 ], [ null, %12 ]
ret i8* %18
}