LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/identify/identifyz.c
// Function: smooth
static void
smooth()
    {
    int i;
    for (i = 4; i < windowSize-4; ++i)
        {
        window[i] = (
            32*window[i-4] + 24*window[i-3] + 8*window[i-2] + 4*window[i-1] +
            window[i] +
            4*window[i+3] + 2*window[i+2]
            ) / 75;
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x4, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl 0x6c18(%rip), %ecx      # 0x98dc
subl $0x4, %ecx
cmpl %ecx, %eax
jge 0x2d8e
movq 0x6c0a(%rip), %rax      # 0x98e0
movl -0x4(%rbp), %ecx
subl $0x4, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
shll $0x5, %eax
movq 0x6bf4(%rip), %rcx      # 0x98e0
movl -0x4(%rbp), %edx
subl $0x3, %edx
movslq %edx, %rdx
imull $0x18, (%rcx,%rdx,4), %ecx
addl %ecx, %eax
movq 0x6bde(%rip), %rcx      # 0x98e0
movl -0x4(%rbp), %edx
subl $0x2, %edx
movslq %edx, %rdx
movl (%rcx,%rdx,4), %ecx
shll $0x3, %ecx
addl %ecx, %eax
movq 0x6bc6(%rip), %rcx      # 0x98e0
movl -0x4(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movl (%rcx,%rdx,4), %ecx
shll $0x2, %ecx
addl %ecx, %eax
movq 0x6bae(%rip), %rcx      # 0x98e0
movslq -0x4(%rbp), %rdx
addl (%rcx,%rdx,4), %eax
movq 0x6ba0(%rip), %rcx      # 0x98e0
movl -0x4(%rbp), %edx
addl $0x3, %edx
movslq %edx, %rdx
movl (%rcx,%rdx,4), %ecx
shll $0x2, %ecx
addl %ecx, %eax
movq 0x6b88(%rip), %rcx      # 0x98e0
movl -0x4(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
movl (%rcx,%rdx,4), %ecx
shll %ecx
addl %ecx, %eax
movl $0x4b, %ecx
cltd
idivl %ecx
movl %eax, %edx
movq 0x6b67(%rip), %rax      # 0x98e0
movslq -0x4(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x2cbb
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/w4kfu[P]HommI/Icn/icn.c
// Function: openicn
struct icn *openicn(char *filename)
{
	struct icn *newicn = NULL;
	FILE *fin = NULL;

	if (!filename)
		return NULL;

	if (!(fin = fopen(filename, "rb")))
	{
		perror("fopen()");
		return NULL;
	}
	if (!(newicn = malloc(sizeof (struct icn))))
	{
		perror("malloc()");
		fclose(fin);
		return NULL;
	}
	fseek(fin, 0, SEEK_END);
        newicn->filesize = ftell(fin);
        fseek(fin, 0, SEEK_SET);
	if (!(newicn->data = malloc(sizeof (char) * newicn->filesize)))
	{
		perror("malloc()");
		fclose(fin);
		free(newicn);
		return NULL;
	}
	if (fread(newicn->data, 1, newicn->filesize, fin) != newicn->filesize)
	{
		perror("fread()");
		fclose(fin);
		free(newicn);
		free(newicn->data);
		return NULL;
	}
	if (((*(unsigned int*)newicn->data + 2) != newicn->filesize) && !icnfillentry(newicn))
	{
		fclose(fin);
		free(newicn);
		free(newicn->data);
		return NULL;
	}
	fclose(fin);
	return newicn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x1840
movq $0x0, -0x8(%rbp)
jmp 0x19e5
movq -0x10(%rbp), %rdi
leaq 0x188b(%rip), %rsi      # 0x30d6
callq 0x1160
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x1873
leaq 0x17a6(%rip), %rdi      # 0x3007
callq 0x1170
movq $0x0, -0x8(%rbp)
jmp 0x19e5
movl $0x20, %edi
callq 0x1130
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x18a9
leaq 0x184b(%rip), %rdi      # 0x30d9
callq 0x1170
movq -0x20(%rbp), %rdi
callq 0x1070
movq $0x0, -0x8(%rbp)
jmp 0x19e5
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x1140
movq -0x20(%rbp), %rdi
callq 0x10f0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x1140
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, %edi
shlq $0x0, %rdi
callq 0x1130
movq -0x18(%rbp), %rcx
movq %rax, 0x10(%rcx)
cmpq $0x0, %rax
jne 0x1927
leaq 0x17d6(%rip), %rdi      # 0x30d9
callq 0x1170
movq -0x20(%rbp), %rdi
callq 0x1070
movq -0x18(%rbp), %rdi
callq 0x1040
movq $0x0, -0x8(%rbp)
jmp 0x19e5
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, %edx
movq -0x20(%rbp), %rcx
movl $0x1, %esi
callq 0x1050
movq -0x18(%rbp), %rcx
movl 0x18(%rcx), %ecx
cmpq %rcx, %rax
je 0x1987
leaq 0x1789(%rip), %rdi      # 0x30e2
callq 0x1170
movq -0x20(%rbp), %rdi
callq 0x1070
movq -0x18(%rbp), %rdi
callq 0x1040
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1040
movq $0x0, -0x8(%rbp)
jmp 0x19e5
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl (%rax), %eax
addl $0x2, %eax
movq -0x18(%rbp), %rcx
cmpl 0x18(%rcx), %eax
je 0x19d4
movq -0x18(%rbp), %rdi
callq 0x19f0
cmpl $0x0, %eax
jne 0x19d4
movq -0x20(%rbp), %rdi
callq 0x1070
movq -0x18(%rbp), %rdi
callq 0x1040
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1040
movq $0x0, -0x8(%rbp)
jmp 0x19e5
movq -0x20(%rbp), %rdi
callq 0x1070
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/w4kfu[P]HommI/Icn/icn.c
// Function: icnfillentry
int icnfillentry(struct icn *icn)
{
	unsigned int i;

	if (!icn)
		return 0;

	icn->numentry = *(unsigned short*)icn->data;
	if (!(icn->entry = malloc(sizeof (struct icn) * icn->numentry)))
	{
		perror("malloc()");
		return 0;
	}
	for (i = 0; i < icn->numentry; i++)
	{
		memcpy(&icn->entry[i], icn->data + 2 + 4 + i * sizeof (struct icnentry), sizeof (struct icnentry));
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x1a0f
movl $0x0, -0x4(%rbp)
jmp 0x1aad
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movw (%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, (%rax)
movq -0x10(%rbp), %rax
movzwl (%rax), %eax
movl %eax, %edi
shlq $0x5, %rdi
callq 0x1130
movq -0x10(%rbp), %rcx
movq %rax, 0x8(%rcx)
cmpq $0x0, %rax
jne 0x1a56
leaq 0x1691(%rip), %rdi      # 0x30d9
callq 0x1170
movl $0x0, -0x4(%rbp)
jmp 0x1aad
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
movzwl (%rcx), %ecx
cmpl %ecx, %eax
jae 0x1aa6
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x14(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x14(%rbp), %edx
imulq $0xc, %rdx, %rdx
movq 0x6(%rcx,%rdx), %rsi
movq %rsi, (%rax)
movl 0xe(%rcx,%rdx), %ecx
movl %ecx, 0x8(%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1a5d
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/w4kfu[P]HommI/Icn/icn.c
// Function: closeicn
void closeicn(struct icn *icn)
{
	if (icn)
	{
		if (icn->entry)
			free(icn->entry);
		if (icn->data)
			free(icn->data);
		free(icn);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1b0c
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1aeb
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1040
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x1b03
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1040
movq -0x8(%rbp), %rdi
callq 0x1040
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/w4kfu[P]HommI/Icn/icn.c
// Function: printicninfo
void printicninfo(struct icn *icn)
{
	unsigned int i;

	if (!icn)
		return;

	printf("NumEntry = %X\n", icn->numentry);
	for (i = 0; i < icn->numentry; i++)
	{
		printf("Width = %X\n", icn->entry[i].width);
		printf("Height = %X\n", icn->entry[i].height);
		printf("Offset = %X\n", icn->entry[i].offset);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x1b38
jmp 0x1bdb
movq -0x8(%rbp), %rax
movzwl (%rax), %esi
leaq 0x15a4(%rip), %rdi      # 0x30ea
movb $0x0, %al
callq 0x1090
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
cmpl %ecx, %eax
jae 0x1bdb
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0xc(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %esi
leaq 0x157a(%rip), %rdi      # 0x30f9
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0xc(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movzwl 0x6(%rax), %esi
leaq 0x1562(%rip), %rdi      # 0x3105
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0xc(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %esi
leaq 0x154c(%rip), %rdi      # 0x3112
movb $0x0, %al
callq 0x1090
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x1b54
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/w4kfu[P]HommI/Icn/icn.c
// Function: icngetmaxwidth
int icngetmaxwidth(struct icn *icn)
{
	unsigned int width = 0;
	unsigned int i;

	if (!icn)
		return width;

	for (i = 0; i < icn->numentry; i++)
	{
		if (icn->entry[i].width > width)
			width = icn->entry[i].width;
	}
	return width;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x1c0e
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1c6a
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
movzwl (%rcx), %ecx
cmpl %ecx, %eax
jae 0x1c64
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x18(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %eax
cmpl -0x14(%rbp), %eax
jbe 0x1c57
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x18(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %eax
movl %eax, -0x14(%rbp)
jmp 0x1c59
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1c15
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/w4kfu[P]HommI/Icn/icn.c
// Function: icngetmaxheight
int icngetmaxheight(struct icn *icn)
{
	unsigned int height = 0;
	unsigned int i;

	if (!icn)
		return height;

	for (i = 0; i < icn->numentry; i++)
	{
		if (icn->entry[i].height > height)
			height = icn->entry[i].height;
	}
	return height;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x1c8e
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1cea
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
movzwl (%rcx), %ecx
cmpl %ecx, %eax
jae 0x1ce4
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x18(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movzwl 0x6(%rax), %eax
cmpl -0x14(%rbp), %eax
jbe 0x1cd7
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x18(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movzwl 0x6(%rax), %eax
movl %eax, -0x14(%rbp)
jmp 0x1cd9
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1c95
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/openshmem-org[P]openshmem-examples/c/fcollect32.c
// Function: show_dst
static void
show_dst(char *tag)
{
    int i;
    printf("%8s: dst[%d/%d] = ", tag, me, npes);
    for (i = 0; i < DST_SIZE; i += 1) {
        printf("%d ", dst[i]);
    }
    printf("\n");
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rsi
movl 0x2df0(%rip), %edx      # 0x4084
movl 0x2de6(%rip), %ecx      # 0x4080
leaq 0xd69(%rip), %rdi       # 0x200a
movb $0x0, %al
callq 0x1030
movl $0x0, 0xc(%rsp)
cmpl $0x80, 0xc(%rsp)
jge 0x12e4
movslq 0xc(%rsp), %rcx
leaq 0x2dea(%rip), %rax      # 0x40b0
movl (%rax,%rcx,4), %esi
leaq 0xd4d(%rip), %rdi       # 0x201d
movb $0x0, %al
callq 0x1030
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x12b0
leaq 0xd36(%rip), %rdi       # 0x2021
movb $0x0, %al
callq 0x1030
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/tcpstream.c
// Function: fTCPStream_MaxFlow
void fTCPStream_MaxFlow(u32 MaxFlow)
{
	s_StreamMax = MaxFlow;
	s_Stream    = (TCPStream_t**)malloc( s_StreamMax * sizeof(TCPStream_t*));
	memset(s_Stream, 0, s_StreamMax * sizeof(TCPStream_t*));
	fprintf(stderr, "TCP Flow Max: %i\n", MaxFlow);
}

// Assembly:
pushq %rax
movl %edi, 0x4(%rsp)
movl 0x4(%rsp), %eax
movl %eax, 0xedd9(%rip)      # 0x10138
movslq 0xedd2(%rip), %rdi      # 0x10138
shlq $0x3, %rdi
callq 0x1190
movq %rax, 0xee1a(%rip)      # 0x10190
movq 0xee13(%rip), %rdi      # 0x10190
movslq 0xedb4(%rip), %rdx      # 0x10138
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x1110
movq 0xec62(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movl 0x4(%rsp), %edx
leaq 0xac9c(%rip), %rsi      # 0xc040
movb $0x0, %al
callq 0x1150
popq %rax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/tcpstream.c
// Function: fTCPStream_Close
void fTCPStream_Close(struct TCPStream_t* S)
{
	if(!S) return;

	//close(S->fd);
	//fclose(S->File);
	fFile_Close(S->File);
	S->File = NULL;

//	printf("[%s] OOO PacketList: %i/%i\n", S->Path, S->BufferListPos, S->BufferListMax);

	memset(S, 0, sizeof(TCPStream_t));
	free(S);
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
cmpq $0x0, (%rsp)
jne 0x161e
jmp 0x1650
movq (%rsp), %rax
movq 0x8(%rax), %rdi
callq 0xbb50
movq (%rsp), %rax
movq $0x0, 0x8(%rax)
movq (%rsp), %rdi
xorl %esi, %esi
movl $0x2460, %edx           # imm = 0x2460
callq 0x1110
movq (%rsp), %rdi
callq 0x1030
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/tcpstream.c
// Function: fTCPStream_OutputHeader
void fTCPStream_OutputHeader(TCPStream_t* S, TCPOutputHeader_t* Header) 
{
	// ensure file is open
	fTCPStream_Open(S);	

	fProfile_Start(13, "TCP PktAdd OutputHeader");

	//int wlen = write(S->fd, &Header, sizeof(Header));
	//int wlen = fwrite(&Header, sizeof(Header), 1, S->File);
	fFile_Write(S->File, Header, sizeof(TCPOutputHeader_t), false);

	S->WritePos += sizeof(TCPOutputHeader_t);

	S->LastTSC = rdtsc();

	fProfile_Stop(13);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0x1700
movl $0xd, %edi
leaq 0xaa4a(%rip), %rsi      # 0xc0ee
callq 0x17f0
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x8(%rsp), %rsi
movl $0x20, %edx
xorl %ecx, %ecx
callq 0xb900
movq 0x10(%rsp), %rax
movq 0x2440(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x2440(%rax)
callq 0x1840
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x2428(%rax)
movl $0xd, %edi
callq 0x1860
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/tcpstream.c
// Function: fTCPStream_Open
static void fTCPStream_Open(TCPStream_t* S)
{
	fProfile_Start(10, "TCP PktAdd Open");

	if (S->File == NULL)
	{
		fProfile_Start(15, "TCP IO Open");

		//S->File = fopen64(S->Path, "w+"); 
		S->File = fFile_Open(S->Path, NULL); 
		fProfile_Stop(15);

		if (S->File == NULL) 
		{
			fprintf(stderr, "failed to create output file [%s] errno:%i (%s)\n", S->Path, errno, strerror(errno));
			exit(-1);
		}
	}
	fProfile_Stop(10);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl $0xa, %edi
leaq 0xade9(%rip), %rsi      # 0xc4fe
callq 0x17f0
movq 0x20(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x17d3
movl $0xf, %edi
leaq 0xadd8(%rip), %rsi      # 0xc50e
callq 0x17f0
movq 0x20(%rsp), %rdi
addq $0x2028, %rdi           # imm = 0x2028
xorl %eax, %eax
movl %eax, %esi
callq 0xb7c0
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
movl $0xf, %edi
callq 0x1860
movq 0x20(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x17d1
movq 0xe87f(%rip), %rax      # 0xfff8
movq (%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
addq $0x2028, %rax           # imm = 0x2028
movq %rax, 0x10(%rsp)
callq 0x1040
movl (%rax), %eax
movl %eax, 0x1c(%rsp)
callq 0x1040
movl (%rax), %edi
callq 0x1240
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rdx
movl 0x1c(%rsp), %ecx
movq %rax, %r8
leaq 0xad5a(%rip), %rsi      # 0xc51a
movb $0x0, %al
callq 0x1150
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1210
jmp 0x17d3
movl $0xa, %edi
callq 0x1860
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/./fTypes.h
// Function: FormatTS
static inline char* FormatTS(u64 ts)
{
	u64 usec = ts / 1000ULL;
	u64 msec = usec / 1000ULL;
	u64 sec = msec / 1000ULL;
	u64 min = sec / 60ULL;
	u64 hour = min / 60ULL;

	u64 nsec = ts - usec*1000ULL;
	usec = usec - msec*1000ULL;
	msec = msec - sec*1000ULL;
	sec = sec - min*60ULL;
	min = min - hour*60ULL;

	static char List[16][128];
	static int Pos = 0;

	char* S = List[Pos];
	Pos = (Pos + 1) & 0xf;

	sprintf(S, "%02lli:%02lli:%02lli.%03lli.%03lli.%03lli", hour % 24, min, sec, msec,usec, nsec);

	return S;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq 0x50(%rsp), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %edx, %edx
divq %rcx
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %edx, %edx
divq %rcx
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %edx, %edx
divq %rcx
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movl $0x3c, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movl $0x3c, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, 0x28(%rsp)
movq 0x50(%rsp), %rax
imulq $0x3e8, 0x48(%rsp), %rcx # imm = 0x3E8
subq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rax
imulq $0x3e8, 0x40(%rsp), %rcx # imm = 0x3E8
subq %rcx, %rax
movq %rax, 0x48(%rsp)
movq 0x40(%rsp), %rax
imulq $0x3e8, 0x38(%rsp), %rcx # imm = 0x3E8
subq %rcx, %rax
movq %rax, 0x40(%rsp)
movq 0x38(%rsp), %rax
imulq $0x3c, 0x30(%rsp), %rcx
subq %rcx, %rax
movq %rax, 0x38(%rsp)
movq 0x30(%rsp), %rax
imulq $0x3c, 0x28(%rsp), %rcx
subq %rcx, %rax
movq %rax, 0x30(%rsp)
movslq 0xe1c4(%rip), %rcx      # 0x109d0
leaq 0xd9bd(%rip), %rax      # 0x101d0
shlq $0x7, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movl 0xe1ab(%rip), %eax      # 0x109d0
addl $0x1, %eax
andl $0xf, %eax
movl %eax, 0xe19f(%rip)      # 0x109d0
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rax
movl $0x18, %ecx
xorl %edx, %edx
divq %rcx
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %r8
movq 0x40(%rsp), %r9
movq 0x48(%rsp), %r10
movq 0x20(%rsp), %rax
leaq 0x9ce6(%rip), %rsi      # 0xc54b
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x1200
movq 0x18(%rsp), %rax
addq $0x58, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/tcpstream.c
// Function: fTCPStream_FlowStats
void fTCPStream_FlowStats(TCPStream_t* S, FILE* Out)
{
	if (!S) return;

	fprintf(Out, " BufPos: %8i WritePos:%8i PktTotal:%8i PktOOO:%8i PktDrop:%8i", 
					S->BufferListPos, 
					S->WritePos,
					S->PktTotal,
					S->PktOOO,
					S->PktDrop

	);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x2fb8
jmp 0x3005
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rax
movl 0x1c(%rax), %edx
movq 0x10(%rsp), %rax
movq 0x2440(%rax), %rcx
movq 0x10(%rsp), %rax
movl 0x2458(%rax), %r8d
movq 0x10(%rsp), %rax
movl 0x2454(%rax), %r9d
movq 0x10(%rsp), %rax
movl 0x2450(%rax), %eax
leaq 0x94c5(%rip), %rsi      # 0xc4c0
movl %eax, (%rsp)
movb $0x0, %al
callq 0x1150
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/udpstream.c
// Function: fUDPStream_Init
UDPStream_t* fUDPStream_Init(char* FileName, u32 FlowID, u64 TS)
{
	UDPStream_t* Stream = malloc(sizeof(UDPStream_t));
	memset(Stream, 0, sizeof(UDPStream_t));

	// append .pcap
	u8 FilenamePCAP[2048];
	if (g_OutputPCAP)
	{
		sprintf(FilenamePCAP, "%s.pcap", FileName);
		FileName = FilenamePCAP;
	}

	Stream->F = fFile_Open(FileName, "w");
	if (!Stream->F)
	{
		fprintf(stderr, "failed to create file [%s]\n", Stream->FileName);
		return 0;
	}
	Stream->FlowID = FlowID;
	printf("[%s] FlowID:%i UDP Stream: [%s]\n", FormatTS(TS), FlowID, FileName);

	// if PCAP then write pcap header
	if (g_OutputPCAP)
	{
		PCAPHeader_t Header;
		Header.Magic 	= PCAPHEADER_MAGIC_NANO;
		Header.Major 	= PCAPHEADER_MAJOR;
		Header.Minor 	= PCAPHEADER_MINOR;
		Header.TimeZone = 0;
		Header.SigFlag 	= 0;
		Header.SnapLen 	= 0;
		Header.Link		= PCAPHEADER_LINK_ETHERNET;

		fFile_Write(Stream->F, &Header, sizeof(Header), true);
	}

	return Stream;
}

// Assembly:
subq $0x848, %rsp            # imm = 0x848
movq %rdi, 0x838(%rsp)
movl %esi, 0x834(%rsp)
movq %rdx, 0x828(%rsp)
movl $0x410, %edi            # imm = 0x410
callq 0x1190
movq %rax, 0x820(%rsp)
movq 0x820(%rsp), %rdi
xorl %esi, %esi
movl $0x410, %edx            # imm = 0x410
callq 0x1110
leaq 0xe1c9(%rip), %rax      # 0x11224
cmpl $0x0, (%rax)
je 0x3088
leaq 0x20(%rsp), %rdi
movq 0x838(%rsp), %rdx
leaq 0x9056(%rip), %rsi      # 0xc0ca
movb $0x0, %al
callq 0x1200
leaq 0x20(%rsp), %rax
movq %rax, 0x838(%rsp)
movq 0x838(%rsp), %rdi
leaq 0x9d81(%rip), %rsi      # 0xce18
callq 0xb7c0
movq %rax, %rcx
movq 0x820(%rsp), %rax
movq %rcx, (%rax)
movq 0x820(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x30ed
movq 0xcf39(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movq 0x820(%rsp), %rdx
addq $0x8, %rdx
leaq 0x8ffd(%rip), %rsi      # 0xc0d2
movb $0x0, %al
callq 0x1150
movq $0x0, 0x840(%rsp)
jmp 0x31a0
movl 0x834(%rsp), %ecx
movq 0x820(%rsp), %rax
movl %ecx, 0x408(%rax)
movq 0x828(%rsp), %rdi
callq 0x31b0
movq %rax, %rsi
movl 0x834(%rsp), %edx
movq 0x838(%rsp), %rcx
leaq 0x9504(%rip), %rdi      # 0xc62c
movb $0x0, %al
callq 0x10e0
leaq 0xe0ee(%rip), %rax      # 0x11224
cmpl $0x0, (%rax)
je 0x3190
movl $0xa1b23c4d, 0x8(%rsp)  # imm = 0xA1B23C4D
movw $0x2, 0xc(%rsp)
movw $0x4, 0xe(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x0, 0x14(%rsp)
movl $0x0, 0x18(%rsp)
movl $0x1, 0x1c(%rsp)
movq 0x820(%rsp), %rax
movq (%rax), %rdi
leaq 0x8(%rsp), %rsi
movl $0x18, %edx
movl $0x1, %ecx
callq 0xb900
movq 0x820(%rsp), %rax
movq %rax, 0x840(%rsp)
movq 0x840(%rsp), %rax
addq $0x848, %rsp            # imm = 0x848
retq
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/udpstream.c
// Function: fUDPStream_Add
void fUDPStream_Add(UDPStream_t* Stream, u64 TS, PCAPPacket_t* Pkt, UDPHeader_t* UDPHeader)
{
	// output in PCAP format
	if (g_OutputPCAP)
	{
		fFile_Write(Stream->F, Pkt, sizeof(PCAPPacket_t) + Pkt->LengthCapture, true);
		return;
	}

	// write only the UDP payload
	u32 Length = swap16(UDPHeader->Length);	
	if (Length >= 16*1024)
	{
		fprintf(stderr, "udp packet length invalid UDP Length:%i PacketLength:%i\n", Length, Pkt->Length);
		return;
	}

	// ensure its caped at the packet length
	if (Length > Pkt->Length)
	{
		fprintf(stderr, "udp packet length truncated: Header %i Capture %i\n", Length, Pkt->Length);
		Length = Pkt->Length;
	}	

	if (g_EnableUDPHeader)
	{
		OutputHeader_t Header;
		Header.TS 		= TS;
		Header.Length 	= sizeof(UDPHeader_t) + Length; 
		Header.StreamID	= Stream->FlowID;
		fFile_Write(Stream->F, &Header, sizeof(Header), false );
	}

	// write the UDP header + payload 
	fFile_Write(Stream->F, UDPHeader, sizeof(UDPHeader_t) + Length, true);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
leaq 0xdf05(%rip), %rax      # 0x11224
cmpl $0x0, (%rax)
je 0x334e
movq 0x30(%rsp), %rax
movq (%rax), %rdi
movq 0x20(%rsp), %rsi
movq 0x20(%rsp), %rax
movl 0x8(%rax), %eax
addq $0x10, %rax
movl %eax, %edx
movl $0x1, %ecx
callq 0xb900
jmp 0x343e
movq 0x18(%rsp), %rax
movzwl 0x4(%rax), %edi
callq 0x3450
movzwl %ax, %eax
movl %eax, 0x14(%rsp)
cmpl $0x4000, 0x14(%rsp)     # imm = 0x4000
jb 0x3396
movq 0xcc84(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movl 0x14(%rsp), %edx
movq 0x20(%rsp), %rax
movl 0xc(%rax), %ecx
leaq 0x92c3(%rip), %rsi      # 0xc64d
movb $0x0, %al
callq 0x1150
jmp 0x343e
movl 0x14(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jbe 0x33d4
movq 0xcc4d(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movl 0x14(%rsp), %edx
movq 0x20(%rsp), %rax
movl 0xc(%rax), %ecx
leaq 0x92c5(%rip), %rsi      # 0xc686
movb $0x0, %al
callq 0x1150
movq 0x20(%rsp), %rax
movl 0xc(%rax), %eax
movl %eax, 0x14(%rsp)
leaq 0xde35(%rip), %rax      # 0x11210
cmpl $0x0, (%rax)
je 0x341d
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
movl 0x14(%rsp), %eax
addq $0x8, %rax
movw %ax, 0x8(%rsp)
movq 0x30(%rsp), %rax
movl 0x408(%rax), %eax
movw %ax, 0xa(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rdi
movq %rsp, %rsi
movl $0x10, %edx
xorl %ecx, %ecx
callq 0xb900
movq 0x30(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rsp), %rsi
movl 0x14(%rsp), %eax
addq $0x8, %rax
movl %eax, %edx
movl $0x1, %ecx
callq 0xb900
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/main.c
// Function: FlowAlloc
static void FlowAlloc(u32 FlowMax)
{
	s_FlowListMax 		= FlowMax;

	if (s_FlowExtract)		free(s_FlowExtract);
	if (s_ExtractTCPFlow)	free(s_ExtractTCPFlow);
	if (s_ExtractTCP) 		free(s_ExtractTCP);
	if (s_ExtractUDP) 		free(s_ExtractUDP);

	s_FlowExtract 		= (u8*)malloc( s_FlowListMax * sizeof(u8) );
	s_ExtractTCPFlow 	= (u8*)malloc( s_FlowListMax * sizeof(u8) );
	s_ExtractTCP	 	= (struct TCPStream_t**)malloc( s_FlowListMax * sizeof(void*) );
	s_ExtractUDP	 	= (struct UDPStream_t**)malloc( s_FlowListMax * sizeof(void*) );

	memset(s_FlowExtract,		0, s_FlowListMax * sizeof(u8) );
	memset(s_ExtractTCPFlow,	0, s_FlowListMax * sizeof(u8) );
	memset(s_ExtractTCP, 		0, s_FlowListMax * sizeof(void*) );
	memset(s_ExtractUDP, 		0, s_FlowListMax * sizeof(void*) );
}

// Assembly:
pushq %rax
movl %edi, 0x4(%rsp)
movl 0x4(%rsp), %eax
movl %eax, 0xa751(%rip)      # 0x11550
cmpq $0x0, 0xa421(%rip)      # 0x11228
je 0x6e15
movq 0xa418(%rip), %rdi      # 0x11228
callq 0x1030
cmpq $0x0, 0xa433(%rip)      # 0x11250
je 0x6e2b
movq 0xa42a(%rip), %rdi      # 0x11250
callq 0x1030
cmpq $0x0, 0xa72d(%rip)      # 0x11560
je 0x6e41
movq 0xa724(%rip), %rdi      # 0x11560
callq 0x1030
cmpq $0x0, 0xa71f(%rip)      # 0x11568
je 0x6e57
movq 0xa716(%rip), %rdi      # 0x11568
callq 0x1030
movl 0xa6f3(%rip), %eax      # 0x11550
movl %eax, %edi
shlq $0x0, %rdi
callq 0x1190
movq %rax, 0xa3b9(%rip)      # 0x11228
movl 0xa6db(%rip), %eax      # 0x11550
movl %eax, %edi
shlq $0x0, %rdi
callq 0x1190
movq %rax, 0xa3c9(%rip)      # 0x11250
movl 0xa6c3(%rip), %eax      # 0x11550
movl %eax, %edi
shlq $0x3, %rdi
callq 0x1190
movq %rax, 0xa6c1(%rip)      # 0x11560
movl 0xa6ab(%rip), %eax      # 0x11550
movl %eax, %edi
shlq $0x3, %rdi
callq 0x1190
movq %rax, 0xa6b1(%rip)      # 0x11568
movq 0xa36a(%rip), %rdi      # 0x11228
movl 0xa68c(%rip), %eax      # 0x11550
movl %eax, %edx
shlq $0x0, %rdx
xorl %esi, %esi
callq 0x1110
movq 0xa378(%rip), %rdi      # 0x11250
movl 0xa672(%rip), %eax      # 0x11550
movl %eax, %edx
shlq $0x0, %rdx
xorl %esi, %esi
callq 0x1110
movq 0xa66e(%rip), %rdi      # 0x11560
movl 0xa658(%rip), %eax      # 0x11550
movl %eax, %edx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x1110
movq 0xa65c(%rip), %rdi      # 0x11568
movl 0xa63e(%rip), %eax      # 0x11550
movl %eax, %edx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x1110
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/main.c
// Function: PCAPMetamako
static Metamako_t* PCAPMetamako(PCAPPacket_t* Pkt)
{
	u8* Payload = (u8*)(Pkt+1);	

	s32 Offset = Pkt->LengthCapture;

	Offset -= sizeof(Metamako_t);

	// double tagged
	if (g_EnableMetamako2T)
	{
		Offset -= sizeof(Metamako_t) - 4;  
	}

// temp work around
// stream_cat isnt adjusting the capture length payload size
// when stripping vlans
//Offset -= 4; 
Offset -= g_MetamakoOffset; 

	// required if pcap has no FCS
	//Offset += 4; 
	if (Offset < 0)
	{
		printf("pkt length %i %i\n", Pkt->Length, Pkt->LengthCapture);
	}

 	assert(Offset > 0);	

	Metamako_t* M = (Metamako_t*)(Payload + Offset); 

	return M;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x14(%rsp)
movslq 0x14(%rsp), %rax
subq $0x14, %rax
movl %eax, 0x14(%rsp)
cmpl $0x0, 0x9681(%rip)      # 0x11218
je 0x7ba6
movslq 0x14(%rsp), %rax
subq $0x10, %rax
movl %eax, 0x14(%rsp)
movl 0x9670(%rip), %ecx      # 0x1121c
movl 0x14(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x14(%rsp)
cmpl $0x0, 0x14(%rsp)
jge 0x7bdb
movq 0x20(%rsp), %rax
movl 0xc(%rax), %esi
movq 0x20(%rsp), %rax
movl 0x8(%rax), %edx
leaq 0x5daa(%rip), %rdi      # 0xd97e
movb $0x0, %al
callq 0x10e0
cmpl $0x0, 0x14(%rsp)
jle 0x7be4
jmp 0x7c03
leaq 0x5da5(%rip), %rdi      # 0xd990
leaq 0x4ce0(%rip), %rsi      # 0xc8d2
movl $0x17a, %edx            # imm = 0x17A
leaq 0x5d9d(%rip), %rcx      # 0xd99b
callq 0x1100
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
addq $0x28, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/main.c
// Function: PCAPIP4Header
static IP4Header_t* PCAPIP4Header(PCAPPacket_t* Pkt)
{
	fEther_t* E = (fEther_t*)(Pkt+1);	

	IP4Header_t* IP4 = (IP4Header_t*)(E + 1);
	u32 IPOffset = (IP4->Version & 0x0f)*4; 

	return IP4;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
addq $0x10, %rax
movq %rax, -0x10(%rsp)
movq -0x10(%rsp), %rax
addq $0xe, %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rax
movzbl (%rax), %eax
andl $0xf, %eax
shll $0x2, %eax
movl %eax, -0x1c(%rsp)
movq -0x18(%rsp), %rax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/main.c
// Function: PCAPTCPHeader
static TCPHeader_t* PCAPTCPHeader(PCAPPacket_t* Pkt)
{
	fEther_t* E = (fEther_t*)(Pkt+1);	

	IP4Header_t* IP4 = (IP4Header_t*)(E + 1);
	u32 IPOffset = (IP4->Version & 0x0f)*4; 

	TCPHeader_t* TCP = (TCPHeader_t*)( ((u8*)IP4) + IPOffset);
	u32 TCPOffset = ((TCP->Flags&0xf0)>>4)*4;

	return TCP;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
addq $0x10, %rax
movq %rax, -0x10(%rsp)
movq -0x10(%rsp), %rax
addq $0xe, %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rax
movzbl (%rax), %eax
andl $0xf, %eax
shll $0x2, %eax
movl %eax, -0x1c(%rsp)
movq -0x18(%rsp), %rax
movl -0x1c(%rsp), %ecx
addq %rcx, %rax
movq %rax, -0x28(%rsp)
movq -0x28(%rsp), %rax
movzwl 0xc(%rax), %eax
andl $0xf0, %eax
sarl $0x4, %eax
shll $0x2, %eax
movl %eax, -0x2c(%rsp)
movq -0x28(%rsp), %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/main.c
// Function: PCAPTCPPayload
static u8* PCAPTCPPayload(PCAPPacket_t* Pkt, s32* Length)
{
	fEther_t* E = (fEther_t*)(Pkt+1);	

	IP4Header_t* IP4 = (IP4Header_t*)(E + 1);
	u32 IPOffset = (IP4->Version & 0x0f)*4; 

	TCPHeader_t* TCP = (TCPHeader_t*)( ((u8*)IP4) + IPOffset);
	u32 TCPOffset = ((TCP->Flags&0xf0)>>4)*4;

	Length[0] = swap16(IP4->Len) - IPOffset - TCPOffset;

	return (u8*)TCP + TCPOffset;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0xe, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movzbl (%rax), %eax
andl $0xf, %eax
shll $0x2, %eax
movl %eax, 0x14(%rsp)
movq 0x18(%rsp), %rax
movl 0x14(%rsp), %ecx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movzwl 0xc(%rax), %eax
andl $0xf0, %eax
sarl $0x4, %eax
shll $0x2, %eax
movl %eax, 0x4(%rsp)
movq 0x18(%rsp), %rax
movzwl 0x2(%rax), %edi
callq 0x7b30
movzwl %ax, %ecx
subl 0x14(%rsp), %ecx
subl 0x4(%rsp), %ecx
movq 0x28(%rsp), %rax
movl %ecx, (%rax)
movq 0x8(%rsp), %rax
movl 0x4(%rsp), %ecx
addq %rcx, %rax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/main.c
// Function: PCAPUDPHeader
static UDPHeader_t* PCAPUDPHeader(PCAPPacket_t* Pkt)
{
	fEther_t* E = (fEther_t*)(Pkt+1);	

	IP4Header_t* IP4 = (IP4Header_t*)(E + 1);
	u32 IPOffset = (IP4->Version & 0x0f)*4; 

	UDPHeader_t* UDP = (UDPHeader_t*)( ((u8*)IP4) + IPOffset);

	return UDP;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
addq $0x10, %rax
movq %rax, -0x10(%rsp)
movq -0x10(%rsp), %rax
addq $0xe, %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rax
movzbl (%rax), %eax
andl $0xf, %eax
shll $0x2, %eax
movl %eax, -0x1c(%rsp)
movq -0x18(%rsp), %rax
movl -0x1c(%rsp), %ecx
addq %rcx, %rax
movq %rax, -0x28(%rsp)
movq -0x28(%rsp), %rax
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/main.c
// Function: PrintHumanFlows
static void PrintHumanFlows(void)
{
	u64 PktMax = 0;
	/*
	for (int i=1; i < s_FlowListPos; i++)
	{
		FlowHash_t* F = &s_FlowList[i];
		if (PktMax < F->PktCnt) PktMax = F->PktCnt;
	}
	*/

	u32 FlowCnt = 0;
	s32 Remain = s_FlowListPos-1;
	while (Remain > 0)
	{
		u64 NextMax = 1e16;
		for (int i=1; i < s_FlowListPos; i++)
		{
			FlowHash_t* F = &s_FlowList[i];
			if (F->PktCnt == PktMax)
			{
				if (F->PktCnt >= s_FlowListPacketMin)
				{
					switch (F->Type)
					{
					case FLOW_TYPE_TCP: PrintFlowTCP(stdout, F, i, FlowCnt); break;
					case FLOW_TYPE_UDP: PrintFlowUDP(stdout, F, i, FlowCnt); break;
					}
				}
				
				Remain--;
				FlowCnt++;
				assert(Remain >= 0);
			}
			else if (F->PktCnt > PktMax)
			{
				if (NextMax > F->PktCnt) NextMax = F->PktCnt;
			}
		}

		//printf("%i -> %i : %i\n", PktMax, NextMax, Remain);
		PktMax = NextMax;
	}
}

// Assembly:
subq $0x38, %rsp
movq $0x0, 0x30(%rsp)
movl $0x0, 0x2c(%rsp)
movl 0x7c99(%rip), %eax      # 0x10164
subl $0x1, %eax
movl %eax, 0x28(%rsp)
cmpl $0x0, 0x28(%rsp)
jle 0x862f
movabsq $0x2386f26fc10000, %rax # imm = 0x2386F26FC10000
movq %rax, 0x20(%rsp)
movl $0x1, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x7c66(%rip), %eax      # 0x10164
jae 0x8620
movq 0x904d(%rip), %rax      # 0x11558
movslq 0x1c(%rsp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
cmpq 0x30(%rsp), %rax
jne 0x85dc
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
cmpq 0x8f60(%rip), %rax      # 0x114a0
jb 0x859c
movq 0x10(%rsp), %rax
movl 0x44(%rax), %eax
movl %eax, 0xc(%rsp)
subl $0x1, %eax
je 0x8560
jmp 0x8555
movl 0xc(%rsp), %eax
subl $0x2, %eax
je 0x857e
jmp 0x859a
movq 0x7a69(%rip), %rax      # 0xffd0
movq (%rax), %rdi
movq 0x10(%rsp), %rsi
movl 0x1c(%rsp), %edx
movl 0x2c(%rsp), %ecx
callq 0x88a0
jmp 0x859a
movq 0x7a4b(%rip), %rax      # 0xffd0
movq (%rax), %rdi
movq 0x10(%rsp), %rsi
movl 0x1c(%rsp), %edx
movl 0x2c(%rsp), %ecx
callq 0x8ad0
jmp 0x859c
movl 0x28(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x28(%rsp)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x28(%rsp)
jl 0x85bb
jmp 0x85da
leaq 0x5526(%rip), %rdi      # 0xdae8
leaq 0x4309(%rip), %rsi      # 0xc8d2
movl $0x28f, %edx            # imm = 0x28F
leaq 0x551f(%rip), %rcx      # 0xdaf4
callq 0x1100
jmp 0x860e
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
cmpq 0x30(%rsp), %rax
jbe 0x860c
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq 0x48(%rcx), %rax
jbe 0x860a
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x860c
jmp 0x860e
jmp 0x8610
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x84f4
movq 0x20(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x84d2
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/main.c
// Function: PrintFlowUDP
static void PrintFlowUDP(FILE* Out, FlowHash_t* F, u32 FlowID, u32 FlowCnt)
{

	UDPHash_t* UDP = (UDPHash_t*)F->Data;
	fprintf(Out, "%5i FlowID: %8i | UDP  ", FlowCnt, FlowID); 	
	PrintMAC(Out, UDP->MACSrc);
	fprintf(Out, " -> ");
	PrintMAC(Out, UDP->MACDst);

	fprintf(Out, " | ");
	PrintIP4(Out, UDP->IPSrc);
	fprintf(Out, " -> ");
	PrintIP4(Out, UDP->IPDst);

	fprintf(Out, " | %6i -> %6i ", UDP->PortSrc, UDP->PortDst);

	fprintf(Out, " | ");
	fprintf(Out, " %'16lld Pkts ", F->PktCnt);
	fprintf(Out, " %'16lli Bytes ", F->Bytes);

	fprintf(Out, " | ");
	fprintf(Out, " %s -> %s", FormatTS(F->TSFirst), FormatTS(F->TSLast) ); 
	fprintf(Out, " : %s", FormatTS(F->TSLast - F->TSFirst));

	fprintf(Out, "\n");
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl %edx, 0x24(%rsp)
movl %ecx, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rdi
movl 0x20(%rsp), %edx
movl 0x24(%rsp), %ecx
leaq 0x4fcc(%rip), %rsi      # 0xdad0
movb $0x0, %al
callq 0x1150
movq 0x30(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x8ca0
movq 0x30(%rsp), %rdi
leaq 0x4f2b(%rip), %rsi      # 0xda51
movb $0x0, %al
callq 0x1150
movq 0x30(%rsp), %rdi
movq 0x18(%rsp), %rsi
addq $0x6, %rsi
callq 0x8ca0
movq 0x30(%rsp), %rdi
leaq 0x4f0a(%rip), %rsi      # 0xda56
movb $0x0, %al
callq 0x1150
movq 0x30(%rsp), %rdi
movq 0x18(%rsp), %rax
movl 0xc(%rax), %esi
callq 0x8d10
movq 0x30(%rsp), %rdi
leaq 0x4ee0(%rip), %rsi      # 0xda51
movb $0x0, %al
callq 0x1150
movq 0x30(%rsp), %rdi
movq 0x18(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x8d10
movq 0x30(%rsp), %rdi
movq 0x18(%rsp), %rax
movzwl 0x14(%rax), %edx
movq 0x18(%rsp), %rax
movzwl 0x16(%rax), %ecx
leaq 0x4eb2(%rip), %rsi      # 0xda5a
movb $0x0, %al
callq 0x1150
movq 0x30(%rsp), %rdi
leaq 0x4e9b(%rip), %rsi      # 0xda56
movb $0x0, %al
callq 0x1150
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rax
movq 0x48(%rax), %rdx
leaq 0x4e92(%rip), %rsi      # 0xda69
movb $0x0, %al
callq 0x1150
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rax
movq 0x50(%rax), %rdx
leaq 0x4e85(%rip), %rsi      # 0xda78
movb $0x0, %al
callq 0x1150
movq 0x30(%rsp), %rdi
leaq 0x4e50(%rip), %rsi      # 0xda56
movb $0x0, %al
callq 0x1150
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
movq 0x28(%rsp), %rax
movq 0x58(%rax), %rdi
callq 0x8360
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rax
movq 0x60(%rax), %rdi
callq 0x8360
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
movq %rax, %rcx
leaq 0x4e3e(%rip), %rsi      # 0xda88
movb $0x0, %al
callq 0x1150
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movq 0x60(%rax), %rdi
movq 0x28(%rsp), %rax
subq 0x58(%rax), %rdi
callq 0x8360
movq 0x10(%rsp), %rdi
movq %rax, %rdx
leaq 0x4e11(%rip), %rsi      # 0xda92
movb $0x0, %al
callq 0x1150
movq 0x30(%rsp), %rdi
leaq 0x37fa(%rip), %rsi      # 0xc48e
movb $0x0, %al
callq 0x1150
addq $0x38, %rsp
retq
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/main.c
// Function: PrintMAC
static void PrintMAC(FILE* Out, u8* MAC)
{
	fprintf(Out, "%02x:%02x:%02x:%02x:%02x:%02x",
			MAC[0],
			MAC[1],
			MAC[2],
			MAC[3],
			MAC[4],
			MAC[5]
		  );
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rax
movzbl (%rax), %edx
movq 0x18(%rsp), %rax
movzbl 0x1(%rax), %ecx
movq 0x18(%rsp), %rax
movzbl 0x2(%rax), %r8d
movq 0x18(%rsp), %rax
movzbl 0x3(%rax), %r9d
movq 0x18(%rsp), %rax
movzbl 0x4(%rax), %r10d
movq 0x18(%rsp), %rax
movzbl 0x5(%rax), %eax
leaq 0x4db0(%rip), %rsi      # 0xdaa2
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x1150
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/fProfile.c
// Function: fProfile_Reset
void fProfile_Reset(void)
{
	for (int i=0; i < 16; i++)
	{
		g_ProfileStart	[i] = 0;
		g_ProfileStop	[i] = 0;
		g_ProfileTotal	[i] = 0;
	}
}

// Assembly:
movl $0x0, -0x4(%rsp)
cmpl $0x10, -0x4(%rsp)
jge 0xb6d8
movslq -0x4(%rsp), %rcx
leaq 0x6715(%rip), %rax      # 0x11db0
movq $0x0, (%rax,%rcx,8)
movslq -0x4(%rsp), %rcx
leaq 0x6801(%rip), %rax      # 0x11eb0
movq $0x0, (%rax,%rcx,8)
movslq -0x4(%rsp), %rcx
leaq 0x68ed(%rip), %rax      # 0x11fb0
movq $0x0, (%rax,%rcx,8)
movl -0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rsp)
jmp 0xb688
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/fProfile.c
// Function: fProfile_Dump
void fProfile_Dump(u32 Index)
{
	double oot = 1.0 / g_ProfileTotal[Index];
	for (int i=0; i < 16; i++)
	{
		fprintf(stderr, "    [%2i] %016llx %20lli : (%.4f) : %s\n", 
				i,
				g_ProfileTotal[i],
				g_ProfileTotal[i],
				g_ProfileTotal[i] * oot,
				g_ProfileDesc[i]);
	}
	fProfile_Reset();
}

// Assembly:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
movl 0x14(%rsp), %eax
movl %eax, %ecx
leaq 0x68bb(%rip), %rax      # 0x11fb0
movq (%rax,%rcx,8), %xmm1
movaps 0x91f(%rip), %xmm0      # 0xc020
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x923(%rip), %xmm0      # 0xc030
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movsd 0xfd4(%rip), %xmm0      # 0xc6f8
divsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
cmpl $0x10, 0x4(%rsp)
jge 0xb7b4
movq 0x48b4(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movslq 0x4(%rsp), %rcx
movl %ecx, %edx
leaq 0x685b(%rip), %rax      # 0x11fb0
movq (%rax,%rcx,8), %r8
movq %r8, %rcx
movq %r8, %xmm0
movaps 0x8b8(%rip), %xmm1      # 0xc020
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x8bc(%rip), %xmm1      # 0xc030
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
mulsd 0x8(%rsp), %xmm0
movslq 0x4(%rsp), %rsi
leaq 0x691b(%rip), %rax      # 0x120b0
movq (%rax,%rsi,8), %r9
leaq 0x236f(%rip), %rsi      # 0xdb0f
movb $0x1, %al
callq 0x1150
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0xb736
callq 0xb680
addq $0x18, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/fFile.c
// Function: fFile_Open
struct fFile_t* fFile_Open(u8* Path, u8* Mode)
{
	fFile_t* F = (fFile_t*)malloc( sizeof(fFile_t) );
	memset(F, 0, sizeof(fFile_t));

	strncpy(F->Path, Path, sizeof(F->Path));

	// initial output buffer 
	F->IsBuffer		= true;
	F->BufferMax	= s_FileSizeMin;
	F->BufferPos	= 0;
	F->Buffer		= malloc( F->BufferMax );		
	memset(F->Buffer, 0, F->BufferMax );

	F->TotalByte	= 0;

	// if file existed before get total length
	struct stat fstat;	
	if (stat(F->Path, &fstat) >= 0) 
	{
		F->TotalByte = fstat.st_size;
	}

	// new file allocated 
	s_TotalFile++;

	return F;
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movl $0x438, %edi            # imm = 0x438
callq 0x1190
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
xorl %esi, %esi
movl $0x438, %edx            # imm = 0x438
callq 0x1110
movq 0x90(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x1050
movq 0x90(%rsp), %rax
movl $0x1, 0x408(%rax)
movq 0x4940(%rip), %rcx      # 0x10170
movq 0x90(%rsp), %rax
movq %rcx, 0x420(%rax)
movq 0x90(%rsp), %rax
movq $0x0, 0x418(%rax)
movq 0x90(%rsp), %rax
movq 0x420(%rax), %rdi
callq 0x1190
movq %rax, %rcx
movq 0x90(%rsp), %rax
movq %rcx, 0x410(%rax)
movq 0x90(%rsp), %rax
movq 0x410(%rax), %rdi
movq 0x90(%rsp), %rax
movq 0x420(%rax), %rdx
xorl %esi, %esi
callq 0x1110
movq 0x90(%rsp), %rax
movq $0x0, 0x428(%rax)
movq 0x90(%rsp), %rdi
movq %rsp, %rsi
callq 0x1160
cmpl $0x0, %eax
jl 0xb8d9
movq 0x30(%rsp), %rcx
movq 0x90(%rsp), %rax
movq %rcx, 0x428(%rax)
movq 0x68d0(%rip), %rax      # 0x121b0
addq $0x1, %rax
movq %rax, 0x68c5(%rip)      # 0x121b0
movq 0x90(%rsp), %rax
addq $0xa8, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/fmadio[P]pcap_flow/fFile.c
// Function: fFile_Close
void fFile_Close(struct fFile_t* F)
{
	if (!F) return;

	// flush buffer contents if not written to disk
	if (F->IsBuffer && (F->BufferPos > 0))
	{
		// if theres real substational data the flush it
		if (F->TotalPayload > s_FileSizeMin)
		{
			F->File = fopen(F->Path, "a");
			assert(F->File != NULL);

			fwrite(F->Buffer, 1, F->BufferPos, F->File);
			F->BufferPos = 0;
		}
	}

	// close
	if (F->File)
	{
		fclose(F->File);
		s_TotalFileActive--;
	}

	if (F->Buffer)
	{
		free(F->Buffer);
		F->Buffer = NULL;
	}
	memset(F, 0, sizeof(fFile_t));
	free(F);

	s_TotalFileClose++;
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
cmpq $0x0, (%rsp)
jne 0xbb61
jmp 0xbcad
movq (%rsp), %rax
cmpl $0x0, 0x408(%rax)
je 0xbc25
movq (%rsp), %rax
cmpq $0x0, 0x418(%rax)
jbe 0xbc25
movq (%rsp), %rax
movq 0x430(%rax), %rax
cmpq 0x45da(%rip), %rax      # 0x10170
jbe 0xbc23
movq (%rsp), %rdi
leaq 0x1fce(%rip), %rsi      # 0xdb75
callq 0x11e0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x400(%rax)
movq (%rsp), %rax
cmpq $0x0, 0x400(%rax)
je 0xbbca
jmp 0xbbe9
leaq 0x1fa6(%rip), %rdi      # 0xdb77
leaq 0x1f5f(%rip), %rsi      # 0xdb37
movl $0x91, %edx
leaq 0x1fa3(%rip), %rcx      # 0xdb87
callq 0x1100
movq (%rsp), %rax
movq 0x410(%rax), %rdi
movq (%rsp), %rax
movq 0x418(%rax), %rdx
movq (%rsp), %rax
movq 0x400(%rax), %rcx
movl $0x1, %esi
callq 0x1220
movq (%rsp), %rax
movq $0x0, 0x418(%rax)
jmp 0xbc25
movq (%rsp), %rax
cmpq $0x0, 0x400(%rax)
je 0xbc55
movq (%rsp), %rax
movq 0x400(%rax), %rdi
callq 0x10c0
movq 0x656e(%rip), %rax      # 0x121b8
addq $-0x1, %rax
movq %rax, 0x6563(%rip)      # 0x121b8
movq (%rsp), %rax
cmpq $0x0, 0x410(%rax)
je 0xbc82
movq (%rsp), %rax
movq 0x410(%rax), %rdi
callq 0x1030
movq (%rsp), %rax
movq $0x0, 0x410(%rax)
movq (%rsp), %rdi
xorl %esi, %esi
movl $0x438, %edx            # imm = 0x438
callq 0x1110
movq (%rsp), %rdi
callq 0x1030
movq 0x6526(%rip), %rax      # 0x121c8
addq $0x1, %rax
movq %rax, 0x651b(%rip)      # 0x121c8
popq %rax
retq
nop
// File: /workspace/github_c_makefile_star2_O0/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_6/exercise_6_02/var_group.c
// Function: main
int main(int argc, char *argv[])
{
  if (!parse_arg_list(argc, argv))
  {
    puts("Error: invalid arguments.");
    return EXIT_FAILURE;
  }

  int n;
  struct list_node *list_root = NULL;
  char word[MAX_WORD_LEN];

  while (get_word(word, MAX_WORD_LEN) != EOF)
  {
    if ((n = bin_search(word, data_types, NR_OF_TYPES)) >= 0)
    {
      do
      {
        // NOTE: This approach takes into consideration both variable and function names.
        if (get_word(word, MAX_WORD_LEN) != EOF && (isalpha(word[0]) || word[0] == '_'))
        {
          list_root = add_to_list(list_root, word);
        }
      } while (get_word(word, MAX_WORD_LEN) == ',');
    }
  }

  print_list(list_root);

  return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x1300
cmpl $0x0, %eax
jne 0x1222
leaq 0xe19(%rip), %rdi       # 0x202a
callq 0x1060
movl $0x1, -0x4(%rbp)
jmp 0x12eb
movq $0x0, -0x20(%rbp)
leaq -0x90(%rbp), %rdi
movl $0x64, %esi
callq 0x1390
cmpl $-0x1, %eax
je 0x12db
leaq -0x90(%rbp), %rdi
leaq 0x2e2e(%rip), %rsi      # 0x4080
movl $0x7, %edx
callq 0x14d0
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jl 0x12d6
jmp 0x1266
leaq -0x90(%rbp), %rdi
movl $0x64, %esi
callq 0x1390
cmpl $-0x1, %eax
je 0x12bc
callq 0x10d0
movq (%rax), %rax
movsbl -0x90(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0x12a8
movsbl -0x90(%rbp), %eax
cmpl $0x5f, %eax
jne 0x12bc
movq -0x20(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x1570
movq %rax, -0x20(%rbp)
jmp 0x12be
leaq -0x90(%rbp), %rdi
movl $0x64, %esi
callq 0x1390
cmpl $0x2c, %eax
je 0x1266
jmp 0x12d6
jmp 0x122a
movq -0x20(%rbp), %rdi
callq 0x1620
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_6/exercise_6_02/var_group.c
// Function: parse_arg_list
int parse_arg_list(int argc, char *argv[])
{
  if (argc > 2)
  {
    return 0;
  }

  if (argc == 2)
  {
    if (!isdigit(argv[1][0]))
    {
      return 0;
    }

    var_name_str_cmp_len = atoi(argv[1]);

    if (var_name_str_cmp_len < 0)
    {
      return 0;
    }
  }

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jle 0x131e
movl $0x0, -0x4(%rbp)
jmp 0x137f
cmpl $0x2, -0x8(%rbp)
jne 0x1378
callq 0x10d0
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x1351
movl $0x0, -0x4(%rbp)
jmp 0x137f
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x10b0
movl %eax, 0x2d54(%rip)      # 0x40b8
cmpl $0x0, 0x2d4d(%rip)      # 0x40b8
jge 0x1376
movl $0x0, -0x4(%rbp)
jmp 0x137f
jmp 0x1378
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)