#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 uint32_t;

/* Variables and functions */
int /*<<< orphan*/ runtime_exception(char *, char *, int);
char *strdup(char *);
char *poash_data_extract(char *line) {
  char *ret;
  char swapL[256] = {0};
  uint32_t i, j, good;
  for (i = j = good = 0; i < 256 && line[i] != 0x00; ++i) {
    if (line[i] == '#') {
      if (good == 0) {
        good = 1;
        continue;
      } else {
        break;
      }
    }
    if (good)
      swapL[j++] = line[i];
  }
  if (((ret) = strdup(swapL)) == NULL) {
    {
      runtime_exception("damn, unable to allocate memory [FILE: %s LINE: %u]",
                        "/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/evilaliv3/"
                        "janus/refs/heads/master/src/os_cmds.c",
                        131);
    }
  };
  return ret;
}


x86 assembly (clang, -O0):
<poash_data_extract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
movl   $0x0,-0x11c(%rbp)
movl   $0x0,-0x118(%rbp)
movl   $0x0,-0x114(%rbp)
xor    %eax,%eax
cmpl   $0x100,-0x114(%rbp)
mov    %al,-0x11d(%rbp)
jge    11a3 <poash_data_extract+0x73>
mov    -0x8(%rbp),%rax
movslq -0x114(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11d(%rbp)
mov    -0x11d(%rbp),%al
test   $0x1,%al
jne    11b6 <poash_data_extract+0x86>
jmp    123d <poash_data_extract+0x10d>
mov    -0x8(%rbp),%rax
movslq -0x114(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x23,%eax
jne    11ef <poash_data_extract+0xbf>
cmpl   $0x0,-0x11c(%rbp)
jne    11ea <poash_data_extract+0xba>
movl   $0x1,-0x11c(%rbp)
jmp    1229 <poash_data_extract+0xf9>
jmp    123d <poash_data_extract+0x10d>
cmpl   $0x0,-0x11c(%rbp)
je     1224 <poash_data_extract+0xf4>
mov    -0x8(%rbp),%rax
movslq -0x114(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x118(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x118(%rbp)
cltq
mov    %cl,-0x110(%rbp,%rax,1)
jmp    1229 <poash_data_extract+0xf9>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    1170 <poash_data_extract+0x40>
lea    -0x110(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    126f <poash_data_extract+0x13f>
lea    0xda2(%rip),%rdi
lea    0xdcf(%rip),%rsi
mov    $0x83,%edx
call   1030 <runtime_exception@plt>
mov    -0x10(%rbp),%rax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poash_data_extract>:
push   %rbx
sub    $0x100,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
xor    %eax,%eax
xor    %edx,%edx
xor    %ecx,%ecx
jmp    11b6 <poash_data_extract+0x96>
nopw   0x0(%rax,%rax,1)
mov    $0x1,%edx
test   %sil,%sil
je     1210 <poash_data_extract+0xf0>
add    $0x2,%rax
cmp    $0x100,%rax
je     1210 <poash_data_extract+0xf0>
movzbl (%rdi,%rax,1),%ebx
cmp    $0x23,%bl
je     11e0 <poash_data_extract+0xc0>
test   %bl,%bl
je     1210 <poash_data_extract+0xf0>
test   %edx,%edx
je     120b <poash_data_extract+0xeb>
movslq %ecx,%rdx
add    $0x1,%ecx
mov    %bl,(%rsp,%rdx,1)
jmp    11e4 <poash_data_extract+0xc4>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %edx,%edx
jne    1210 <poash_data_extract+0xf0>
xor    %esi,%esi
movzbl 0x1(%rdi,%rax,1),%ebx
cmp    $0x23,%bl
je     11a0 <poash_data_extract+0x80>
test   %bl,%bl
je     1210 <poash_data_extract+0xf0>
xor    %edx,%edx
test   %sil,%sil
jne    11aa <poash_data_extract+0x8a>
movslq %ecx,%rdx
add    $0x1,%ecx
mov    %bl,(%rsp,%rdx,1)
mov    $0x1,%edx
jmp    11aa <poash_data_extract+0x8a>
mov    $0x1,%sil
jmp    11e6 <poash_data_extract+0xc6>
mov    %rsp,%rdi
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1238 <poash_data_extract+0x118>
lea    0xdd9(%rip),%rdi
lea    0xe06(%rip),%rsi
mov    $0x83,%edx
call   1030 <runtime_exception@plt>
mov    %rbx,%rax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"damn, unable to allocate memory [FILE: %s LINE: %u]\00"
@.str.1 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/evilaliv3/janus/refs/heads/master/src/os_cmds.c\00"
define i8* @poash_data_extract(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [256 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %2
%8 = bitcast [256 x i8]* %4 to i8*
store i32 0, i32* %7
store i32 0, i32* %6
store i32 0, i32* %5
br label %9
9: ; preds = %49, %1
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 256
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i8*, i8** %2
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %12, %9
%21 = phi i1 [ false, %9 ], [ %19, %12 ]
br i1 %21, label %22, label %52
22: ; preds = %20
%23 = load i8*, i8** %2
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 35
br i1 %29, label %30, label %35
30: ; preds = %22
%31 = load i32, i32* %7
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %30
store i32 1, i32* %7
br label %49
34: ; preds = %30
br label %52
35: ; preds = %22
%36 = load i32, i32* %7
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %48
38: ; preds = %35
%39 = load i8*, i8** %2
%40 = load i32, i32* %5
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %39, i64 %41
%43 = load i8, i8* %42
%44 = load i32, i32* %6
%45 = add nsw i32 %44, 1
store i32 %45, i32* %6
%46 = sext i32 %44 to i64
%47 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %46
store i8 %43, i8* %47
br label %48
48: ; preds = %38, %35
br label %49
49: ; preds = %48, %33
%50 = load i32, i32* %5
%51 = add nsw i32 %50, 1
store i32 %51, i32* %5
br label %9
52: ; preds = %34, %20
%53 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%54 = call i8* @strdup(i8* %53)
store i8* %54, i8** %3
%55 = icmp eq i8* %54, null
br i1 %55, label %56, label %58
56: ; preds = %52
%57 = call i32 @runtime_exception(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 131)
br label %58
58: ; preds = %56, %52
%59 = load i8*, i8** %3
ret i8* %59
}

LLVM IR (-O2):
@.str = [52 x i8] c"damn, unable to allocate memory [FILE: %s LINE: %u]\00"
@.str.1 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/evilaliv3/janus/refs/heads/master/src/os_cmds.c\00"
define noalias i8* @poash_data_extract(i8* nocapture %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %30, %1
%5 = phi i64 [ 0, %1 ], [ %33, %30 ]
%6 = phi i32 [ 0, %1 ], [ %32, %30 ]
%7 = phi i32 [ 0, %1 ], [ %31, %30 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %5
%9 = load i8, i8* %8
switch i8 %9, label %12 [
i8 0, label %35
i8 35, label %10
]
10: ; preds = %4
%11 = icmp eq i32 %6, 0
br i1 %11, label %18, label %35
12: ; preds = %4
%13 = icmp eq i32 %6, 0
br i1 %13, label %18, label %14
14: ; preds = %12
%15 = add nsw i32 %7, 1
%16 = sext i32 %7 to i64
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %16
store i8 %9, i8* %17
br label %18
18: ; preds = %10, %12, %14
%19 = phi i32 [ %15, %14 ], [ %7, %12 ], [ %7, %10 ]
%20 = phi i1 [ false, %14 ], [ true, %12 ], [ false, %10 ]
%21 = or i64 %5, 1
%22 = getelementptr inbounds i8, i8* %0, i64 %21
%23 = load i8, i8* %22
switch i8 %23, label %25 [
i8 0, label %35
i8 35, label %24
]
24: ; preds = %18
br i1 %20, label %30, label %35
25: ; preds = %18
br i1 %20, label %30, label %26
26: ; preds = %25
%27 = add nsw i32 %19, 1
%28 = sext i32 %19 to i64
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %28
store i8 %23, i8* %29
br label %30
30: ; preds = %26, %25, %24
%31 = phi i32 [ %27, %26 ], [ %19, %25 ], [ %19, %24 ]
%32 = phi i32 [ 1, %26 ], [ 0, %25 ], [ 1, %24 ]
%33 = add nuw nsw i64 %5, 2
%34 = icmp eq i64 %33, 256
br i1 %34, label %35, label %4
35: ; preds = %30, %24, %18, %4, %10
%36 = call i8* @strdup(i8* %3)
%37 = icmp eq i8* %36, null
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = tail call i32 @runtime_exception(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 131)
br label %40
40: ; preds = %38, %35
ret i8* %36
}