#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*/ fflush(int /*<<< orphan*/);
void fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ isspace(int);
int /*<<< orphan*/ stderr;
char *Trim_Leading_Spaces(char *input) {
  char *output = input;
  (output != NULL
       ? (void)1
       : (fprintf(stderr, "DevWaring: at %s: %d",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/pumpkin83/OpenUH-OpenACC/"
                  "refs/heads/master/osprey/libopenmp/omp_util.c",
                  69),
          fprintf(stderr, ("input string is NULL!")), fprintf(stderr, "\n"),
          fflush(stderr), (void)0));
  while ((*output != '\0') && isspace((int)(*output))) {
    output++;
  }
  return output;
}


x86 assembly (clang, -O0):
<Trim_Leading_Spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1154 <Trim_Leading_Spaces+0x24>
jmp    11b3 <Trim_Leading_Spaces+0x83>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
lea    0xeaa(%rip),%rdx
mov    $0x45,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
lea    0xf2f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
lea    0xf2e(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e34(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    11b8 <Trim_Leading_Spaces+0x88>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     11e3 <Trim_Leading_Spaces+0xb3>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    11f3 <Trim_Leading_Spaces+0xc3>
jmp    1204 <Trim_Leading_Spaces+0xd4>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    11b8 <Trim_Leading_Spaces+0x88>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Trim_Leading_Spaces>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %rdi,%rdi
jne    118a <Trim_Leading_Spaces+0x5a>
mov    0x2e9d(%rip),%r14
mov    (%r14),%edi
lea    0xeb3(%rip),%rsi
lea    0xec1(%rip),%rdx
mov    $0x45,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r14),%edi
lea    0xf4c(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r14),%edi
lea    0xf51(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r14),%edi
call   1050 <fflush@plt>
mov    (%rbx),%al
test   %al,%al
je     11a9 <Trim_Leading_Spaces+0x79>
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     11a9 <Trim_Leading_Spaces+0x79>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1190 <Trim_Leading_Spaces+0x60>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"DevWaring: at %s: %d\00"
@.str.1 = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/pumpkin83/OpenUH-OpenACC/refs/heads/master/osprey/libopenmp/omp_util.c\00"
@.str.2 = [22 x i8] c"input string is NULL!\00"
@.str.3 = [2 x i8] c"\0A\00"
define i8* @Trim_Leading_Spaces(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
br label %14
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* @stderr
%11 = load i32, i32* @stderr
%12 = load i32, i32* @stderr
%13 = call i32 @fflush(i32 %12)
br label %14
14: ; preds = %8, %7
br label %15
15: ; preds = %28, %14
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = call i64 @isspace(i32 %23)
%25 = icmp ne i64 %24, 0
br label %26
26: ; preds = %20, %15
%27 = phi i1 [ false, %15 ], [ %25, %20 ]
br i1 %27, label %28, label %31
28: ; preds = %26
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %3
br label %15
31: ; preds = %26
%32 = load i8*, i8** %3
ret i8* %32
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"DevWaring: at %s: %d\00"
@.str.1 = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/pumpkin83/OpenUH-OpenACC/refs/heads/master/osprey/libopenmp/omp_util.c\00"
@.str.2 = [22 x i8] c"input string is NULL!\00"
@.str.3 = [2 x i8] c"\0A\00"
define i8* @Trim_Leading_Spaces(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = load i32, i32* @stderr
tail call void (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.1, i64 0, i64 0), i32 69)
%5 = load i32, i32* @stderr
tail call void (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* @stderr
tail call void (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 @fflush(i32 %7)
br label %9
9: ; preds = %1, %3
%10 = load i8, i8* %0
%11 = icmp eq i8 %10, 0
br i1 %11, label %22, label %12
12: ; preds = %9, %18
%13 = phi i8 [ %20, %18 ], [ %10, %9 ]
%14 = phi i8* [ %19, %18 ], [ %0, %9 ]
%15 = sext i8 %13 to i32
%16 = tail call i64 @isspace(i32 %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %12
%19 = getelementptr inbounds i8, i8* %14, i64 1
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 0
br i1 %21, label %22, label %12
22: ; preds = %12, %18, %9
%23 = phi i8* [ %0, %9 ], [ %19, %18 ], [ %14, %12 ]
ret i8* %23
}