#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 *extract_simple(char *line) {
  char *ret;
  char buffer[256] = {0};
  uint32_t i;
  for (i = 2; i < 256 && line[i] != 0x00; ++i)
    buffer[i - 2] = line[i];
  if (((ret) = strdup(buffer)) == 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",
                        190);
    }
  };
  return ret;
}


x86 assembly (clang, -O0):
<extract_simple>:
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   $0x2,-0x114(%rbp)
xor    %eax,%eax
cmpl   $0x100,-0x114(%rbp)
mov    %al,-0x115(%rbp)
jge    118f <extract_simple+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x114(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x115(%rbp)
mov    -0x115(%rbp),%al
test   $0x1,%al
jne    11a2 <extract_simple+0x72>
jmp    11d6 <extract_simple+0xa6>
mov    -0x8(%rbp),%rax
movslq -0x114(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x114(%rbp),%eax
sub    $0x2,%eax
cltq
mov    %cl,-0x110(%rbp,%rax,1)
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    115c <extract_simple+0x2c>
lea    -0x110(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1208 <extract_simple+0xd8>
lea    0xe09(%rip),%rdi
lea    0xe36(%rip),%rsi
mov    $0xbe,%edx
call   1030 <runtime_exception@plt>
mov    -0x10(%rbp),%rax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_simple>:
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
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x2(%rdi,%rax,1),%ecx
test   %cl,%cl
je     11c5 <extract_simple+0xa5>
mov    %cl,(%rsp,%rax,1)
movzbl 0x3(%rdi,%rax,1),%ecx
test   %cl,%cl
je     11c5 <extract_simple+0xa5>
mov    %cl,0x1(%rsp,%rax,1)
add    $0x2,%rax
cmp    $0xfe,%rax
jne    11a0 <extract_simple+0x80>
mov    %rsp,%rdi
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    11ed <extract_simple+0xcd>
lea    0xe24(%rip),%rdi
lea    0xe51(%rip),%rsi
mov    $0xbe,%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* @extract_simple(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [256 x i8]
%5 = alloca i32
store i8* %0, i8** %2
%6 = bitcast [256 x i8]* %4 to i8*
store i32 2, i32* %5
br label %7
7: ; preds = %30, %1
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 256
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i8*, i8** %2
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %10, %7
%19 = phi i1 [ false, %7 ], [ %17, %10 ]
br i1 %19, label %20, label %33
20: ; preds = %18
%21 = load i8*, i8** %2
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = load i32, i32* %5
%27 = sub nsw i32 %26, 2
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %28
store i8 %25, i8* %29
br label %30
30: ; preds = %20
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %7
33: ; preds = %18
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%35 = call i8* @strdup(i8* %34)
store i8* %35, i8** %3
%36 = icmp eq i8* %35, null
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = 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 190)
br label %39
39: ; preds = %37, %33
%40 = load i8*, i8** %3
ret i8* %40
}

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* @extract_simple(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 = %16, %1
%5 = phi i64 [ 2, %1 ], [ %19, %16 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %21, label %9
9: ; preds = %4
%10 = add nsw i64 %5, -2
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %10
store i8 %7, i8* %11
%12 = or i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %21, label %16
16: ; preds = %9
%17 = add nsw i64 %5, -1
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %17
store i8 %14, i8* %18
%19 = add nuw nsw i64 %5, 2
%20 = icmp eq i64 %19, 256
br i1 %20, label %21, label %4
21: ; preds = %16, %9, %4
%22 = call i8* @strdup(i8* %3)
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = 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 190)
br label %26
26: ; preds = %24, %21
ret i8* %22
}