#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*/ _assert(char *, int, char *);
char *strchr(char *, char);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strrchr(char *, char);
void getMessageID(char *idBuffer, char *messageLine) {
  char msg[1000] = {'\0'};
  char *ptrMsg1, *ptrMsg2;
  int length = 0;
  strcpy(msg, messageLine);
  ptrMsg1 = strchr(msg, '<');
  _assert("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/CS4098Group/Project/refs/heads/master/"
          "peos/os/virtual_repository/EMAILseeker.c",
          390, ptrMsg1);
  ptrMsg2 = strrchr(msg, '>');
  _assert("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/CS4098Group/Project/refs/heads/master/"
          "peos/os/virtual_repository/EMAILseeker.c",
          392, ptrMsg2);
  length = ptrMsg2 - ptrMsg1;
  strncpy(idBuffer, ptrMsg1 + 1, length - 1);
  idBuffer[length - 1] = '\0';
}


x86 assembly (clang, -O0):
<getMessageID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x400(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1070 <memset@plt>
movl   $0x0,-0x414(%rbp)
lea    -0x400(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x400(%rbp),%rdi
mov    $0x3c,%esi
call   1050 <strchr@plt>
mov    %rax,-0x408(%rbp)
mov    -0x408(%rbp),%rdx
lea    0xe3a(%rip),%rdi
mov    $0x186,%esi
call   1080 <_assert@plt>
lea    -0x400(%rbp),%rdi
mov    $0x3e,%esi
call   1060 <strrchr@plt>
mov    %rax,-0x410(%rbp)
mov    -0x410(%rbp),%rdx
lea    0xe0a(%rip),%rdi
mov    $0x188,%esi
call   1080 <_assert@plt>
mov    -0x410(%rbp),%rax
mov    -0x408(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x414(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x408(%rbp),%rsi
add    $0x1,%rsi
mov    -0x414(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x414(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMessageID>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3f0,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsp,%r15
mov    $0x3e8,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    %r15,%rdi
mov    $0x3c,%esi
call   1050 <strchr@plt>
mov    %rax,%r13
lea    0xe56(%rip),%r12
mov    %r12,%rdi
mov    $0x186,%esi
mov    %rax,%rdx
call   1080 <_assert@plt>
mov    %r15,%rdi
mov    $0x3e,%esi
call   1060 <strrchr@plt>
mov    %rax,%rbx
mov    %r12,%rdi
mov    $0x188,%esi
mov    %rax,%rdx
call   1080 <_assert@plt>
sub    %r13d,%ebx
add    $0x1,%r13
movslq %ebx,%rbx
lea    -0x1(%rbx),%rdx
mov    %r14,%rdi
mov    %r13,%rsi
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
add    $0x3f0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CS4098Group/Project/refs/heads/master/peos/os/virtual_repository/EMAILseeker.c\00"
define void @getMessageID(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1000 x i8]
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = bitcast [1000 x i8]* %5 to i8*
store i32 0, i32* %8
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%14 = call i8* @strchr(i8* %13, i8 signext 60)
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = call i32 @_assert(i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 390, i8* %15)
%17 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%18 = call i8* @strrchr(i8* %17, i8 signext 62)
store i8* %18, i8** %7
%19 = load i8*, i8** %7
%20 = call i32 @_assert(i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 392, i8* %19)
%21 = load i8*, i8** %7
%22 = load i8*, i8** %6
%23 = ptrtoint i8* %21 to i64
%24 = ptrtoint i8* %22 to i64
%25 = sub i64 %23, %24
%26 = trunc i64 %25 to i32
store i32 %26, i32* %8
%27 = load i8*, i8** %3
%28 = load i8*, i8** %6
%29 = getelementptr inbounds i8, i8* %28, i64 1
%30 = load i32, i32* %8
%31 = sub nsw i32 %30, 1
%32 = call i32 @strncpy(i8* %27, i8* %29, i32 %31)
%33 = load i8*, i8** %3
%34 = load i32, i32* %8
%35 = sub nsw i32 %34, 1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %33, i64 %36
store i8 0, i8* %37
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CS4098Group/Project/refs/heads/master/peos/os/virtual_repository/EMAILseeker.c\00"
define void @getMessageID(i8* %0, i8* %1) {
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %1)
%6 = call i8* @strchr(i8* %4, i8 signext 60)
%7 = call i32 @_assert(i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 390, i8* %6)
%8 = call i8* @strrchr(i8* %4, i8 signext 62)
%9 = call i32 @_assert(i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 392, i8* %8)
%10 = ptrtoint i8* %8 to i64
%11 = ptrtoint i8* %6 to i64
%12 = sub i64 %10, %11
%13 = trunc i64 %12 to i32
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = add nsw i32 %13, -1
%16 = call i32 @strncpy(i8* %0, i8* %14, i32 %15)
%17 = sext i32 %15 to i64
%18 = getelementptr inbounds i8, i8* %0, i64 %17
store i8 0, i8* %18
ret void
}